Skip to content

Commit d472448

Browse files
[UX] Better "No fleets" messages; plus updated Troubleshooting guide (#3428)
1 parent 0697f2d commit d472448

File tree

5 files changed

+30
-20
lines changed

5 files changed

+30
-20
lines changed

docs/docs/guides/troubleshooting.md

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,20 @@ and [this](https://github.com/dstackai/dstack/issues/1551).
2828

2929
## Typical issues
3030

31+
### No fleets { #no-fleets }
32+
[//]: # (NOTE: This section is referenced in the CLI. Do not change its URL.)
33+
34+
If you run `dstack apply` and see `No fleets` status it can mean two things:
35+
36+
=== "The project has no fleets"
37+
In this case, ensure you've created one before submitting runs. This can be either a [backend fleet](../concepts/fleets.md#backend-fleets) (if you are using cloud or Kubernetes) or an [SSH fleet](../concepts/fleets.md#ssh-fleets) (if you're using on-prem clusters).
38+
39+
!!! info "Backend fleets"
40+
Note that creating [backend fleet](../concepts/fleets.md#backend-fleets) doesn't necessarily require provisioning instances upfront. If you set `nodes` to a range, `dstack` will be able to provision instances as required. See [backend fleet](../concepts/fleets.md#backend-fleets) for examples.
41+
42+
=== "No matching fleet found"
43+
This means fleets exist but run requirements do not match the configuration of the fleet. Review your fleets, and ensure that both run and fleet configuration are correct.
44+
3145
### No offers { #no-offers }
3246
[//]: # (NOTE: This section is referenced in the CLI. Do not change its URL.)
3347

@@ -37,19 +51,15 @@ Below are some of the reasons why this might happen.
3751

3852
> Feel free to use `dstack offer` to view available offers.
3953
40-
#### Cause 1: No fleets
41-
42-
Make sure you've created a [fleet](../concepts/fleets.md) before submitting any runs.
43-
44-
#### Cause 2: No backends
54+
#### Cause 1: No backends
4555

4656
If you are not using [SSH fleets](../concepts/fleets.md#ssh-fleets), make sure you have configured at least one [backends](../concepts/backends.md).
4757

4858
If you have configured a backend but still cannot use it, check the output of `dstack server` for backend configuration errors.
4959

5060
> You can find a list of successfully configured backends on the [project settings page](../concepts/projects.md#backends) in the UI.
5161
52-
#### Cause 3: Requirements mismatch
62+
#### Cause 2: Requirements mismatch
5363

5464
When you apply a configuration, `dstack` tries to find instances that match the
5565
[`resources`](../reference/dstack.yml/task.md#resources),
@@ -66,7 +76,7 @@ Make sure your configuration doesn't set any conflicting requirements, such as
6676
`regions` that don't exist in the specified `backends`, or `instance_types` that
6777
don't match the specified `resources`.
6878

69-
#### Cause 4: Too specific resources
79+
#### Cause 3: Too specific resources
7080

7181
If you set a resource requirement to an exact value, `dstack` will only select instances
7282
that have exactly that amount of resources. For example, `cpu: 5` and `memory: 10GB` will only
@@ -76,14 +86,14 @@ Typically, you will want to set resource ranges to match more instances.
7686
For example, `cpu: 4..8` and `memory: 10GB..` will match instances with 4 to 8 CPUs
7787
and at least 10GB of memory.
7888

79-
#### Cause 5: Default resources
89+
#### Cause 4: Default resources
8090

8191
By default, `dstack` uses these resource requirements:
8292
`cpu: 2..`, `memory: 8GB..`, `disk: 100GB..`.
8393
If you want to use smaller instances, override the `cpu`, `memory`, or `disk`
8494
properties in your configuration.
8595

86-
#### Cause 6: GPU requirements
96+
#### Cause 5: GPU requirements
8797

8898
By default, `dstack` only selects instances with no GPUs or a single NVIDIA GPU.
8999
If you want to use non-NVIDIA GPUs or multi-GPU instances, set the `gpu` property
@@ -94,13 +104,13 @@ Examples: `gpu: amd` (one AMD GPU), `gpu: A10:4..8` (4 to 8 A10 GPUs),
94104

95105
> If you don't specify the number of GPUs, `dstack` will only select single-GPU instances.
96106
97-
#### Cause 7: Network volumes
107+
#### Cause 6: Network volumes
98108

99109
If your run configuration uses [network volumes](../concepts/volumes.md#network-volumes),
100110
`dstack` will only select instances from the same backend and region as the volumes.
101111
For AWS, the availability zone of the volume and the instance should also match.
102112

103-
#### Cause 8: Feature support
113+
#### Cause 7: Feature support
104114

105115
Some `dstack` features are not supported by all backends. If your configuration uses
106116
one of these features, `dstack` will only select offers from the backends that support it.
@@ -116,7 +126,7 @@ one of these features, `dstack` will only select offers from the backends that s
116126
- [Reservations](../reference/dstack.yml/fleet.md#reservation)
117127
are only supported by the `aws` and `gcp` backends.
118128

119-
#### Cause 9: dstack Sky balance
129+
#### Cause 8: dstack Sky balance
120130

121131
If you are using
122132
[dstack Sky](https://sky.dstack.ai),

src/dstack/_internal/cli/utils/common.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@
3333
NO_OFFERS_WARNING = (
3434
"[warning]"
3535
"No matching instance offers available. Possible reasons:"
36-
" https://dstack.ai/docs/guides/troubleshooting/#no-offers"
36+
" [link]https://dstack.ai/docs/guides/troubleshooting/#no-offers[/link]"
3737
"[/]\n"
3838
)
3939
NO_FLEETS_WARNING = (
40-
"[warning]"
41-
"The project has no fleets. Create one before submitting a run:"
42-
" https://dstack.ai/docs/concepts/fleets"
40+
"[error]"
41+
"The project has no fleets. Create one before submitting a run.\n"
42+
"See [link]https://dstack.ai/docs/guides/troubleshooting/#no-fleets[/link]"
4343
"[/]\n"
4444
)
4545

src/dstack/_internal/server/background/tasks/process_submitted_jobs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,8 @@ async def _process_submitted_job(
351351
)
352352
# Note: `_get_job_status_message` relies on the "No fleet found" substring to return "no fleets"
353353
job_model.termination_reason_message = (
354-
"No fleet found. Create it before submitting a run: "
355-
"https://dstack.ai/docs/concepts/fleets"
354+
"No matching fleet found. Possible reasons: "
355+
"https://dstack.ai/docs/guides/troubleshooting/#no-fleets"
356356
)
357357
switch_job_status(session, job_model, JobStatus.TERMINATING)
358358
job_model.last_processed_at = common_utils.get_current_datetime()

src/dstack/_internal/server/services/jobs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ def _get_job_status_message(job_model: JobModel) -> str:
806806
):
807807
if (
808808
job_model.termination_reason_message
809-
and "No fleet found" in job_model.termination_reason_message
809+
and "No matching fleet found" in job_model.termination_reason_message
810810
):
811811
return "no fleets"
812812
return "no offers"

src/tests/_internal/cli/utils/test_run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ async def test_simple_run(self, session: AsyncSession):
261261
JobStatus.FAILED,
262262
JobTerminationReason.FAILED_TO_START_DUE_TO_NO_CAPACITY,
263263
None,
264-
"No fleet found. Create it before submitting a run: https://dstack.ai/docs/concepts/fleets",
264+
"No matching fleet found. Possible reasons: https://dstack.ai/docs/guides/troubleshooting/#no-fleets",
265265
"no fleets",
266266
"indian_red1",
267267
),

0 commit comments

Comments
 (0)