Skip to content

Commit d96e64f

Browse files
experimental/air: scaffold AI runtime CLI command package
Add the experimental `air` command group as the Go port surface for the Python `air` CLI. Every subcommand (run, status, list, logs, cancel, register-image) is registered as a stub that returns a not-implemented error; the real implementations land in later milestones. The package lives under experimental/air/cmd (imported as aircmd), matching the layout of the other experimental features (aitools, genie, postgres); cmd/experimental/ keeps only the dispatcher. TEST_PACKAGES in Taskfile.yml gains ./experimental/air/... so the unit tests keep running after the move. Includes unit tests for the command-tree wiring and the not-implemented stubs, plus an acceptance test exercising the stubs end-to-end. Co-authored-by: Isaac
1 parent d66b99e commit d96e64f

19 files changed

Lines changed: 391 additions & 1 deletion

File tree

Taskfile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ vars:
44
# Absolute path so tasks with `dir:` (lint-go-tools, lint-go-codegen) can use it.
55
GO_TOOL: go tool -modfile={{.ROOT_DIR}}/tools/go.mod
66
EXE_EXT: '{{if eq OS "windows"}}.exe{{end}}'
7-
TEST_PACKAGES: ./acceptance/internal ./libs/... ./internal/... ./cmd/... ./bundle/... ./experimental/ssh/... .
7+
TEST_PACKAGES: ./acceptance/internal ./libs/... ./internal/... ./cmd/... ./bundle/... ./experimental/air/... ./experimental/ssh/... .
88
ACCEPTANCE_TEST_FILTER: ""
99
# Single brace-expansion glob covering every //go:embed target in the repo,
1010
# computed by grepping `//go:embed` directives. Evaluated lazily by Task so

acceptance/experimental/air/help/out.test.toml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
=== help
3+
>>> [CLI] experimental air --help
4+
Run and manage AI runtime training workloads on Databricks serverless GPU compute.
5+
6+
This command set is the Go port of the standalone Python "air" CLI. It is
7+
experimental and may change in future versions.
8+
9+
Usage:
10+
databricks experimental air [command]
11+
12+
Available Commands:
13+
cancel Cancel one or more runs
14+
list List recent runs
15+
logs Stream or fetch logs for a run
16+
register-image Mirror a Docker image into the workspace registry
17+
run Submit a training workload from a YAML config
18+
status Show status and configuration for a run
19+
20+
Flags:
21+
-h, --help help for air
22+
23+
Global Flags:
24+
--debug enable debug logging
25+
-o, --output type output type: text or json (default text)
26+
-p, --profile string ~/.databrickscfg profile
27+
-t, --target string bundle target to use (if applicable)
28+
29+
Use "databricks experimental air [command] --help" for more information about a command.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Pin the command tree so any change to a subcommand or its short description
2+
# shows up as a diff here.
3+
4+
title "help"
5+
trace $CLI experimental air --help
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Local = true
2+
Cloud = false
3+
4+
# --help prints without authenticating, so no server stubs are needed.
5+
[EnvMatrix]
6+
DATABRICKS_BUNDLE_ENGINE = []

acceptance/experimental/air/unimplemented/out.test.toml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
=== run
3+
>>> [CLI] experimental air run
4+
Error: `air run` is not implemented yet
5+
6+
Exit code: 1
7+
8+
=== status
9+
>>> [CLI] experimental air status 123
10+
Error: `air status` is not implemented yet
11+
12+
Exit code: 1
13+
14+
=== list
15+
>>> [CLI] experimental air list
16+
Error: `air list` is not implemented yet
17+
18+
Exit code: 1
19+
20+
=== logs
21+
>>> [CLI] experimental air logs 123
22+
Error: `air logs` is not implemented yet
23+
24+
Exit code: 1
25+
26+
=== cancel
27+
>>> [CLI] experimental air cancel 123
28+
Error: `air cancel` is not implemented yet
29+
30+
Exit code: 1
31+
32+
=== register-image
33+
>>> [CLI] experimental air register-image my-image:latest
34+
Error: `air register-image` is not implemented yet
35+
36+
Exit code: 1
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Each stub must fail with "not implemented"; errcode records the exit code.
2+
3+
title "run"
4+
errcode trace $CLI experimental air run
5+
6+
title "status"
7+
errcode trace $CLI experimental air status 123
8+
9+
title "list"
10+
errcode trace $CLI experimental air list
11+
12+
title "logs"
13+
errcode trace $CLI experimental air logs 123
14+
15+
title "cancel"
16+
errcode trace $CLI experimental air cancel 123
17+
18+
title "register-image"
19+
errcode trace $CLI experimental air register-image my-image:latest
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Local = true
2+
Cloud = false
3+
4+
# Stubs fail locally before any API call, so no server stubs needed.
5+
[EnvMatrix]
6+
DATABRICKS_BUNDLE_ENGINE = []

cmd/experimental/experimental.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package experimental
22

33
import (
4+
aircmd "github.com/databricks/cli/experimental/air/cmd"
45
aitoolscmd "github.com/databricks/cli/experimental/aitools/cmd"
56
geniecmd "github.com/databricks/cli/experimental/genie/cmd"
67
postgrescmd "github.com/databricks/cli/experimental/postgres/cmd"
@@ -22,6 +23,7 @@ These commands provide early access to new features that are still under
2223
development. They may change or be removed in future versions without notice.`,
2324
}
2425

26+
cmd.AddCommand(aircmd.New())
2527
cmd.AddCommand(aitoolscmd.NewAitoolsCmd())
2628
cmd.AddCommand(geniecmd.NewGenieCmd())
2729
cmd.AddCommand(postgrescmd.New())

0 commit comments

Comments
 (0)