fix(docker-images): fail build when base image lacks the airbyte user - #84352
Draft
devin-ai-integration[bot] wants to merge 2 commits into
Draft
fix(docker-images): fail build when base image lacks the airbyte user#84352devin-ai-integration[bot] wants to merge 2 commits into
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
…yte user Co-Authored-By: bot_apk <apk@cognition.ai>
…uard Co-Authored-By: bot_apk <apk@cognition.ai>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksPR Slash CommandsAirbyte Maintainers (that's you!) can execute the following slash commands on your PR:
📚 Show Repo GuidanceHelpful Resources
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Preventative guard for the failure class in https://github.com/airbytehq/oncall/issues/13302.
Related to https://github.com/airbytehq/oncall/issues/13302:
Public mirror: #84351. See also #84349 and the pin bump #84350.
The connector Dockerfiles end with
USER airbyte, but that OS user is created in the base image. Connectors pinning an oldconnectorBuildOptions.baseImage(e.g.source-declarative-manifest:5.15.0, which predates the user) build successfully — Docker recordsUSERin the image config without validating it — and then fail atdocker runwith exit 125 andunable to find user airbyte: no matching entries in passwd file, which never mentions the base-image pin. That opaque failure is what broke the pre-release publish workflow, the regression harness, and per-connector image/spec checks.How
Assert the user exists at build time, immediately before switching to it, in all three connector Dockerfiles:
Dockerfile.manifest-only-connectorandDockerfile.java-connectorneededARG BASE_IMAGEre-declared afterFROMso the message can name the offending pin. OneRUNlayer, no extra image content.This layer was chosen over a CDK-side error translation (
airbyte_cdk.utils.docker.verify_connector_image) or a metadata QA check because the Dockerfiles are the single point every build path goes through — Gradle,airbyte-cdk image build(which downloads these templates frommasterwhen the monorepo isn't checked out), and CI — and it's the only place that can catch it deterministically without pulling and inspecting the remote base image separately.Review guide
docker-images/Dockerfile.manifest-only-connector,Dockerfile.python-connector,Dockerfile.java-connector— the guard.docker-images/test-manifest-only-connector-base-image-user.sh— new test: buildssource-pokeapiagainstsource-declarative-manifest:5.15.0and asserts the build fails with the actionable message, then builds against:latestand asserts success..github/workflows/docker-connector-base-image-tests.yml— runs that test in the manifest-only job (already triggered by changes to these Dockerfiles).docker-images/README.md— FAQ entry.Verified locally on
linux/amd64: the5.15.0build fails withand the
:latestbuild succeeds. The Python and Java connector guards were not exercised locally — building the Python base image currently fails on an unrelated Debian package version mismatch (poppler-utils/libpoppler126) and the Java path needs a Gradle tarball, so those two rely on CI. Their base images do define the user today, so the guard is a no-op there.User Impact
Connector developers and CI get a build-time failure naming the stale pin instead of an opaque exit 125 at container start. No runtime behavior change for published connectors.
Follow-up considered and skipped: a metadata lint for base-image pins far behind the current SDM release.
.github/workflows/connectors-up-to-date.ymlalready runsairbyte-ops local connector bump-base-imageacross support levels, so staleness is largely covered.Can this PR be safely reverted and rolled back?
Link to Devin session: https://app.devin.ai/sessions/ca238921c33246d09d908bb694bcd05f