fix: use fleet blocks config for string SSH hosts in create_fleet_ssh_instance_model#3695
Closed
mattate wants to merge 1 commit intodstackai:masterfrom
Closed
fix: use fleet blocks config for string SSH hosts in create_fleet_ssh_instance_model#3695mattate wants to merge 1 commit intodstackai:masterfrom
mattate wants to merge 1 commit intodstackai:masterfrom
Conversation
…_instance_model When SSH fleet hosts are specified as plain strings (e.g. hosts: ["192.168.0.1"]), the fleet-level blocks configuration is ignored and hardcoded to 1. This prevents instances from being divided into multiple GPU blocks. The fix uses spec.configuration.blocks instead of the hardcoded value, consistent with how the else branch reads host.blocks for SSHHostParams objects. Fixes dstackai#3475
Collaborator
|
Thanks for the contribution. Actually, this fix is not related to #3475 but addresses another known issue – #3278 The fix is partial, though – it works when a host is specified as a string, but the object form still defaults to Now: blocks: 4
ssh_config:
hosts:
- 192.168.100.100 # blocks = 1, top-level blocks is ignored
- hostname: 192.168.100.200 # blocks = 1, top-level blocks is ignoredWith the fix: blocks: 4
ssh_config:
hosts:
- 192.168.100.100 # blocks = 4, top-level blocks value is used as a fallback
- hostname: 192.168.100.200 # blocks = 1, top-level blocks is still ignored@peterschmidt85 I think we should reopen #3278 and make a proper fix with the following fallback chain: |
Collaborator
|
Closed in favor of #3700 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #3475
When SSH fleet hosts are specified as plain strings (e.g.,
hosts: ["192.168.0.1"]), the fleet-levelblocksconfiguration is ignored and hardcoded to1. This prevents instances from being divided into multiple GPU blocks, even whenblocks: autoor a specific number is set in the fleet YAML.Root Cause
In
create_fleet_ssh_instance_model(), theif isinstance(host, str)branch hardcodesblocks = 1, while theelsebranch (forSSHHostParamsobjects) correctly readsblocksfromhost.blocks. The fleet-levelspec.configuration.blocksis never used for string hosts.Fix
Replace
blocks = 1withblocks = spec.configuration.blocksin the string host branch, consistent with how fleet-level configuration is propagated for other SSH parameters (ssh_user,ssh_key,port) in the same branch.Steps to reproduce
blocks: 3(orblocks: auto):dstack apply -f fleet.dstack.ymldstack fleet get my-fleet --json | jq ".instances[0].total_blocks"total_blocks: 1instead of3After this fix, the instance correctly reports
total_blocks: 3.AI Assistance Disclosure
This PR was written with AI assistance (code agent).