Skip to content

Commit 16fc34e

Browse files
Deploying to gh-pages from @ dstackai/dstack@24defbb 🚀
1 parent 98a8791 commit 16fc34e

File tree

21 files changed

+489
-567
lines changed

21 files changed

+489
-567
lines changed

assets/images/social/examples.png

-338 Bytes
Loading

assets/images/social/partners.png

-427 Bytes
Loading

docs/concepts/backends/index.html

Lines changed: 7 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,38 +1038,6 @@
10381038
</ul>
10391039
</nav>
10401040

1041-
</li>
1042-
1043-
<li class="md-nav__item">
1044-
<a href="#on-prem" class="md-nav__link">
1045-
<span class="md-ellipsis">
1046-
1047-
<span class="md-typeset">
1048-
On-prem
1049-
</span>
1050-
1051-
</span>
1052-
</a>
1053-
1054-
<nav class="md-nav" aria-label="On-prem">
1055-
<ul class="md-nav__list">
1056-
1057-
<li class="md-nav__item">
1058-
<a href="#ssh-fleets" class="md-nav__link">
1059-
<span class="md-ellipsis">
1060-
1061-
<span class="md-typeset">
1062-
SSH fleets
1063-
</span>
1064-
1065-
</span>
1066-
</a>
1067-
1068-
</li>
1069-
1070-
</ul>
1071-
</nav>
1072-
10731041
</li>
10741042

10751043
</ul>
@@ -4280,38 +4248,6 @@
42804248
</ul>
42814249
</nav>
42824250

4283-
</li>
4284-
4285-
<li class="md-nav__item">
4286-
<a href="#on-prem" class="md-nav__link">
4287-
<span class="md-ellipsis">
4288-
4289-
<span class="md-typeset">
4290-
On-prem
4291-
</span>
4292-
4293-
</span>
4294-
</a>
4295-
4296-
<nav class="md-nav" aria-label="On-prem">
4297-
<ul class="md-nav__list">
4298-
4299-
<li class="md-nav__item">
4300-
<a href="#ssh-fleets" class="md-nav__link">
4301-
<span class="md-ellipsis">
4302-
4303-
<span class="md-typeset">
4304-
SSH fleets
4305-
</span>
4306-
4307-
</span>
4308-
</a>
4309-
4310-
</li>
4311-
4312-
</ul>
4313-
</nav>
4314-
43154251
</li>
43164252

43174253
</ul>
@@ -4397,19 +4333,17 @@
43974333

43984334

43994335
<h1 id="backends">Backends<a class="headerlink" href="#backends" title="Permanent link">&para;</a></h1>
4400-
<p>Backends allow <code>dstack</code> to manage compute across various environments.
4401-
They can be configured via <code>~/.dstack/server/config.yml</code> or through the <a href="../projects/#backends">project settings page</a> in the UI.</p>
4402-
<p><code>dstack</code> supports three types of backends: </p>
4336+
<p>Backends allow <code>dstack</code> to provision fleets across cloud providers or Kubernetes clusters.</p>
4337+
<p><code>dstack</code> supports two types of backends: </p>
44034338
<ul>
44044339
<li><a href="#vm-based">VM-based</a> – use <code>dstack</code>'s native integration with cloud providers to provision VMs, manage clusters, and orchestrate container-based runs. </li>
44054340
<li><a href="#container-based">Container-based</a> – use either <code>dstack</code>'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. </li>
4406-
<li><a href="#on-prem">On-prem</a> – use <code>dstack</code>'s native support for on-prem servers without needing Kubernetes. </li>
44074341
</ul>
4408-
<div class="admonition info">
4409-
<p class="admonition-title">dstack Sky</p>
4410-
<p>If you're using <a href="https://sky.dstack.ai">dstack Sky</a>, backend configuration is optional. dstack Sky lets you use pre-configured backends to access GPU marketplace.</p>
4411-
</div>
4412-
<p>See the examples of backend configuration below.</p>
4342+
<details class="info">
4343+
<summary>SSH fleets</summary>
4344+
<p>When using <code>dstack</code> with on-prem servers, backend configuration isn’t required. Simply create <a href="../fleets/#ssh-fleets">SSH fleets</a> once the server is up.</p>
4345+
</details>
4346+
<p>Backends can be configured via <code>~/.dstack/server/config.yml</code> or through the <a href="../projects/#backends">project settings page</a> in the UI. See the examples of backend configuration below.</p>
44134347
<h2 id="vm-based">VM-based<a class="headerlink" href="#vm-based" title="Permanent link">&para;</a></h2>
44144348
<p>VM-based backends allow <code>dstack</code> users to manage clusters and orchestrate container-based runs across a wide range of cloud providers.<br />
44154349
Under the hood, <code>dstack</code> uses native integrations with these providers to provision clusters on demand. </p>
@@ -5395,12 +5329,6 @@ <h3 id="vastai">Vast.ai<a class="headerlink" href="#vastai" title="Permanent lin
53955329
</div>
53965330

