Skip to content

Do not filter by fleet in filter_instances()#3674

Merged
jvstme merged 1 commit intomasterfrom
issue_3672_fix_inconsistent_dstack_offer_fleet
Mar 19, 2026
Merged

Do not filter by fleet in filter_instances()#3674
jvstme merged 1 commit intomasterfrom
issue_3672_fix_inconsistent_dstack_offer_fleet

Conversation

@jvstme
Copy link
Collaborator

@jvstme jvstme commented Mar 19, 2026

Motivation:

  • Simplify the implementation and improve the
    performance of the upcoming <project>/<fleet>
    syntax in the fleets property. Filtering by
    fleet in filter_instances() would require
    loading the project from the database for each
    fleet in order to support filtering by
    <project>/<fleet> (part of [Feature]: Cross-project SSH fleet sharing #3626).
  • Make the behavior of dstack offer --fleet
    consistent for idle instances and backend
    offers, by ignoring --fleet for both. At least
    as a temporary solution, until we support
    filtering backend offers by --fleet (fixes [Bug]: Inconsistent dstack offer --fleet #3672).

Apart from dstack offer, there is no other
impact of this change for end users. In all other
cases when filter_instances() is called,
filtering by fleet is actually redundant — either
because the instances are already pre-filtered by
select_run_candidate_fleet_models_with_filters,
or because profile.fleets is guaranteed to be
None (the case for autocreated fleets).

Motivation:
- Simplify the implementation and improve the
  performance of the upcoming `<project>/<fleet>`
  syntax in the `fleets` property. Filtering by
  fleet in `filter_instance()` would require
  loading the project from the database for each
  fleet in order to support filtering by
  `<project>/<fleet>`.
- Make the behavior of `dstack offer --fleet`
  consistent for idle instances and backend
  offers, by ignoring `--fleet` for both. At least
  as a temporary solution, until we support
  filtering backend offers by `--fleet`.

Apart from `dstack offer`, there is no other
impact of this change for end users. In all other
cases when `filter_instances()` is called,
filtering by fleet is actually redundant — either
because the instances are already pre-filtered by
`select_run_candidate_fleet_models_with_filters`,
or because `profile.fleets` is guaranteed to be
`None` (the case for autocreated fleets).
@jvstme jvstme requested a review from r4victor March 19, 2026 00:31
@jvstme jvstme merged commit fc914c3 into master Mar 19, 2026
28 checks passed
@jvstme jvstme deleted the issue_3672_fix_inconsistent_dstack_offer_fleet branch March 19, 2026 07:47
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]: Inconsistent dstack offer --fleet

2 participants