Skip to content

air: show the Databricks AI environment in air get - #7637

Draft
dimk0 wants to merge 4 commits into
mainfrom
cnxt-2641-air-get-ai-environment
Draft

dimk0 wants to merge 4 commits into
mainfrom
cnxt-2641-air-get-ai-environment

Conversation

@dimk0

@dimk0 dimk0 commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Changes

  • air get now shows the environment, for example databricks_ai_v6, for runs submitted with environment.version: databricks_ai_v*, instead of Environment N/A. The air list info pane renders through the same code and is fixed too.
  • air run submits those versions as spec.base_environment = workspace-base-environments/<version> with no environment_version. The reader now strips that exact prefix, shared as workspaceBaseEnvironmentPrefix with buildRunEnvironment and convert-to-dabs. Any other workspace base environment, such as a custom dbe_<uuid>, shows its ID the same way. Numeric versions are still read from environment_version.
  • The Environment cell is passed through stripControl, like the other server-supplied cells, so escape sequences in a base environment name cannot reach the terminal.

Why

Every run on the Databricks AI environment, which most AI Runtime cookbook recipes use, showed Environment N/A. A real jobs/runs/get response for such a run, from air run with environment.version: databricks_ai_v6, returns "environments": [{"environment_key": "default", "spec": {"base_environment": "workspace-base-environments/databricks_ai_v6"}}]. Internal ticket: CNXT-2641.

Tests

  • TestAiRuntimeEnvironmentVersion: numeric environment_version, databricks_ai_v6 and custom dbe_<uuid> base environments.
  • New acceptance test acceptance/air/get-databricks-ai: air get text output for a databricks_ai_v6 run.
  • TestRenderFieldsStripsControlCharacters and the acceptance/air/control-chars test now put an escape sequence into the environment and assert clean output.
  • Each new test fails without its fix. go test ./cmd/air/... and go test ./acceptance -run 'TestAccept/air/' pass; ./task lint-q and ./task fmt-q are clean. Unit tests ran with DATABRICKS_WORKSPACE_ID unset: TestLogsCommandRepeatsRunLinkAfterStreaming also fails on main when that variable is set.

This pull request and its description were written by Isaac.

dimk0 and others added 2 commits November 14, 2026 23:42
`air run` submits a databricks_ai_v* version as spec.base_environment
(workspace-base-environments/databricks_ai_v6), but `air get` and the
`air list` info pane read only spec.environment_version, so Environment
showed N/A. Strip the shared prefix and show the configured version.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
@github-actions github-actions Bot added the AIR Databricks AI Runtime CLI label Nov 14, 2026
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Commit: 787fb7eb9 | Workflow run

Regression test report

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

2 tests: regression=2 unreleased=0 coverage=0 failing=0
test branch main (20fef7c) latest (v1.26.0)
TestAccept/air/control-chars ✅ ❌ ❌
TestAccept/air/get-databricks-ai ✅ ❌ ❌
TestAccept/air/control-chars: branch ✅ | main (20fef7c) ❌ | latest (v1.26.0) ❌

main (20fef7c):

acceptance_test.go:1374: Diff:
        --- air/control-chars/output.txt
        +++ /tmp/TestAcceptaircontrol-chars1911292409/002/output.txt
        @@ -15,7 +15,7 @@
         │  MLflow Run    my-run                                          │
         │  User          user@example.com                                │
         │  Accelerators  1x A10                                          │
        -│  Environment   databricks_ai_v6                                │
        +│  Environment   N/A                                             │
         │                                                                │
         ╰────────────────────────────────────────────────────────────────╯
         
        
FAIL

latest (v1.26.0):

acceptance_test.go:1374: Diff:
        --- air/control-chars/output.txt
        +++ /tmp/TestAcceptaircontrol-chars706308975/002/output.txt
        @@ -11,11 +11,12 @@
         │  Retries       0                                               │
         │  Max Retries   0                                               │
         │  Duration      12s                                             │
        -│  Experiment    my-exp                                          │
        -│  MLflow Run    my-run                                          │
        -│  User          user@example.com                                │
        +│  Experiment    my�]0;pwned�-exp                                          │
        +│  MLflow Run    �]0;pwned�my�[2J-run
        +                                          │
        +│  User          user�[31m@example.com                                │
         │  Accelerators  1x A10                                          │
        -│  Environment   databricks_ai_v6                                │
        +│  Environment   N/A                                             │
         │                                                                │
         ╰────────────────────────────────────────────────────────────────╯
         
        @@ -26,7 +26,8 @@
         
         >>> [CLI] air list --all-users
            Run ID  Experiment  Status     Started              Duration  Progress  MLflow                  User              Accelerators
        -   123     my-exp      ● SUCCESS  [TIMESTAMP]       12s         -  my-run                  user@example.com  1x A10
        +   123     my�]0;pwned�-exp      ● SUCCESS  [TIMESTAMP]       12s         -  �]0;pwned�my�[2J-run
        +                  user�[31m@example.com  1x A10
         
         === list (json): strings are passed through as the server sent them
         
        @@ -42,12 +43,7 @@
                 "user": "user\u001b[31m@example.com",
                 "status": "SUCCESS",
                 "started_at": "[TIMESTAMP]",
        -        "is_sweep": false,
        -        "experiment_name": "my\u001b]0;pwned\u0007-exp",
        -        "duration_seconds": 12,
        -        "accelerator_type": "GPU_1xA10",
        -        "num_accelerators": 1,
        -        "dashboard_url": "[DATABRICKS_URL]/jobs/runs/123?o=[WORKSPACE_ID]"
        +        "is_sweep": false
               }
             ]
           }
        
FAIL
TestAccept/air/get-databricks-ai: branch ✅ | main (20fef7c) ❌ | latest (v1.26.0) ❌

main (20fef7c):

acceptance_test.go:1374: Diff:
        --- air/get-databricks-ai/output.txt
        +++ /tmp/TestAcceptairget-databricks-ai3726081306/002/output.txt
        @@ -13,7 +13,7 @@
         │  MLflow Run    N/A                                             │
         │  User          user@example.com                                │
         │  Accelerators  1x A10                                          │
        -│  Environment   databricks_ai_v6                                │
        +│  Environment   N/A                                             │
         │                                                                │
         ╰────────────────────────────────────────────────────────────────╯

latest (v1.26.0): same output as main (20fef7c)

@eng-dev-ecosystem-bot

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

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 787fb7e

Run: 43770520444

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 270 17 3:35
💚​ aws-windows-latest-4core-16gb 1 272 15 2:58
💚​ azure linux-2core-8gb 1 269 17 3:30
💚​ azure-windows-latest-4core-16gb 1 271 15 2:55
💚​ gcp linux-2core-8gb 1 270 17 3:30
💚​ gcp-windows-latest-4core-16gb 1 272 15 3:12
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 3 slowest tests (at least 2 minutes):
duration env testname
3:08 gcp-windows-latest-4core-16gb TestAccept
2:54 aws-windows-latest-4core-16gb TestAccept
2:50 azure-windows-latest-4core-16gb TestAccept

dimk0 and others added 2 commits November 15, 2026 22:12
- Strip control characters from the Environment cell, as for the other server-supplied cells, and cover it in the control-character tests.
- Reword the base environment comments: any workspace base environment shows its ID, not only databricks_ai_v*; pin that with a dbe_ test row.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>

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.

2 participants