Skip to content

[AIR] CNXT-2687: report the image size and compressed layer size when pushing - #7868

Open
vinchenzo-db wants to merge 9 commits into
mainfrom
vinchenzo-db/cnxt-2687
Open

vinchenzo-db wants to merge 9 commits into
mainfrom
vinchenzo-db/cnxt-2687

Conversation

@vinchenzo-db

@vinchenzo-db vinchenzo-db commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Changes

databricks air images push now reports image sizes around the upload. All of the output is informational:

  • Before tagging, it prints the local uncompressed size, read from the existing docker image inspect call (Source image X is 7.1 GB uncompressed.).
  • After the push, it reads the pushed manifest with docker manifest inspect --verbose and 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.
  • It then links the Databricks Artifact Registry limitations page for the workspace's cloud (AWS, Azure or GCP).

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-check flags one line: the "AIR requires linux/amd64" platform error in cmd/air/image.go. That check is existing code on main; this PR only moves it, by reading the size from the same docker image inspect call. 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.
  • TestFormatImageSize checks MB and GB formatting; TestDARLimitationsURL checks the link for AWS, Azure and GCP.
  • TestRunImagePushTagsAndPushesLocalImage asserts the command sequence, including the post-push docker manifest inspect --verbose on the pushed ref.
  • Acceptance test 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. A bad-size step 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 ws and task check-changelog pass locally. The docker manifest inspect --verbose output 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.

@vinchenzo-db
vinchenzo-db requested review from a team as code owners November 21, 2026 05:21
vinchenzo-db added a commit that referenced this pull request Nov 21, 2026
Co-authored-by: Isaac <no-reply@databricks.com>
@vinchenzo-db

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot added the AIR Databricks AI Runtime CLI label Nov 21, 2026
@vinchenzo-db

Copy link
Copy Markdown
Contributor Author

/review

@vinchenzo-db vinchenzo-db changed the title [AIR] CNXT-2687: check the source image size against the 20 GB limit before pushing [AIR] CNXT-2687: print the source image size and warn about the 20 GB limit before pushing Nov 21, 2026
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Commit: 04d658133 | Workflow run

Regression test report

Selected 1 changed tests (limit=20, 0 not selected)

1 tests: regression=1 unreleased=0 coverage=0 failing=0
test branch main (1ea5591) latest (v1.27.0)
TestAccept/air/image-push ✅ ❌ ❌
TestAccept/air/image-push: branch ✅ | main (1ea5591) ❌ | latest (v1.27.0) ❌

main (1ea5591):

