Skip to content

Commit de0ae07

Browse files
Fleet-first docs (#3242)
* Fix Creation policy and Idle duration * Add fleet configurations for multi-node examples * Add Create fleet to quickstart * Fix Idle duration * Move Fleets up * Do not mention autocreated fleets * Fix pronoun * Update docs/docs/quickstart.md Co-authored-by: Andrey Cheptsov <54148038+peterschmidt85@users.noreply.github.com> * Update docs/docs/quickstart.md Co-authored-by: Andrey Cheptsov <54148038+peterschmidt85@users.noreply.github.com> * Update docs/docs/quickstart.md Co-authored-by: Andrey Cheptsov <54148038+peterschmidt85@users.noreply.github.com> * Make Fleet section collapsed by default * [Docs] Improve fleet documentation to reflect fleet-first UX changes --------- Co-authored-by: Andrey Cheptsov <54148038+peterschmidt85@users.noreply.github.com> Co-authored-by: peterschmidt85 <andrey.cheptsov@gmail.com>
1 parent 006dbf6 commit de0ae07

File tree

22 files changed

+197
-141
lines changed

22 files changed

+197
-141
lines changed

docker/server/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Configuration is updated at ~/.dstack/config.yml
3939
## Create SSH fleets
4040

4141
If you want the `dstack` server to run containers on your on-prem servers,
42-
use [fleets](https://dstack.ai/docs/concepts/fleets#ssh).
42+
use [fleets](https://dstack.ai/docs/concepts/fleets#ssh-fleets).
4343

4444
## More information
4545

docs/blog/posts/amd-mi300x-inference-benchmark.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ categories:
1010

1111
# Benchmarking Llama 3.1 405B on 8x AMD MI300X GPUs
1212

13-
At `dstack`, we've been adding support for AMD GPUs with [SSH fleets](../../docs/concepts/fleets.md#ssh),
13+
At `dstack`, we've been adding support for AMD GPUs with [SSH fleets](../../docs/concepts/fleets.md#ssh-fleets),
1414
so we saw this as a great chance to test our integration by benchmarking AMD GPUs. Our friends at
1515
[Hot Aisle :material-arrow-top-right-thin:{ .external }](https://hotaisle.xyz/){:target="_blank"}, who build top-tier
1616
bare metal compute for AMD GPUs, kindly provided the hardware for the benchmark.
@@ -34,7 +34,7 @@ Here is the spec of the bare metal machine we got:
3434
??? info "Set up an SSH fleet"
3535

3636
Hot Aisle provided us with SSH access to the machine. To make it accessible via `dstack`,
37-
we created an [SSH fleet](../../docs/concepts/fleets.md#ssh) using the following configuration:
37+
we created an [SSH fleet](../../docs/concepts/fleets.md#ssh-fleets) using the following configuration:
3838

3939
<div editor-title="hotaisle.dstack.yml">
4040

@@ -215,7 +215,7 @@ If you have questions, feedback, or want to help improve the benchmark, please r
215215
is the primary sponsor of this benchmark, and we are sincerely grateful for their hardware and support.
216216

217217
If you'd like to use top-tier bare metal compute with AMD GPUs, we recommend going
218-
with Hot Aisle. Once you gain access to a cluster, it can be easily accessed via `dstack`'s [SSH fleet](../../docs/concepts/fleets.md#ssh) easily.
218+
with Hot Aisle. Once you gain access to a cluster, it can be easily accessed via `dstack`'s [SSH fleet](../../docs/concepts/fleets.md#ssh-fleets) easily.
219219

220220
### RunPod
221221
If you’d like to use on-demand compute with AMD GPUs at affordable prices, you can configure `dstack` to

docs/docs/concepts/backends.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ They can be configured via `~/.dstack/server/config.yml` or through the [project
99
* [Container-based](#container-based) – use either `dstack`'s native integration with cloud providers or Kubernetes to orchestrate container-based runs; provisioning in this case is delegated to the cloud provider or Kubernetes.
1010
* [On-prem](#on-prem) – use `dstack`'s native support for on-prem servers without needing Kubernetes.
1111

12-
??? info "dstack Sky"
13-
If you're using [dstack Sky :material-arrow-top-right-thin:{ .external }](https://sky.dstack.ai){:target="_blank"},
14-
you can either configure your own backends or use the pre-configured backend that gives you access to compute from the GPU marketplace.
12+
!!! info "dstack Sky"
13+
If you're using [dstack Sky :material-arrow-top-right-thin:{ .external }](https://sky.dstack.ai){:target="_blank"}, backend configuration is optional. dstack Sky lets you use pre-configured backends to access GPU marketplace.
1514

1615
See the examples of backend configuration below.
1716

docs/docs/concepts/fleets.md

Lines changed: 46 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,41 @@ Fleets act both as pools of instances and as templates for how those instances a
44

55
`dstack` supports two kinds of fleets:
66

7-
* [Standard fleets](#standard) – dynamically provisioned through configured backends; they are supported with any type of backends: [VM-based](backends.md#vm-based), [container-based](backends.md#container-based), and [Kubernetes](backends.md#kubernetes)
7+
* [Backend fleets](#backend) – dynamically provisioned through configured backends; they are supported with any type of backends: [VM-based](backends.md#vm-based) and [container-based](backends.md#container-based) (incl. [`kubernetes`](backends.md#kubernetes))
88
* [SSH fleets](#ssh) – created using on-prem servers; do not require backends
99

10-
## Standard fleets { #standard }
10+
When you run `dstack apply` to start a dev environment, task, or service, `dstack` will reuse idle instances from an existing fleet whenever available.
1111

12-
When you run `dstack apply` to start a dev environment, task, or service, `dstack` will reuse idle instances
13-
from an existing fleet whenever available.
12+
## Backend fleets { #backend-fleets }
1413

15-
If no fleet meets the requirements or has idle capacity, `dstack` can create a new fleet on the fly.
16-
However, it’s generally better to define fleets explicitly in configuration files for greater control.
14+
If you configured [backends](backends.md), `dstack` can provision fleets on the fly.
15+
However, it’s recommended to define fleets explicitly.
1716

1817
### Apply a configuration
1918

20-
Define a fleet configuration as a YAML file in your project directory. The file must have a
19+
To create a backend fleet, define a configuration as a YAML file in your project directory. The file must have a
2120
`.dstack.yml` extension (e.g. `.dstack.yml` or `fleet.dstack.yml`).
2221

2322
<div editor-title="examples/misc/fleets/.dstack.yml">
2423

2524
```yaml
2625
type: fleet
2726
# The name is optional, if not specified, generated randomly
28-
name: my-fleet
27+
name: default-fleet
2928

3029
# Can be a range or a fixed number
31-
nodes: 2
30+
# Allow to provision of up to 2 instances
31+
nodes: 0..2
32+
3233
# Uncomment to ensure instances are inter-connected
3334
#placement: cluster
35+
36+
# Deprovision instances above the minimum if they remain idle
37+
idle_duration: 1h
3438

3539
resources:
36-
gpu: 24GB
40+
# Allow to provision up to 8 GPUs
41+
gpu: 0..8
3742
```
3843

3944
</div>
@@ -48,63 +53,49 @@ $ dstack apply -f examples/misc/fleets/.dstack.yml
4853
Provisioning...
4954
---> 100%
5055

51-
FLEET INSTANCE BACKEND GPU PRICE STATUS CREATED
52-
my-fleet 0 gcp (europe-west-1) L4:24GB (spot) $0.1624 idle 3 mins ago
53-
1 gcp (europe-west-1) L4:24GB (spot) $0.1624 idle 3 mins ago
56+
FLEET INSTANCE BACKEND GPU PRICE STATUS CREATED
57+
my-fleet - - - - - -
5458
```
5559

5660
</div>
5761

58-
Once the status of instances changes to `idle`, they can be used by dev environments, tasks, and services.
62+
`dstack` always keeps the minimum number of nodes provisioned. Additional instances, up to the maximum limit, are provisioned on demand.
5963

60-
??? info "Container-based backends"
61-
[Container-based](backends.md#container-based) backends don’t support pre-provisioning,
62-
so `nodes` can only be set to a range starting with `0`.
63-
64-
This means instances are created only when a run starts, and once it finishes, they’re terminated and released back to the provider (either a cloud service or Kubernetes).
64+
!!! info "Container-based backends"
65+
For [container-based](backends.md#container-based) backends (such as `kubernetes`, `runpod`, etc), `nodes` must be defined as a range starting with `0`. In these cases, instances are provisioned on demand as needed.
6566

66-
<div editor-title=".dstack.yml">
67+
<!-- TODO: Ensure the user sees the error or warning otherwise -->
6768

68-
```yaml
69-
type: fleet
70-
# The name is optional, if not specified, generated randomly
71-
name: my-fleet
72-
73-
# Specify the number of instances
74-
nodes: 0..2
75-
# Uncomment to ensure instances are inter-connected
76-
#placement: cluster
77-
78-
resources:
79-
gpu: 24GB
80-
```
69+
??? info "Target number of nodes"
8170

82-
</div>
71+
If `nodes` is defined as a range, you can start with more than the minimum number of instances by using the `target` parameter when creating the fleet.
8372

84-
### Configuration options
73+
<div editor-title=".dstack.yml">
8574

86-
#### Nodes { #nodes }
75+
```yaml
76+
type: fleet
8777

88-
The `nodes` property controls how many instances to provision and maintain in the fleet:
78+
name: my-fleet
8979

90-
<div editor-title=".dstack.yml">
80+
nodes:
81+
min: 0
82+
max: 2
9183

92-
```yaml
93-
type: fleet
84+
# Provision 2 instances initially
85+
target: 2
9486

95-
name: my-fleet
87+
# Deprovision instances above the minimum if they remain idle
88+
idle_duration: 1h
89+
```
9690

97-
nodes:
98-
min: 1 # Always maintain at least 1 idle instance. Can be 0.
99-
target: 2 # (Optional) Provision 2 instances initially
100-
max: 3 # (Optional) Do not allow more than 3 instances
101-
```
91+
</div>
10292

103-
</div>
93+
By default, when you submit a [dev environment](dev-environments.md), [task](tasks.md), or [service](services.md), `dstack` tries all available fleets. However, you can explicitly specify the [`fleets`](../reference/dstack.yml/dev-environment.md#fleets) in your run configuration
94+
or via [`--fleet`](../reference/cli/dstack/apply.md#fleet) with `dstack apply`.
10495

105-
`dstack` ensures the fleet always has at least `nodes.min` instances, creating new instances in the background if necessary. If you don't need to keep instances in the fleet forever, you can set `nodes.min` to `0`. By default, `dstack apply` also provisions `nodes.min` instances. The `nodes.target` property allows provisioning more instances initially than needs to be maintained.
96+
### Configuration options
10697

107-
#### Placement { #standard-placement }
98+
#### Placement { #backend-placement }
10899

109100
To ensure instances are interconnected (e.g., for
110101
[distributed tasks](tasks.md#distributed-tasks)), set `placement` to `cluster`.
@@ -190,9 +181,9 @@ and their quantity. Examples: `nvidia` (one NVIDIA GPU), `A100` (one A100), `A10
190181
> If you’re unsure which offers (hardware configurations) are available from the configured backends, use the
191182
> [`dstack offer`](../reference/cli/dstack/offer.md#list-gpu-offers) command to list them.
192183

193-
#### Blocks { #standard-blocks }
184+
#### Blocks { #backend-blocks }
194185

195-
For standard fleets, `blocks` function the same way as in SSH fleets.
186+
For backend fleets, `blocks` function the same way as in SSH fleets.
196187
See the [`Blocks`](#ssh-blocks) section under SSH fleets for details on the blocks concept.
197188

198189
<div editor-title=".dstack.yml">
@@ -214,10 +205,10 @@ blocks: 4
214205
#### Idle duration
215206

216207
By default, fleet instances stay `idle` for 3 days and can be reused within that time.
217-
If the fleet is not reused within this period, it is automatically terminated.
208+
If an instance is not reused within this period, it is automatically terminated.
218209

219210
To change the default idle duration, set
220-
[`idle_duration`](../reference/dstack.yml/fleet.md#idle_duration) in the run configuration (e.g., `0s`, `1m`, or `off` for
211+
[`idle_duration`](../reference/dstack.yml/fleet.md#idle_duration) in the fleet configuration (e.g., `0s`, `1m`, or `off` for
221212
unlimited).
222213

223214
<div editor-title="examples/misc/fleets/.dstack.yml">
@@ -272,13 +263,13 @@ retry:
272263
</div>
273264

274265
!!! info "Reference"
275-
Standard fleets support many more configuration options,
266+
Backend fleets support many more configuration options,
276267
incl. [`backends`](../reference/dstack.yml/fleet.md#backends),
277268
[`regions`](../reference/dstack.yml/fleet.md#regions),
278269
[`max_price`](../reference/dstack.yml/fleet.md#max_price), and
279270
among [others](../reference/dstack.yml/fleet.md).
280271

281-
## SSH fleets { #ssh }
272+
## SSH fleets { #ssh-fleets }
282273

283274
If you have a group of on-prem servers accessible via SSH, you can create an SSH fleet.
284275

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
### Creation policy
22

33
By default, when you run `dstack apply` with a dev environment, task, or service,
4-
if no `idle` instances from the available fleets meet the requirements, `dstack` creates a new fleet
4+
if no `idle` instances from the available fleets meet the requirements, `dstack` provisions a new instance
55
using configured backends.
66

7-
To ensure `dstack apply` doesn't create a new fleet but reuses an existing one,
7+
To ensure `dstack apply` doesn't provision a new instance but reuses an existing one,
88
pass `-R` (or `--reuse`) to `dstack apply`.
99

1010
<div class="termy">
@@ -19,12 +19,7 @@ Or, set [`creation_policy`](../reference/dstack.yml/dev-environment.md#creation_
1919

2020
### Idle duration
2121

22-
If a fleet is created automatically, it stays `idle` for 5 minutes by default and can be reused within that time.
23-
If the fleet is not reused within this period, it is automatically terminated.
22+
If a run provisions a new instance, the instance stays `idle` for 5 minutes by default and can be reused within that time.
23+
If the instance is not reused within this period, it is automatically terminated.
2424
To change the default idle duration, set
25-
[`idle_duration`](../reference/dstack.yml/fleet.md#idle_duration) in the run configuration (e.g., `0s`, `1m`, or `off` for
26-
unlimited).
27-
28-
!!! info "Fleets"
29-
For greater control over fleet provisioning, it is recommended to create
30-
[fleets](fleets.md) explicitly.
25+
[`idle_duration`](../reference/dstack.yml/fleet.md#idle_duration) in the run configuration (e.g., `0s`, `1m`, or `off` for unlimited).

docs/docs/concepts/tasks.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,8 @@ Use `DSTACK_MASTER_NODE_IP`, `DSTACK_NODES_IPS`, `DSTACK_NODE_RANK`, and other
170170
For convenience, `~/.ssh/config` is preconfigured with these options, so a simple `ssh <node_ip>` is enough.
171171
For a list of nodes IPs check the `DSTACK_NODES_IPS` environment variable.
172172

173-
!!! info "Fleets"
174-
Distributed tasks can only run on fleets with
175-
[cluster placement](fleets.md#cloud-placement).
176-
While `dstack` can provision such fleets automatically, it is
177-
recommended to create them via a fleet configuration
178-
to ensure the highest level of inter-node connectivity.
173+
!!! info "Cluster fleets"
174+
To run distributed tasks, you need to create a fleet with [`placement: cluster`](fleets.md#cloud-placement).
179175

180176
> See the [Clusters](../guides/clusters.md) guide for more details on how to use `dstack` on clusters.
181177

docs/docs/guides/protips.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,9 @@ See more Docker examples [here](https://github.com/dstackai/dstack/tree/master/e
190190
### Creation policy
191191

192192
By default, when you run `dstack apply` with a dev environment, task, or service,
193-
`dstack` reuses `idle` instances from an existing [fleet](../concepts/fleets.md).
194-
If no `idle` instances match the requirements, `dstack` automatically creates a new fleet
195-
using configured backends.
193+
if no `idle` instances from the available fleets meet the requirements, `dstack` provisions a new instance using configured backends.
196194

197-
To ensure `dstack apply` doesn't create a new fleet but reuses an existing one,
195+
To ensure `dstack apply` doesn't provision a new instance but reuses an existing one,
198196
pass `-R` (or `--reuse`) to `dstack apply`.
199197

200198
<div class="termy">
@@ -205,16 +203,14 @@ $ dstack apply -R -f examples/.dstack.yml
205203

206204
</div>
207205

206+
Or, set [`creation_policy`](../reference/dstack.yml/dev-environment.md#creation_policy) to `reuse` in the run configuration.
207+
208208
### Idle duration
209209

210-
If a fleet is created automatically, it stays `idle` for 5 minutes by default and can be reused within that time.
211-
If the fleet is not reused within this period, it is automatically terminated.
210+
If a run provisions a new instance, the instance stays `idle` for 5 minutes by default and can be reused within that time.
211+
If the instance is not reused within this period, it is automatically terminated.
212212
To change the default idle duration, set
213-
[`idle_duration`](../reference/dstack.yml/fleet.md#idle_duration) in the run configuration (e.g., `0s`, `1m`, or `off` for
214-
unlimited).
215-
216-
> For greater control over fleet provisioning, configuration, and lifecycle management, it is recommended to use
217-
> [fleets](../concepts/fleets.md) directly.
213+
[`idle_duration`](../reference/dstack.yml/fleet.md#idle_duration) in the run configuration (e.g., `0s`, `1m`, or `off` for unlimited).
218214

219215
## Volumes
220216

0 commit comments

Comments
 (0)