Skip to content

Commit efefea9

Browse files
committed
air: align compute help with current validation handling
1 parent 53ecf61 commit efefea9

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎cmd/air/run.go‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,8 @@ func loadComputeOptionsForHelp(cmd *cobra.Command, args []string) []computeOptio
290290

291291
options, err := listWorkspaceComputeOptions(cmd.Context(), cmdctx.WorkspaceClient(cmd.Context()))
292292
if err != nil {
293-
if !endpointUnavailable(err) {
293+
unavailable, retryable := classifyValidationFailure(err)
294+
if !unavailable || retryable {
294295
cmd.PrintErrf("Warning: couldn't fetch the accelerator types available in this workspace; showing the built-in list instead: %v\n", err)
295296
}
296297
return fallbackComputeOptions()

‎cmd/air/runconfig.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ func renderConfigField(w io.Writer, f configField, computeOptions []computeOptio
865865
if f.path == "config.compute" && computeOptions != nil {
866866
fmt.Fprintln(w, "\n Supported accelerator types:")
867867
if len(computeOptions) == 0 {
868-
fmt.Fprintln(w, " No accelerator types are currently available in this workspace.")
868+
fmt.Fprintln(w, " No accelerator types are currently available for AI Runtime in this workspace.")
869869
}
870870
for _, option := range computeOptions {
871871
fmt.Fprintf(w, " %s - %s%s\n", option.HardwareAccelerator, formatPerNodeAcceleratorCount(option), launchStageBadge(option.LaunchStage))

‎cmd/air/runconfig_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ func TestRunCommandHelpComputeOptions(t *testing.T) {
779779
{
780780
name: "empty response",
781781
response: `{}`,
782-
wantOptions: " No accelerator types are currently available in this workspace.",
782+
wantOptions: " No accelerator types are currently available for AI Runtime in this workspace.",
783783
},
784784
{
785785
name: "endpoint unavailable falls back",

0 commit comments

Comments
 (0)