acceptance_test.go:1402: Diff:
        --- air/image-push/output.txt
        +++ /tmp/TestAcceptairimage-push4243201587/002/output.txt
        @@ -8,271 +8,6 @@
         Updated Docker config: [TEST_TMP_DIR]/home/docker/config.json
         Installed Docker credential helper: [TEST_TMP_DIR]/home/bin/docker-credential-databricks
         Using local source image nvidia/cuda:13.4.1
        -Source image nvidia/cuda:13.4.1 is 7.1 GB uncompressed.
        -Tagging image as [WORKSPACE_ID].container.us-west-2.localhost/my-catalog.my-schema.cuda:13.4.1-cudnn-devel-ubuntu26.04
        -Pushing image to [WORKSPACE_ID].container.us-west-2.localhost/my-catalog.my-schema.cuda:13.4.1-cudnn-devel-ubuntu26.04
        -Docker push progress
        -Pushed image.
        -Compressed image size: 3.1 GB in 2 layers.
        -For Databricks Artifact Registry image limits, see https://docs.databricks.com/aws/en/artifact-registry/#limitations
        -Now you can set `environment.unity_catalog_image = my-catalog.my-schema.cuda:13.4.1-cudnn-devel-ubuntu26.04` in your YAML config and create a workload with `databricks air run -f config.yaml`.
        +Error: source image nvidia/cuda:13.4.1 has platform "linux/amd64|7140000000"; AIR requires linux/amd64: use --pull to fetch a compatible image, or rebuild the source for linux/amd64
         
        -=== inferred region and workspace ID requests
        -
        ->>> print_requests.py --get //api
        -{
        -  "method": "GET",
        -  "path": "/api/2.0/preview/scim/v2/Me",
        -  "q": {
        -    "excludedAttributes": "entitlements"
        -  }
        -}
        -{
        -  "method": "GET",
        -  "path": "/api/2.1/unity-catalog/metastore_summary"
        -}
        -
        -=== docker commands
        -image ls --quiet nvidia/cuda:13.4.1
        -image inspect --format {{.Os}}/{{.Architecture}}|{{.Size}} nvidia/cuda:13.4.1
        -tag nvidia/cuda:13.4.1 [WORKSPACE_ID].container.us-west-2.localhost/my-catalog.my-schema.cuda:13.4.1-cudnn-devel-ubuntu26.04
        -push [WORKSPACE_ID].container.us-west-2.localhost/my-catalog.my-schema.cuda:13.4.1-cudnn-devel-ubuntu26.04
        -manifest inspect --verbose [WORKSPACE_ID].container.us-west-2.localhost/my-catalog.my-schema.cuda:13.4.1-cudnn-devel-ubuntu26.04
        -
        -=== missing image is pulled for AIR; destination defaults to source
        -
        ->>> databricks air images push -p docker-test -s example/image:v1 --catalog main --schema training
        -Warning: This feature is in Preview. APIs may change, and the workspace must enable the Preview features.
        -Pushing example/image:v1 as main.training.image:v1 using profile docker-test
        -Configured Docker credential helper for [WORKSPACE_ID].container.us-west-2.localhost
        -Updated Docker config: [TEST_TMP_DIR]/home/docker/config.json
        -Installed Docker credential helper: [TEST_TMP_DIR]/home/bin/docker-credential-databricks
        -Pulling source image example/image:v1 for linux/amd64
        -Docker pull progress
        -Source image example/image:v1 is 7.1 GB uncompressed.
        -Tagging image as [WORKSPACE_ID].container.us-west-2.localhost/main.training.image:v1
        -Pushing image to [WORKSPACE_ID].container.us-west-2.localhost/main.training.image:v1
        -Docker push progress
        -Pushed image.
        -Compressed image size: 3.1 GB in 2 layers.
        -For Databricks Artifact Registry image limits, see https://docs.databricks.com/aws/en/artifact-registry/#limitations
        -Now you can set `environment.unity_catalog_image = main.training.image:v1` in your YAML config and create a workload with `databricks air run -f config.yaml`.
        -
        -=== forced pull and JSON output
        -
        ->>> databricks air images push -p docker-test -s example/image:v1 --catalog main --schema training --pull -o json
        -Warning: This feature is in Preview. APIs may change, and the workspace must enable the Preview features.
        -Pushing example/image:v1 as main.training.image:v1 using profile docker-test
        -Configured Docker credential helper for [WORKSPACE_ID].container.us-west-2.localhost
        -Updated Docker config: [TEST_TMP_DIR]/home/docker/config.json
        -Installed Docker credential helper: [TEST_TMP_DIR]/home/bin/docker-credential-databricks
        -Pulling source image example/image:v1 for linux/amd64
        -Docker pull progress
        -Source image example/image:v1 is 7.1 GB uncompressed.
        -Tagging image as [WORKSPACE_ID].container.us-west-2.localhost/main.training.image:v1
        -Pushing image to [WORKSPACE_ID].container.us-west-2.localhost/main.training.image:v1
        -Docker push progress
        -Pushed image.
        -Compressed image size: 3.1 GB in 2 layers.
        -For Databricks Artifact Registry image limits, see https://docs.databricks.com/aws/en/artifact-registry/#limitations
        -
        ->>> jq -e {v, data} [TEST_TMP_DIR]/home/result.json
        -{
        -  "v": 1,
        -  "data": {
        -    "unity_catalog_image": "main.training.image:v1",
        -    "registry_image": "[WORKSPACE_ID].container.us-west-2.localhost/main.training.image:v1"
        -  }
        -}
        -
        -=== daemon failure must not pull
        -
        ->>> musterr databricks air images push -p docker-test -s example/image:v1 --catalog main --schema training
        -Warning: This feature is in Preview. APIs may change, and the workspace must enable the Preview features.
        -Pushing example/image:v1 as main.training.image:v1 using profile docker-test
        -Configured Docker credential helper for [WORKSPACE_ID].container.us-west-2.localhost
        -Updated Docker config: [TEST_TMP_DIR]/home/docker/config.json
        -Installed Docker credential helper: [TEST_TMP_DIR]/home/bin/docker-credential-databricks
        -Cannot connect to the Docker daemon
        -Error: check local source image example/image:v1 (ensure Docker is running and accessible): exit status 1
        -
        -=== inspect failure must not pull
        -
        ->>> musterr databricks air images push -p docker-test -s example/image:v1 --catalog main --schema training
        -Warning: This feature is in Preview. APIs may change, and the workspace must enable the Preview features.
        -Pushing example/image:v1 as main.training.image:v1 using profile docker-test
        -Configured Docker credential helper for [WORKSPACE_ID].container.us-west-2.localhost
        -Updated Docker config: [TEST_TMP_DIR]/home/docker/config.json
        -Installed Docker credential helper: [TEST_TMP_DIR]/home/bin/docker-credential-databricks
        -Using local source image example/image:v1
        -Docker inspect failed
        -Error: inspect source image example/image:v1: exit status 1
        -
        -=== unreadable image sizes warn but the image is pushed
        -
        ->>> databricks air images push -p docker-test -s example/image:v1 --catalog main --schema training
        -Warning: This feature is in Preview. APIs may change, and the workspace must enable the Preview features.
        -Pushing example/image:v1 as main.training.image:v1 using profile docker-test
        -Configured Docker credential helper for [WORKSPACE_ID].container.us-west-2.localhost
        -Updated Docker config: [TEST_TMP_DIR]/home/docker/config.json
        -Installed Docker credential helper: [TEST_TMP_DIR]/home/bin/docker-credential-databricks
        -Using local source image example/image:v1
        -Warning: could not read the uncompressed size of source image example/image:v1 (got "").
        -Tagging image as [WORKSPACE_ID].container.us-west-2.localhost/main.training.image:v1
        -Pushing image to [WORKSPACE_ID].container.us-west-2.localhost/main.training.image:v1
        -Docker push progress
        -Pushed image.
        -Warning: could not read the compressed size of [WORKSPACE_ID].container.us-west-2.localhost/main.training.image:v1: no such manifest: [WORKSPACE_ID].container.us-west-2.localhost/main.training.image:v1
        -For Databricks Artifact Registry image limits, see https://docs.databricks.com/aws/en/artifact-registry/#limitations
        -Now you can set `environment.unity_catalog_image = main.training.image:v1` in your YAML config and create a workload with `databricks air run -f config.yaml`.
        -
        -=== incompatible local image must not be pushed
        -
        ->>> musterr databricks air images push -p docker-test -s example/image:v1 --catalog main --schema training
        -Warning: This feature is in Preview. APIs may change, and the workspace must enable the Preview features.
        -Pushing example/image:v1 as main.training.image:v1 using profile docker-test
        -Configured Docker credential helper for [WORKSPACE_ID].container.us-west-2.localhost
        -Updated Docker config: [TEST_TMP_DIR]/home/docker/config.json
        -Installed Docker credential helper: [TEST_TMP_DIR]/home/bin/docker-credential-databricks
        -Using local source image example/image:v1
        -Error: source image example/image:v1 has platform "linux/arm64"; AIR requires linux/amd64: use --pull to fetch a compatible image, or rebuild the source for linux/amd64
        -
        -=== incompatible pulled image must not be pushed
        -
        ->>> musterr databricks air images push -p docker-test -s example/image:v1 --catalog main --schema training --pull
        -Warning: This feature is in Preview. APIs may change, and the workspace must enable the Preview features.
        -Pushing example/image:v1 as main.training.image:v1 using profile docker-test
        -Configured Docker credential helper for [WORKSPACE_ID].container.us-west-2.localhost
        -Updated Docker config: [TEST_TMP_DIR]/home/docker/config.json
        -Installed Docker credential helper: [TEST_TMP_DIR]/home/bin/docker-credential-databricks
        -Pulling source image example/image:v1 for linux/amd64
        -Docker pull progress
        -Error: source image example/image:v1 has platform "linux/arm64"; AIR requires linux/amd64: use --pull to fetch a compatible image, or rebuild the source for linux/amd64
        -
        -=== pull failure must not be pushed
        -
        ->>> musterr databricks air images push -p docker-test -s example/image:v1 --catalog main --schema training --pull
        -Warning: This feature is in Preview. APIs may change, and the workspace must enable the Preview features.
        -Pushing example/image:v1 as main.training.image:v1 using profile docker-test
        -Configured Docker credential helper for [WORKSPACE_ID].container.us-west-2.localhost
        -Updated Docker config: [TEST_TMP_DIR]/home/docker/config.json
        -Installed Docker credential helper: [TEST_TMP_DIR]/home/bin/docker-credential-databricks
        -Pulling source image example/image:v1 for linux/amd64
        -Docker pull failed
        -Error: pull source image example/image:v1: exit status 1
        -
        -=== invalid destination and removed flags
        -
        ->>> musterr databricks air images push -p docker-test -s example/image:v1 --catalog main --schema training --artifact invalid.name
        -Warning: This feature is in Preview. APIs may change, and the workspace must enable the Preview features.
        -Error: invalid artifact name "invalid.name": use lowercase letters and digits separated by one or two underscores or one or more hyphens
        -
        ->>> musterr databricks air images push -p docker-test -s example/image:v1 --catalog main --schema team_-training
        -Warning: This feature is in Preview. APIs may change, and the workspace must enable the Preview features.
        -Error: invalid schema "team_-training": use lowercase letters and digits separated by one or two underscores or one or more hyphens
        -
        ->>> musterr databricks air images push --region us-west-2
        -Error: unknown flag: --region
        -
        -Usage:
        -  databricks air images push [flags]
        -
        -Flags:
        -      --artifact string     Destination ARTIFACT[:TAG]; defaults to the source image name and tag (latest if untagged); maximum 255 characters for catalog.schema.artifact and 128 for the tag
        -      --catalog string      Destination Unity Catalog catalog; use lowercase letters and digits separated by one or two underscores or one or more hyphens
        -  -h, --help[=true|false]   help for push
        -      --pull[=true|false]   Pull the source image even when it is already available locally
        -      --schema string       Destination Unity Catalog schema; use lowercase letters and digits separated by one or two underscores or one or more hyphens
        -  -s, --source string       Source container image to push (NAME[:TAG] or NAME@DIGEST)
        -
        -Global Flags:
        -      --debug[=true|false]   enable debug logging
        -  -o, --output type          output type: text or json (default text)
        -  -p, --profile string       ~/.databrickscfg profile
        -  -t, --target string        bundle target to use (if applicable)
        -
        -
        ->>> musterr databricks air images push --image artifact
        -Error: unknown flag: --image
        -
        -Usage:
        -  databricks air images push [flags]
        -
        -Flags:
        -      --artifact string     Destination ARTIFACT[:TAG]; defaults to the source image name and tag (latest if untagged); maximum 255 characters for catalog.schema.artifact and 128 for the tag
