Commit fc914c3
authored
Do not filter by fleet in
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).filter_instances() (#3674)1 parent 8657913 commit fc914c3
3 files changed
Lines changed: 8 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
| 22 | + | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
| |||
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
77 | 85 | | |
78 | 86 | | |
79 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
366 | | - | |
367 | 366 | | |
368 | 367 | | |
369 | 368 | | |
| |||
417 | 416 | | |
418 | 417 | | |
419 | 418 | | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | 419 | | |
427 | 420 | | |
428 | 421 | | |
| |||
467 | 460 | | |
468 | 461 | | |
469 | 462 | | |
470 | | - | |
471 | 463 | | |
472 | 464 | | |
473 | 465 | | |
| |||
476 | 468 | | |
477 | 469 | | |
478 | 470 | | |
479 | | - | |
480 | 471 | | |
481 | 472 | | |
482 | 473 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
484 | 484 | | |
485 | 485 | | |
486 | 486 | | |
487 | | - | |
488 | 487 | | |
489 | 488 | | |
490 | 489 | | |
| |||
495 | 494 | | |
496 | 495 | | |
497 | 496 | | |
498 | | - | |
499 | 497 | | |
500 | 498 | | |
501 | 499 | | |
| |||
0 commit comments