Repository navigation
[AIR] CNXT-2686: warn when a pushed image sets WORKDIR - #7867
vinchenzo-db wants to merge 5 commits into
Conversation
AI Runtime does not honor the Docker WORKDIR directive, so commands that rely on relative paths fail at runtime with file-not-found errors, and nothing warned at push time. `air images push` now inspects the source image's Config.WorkingDir and prints a warning telling the user to use absolute paths. The push itself is unchanged. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
|
/review |
There was a problem hiding this comment.
Automated review at 3031cd9. Each finding was verified against the code.
Not ready yet: 1 blocking issue(s), tagged [blocking].
This PR adds a WORKDIR warning to databricks air images push by inspecting the image config after the platform check. Two issues stand out: the "warning" can actually abort the push when the inspect subprocess fails, contradicting the stated non-blocking intent; and images that set WORKDIR / (effectively the default) trigger a misleading warning about relative paths.
An inspect failure now logs a warning instead of aborting, and WORKDIR / (the Docker default) no longer triggers the warning. Co-authored-by: Isaac <no-reply@databricks.com>
|
/review |
There was a problem hiding this comment.
Automated review at 42e16c3. Each finding was verified against the code.
No blocking issues found. 1 non-blocking comment(s) below.
This PR adds an informational WORKDIR warning to databricks air images push by inspecting the image config after the platform check. The implementation is correct and well-tested, but the new check spawns a second docker image inspect subprocess on the same image that was just inspected, when a single call with a combined format string would suffice.
Co-authored-by: Isaac <no-reply@databricks.com>
|
/review |
There was a problem hiding this comment.
Automated review at d48fc7f. Each finding was verified against the code.
No blocking issues found.
This PR adds a WORKDIR warning to databricks air images push by extending the existing docker image inspect format string to also retrieve Config.WorkingDir, then printing an informational warning when a non-trivial WORKDIR is set. The change is small, well-scoped, and covered by new and updated unit tests. No correctness issues survive verification.
Co-authored-by: Isaac <no-reply@databricks.com>
|
/review |
|
Commit: Regression test reportSelected 1 changed tests (limit=20, 0 not selected) 1 tests: regression=1 unreleased=0 coverage=0 failing=0
TestAccept/air/image-push: branch ✅ | main (a4388d7) ❌ | latest (v1.27.0) ❌main (a4388d7): latest (v1.27.0): same output as main (a4388d7) |
There was a problem hiding this comment.
Automated review at 0f620d5. Each finding was verified against the code.
No blocking issues found.
This PR adds an informational warning to databricks air images push when the source image sets a non-default WORKDIR, since AI Runtime ignores it at runtime. The implementation correctly extends the existing docker image inspect format string with a pipe-delimited field and parses it with strings.Cut on the first |. The warning condition (workingDir != "" && workingDir != "/") is sound, the comment on line 209 explains the rationale, and the unit and acceptance tests cover the key cases (unset, /, /app). No correctness issues found.
✅ Integration test reportCommit: 0f620d5
Top 3 slowest tests (at least 2 minutes):
|
Changes
databricks air images pushnow readsConfig.WorkingDirfrom the existingdocker image inspectcall (combined format string) and, when it is set to anything other than/, prints a warning that AI Runtime does not honorWORKDIRat runtime and that commands and scripts should use absolute paths. The push itself is unchanged: the warning is informational and never blocks.Why
AI Runtime ignores the Docker
WORKDIRdirective, so an image whose entrypoint or scripts rely on relative paths works underdocker runbut fails on AIR with file-not-found errors. Until now the only mention of this was in the agent skill's docker-images notes, and neitherair images pushnorair runwarned about it, so users only discovered the limitation from a failed run (Jira CNXT-2686, found in the CUJ PE64 runthrough).Warning at push time is the earliest point where the CLI sees the image config, and it reuses the inspect call the platform check already makes, so there is no extra Docker invocation.
Tests
TestRunImagePushWarnsWhenImageSetsWorkingDir(table: unset,/,/app) checks the warning fires only for a realWORKDIR.TestRunImagePushTagsAndPushesLocalImageasserts the combined inspect format and no warning for an image withoutWORKDIR.acceptance/air/image-pushgained aworkdirfake-docker mode and a step showing the warning while the push proceeds; golden output regenerated.go test ./cmd/air,go test ./acceptance -run TestAccept/air/image-push,task lint-q, andtask check-changelogpass locally.This pull request and its description were written by Isaac.