Repository navigation
air: validate list filters and support full accelerator types - #7515
Conversation
|
Commit: Regression test reportSelected 1 changed tests (limit=20, 0 not selected) 1 tests: regression=1 unreleased=0 coverage=0 failing=0
TestAccept/air/help: branch ✅ | main (db52460) ❌ | latest (v1.26.0) ❌main (db52460): latest (v1.26.0): |
✅ Integration test reportCommit: b2b3c80
Top 25 slowest tests (at least 2 minutes):
|
| } | ||
|
|
||
| func validAcceleratorFilterHint() string { | ||
| return "use a family name (A10, H100, B300, RTX6000) or a full type; " + validGPUTypesHint() |
There was a problem hiding this comment.
nit: The family list (A10, H100, B300, RTX6000) is hardcoded here, so it will drift the next time a type is added to gpuTypes. Could we build it from gpuTypes via gpuDisplayName (deduped, since 1x and 8x H100 share a family), the same way validGPUTypesHint builds the full-type list?
There was a problem hiding this comment.
updating this to be workspace aware and not hardcoded, especially following steven's changes to avoid hardcoding in cli help as well
|
|
||
| accelerator_type Accelerator type, such as A10 or H100. | ||
| accelerator_type Accelerator family or exact full type. Examples: A10, H100, | ||
| GPU_1xA10, GPU_8xH100. |
There was a problem hiding this comment.
Human readability: The air list table shows accelerators as 8x H100, so a user who copies that value into --filter accelerator_type=8x H100 gets an error. The error does list the valid values, but could we either accept the table's display format or say here that the table format isn't accepted as a filter value?
There was a problem hiding this comment.
the table shows <num accelerators>x <accelerator family> meaning it would show 16x H100 for a 2 node 8xh100, the 8 here refers to total num accelerators rather than part of the accelerator type. I think we can leave this behavior for now rather than adding a new supported 8x H100 or 8xH100 type, and I'll update the error and help to be more explicit about this.
de3d528 to
038b845
Compare
pardis-beikzadeh-db
left a comment
There was a problem hiding this comment.
LGTM, nits below. Separately, could you file a follow-up for this? air list returns filter errors as plain text even with -o json, while air logs returns a JSON INVALID_ARGS error. That predates this PR, but this PR adds more of these errors.
| @@ -0,0 +1 @@ | |||
| * Support workspace accelerator families, display names, and full types in `air list` filters, and reject invalid filter values. ([#7515](https://github.com/databricks/cli/pull/7515)) | |||
There was a problem hiding this comment.
The accelerator filter now matches exactly instead of by substring, so accelerator_type=H1 used to match and now errors. Worth saying that here and in the description, since scripts may rely on the old behavior.
| if !ok || key == "" { | ||
| return listFilters{}, fmt.Errorf("invalid --filter %q: expected KEY=VALUE", item) | ||
| } | ||
| if strings.TrimSpace(value) == "" { |
There was a problem hiding this comment.
nit: (1) This runs before the key switch, so --filter acclerator_type= reports "value cannot be empty" instead of "unsupported key". (2) Surrounding whitespace isn't trimmed, so user= me@example.com quietly matches nothing, the empty-result case this PR fixes. Trim value once at the top, and check the key first?
| return listFilters{}, fmt.Errorf("invalid --filter %q: expected KEY=VALUE", item) | ||
| } | ||
| if strings.TrimSpace(value) == "" { | ||
| return listFilters{}, fmt.Errorf("invalid --filter %s: value cannot be empty", key) |
There was a problem hiding this comment.
nit: this one reads invalid --filter KEY: …, but the others read invalid --filter KEY="value": …. Use one format?
3645a5f to
b2b3c80
Compare
❌ Integration test reportCommit: a80bc97
55 interesting tests: 43 FAIL, 9 RECOVERED, 3 KNOWN
Top 50 slowest tests (at least 2 minutes):
|
Changes
Examples:
Why
Users copying accelerator values from workload YAML or supplying invalid filters received misleading empty results. This adds YAML-compatible filtering and actionable validation without breaking existing family filters or historical runs. Addresses CNXT-2522 and CNXT-2584.
Tests
./task fmt./task checks./task lintgo test ./cmd/airgo test ./acceptance -run "^TestAccept/air/" -tail./task test: all unit tests passed; the full acceptance suite was blocked by unrelated network-disabled bundle tests that could not download Python build dependenciesThis PR was written with Codex.