Skip to content

Allow block fleets to grow for smaller jobs - #4234

Closed
SiluPanda wants to merge 1 commit into
dstackai:masterfrom
SiluPanda:issue_4188_blocks_fleet_provisioning
Closed

Allow block fleets to grow for smaller jobs#4234
SiluPanda wants to merge 1 commit into
dstackai:masterfrom
SiluPanda:issue_4188_blocks_fleet_provisioning

Conversation

@SiluPanda

Copy link
Copy Markdown

Summary

  • query new VM capacity with fleet-sized resources, then match each candidate against the job's proportional block requirements
  • persist the full host offer and selected busy-block count while exposing a fractional offer to the job, so remaining blocks can be reused
  • preserve CPU architecture and configurable disk constraints, and keep unsupported container or wrapper-emitted offers out of the shared-host path before offer limits are applied

SSH block fleets retain their existing requirement-combination behavior, and VM provisioning still receives the job's runtime requirements.

Fixes #4188.

Validation

$ PYTHONPATH=src uv run --group test pytest -q <seven focused block-fleet tests>
7 passed, 4 skipped in 0.30s

$ PYTHONPATH=src uv run --group test pytest -q src/tests/_internal/server/services/runs/test_plan.py::TestGetBackendOffersInFleet
5 passed, 4 skipped in 0.21s

$ PYTHONPATH=src uv run ruff check <changed Python files>
All checks passed!

$ PYTHONPATH=src uv run ruff format --check <changed Python files>
8 files already formatted

$ git diff --check origin/master...HEAD
# no output

AI-assisted implementation; I reviewed the final diff, independently peer-reviewed the edge cases, and ran the checks above locally.

@r4victor r4victor closed this Sep 1, 2026
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.

[Bug]: A fleet with blocks cannot provision a new instance for jobs smaller than one node

2 participants