-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Separate connectors /publish
workflow into a build candidate and promotion to production GitOps pipeline pattern
#12108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
/publish
and into a post-merge action to better follow GitOps
/publish
and into a post-merge action to better follow GitOps/publish
workflow into a build candidate and promotion to production GitOps pipeline pattern
Another scenario where a post-merge promotion would have been nice: #10256 (comment) |
I really like the candidate image idea. I have one comment. Based on timeline 1-3:
The candidate image can be built and pushed multiple times in a PR. Does the automatic image building and publishing happen for every commit in the PR? This can be quite wasteful in terms of github action quota and resource I think. I can think of two alternative proposals:
|
I was thinking since it still will be triggered by a manual
Technically that would result in us building the same image twice, and pushing a non tested image to prod. Idea is that the built candidate image is the same one that was tested, we're just retagging to be usable by deployments
Period strategy would be nice to reduce the amount of images being created on every PR, but I dont know how we would have an efficient/automated way to handle changelog notes for all of the changes merged in since last release. Since we dont use github releases on airbyte connectors, we would not be able to do something like |
I'm actually going to start implementing a prototype that can be demo'd for this because I think its a worthwhile thing to get done as soon as possible to reduce some pain. Open to iterate as feedback comes up on certain ideas and if I discover certain weaknesses to this approach, starting to try to implement is the only way to see what other blockers might need to be addressed. EDIT: I've cleaned up the issue description and added more details based on some new ideas |
@noahkawasaki-airbyte FYI, I filed an issue for similar context a month ago: https://github.com/airbytehq/airbyte-internal-issues/issues/509 and @evantahler created an Epic for similar issues: #11937 |
Feel free to close #11937 in favor of yours! |
This is actually just a sub task of that epic :) thanks for filing that^ Ill contribute |
Initial PR to have workflows created in GHA: #12405 |
@noahkawasaki-airbyte this is really great thinking, massive +1 to this. I can see how this helps us avoid user error / visibility issues and avoid the problem statements 1 & 3. I'm unsure how this solves problem statement 2 though, since the publish is retagging the docker image that was built in the PR. e.g.
Unless I'm missing something, I think we'd need to build from master at the point of 2nd workflow to ensure we're getting any changes that were recently merged and not accounted for when we built the candidate image.
|
Yeah, I've been rethinking the retag strategy vs building from new. But either way, if the scenario you said ever happened, in my mind the outcome would be: PR 1 I need to figure out how to enforce that happens in the code still. On your last new issue comment. If workflow 1 ran successfully and another PR merged (hence would cause publish workflow after to fail) I think that would also be blocked by a merge conflict? Again, I need to confirm my theory on merge conflicts blocking some of these scenarios from happening. Based on my experience working on a connector as the same time as someone else, I always got merge conflicts in the Dockerfile, definitions file, and seed specs and was forced to make updates in order to merge |
@noahkawasaki-airbyte |
Now that I've actually worked on this I've learned that the publishing aspect of this is a little more complicated than I thought, the build tag and test stuff is straightforward though. Would like some thoughts on some ideas for Workflow 2: publish-connector AKA the step that handles the building and pushing of a connector based on the pre-req that a PR has been merged. Option 1: Use a post-merge Github Action to build and publish connectors (to DockerHub). Overview: After you merge your PR with say changes to source-X and source-Y, Why its nice:
Challenges:
Option 2: Make the releasing of connectors a periodic cadence (weekly) that builds connectors each week if there are any changes. Why its nice:
Challenges:
Based on these thoughts, I think idea 1 is preferrable. I trust that PR authors can make the good judgement call on releasing a new version better than any script anyone can write to try to reliably auto-detect when to cut a new version of something. |
Closing in favor of #17189 |
Tell us about the problem you're trying to solve
Currently, the automation for developing a connector involves running the
/publish
command which builds a docker image based on a branch/PR, doing various version tagging and bumping, and then pushing this image to Airbyte's Dockerhub as an official production ready connector for customers. This can/does occur while the PR is in flight (AKA, not merged).There are some problem scenarios with this approach:
Describe the solution you’d like
I would like airbyte connector image publishing to follow a more GitOps-like approach. The idea is to decompose the publish workflow into two different workflows with more focused purposes.
Assume we are working with
source-postgres:0.3.18
and trying to bump tosource-postgres:0.3.19
Workflow 1: bump-build-test-connector
Main responsibility: Handle bumping of version in all necessary files, build an image to test, run tests
auto-bump-version=true
bump the version (version in Master) +1 in Dockerfile, processResources (which updates definitions.yaml and seed.yaml, I think?)source-postgres:0.3.19-candidate-${PR_NUMBER}
If success^
publish/source-postgres
which will be a signal to Workflow 2 to executeWorkflow 2: publish-connector
Prerequisites: Workflow above succeeded, and PR has been reviewed, approved, merged, and contains the signal label set in step 5 above. This means the image and code is shippable.
Main responsibility: Re-tag
source-postgres:0.3.19-candidate-${PR_NUMBER}
assource-postgres:0.3.19
, AKA the tagging pattern that Airbyte will use for deploymenthttps://github.community/t/trigger-workflow-only-on-pull-request-merge/17359
Timeline of Workflows
The timeline in which stuff happens becomes:
bump-build-test-connector
runs if triggered by commentSteps 2-3 happen as many times as necessary
publish-connector
runsDescribe the alternative you’ve considered or used
Alternative ideas include:
Decoupling the Airbyte Connector tagging from PRs entirely. Have a periodic cadence, such as a week or 2, where some release job runs and checks for all changed connectors and bumps versions if any changes have merged. This would mean every two weeks if anythings been merged a new connector version would be created.
Pros: Simplifies pipeline significantly, since devs never need to worry about bumping certain versions. You just merge your code knowing the next time the release pipeline runs it will be in that version. Fully automated. Never need to worry about other in flight PRs on same connector
Cons: Might require manual changelog reading and writing, as someone would need to check through merged changes and write up relevant ones. Also would still occasionally require a manual release cut if a critical bug needed to be fixed and released immediately.
Current system: manual publishing and having to keep track of other potential conflicting changes.
Additional context
Found this because it kind of means I cannot merge this #11954 (review) until this merges: https://github.com/airbytehq/airbyte/pull/11877/files
So this scenario kind of creates this dependency on each other
Are you willing to submit a PR?
Yes
The text was updated successfully, but these errors were encountered: