AIR CLI Integration: Implement the air get command#5600
AIR CLI Integration: Implement the air get command#5600riddhibhagwat-db wants to merge 3 commits into
air get command#5600Conversation
Implement the read-only run-details command (renamed from `status` to `get`).
It fetches a job run via the Jobs API and renders the run's status, start time,
duration, retries, experiment, accelerators, dashboard URL, MLflow deep-link,
and a foreach/sweep summary. Output is the air-style {v, ts, data} JSON envelope
under -o json, or a text view.
Renames the command-level identifiers (status -> get) while keeping the run's
"status" field/label. Adds format/mlflow/sweep/output helpers with unit tests
and an acceptance test, and drops `get` from the not-implemented stub coverage.
Co-authored-by: Isaac
Waiting for approvalCould not determine reviewers from git history. Eligible reviewers: Suggestions based on git history. See OWNERS for ownership rules. |
air status commandair get command
Integration test reportCommit: c99239c
22 interesting tests: 15 SKIP, 7 RECOVERED
Top 29 slowest tests (at least 2 minutes):
|
Co-authored-by: Isaac
Co-authored-by: Isaac
|
|
||
| cmdio.LogString(ctx, "Training Configuration:") | ||
| cmdio.LogString(ctx, string(content)) | ||
| cmdio.LogString(ctx, "") |
There was a problem hiding this comment.
This helper function LogString writes to stderr, instead of stdout which was the original Python code behavior: https://github.com/databricks/cli/blob/main/libs/cmdio/log.go#L14-L18
|
|
||
| runID, err := strconv.ParseInt(args[0], 10, 64) | ||
| if err != nil || runID <= 0 { | ||
| return fmt.Errorf("invalid RUN_ID %q: must be a positive integer", args[0]) |
There was a problem hiding this comment.
In json mode does this return a plain Go error instead of json envelope?
This and a few other places should return json if --json flag is passed
| // Accelerators describes the run's GPUs, e.g. "8x H100". | ||
| Accelerators string `json:"-"` | ||
| // User is the run's creator. Text-only; JSON omits it, matching `air get --json`. | ||
| User string `json:"-"` |
There was a problem hiding this comment.
I think this is one area where we can update. I think user can be included in json
Changes
Implements
databricks experimental ai get RUN_ID, the Go port of the Pythonair getcommand. It fetches the run viaJobs.GetRunand renders:User), and the run's dashboard URL.jobs/runs/get-output(thegen_ai_compute_outputfield is not modeled by the typed SDK, so it's fetched via a direct REST call).Why
getis the first real command integrated from the air cli and it sets the conventions the rest of the CLI will follow. The{v, ts, data}envelope mirrors the Python CLI so existing machine consumers keep working. The implementation is a faithful port ofhandle_status+ thecli_displayhelpers, verified field-by-field against the Python source:_display_foreach_sweep_status) and the training-config panel (_fetch_and_display_yaml_config); JSON output omits both, exactly matchingair get <run> --json.gen_ai_compute_outputfield (direct REST call), and the MLflow link / YAML fetch are best-effort (logic matches python cli)Tests
buildGetData, and all template branches (single-run minimal/all-fields, sweep, sweep-with-no-tasks).unittest.mocksuite) coverbuildSweepInfo,printConfigYAML,mlflowURL(overhttptest, since it bypasses the typed SDK), and theRunEinvalid-id / not-found branches.acceptance/experimental/air/get) runs the command end-to-end against a stubbed Jobs API: text output,-o json, and an invalid run ID.