... (79 more lines truncated, raise DATABRICKS_CLI_TEST_MAX_LOG to see more)

latest (v1.27.0): same output as main (1ea5591)

@review-oss-bot review-oss-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread cmd/air/image.go Resolved
Comment thread cmd/air/image.go Resolved
@vinchenzo-db

Copy link
Copy Markdown
Contributor Author

/review

@review-oss-bot review-oss-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 04d6581

Run: 45268656966

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 272 20 15:19
💚​ aws-windows-latest-4core-16gb 1 274 18 11:48
💚​ azure linux-2core-8gb 1 271 20 14:12
💚​ azure-windows-latest-4core-16gb 1 273 18 9:25
💚​ gcp linux-2core-8gb 1 272 20 14:03
💚​ gcp-windows-latest-4core-16gb 1 274 18 10:23
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 31 slowest tests (at least 2 minutes):
duration env testname
4:39 aws-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsReadDir
4:11 aws linux-2core-8gb TestFilerWorkspaceFilesExtensionsReadDir
4:04 gcp linux-2core-8gb TestAccept
4:03 gcp-windows-latest-4core-16gb TestAccept
3:59 aws-windows-latest-4core-16gb TestFilerReadWrite/workspace_files
3:58 azure linux-2core-8gb TestAccept
3:55 azure linux-2core-8gb TestSyncIncrementalFileSync
3:52 azure linux-2core-8gb TestFilerRecursiveDelete/workspace_files
3:51 azure-windows-latest-4core-16gb TestAccept
3:31 aws-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsDelete
3:30 azure-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsRead
3:23 aws linux-2core-8gb TestAccept
3:17 gcp-windows-latest-4core-16gb TestFilerReadWrite/workspace_files_extensions
3:10 aws linux-2core-8gb TestSyncFullFileSync
3:00 gcp-windows-latest-4core-16gb TestExportDir
2:56 azure linux-2core-8gb TestWorkspaceFilesExtensions_ExportFormatIsPreserved/source_scala
2:50 aws-windows-latest-4core-16gb TestAccept
2:44 azure-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsStat
2:39 gcp-windows-latest-4core-16gb TestFilerWorkspaceNotebook/scalaJupyterNb.ipynb
2:34 azure-windows-latest-4core-16gb TestImportDirWithOverwriteFlag
2:27 gcp-windows-latest-4core-16gb TestImportDirWithOverwriteFlag
2:25 aws-windows-latest-4core-16gb TestImportDirWithOverwriteFlag
2:20 gcp linux-2core-8gb TestFilerWorkspaceFilesExtensionsReadDir
2:16 aws linux-2core-8gb TestFilerWorkspaceNotebook/rJupyterNb.ipynb
2:15 aws-windows-latest-4core-16gb TestImportDir
2:11 gcp-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsRead
2:11 aws-windows-latest-4core-16gb TestFilerReadWrite/workspace_files_extensions
2:07 aws linux-2core-8gb TestFilerReadDir/workspace_files
2:05 azure-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsReadDir
2:05 azure linux-2core-8gb TestFilerWorkspaceFilesExtensionsReadDir
2:03 gcp-windows-latest-4core-16gb TestFilerRecursiveDelete/workspace_files