53975331
<p>Also, the <code>vastai</code> backend supports on-demand instances only. Spot instance support coming soon.</p>
5398-
<h2 id="on-prem">On-prem<a class="headerlink" href="#on-prem" title="Permanent link">&para;</a></h2>
5399-
<p>In on-prem environments, the <a href="#kubernetes">Kubernetes</a> backend can be used if a Kubernetes cluster is already set up and configured.<br />
5400-
However, often <a href="../fleets/#ssh-fleets">SSH fleets</a> are a simpler and lighter alternative.</p>
5401-
<h3 id="ssh-fleets">SSH fleets<a class="headerlink" href="#ssh-fleets" title="Permanent link">&para;</a></h3>
5402-
<p>SSH fleets require no backend configuration.
5403-
All you need to do is <a href="../fleets/#ssh-fleets">provide hostnames and SSH credentials</a>, and <code>dstack</code> sets up a fleet that can orchestrate container-based runs on your servers.</p>
54045332
<p>SSH fleets support the same features as <a href="#vm-based">VM-based</a> backends.</p>
54055333
<div class="admonition info">
54065334
<p class="admonition-title">What's next</p>

docs/concepts/backends/index.md

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
# Backends
22

3-
Backends allow `dstack` to manage compute across various environments.
4-
They can be configured via `~/.dstack/server/config.yml` or through the [project settings page](../concepts/projects.md#backends) in the UI.
3+
Backends allow `dstack` to provision fleets across cloud providers or Kubernetes clusters.
54

6-
`dstack` supports three types of backends:
5+
`dstack` supports two types of backends:
76

87
* [VM-based](#vm-based) – use `dstack`'s native integration with cloud providers to provision VMs, manage clusters, and orchestrate container-based runs.
98
* [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.
10-
* [On-prem](#on-prem) – use `dstack`'s native support for on-prem servers without needing Kubernetes.
119

12-
!!! info "dstack Sky"
13-
If you're using [dstack Sky](https://sky.dstack.ai), backend configuration is optional. dstack Sky lets you use pre-configured backends to access GPU marketplace.
10+
??? info "SSH fleets"
11+
When using `dstack` with on-prem servers, backend configuration isn’t required. Simply create [SSH fleets](../concepts/fleets.md#ssh-fleets) once the server is up.
1412

15-
See the examples of backend configuration below.
13+
Backends can be configured via `~/.dstack/server/config.yml` or through the [project settings page](../concepts/projects.md#backends) in the UI. See the examples of backend configuration below.
1614

1715
## VM-based
1816

@@ -1154,16 +1152,6 @@ projects:
11541152

11551153
Also, the `vastai` backend supports on-demand instances only. Spot instance support coming soon.
11561154

1157-
## On-prem
1158-
1159-
In on-prem environments, the [Kubernetes](#kubernetes) backend can be used if a Kubernetes cluster is already set up and configured.
1160-
However, often [SSH fleets](../concepts/fleets.md#ssh-fleets) are a simpler and lighter alternative.
1161-
1162-
### SSH fleets
1163-
1164-
SSH fleets require no backend configuration.
1165-
All you need to do is [provide hostnames and SSH credentials](../concepts/fleets.md#ssh-fleets), and `dstack` sets up a fleet that can orchestrate container-based runs on your servers.
1166-
11671155
SSH fleets support the same features as [VM-based](#vm-based) backends.
11681156

11691157
!!! info "What's next"

docs/concepts/dev-environments/index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4296,8 +4296,12 @@
42964296

42974297
<h1 id="dev-environments">Dev environments<a class="headerlink" href="#dev-environments" title="Permanent link">&para;</a></h1>
42984298
<p>A dev environment lets you provision an instance and access it with your desktop IDE.</p>
4299+
<details class="info">
4300+
<summary>Prerequisites</summary>
4301+
<p>Before running a dev environment, make sure you’ve <a href="../../installation/">installed</a> the server and CLI, and created a <a href="../fleets/">fleet</a>.</p>
4302+
</details>
42994303
<h2 id="apply-a-configuration">Apply a configuration<a class="headerlink" href="#apply-a-configuration" title="Permanent link">&para;</a></h2>
4300-
<p>First, define a dev environment configuration as a YAML file in your project folder.
4304+
<p>First, define a dev environment configuration as a YAML file.
43014305
The filename must end with <code>.dstack.yml</code> (e.g. <code>.dstack.yml</code> or <code>dev.dstack.yml</code> are both acceptable).</p>
43024306
<div editor-title="examples/.dstack.yml">
43034307

docs/concepts/dev-environments/index.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
A dev environment lets you provision an instance and access it with your desktop IDE.
44

5+
??? info "Prerequisites"
6+
Before running a dev environment, make sure you’ve [installed](../installation/index.md) the server and CLI, and created a [fleet](fleets.md).
7+
58
## Apply a configuration
69

7-
First, define a dev environment configuration as a YAML file in your project folder.
10+
First, define a dev environment configuration as a YAML file.
811
The filename must end with `.dstack.yml` (e.g. `.dstack.yml` or `dev.dstack.yml` are both acceptable).
912

1013
<div editor-title="examples/.dstack.yml">

docs/concepts/fleets/index.html

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -837,11 +837,11 @@
837837
<ul class="md-nav__list">
838838

839839
<li class="md-nav__item">
840-
<a href="#apply-a-configuration" class="md-nav__link">
840+
<a href="#apply-the-configuration" class="md-nav__link">
841841
<span class="md-ellipsis">
842842

843843
<span class="md-typeset">
844-
Apply a configuration
844+
Apply the configuration
845845
</span>
846846

847847
</span>
@@ -882,7 +882,7 @@
882882
<ul class="md-nav__list">
883883

884884
<li class="md-nav__item">
885-
<a href="#apply-a-configuration_1" class="md-nav__link">
885+
<a href="#apply-a-configuration" class="md-nav__link">
886886
<span class="md-ellipsis">
887887

888888
<span class="md-typeset">
@@ -3908,11 +3908,11 @@
39083908
<ul class="md-nav__list">
39093909

39103910
<li class="md-nav__item">
3911-
<a href="#apply-a-configuration" class="md-nav__link">
3911+
<a href="#apply-the-configuration" class="md-nav__link">
39123912
<span class="md-ellipsis">
39133913

39143914
<span class="md-typeset">
3915-
Apply a configuration
3915+
Apply the configuration
39163916
</span>
39173917

39183918
</span>
@@ -3953,7 +3953,7 @@
39533953
<ul class="md-nav__list">
39543954

39553955
<li class="md-nav__item">
3956-
<a href="#apply-a-configuration_1" class="md-nav__link">
3956+
<a href="#apply-a-configuration" class="md-nav__link">
39573957
<span class="md-ellipsis">
39583958

39593959
<span class="md-typeset">
@@ -4114,21 +4114,27 @@ <h1 id="fleets">Fleets<a class="headerlink" href="#fleets" title="Permanent link
41144114
<p>Fleets act both as pools of instances and as templates for how those instances are provisioned.</p>
41154115
<p><code>dstack</code> supports two kinds of fleets: </p>
41164116
<ul>
4117-
<li><a href="#backend-fleets">Backend fleets</a> – dynamically provisioned through configured backends; they are supported with any type of backends: <a href="../backends/#vm-based">VM-based</a> and <a href="../backends/#container-based">container-based</a> (incl. <a href="../backends/#kubernetes"><code>kubernetes</code></a>)</li>
4117+
<li><a href="#backend-fleets">Backend fleets</a> – dynamically provisioned through configured backends; they are supported with any type of backends: <a href="../backends/#vm-based">VM-based</a> and <a href="../backends/#container-based">container-based</a> (incl. <a href="../backends/#kubernetes">Kubernetes</a>)</li>
41184118
<li><a href="#ssh-fleets">SSH fleets</a> – created using on-prem servers; do not require backends</li>
41194119
</ul>
4120-
<p>When you run <code>dstack apply</code> to start a dev environment, task, or service, <code>dstack</code> will reuse idle instances from an existing fleet whenever available.</p>
4120+
<p>When you submit a dev environment, task, or service, <code>dstack</code> reuses idle instances or provisions new ones based on the fleet configuration. </p>
4121+
<blockquote>
4122+
<p>You must create a fleet before submitting runs.</p>
4123+
</blockquote>
41214124
<h2 id="backend-fleets">Backend fleets<a class="headerlink" href="#backend-fleets" title="Permanent link">&para;</a></h2>
4122-
<p>If you configured <a href="../backends/">backends</a>, <code>dstack</code> can provision fleets on the fly.
4123-
However, it’s recommended to define fleets explicitly.</p>
4124-
<h3 id="apply-a-configuration">Apply a configuration<a class="headerlink" href="#apply-a-configuration" title="Permanent link">&para;</a></h3>
4125-
<p>To create a backend fleet, define a configuration as a YAML file in your project directory. The file must have a
4125+
<p>Backend fleets allow provisioning compute across cloud providers or Kubernetes clusters. </p>
4126+
<details class="info">
4127+
<summary>Prerequisites</summary>
4128+
<p>Before creating a backend fleet, make sure to configure the corresponding <a href="../backends/">backends</a>.</p>
4129+
</details>
4130+
<h3 id="apply-the-configuration">Apply the configuration<a class="headerlink" href="#apply-the-configuration" title="Permanent link">&para;</a></h3>
4131+
<p>To create a backend fleet, define a configuration as a YAML file. The file must have a
41264132
<code>.dstack.yml</code> extension (e.g. <code>.dstack.yml</code> or <code>fleet.dstack.yml</code>).</p>
4127-
<div editor-title="examples/misc/fleets/.dstack.yml">
4133+
<div editor-title="fleet.dstack.yml">
41284134

41294135
<div class="highlight"><pre><span></span><code><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">fleet</span>
41304136
<span class="c1"># The name is optional, if not specified, generated randomly</span>
4131-
<span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">default-fleet</span>
4137+
<span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">default</span>
41324138

41334139
<span class="c1"># Can be a range or a fixed number</span>
41344140
<span class="c1"># Allow to provision of up to 2 instances</span>
@@ -4150,7 +4156,7 @@ <h3 id="apply-a-configuration">Apply a configuration<a class="headerlink" href="
41504156
<p>To create or update the fleet, pass the fleet configuration to <a href="../../reference/cli/dstack/apply/"><code>dstack apply</code></a>:</p>
41514157
<div class="termy">
41524158

4153-
<div class="highlight"><pre><span></span><code>$<span class="w"> </span>dstack<span class="w"> </span>apply<span class="w"> </span>-f<span class="w"> </span>examples/misc/fleets/.dstack.yml
4159+
<div class="highlight"><pre><span></span><code>$<span class="w"> </span>dstack<span class="w"> </span>apply<span class="w"> </span>-f<span class="w"> </span>fleet.dstack.yml
41544160

41554161
Provisioning...
41564162
---&gt;<span class="w"> </span><span class="m">100</span>%
@@ -4161,16 +4167,14 @@ <h3 id="apply-a-configuration">Apply a configuration<a class="headerlink" href="
41614167

41624168
</div>
41634169

4164-
<p><code>dstack</code> always keeps the minimum number of nodes provisioned. Additional instances, up to the maximum limit, are provisioned on demand.</p>
4165-
<div class="admonition info">
4166-
<p class="admonition-title">Container-based backends</p>
4167-
<p>For <a href="../backends/#container-based">container-based</a> backends (such as <code>kubernetes</code>, <code>runpod</code>, etc), <code>nodes</code> must be defined as a range starting with <code>0</code>. In these cases, instances are provisioned on demand as needed.</p>
4168-
<!-- TODO: Ensure the user sees the error or warning otherwise -->
4169-
</div>
4170+
<p>If <code>nodes</code> is a range that starts above <code>0</code>, <code>dstack</code> pre-creates the initial number of instances up front, while any additional ones are created on demand. </p>
4171+
<blockquote>
4172+
<p>Setting the <code>nodes</code> range to start above <code>0</code> is supported only for <a href="../backends/#vm-based">VM-based backends</a>.</p>
4173+
</blockquote>
41704174
<details class="info">
41714175
<summary>Target number of nodes</summary>
41724176
<p>If <code>nodes</code> is defined as a range, you can start with more than the minimum number of instances by using the <code>target</code> parameter when creating the fleet.</p>
4173-
<p><div editor-title=".dstack.yml"> </p>
4177+
<p><div editor-title="fleet.dstack.yml"> </p>
41744178
<div class="highlight"><pre><span></span><code><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">fleet</span>
41754179

41764180
<span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">my-fleet</span>
@@ -4349,7 +4353,7 @@ <h4 id="retry-policy">Retry policy<a class="headerlink" href="#retry-policy" tit
43494353
</div>
43504354
<h2 id="ssh-fleets">SSH fleets<a class="headerlink" href="#ssh-fleets" title="Permanent link">&para;</a></h2>
43514355
<p>If you have a group of on-prem servers accessible via SSH, you can create an SSH fleet.</p>
4352-
<h3 id="apply-a-configuration_1">Apply a configuration<a class="headerlink" href="#apply-a-configuration_1" title="Permanent link">&para;</a></h3>
4356+
<h3 id="apply-a-configuration">Apply a configuration<a class="headerlink" href="#apply-a-configuration" title="Permanent link">&para;</a></h3>
43534357
<p>Define a fleet configuration as a YAML file in your project directory. The file must have a
43544358
<code>.dstack.yml</code> extension (e.g. <code>.dstack.yml</code> or <code>fleet.dstack.yml</code>).</p>
43554359
<div editor-title="examples/misc/fleets/.dstack.yml">

docs/concepts/fleets/index.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,31 @@ 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-
* [Backend fleets](#backend-fleets) – 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))
7+
* [Backend fleets](#backend-fleets) – 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-fleets) – created using on-prem servers; do not require backends
99

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.
10+
When you submit a dev environment, task, or service, `dstack` reuses idle instances or provisions new ones based on the fleet configuration.
11+
12+
> You must create a fleet before submitting runs.
1113
1214
## Backend fleets
1315

14-
If you configured [backends](backends.md), `dstack` can provision fleets on the fly.
15-
However, it’s recommended to define fleets explicitly.
16+
Backend fleets allow provisioning compute across cloud providers or Kubernetes clusters.
1617

17-
### Apply a configuration
18+
??? info "Prerequisites"
19+
Before creating a backend fleet, make sure to configure the corresponding [backends](backends.md).
20+
21+
### Apply the configuration
1822

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

22-
<div editor-title="examples/misc/fleets/.dstack.yml">
26+
<div editor-title="fleet.dstack.yml">
2327

2428
```yaml
2529
type: fleet
2630
# The name is optional, if not specified, generated randomly
27-
name: default-fleet
31+
name: default
2832

2933
# Can be a range or a fixed number
3034
# Allow to provision of up to 2 instances
@@ -48,7 +52,7 @@ To create or update the fleet, pass the fleet configuration to [`dstack apply`](
4852
<div class="termy">
4953

5054
```shell
51-
$ dstack apply -f examples/misc/fleets/.dstack.yml
55+
$ dstack apply -f fleet.dstack.yml
5256

5357
Provisioning...
5458
---> 100%
@@ -59,18 +63,15 @@ Provisioning...
5963

6064
</div>
6165

62-
`dstack` always keeps the minimum number of nodes provisioned. Additional instances, up to the maximum limit, are provisioned on demand.
63-
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.
66+
If `nodes` is a range that starts above `0`, `dstack` pre-creates the initial number of instances up front, while any additional ones are created on demand.
6667

67-
<!-- TODO: Ensure the user sees the error or warning otherwise -->
68+
> Setting the `nodes` range to start above `0` is supported only for [VM-based backends](backends.md#vm-based).
6869
6970
??? info "Target number of nodes"
7071

7172
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.
7273

73-
<div editor-title=".dstack.yml">
74+
<div editor-title="fleet.dstack.yml">
7475

7576
```yaml
7677
type: fleet

0 commit comments

Comments
 (0)