Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

r4victor
Copy link
Collaborator

@r4victor r4victor commented Aug 25, 2025

Closes #2969

This PR implements functions for combining fleet and run profiles and requirements so that process_submitted_jobs respects both fleet and run specs when provisioning new instances. If fleet spec and run spec are not compatible / have empty intersection – job is terminated with FAILED_TO_START_DUE_TO_NO_CAPACITY. Run plan offers are not affected by this PR and do not respect fleet spec – to keep dstack offers logic intact and because run plan offers will be different for different fleets. We may introduce per-fleet offers in run plan after #3021 and #3020.

Example: respect fleet backend

type: fleet
name: cloud-fleet
placement: any
nodes: 0..2
backends:
  - runpod
type: dev-environment
ide: vscode
fleets:
  - cloud-fleet
✗ dstack apply
 Project              main                           
 User                 admin                          
 Configuration        .dstack.yml                    
 Type                 dev-environment                
 Resources            cpu=2.. mem=8GB.. disk=100GB.. 
 Spot policy          auto                           
 Max price            -                              
 Retry policy         -                              
 Creation policy      reuse-or-create                
 Idle duration        5m                             
 Max duration         -                              
 Inactivity duration  -                              
 Reservation          -                              

 #  BACKEND           RESOURCES                           INSTANCE TYPE     PRICE     
 1  gcp               cpu=2 mem=8GB disk=100GB (spot)     e2-standard-2     $0.0295   
    (europe-west4)                                                                    
 2  gcp               cpu=2 mem=8GB disk=100GB (spot)     n4-standard-2     $0.0316   
    (europe-west4)                                                                    
 3  gcp               cpu=2 mem=8GB disk=100GB (spot)     n2-standard-2     $0.0354   
    (europe-west4)                                                                    
    ...                                                                               
 Shown 3 of 2237 offers, $56.62656max

Submit a new run? [y/n]: y
⠧ Launching cowardly-dog-1...
 NAME              BACKEND          RESOURCES                 PRICE    STATUS  SUBMI… 
 cowardly-dog-1    runpod (FR)      cpu=8 mem=30GB            $0.11    provi…  50 se… 
                                    disk=100GB                                        
                                    RTX3090:24GB:1 (spot)                            

@r4victor r4victor merged commit 54c4a9f into master Aug 25, 2025
28 checks passed
@r4victor r4victor deleted the issue_2969_respect_fleet_spec branch August 25, 2025 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Respect fleet spec when adding new instances on run apply

1 participant