@maggiewang-db maggiewang-db left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@vinchenzo-db vinchenzo-db changed the title [AIR] CNXT-2687: print the source image size and warn about the 20 GB limit before pushing [AIR] CNXT-2687: print the source image size and warn about the 30 GB registry limit before pushing Nov 21, 2026
@vinchenzo-db

Copy link
Copy Markdown
Contributor Author

/review

@vinchenzo-db

Copy link
Copy Markdown
Contributor Author

Thanks, updated to the 30 GB DAR limit and reworded; AI Runtime's own limit is gone from the PR.

@review-oss-bot review-oss-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread cmd/air/image.go Resolved
@vinchenzo-db

Copy link
Copy Markdown
Contributor Author

/review

@review-oss-bot review-oss-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 maggiewang-db left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

vinchenzo-db and others added 7 commits November 23, 2026 17:49
`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>
@vinchenzo-db
vinchenzo-db force-pushed the vinchenzo-db/cnxt-2687 branch from 47a3ded to 8e98af6 Compare November 23, 2026 17:54
@vinchenzo-db vinchenzo-db changed the title [AIR] CNXT-2687: print the source image size and warn about the 30 GB registry limit before pushing [AIR] CNXT-2687: print the source image size and link the DAR image limits before pushing Nov 23, 2026
@vinchenzo-db

Copy link
Copy Markdown
Contributor Author

/review

@review-oss-bot review-oss-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread cmd/air/image.go Resolved
Comment thread cmd/air/image.go Resolved
Comment thread cmd/air/image_test.go Resolved
Comment thread cmd/air/image_test.go Resolved
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>
@vinchenzo-db

Copy link
Copy Markdown
Contributor Author

/review

@review-oss-bot review-oss-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread cmd/air/image.go Resolved
Comment thread cmd/air/image.go Resolved
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>
@vinchenzo-db vinchenzo-db changed the title [AIR] CNXT-2687: print the source image size and link the DAR image limits before pushing [AIR] CNXT-2687: report the image size and compressed layer size when pushing Nov 23, 2026
@vinchenzo-db

Copy link
Copy Markdown
Contributor Author

/review

@review-oss-bot review-oss-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 push fails and we return push image %s: %w right 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 the darLimitationsURL(w.Config) hint to this error too, so a failed push points at the limits?

Comment thread cmd/air/image.go Resolved
Comment thread cmd/air/image.go Resolved
Comment thread cmd/air/image.go Resolved

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AIR Databricks AI Runtime CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants