Skip to content

Commit f727379

Browse files
[Docs] Added Spot policy
1 parent 0d58216 commit f727379

1 file changed

Lines changed: 29 additions & 3 deletions

File tree

docs/docs/concepts/fleets.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,12 +281,38 @@ Pre-provisioning is supported only for [VM-based backends](backends.md#vm-based)
281281

282282
Backend fleets allow you to specify the resource requirements for the instances to be provisioned. The `resources` property syntax is the same as for [run configurations](dev-environments.md#resources).
283283

284-
> Not directly related, but in addition to `resources`, you can specify [`spot_policy`](../reference/dstack.yml/fleet.md#instance_types), [`instance_types`](../reference/dstack.yml/fleet.md#instance_types), [`max_price`](../reference/dstack.yml/fleet.md#max_price), [`region`](../reference/dstack.yml/fleet.md#max_price), and other [options](../reference/dstack.yml/fleet.md#).
284+
### Spot policy
285285

286-
<!-- TODO: add dedicated spot policy example -->
286+
Backend fleets allow you to specify a `spot policy`. By default, it is set to `on-demand`. If you want to use spot instances, you must set it to `auto` if you plan to use both on-demand and spot instances, or to `spot` if only spot instances are allowed.
287+
288+
<div editor-title="fleet.dstack.yml">
289+
290+
```yaml
291+
type: fleet
292+
name: my-fleet
293+
294+
nodes: 0..2
295+
296+
# Uncomment to ensure instances are inter-connected
297+
#placement: cluster
298+
299+
# Allows both on-demand and spot
300+
spot_policy: auto
301+
302+
idle_duration: 1h
303+
304+
resources:
305+
gpu: 0..8
306+
```
307+
308+
</div>
309+
310+
Note that run configurations must specify their own `spot policy` which is also set to `on-demand` by default.
287311

288312
### Backends
289313

314+
Backend fleets allow you to set `backends` to specify which backends are allowed to be used.
315+
290316
### Idle duration
291317

292318
By default, instances of a backend fleet stay `idle` for 3 days and can be reused within that time.
@@ -432,7 +458,7 @@ ssh_config:
432458
```
433459

434460
!!! info "Reference"
435-
The fleet configuration file supports many more options. See the [reference](../reference/dstack.yml/fleet.md).
461+
The fleet configuration file supports additional options, including [`instance_types`](../reference/dstack.yml/fleet.md#instance_types), [`max_price`](../reference/dstack.yml/fleet.md#max_price), [`regions`](../reference/dstack.yml/fleet.md#max_price), among others. For the complete list, see the [reference](../reference/dstack.yml/fleet.md).
436462

437463
## Manage fleets
438464

0 commit comments

Comments
 (0)