Repository navigation
[AIR] CNXT-2687: report the image size and compressed layer size when pushing - #7868
vinchenzo-db wants to merge 9 commits into
Conversation
Co-authored-by: Isaac <no-reply@databricks.com>
|
/review |
|
/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 (1ea5591) ❌ | latest (v1.27.0) ❌main (1ea5591): latest (v1.27.0): same output as main (1ea5591) |
There was a problem hiding this comment.
Automated review at 5e75898. Each finding was verified against the code.
Not ready yet: 1 blocking issue(s), tagged [blocking].
This PR adds an image-size info line and an oversized-image warning to databricks air images push. The size check is well-tested and the warning path (oversized image still pushes) works correctly. However, the parse-failure path hard-aborts the push for what is a purely advisory feature, introducing a new failure mode that the base code doesn't have. A second, minor concern is that the size inspect spawns a redundant subprocess on the same image.
|
/review |
There was a problem hiding this comment.
Automated review at a5f8163. Each finding was verified against the code.
No blocking issues found.
This PR adds image-size reporting and a warning to databricks air images push, reading the size from the existing docker image inspect call and printing it before pushing. When the uncompressed size exceeds 20 GB, an advisory warning is shown but the push proceeds. The implementation is clean: edge cases (missing | separator, unparseable size) degrade gracefully into warnings, the format string uses values that cannot contain the delimiter, and tests cover at-limit, over-limit, and unreadable-size scenarios. No concrete defects were found.
✅ Integration test reportCommit: 04d6581
Top 31 slowest tests (at least 2 minutes):
|
maggiewang-db
left a comment
There was a problem hiding this comment.
We have changed the limit: AI Runtime no longer has an image size limit. The only limit now is Databricks Artifact Registry (DAR), which caps images at 30 GB. The 20 GB check and warning in this PR are out of date, so I'm requesting changes to block merging until that's resolved.
|
/review |
|
Thanks, updated to the 30 GB DAR limit and reworded; AI Runtime's own limit is gone from the PR. |
There was a problem hiding this comment.
Automated review at cd98a4f. Each finding was verified against the code.
No blocking issues found. 1 non-blocking comment(s) below.
The PR adds a pre-push size check to databricks air images push, printing the uncompressed image size and warning when it exceeds 30 GB. The logic is clean: the inspect format is extended without a second Docker process, parsing failures are advisory, and the push always proceeds. Tests cover at-limit, over-limit, and unparsable cases plus an acceptance test for the oversized path. One minor user-facing text issue noted below.
|
/review |
There was a problem hiding this comment.
Automated review at 47a3ded. Each finding was verified against the code.
No blocking issues found.
This PR adds image-size reporting and a 30 GB advisory warning to databricks air images push, piggy-backing on the existing docker image inspect call. The new code parses the size, prints it, and warns (without blocking) when the uncompressed size exceeds the registry's compressed-layer limit. The implementation is clean: the size/platform parsing handles missing and unparsable values gracefully, tests cover the boundary, over-limit, and unreadable cases, and the acceptance test gains an oversized mode with matching golden output. I found no correctness defects.
maggiewang-db
left a comment
There was a problem hiding this comment.
I would prefer we don't hardcode image size in AIR, especially in the CLI client. Right now AIR doesn't have any image size limit. The limit comes from Databricks Artifact Registry. If we have hardcoded values, when DAR changes their limit we will have to change our code and tell customers to upgrade their CLI.
`databricks air images push` now inspects the local image size after the platform check, prints it, and fails before tagging or uploading when it exceeds AI Runtime's 20 GB maximum, with the server's message plus advice to start from a Databricks base image and trim layers (CNXT-2687). Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Docker reports the uncompressed size while the server measures compressed layers, so an oversized local image may still be accepted: print the size, warn with the limit and advice, and let the push proceed. Co-authored-by: Isaac <no-reply@databricks.com>
Fold {{.Size}} into the platform inspect so no second docker process is
spawned, and warn instead of failing when the size cannot be parsed, since
the size check never gates the push.
Co-authored-by: Isaac <no-reply@databricks.com>
AI Runtime no longer limits image size; Databricks Artifact Registry caps images at 30 GB. Update the threshold, messages, tests, golden output and changelog fragment accordingly. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
AI Runtime has no image size limit of its own, and Databricks Artifact Registry sets and may change its own. Print the local image size and the DAR limitations page for the workspace's cloud, with no threshold or warning. Co-authored-by: Isaac <no-reply@databricks.com>
47a3ded to
8e98af6
Compare
|
/review |
There was a problem hiding this comment.
Automated review at 8e98af6. Each finding was verified against the code.
No blocking issues found. 4 non-blocking comment(s) below.
This PR reads {{.Size}} from the existing docker image inspect call in databricks air images push, prints the local image size before tagging, and links the DAR limitations docs for the workspace's cloud. The platform check still works with the combined output and the push itself doesn't change. What's left is a size format that prints 0.0 GB for small images, plus a few places where the new code and tests break repo rules: a soft fallback branch, test hosts on real domains, and unit assertions that repeat the acceptance golden.
Print sub-GB images in MB, treat inspect output without a size as an inspect error, select the cloud in TestDARLimitationsURL through the config's Cloud field, and cover the unreadable-size case in the acceptance test instead of repeating golden output in unit tests. Co-authored-by: Isaac <no-reply@databricks.com>
|
/review |
There was a problem hiding this comment.
Automated review at fb341d0. Each finding was verified against the code.
No blocking issues found. 2 non-blocking comment(s) below.
This PR reads {{.Size}} from the existing docker image inspect call, prints the local image size, and links the DAR limitations docs for the workspace's cloud before tagging and pushing. The change is small and well tested. One behavior change is worth reconsidering: if the size can't be parsed, the push now fails, even though the size is only shown to the user. There is also a small rounding glitch at the MB/GB boundary.
DAR measures the compressed image (the sum of the manifest's layer sizes), which the local image store doesn't know. After the push, read the pushed manifest with docker manifest inspect --verbose and print its compressed size and layer count with the DAR limitations link. All size output is informational: a size or manifest that can't be read prints a warning and the push still succeeds. Co-authored-by: Isaac <no-reply@databricks.com>
|
/review |
There was a problem hiding this comment.
Automated review at 04d6581. Each finding was verified against the code.
No blocking issues found. 4 non-blocking comment(s) below.
This PR makes air images push print the local uncompressed size before tagging. After the push it prints the compressed size and layer count from docker manifest inspect --verbose, plus a link to DAR's limits for the workspace's cloud. The platform check works as before and a failed size read can't block the push. The main gaps: the limits link is missing in the one case it matters most, a push DAR rejects, and there is a just-in-case branch for size output Docker doesn't produce. The rest are small output-formatting fixes.
Comments outside the changed lines
- [nice to have]
cmd/air/image.go:318: When DAR rejects an image for being too large,docker pushfails and we returnpush image %s: %wright here. The compressed size and the limits link at lines 322-324 only print after a successful push. So the user who goes over the limit gets neither, and the user who stays under it gets both. Can we add thedarLimitationsURL(w.Config)hint to this error too, so a failed push points at the limits?
Changes
databricks air images pushnow reports image sizes around the upload. All of the output is informational:docker image inspectcall (Source image X is 7.1 GB uncompressed.).docker manifest inspect --verboseand prints the compressed size (the sum of the manifest's layer sizes) and the layer count as the headline (Compressed image size: 3.1 GB in 2 layers.). When the pushed reference is an index, it uses the linux/amd64 entry.A size or manifest that can't be read prints a one-line warning, and the push still succeeds. No limit is hardcoded.
Why
The CLI gave no size information around the upload, so users couldn't tell how their image compared with Databricks Artifact Registry's documented limit (Jira CNXT-2687, found in the CUJ PE64 runthrough). DAR's documented limit applies to the compressed image, meaning the sum of layer sizes in the manifest. The local image store only knows the uncompressed size, so the exact compressed size comes from the pushed manifest. DAR's external endpoint serves manifest reads; only blob downloads, tag listing and deletes are refused.
Change source: Maggie suggested printing the compressed size, and DAR confirmed the documented limit is on the compressed image. All size output is informational, per Vincent.
Hard-coded values
cli-checkflags one line: the "AIR requires linux/amd64" platform error incmd/air/image.go. That check is existing code onmain; this PR only moves it, by reading the size from the samedocker image inspectcall. The new manifest code reuses the same existing platform constant to choose the linux/amd64 entry of an index, so it adds no new rule. This PR adds no size limit numbers: sizes are only reported, and the limits are linked to Databricks Artifact Registry's own documentation.Tests
TestCompressedImageSize: OCI image manifest, schema2 manifest without a platform, an index where the linux/amd64 entry is chosen over arm64 and attestation entries, an index with no linux/amd64 entry, and non-JSON output.TestFormatImageSizechecks MB and GB formatting;TestDARLimitationsURLchecks the link for AWS, Azure and GCP.TestRunImagePushTagsAndPushesLocalImageasserts the command sequence, including the post-pushdocker manifest inspect --verboseon the pushed ref.acceptance/air/image-push: the fake docker serves a pushed manifest, and the golden records the uncompressed line, the compressed headline with layer count, and the DAR link. Abad-sizestep shows both size reads failing with warnings while the push succeeds. Golden output regenerated.go test ./cmd/air -run 'TestRunImagePush|TestImageExistsLocally|TestDARLimitationsURL|TestFormatImageSize|TestCompressedImageSize',go test ./acceptance -run TestAccept/air/image-push,task lint-q,task wsandtask check-changelogpass locally. Thedocker manifest inspect --verboseoutput shape was checked against Docker 29.6 for both a single manifest and an index.This pull request and its description were written by Isaac.