@@ -320,6 +320,27 @@ def create(
320
320
):
321
321
availabilities = availability_client .get ()
322
322
323
+ if env_vars :
324
+ filtered_availabilities = {}
325
+ for availability_type , gpus in availabilities .items ():
326
+ filtered_gpus = []
327
+ for gpu in gpus :
328
+ if gpu .provider == "runpod" :
329
+ continue
330
+ if gpu .images :
331
+ # Filter out ubuntu image
332
+ filtered_images = [
333
+ img for img in gpu .images if img != "ubuntu_22_cuda_12"
334
+ ]
335
+ if len (filtered_images ) > 0 :
336
+ gpu .images = filtered_images
337
+ filtered_gpus .append (gpu )
338
+
339
+ if filtered_gpus :
340
+ filtered_availabilities [availability_type ] = filtered_gpus
341
+
342
+ availabilities = filtered_availabilities
343
+
323
344
if id or cloud_id :
324
345
# Find the matching GPU configuration by ID or cloud_id
325
346
for gpu_type_key , gpus in availabilities .items ():
@@ -566,26 +587,28 @@ def select_provider_from_configs(
566
587
)
567
588
raise typer .Exit (1 )
568
589
569
- if not image and selected_gpu .images :
570
- if len (selected_gpu .images ) == 1 :
590
+ available_images = selected_gpu .images
591
+
592
+ if not image and available_images :
593
+ if len (available_images ) == 1 :
571
594
# If only one image available, use it directly
572
- image = selected_gpu . images [0 ]
595
+ image = available_images [0 ]
573
596
else :
574
597
# Show available images
575
598
console .print ("\n [bold]Available Images:[/bold]" )
576
- for idx , img in enumerate (selected_gpu . images ):
599
+ for idx , img in enumerate (available_images ):
577
600
console .print (f"{ idx + 1 } . { img } " )
578
601
579
602
# Prompt for image selection
580
603
image_idx = typer .prompt (
581
604
"Select image number" , type = int , default = 1 , show_default = False
582
605
)
583
606
584
- if image_idx < 1 or image_idx > len (selected_gpu . images ):
607
+ if image_idx < 1 or image_idx > len (available_images ):
585
608
console .print ("[red]Invalid image selection[/red]" )
586
609
raise typer .Exit (1 )
587
610
588
- image = selected_gpu . images [image_idx - 1 ]
611
+ image = available_images [image_idx - 1 ]
589
612
590
613
# Get team ID from config if not provided
591
614
if not team_id :
0 commit comments