Skip to content

Commit 9d53361

Browse files
committed
Deploying to gh-pages from @ dstackai/dstack@fc9afa9 🚀
1 parent 645f7f0 commit 9d53361

File tree

9 files changed

+247
-189
lines changed

9 files changed

+247
-189
lines changed

docs/guides/server-deployment.md

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ To store the server state in Postgres, set the `DSTACK_DATABASE_URL` environment
135135
$ DSTACK_DATABASE_URL=postgresql+asyncpg://user:password@db-host:5432/dstack dstack server
136136
```
137137

138+
The minimum requirements for the DB instance are 2 CPU, 2GB of RAM, and at least 50 `max_connections` per server replica
139+
or a configured connection pooler to handle that many connections.
140+
If you're using a smaller DB instance, you may need to set lower `DSTACK_DB_POOL_SIZE` and `DSTACK_DB_MAX_OVERFLOW`, e.g.
141+
`DSTACK_DB_POOL_SIZE=10` and `DSTACK_DB_MAX_OVERFLOW=0`.
142+
138143
??? info "Migrate from SQLite to PostgreSQL"
139144
You can migrate the existing state from SQLite to PostgreSQL using `pgloader`:
140145

@@ -349,6 +354,22 @@ The bucket must be created beforehand. `dstack` won't try to create it.
349354
storage.objects.update
350355
```
351356

357+
## SSH proxy
358+
359+
[`dstack-sshproxy`](https://github.com/dstackai/sshproxy) is an optional component that provides direct SSH access to workloads.
360+
361+
Without SSH proxy, in order to connect to a job via SSH or use an IDE URL, the `dstack attach` CLI command must be used, which configures user's SSH client in a backend-specific way for each job.
362+
363+
When SSH proxy is deployed, there is one well-known entry point – a proxy address – for all `dstack` jobs, which can be used for SSH access without any additional steps on the user's side (such as installing `dstack` and executing `dstack attach` each time). All the user has to do is to upload their public key to the `dstack` server once – there is a dedicated “SSH keys” tab on the user's page of the control plane UI.
364+
365+
366+
To deploy SSH proxy, see `dstack-sshproxy` [Deployment guide](https://github.com/dstackai/sshproxy/blob/main/DEPLOYMENT.md).
367+
368+
To enable SSH proxy integration on the `dstack` server side, set the following environment variables:
369+
370+
* `DSTACK_SSHPROXY_API_TOKEN` – a token used to authenticate SSH proxy API requests, must be the same value as when deploying `dstack-sshproxy`.
371+
* `DSTACK_SERVER_SSHPROXY_ADDRESS` – an address where SSH proxy is available to `dstack` users, in the `HOSTNAME[:PORT]` form, where `HOSTNAME` is a domain name or an IP address, and `PORT`, if not specified, defaults to 22.
372+
352373
## Encryption
353374

354375
By default, `dstack` stores data in plaintext. To enforce encryption, you
@@ -456,26 +477,14 @@ Backward compatibility is maintained based on these principles:
456477

457478
## Server limits
458479

459-
A single `dstack` server replica can support:
460-
461-
* Up to 150 active runs.
462-
* Up to 150 active jobs.
463-
* Up to 150 active instances.
480+
A single `dstack` server replica can support at least
464481

465-
Having more active resources will work but can affect server performance.
466-
If you hit these limits, consider using Postgres with multiple server replicas.
467-
You can also increase processing rates of a replica by setting the `DSTACK_SERVER_BACKGROUND_PROCESSING_FACTOR` environment variable.
468-
You should also increase `DSTACK_DB_POOL_SIZE` and `DSTACK_DB_MAX_OVERFLOW` proportionally.
469-
For example, to increase processing rates 4 times, set:
470-
471-
```
472-
export DSTACK_SERVER_BACKGROUND_PROCESSING_FACTOR=4
473-
export DSTACK_DB_POOL_SIZE=80
474-
export DSTACK_DB_MAX_OVERFLOW=80
475-
```
482+
* 1000 active instances
483+
* 1000 active runs
484+
* 1000 active jobs.
476485

477-
You have to ensure your Postgres installation supports that many connections by
478-
configuring [`max_connections`](https://www.postgresql.org/docs/current/runtime-config-connection.html#GUC-MAX-CONNECTIONS) and/or using connection pooler.
486+
If you hit server performance limits, try scale up server instances and/or configure Postgres with multiple server replicas.
487+
Also, please [submit a GitHub issue](https://github.com/dstackai/dstack/issues) describing your setup – we strive to improve `dstack` scalability and efficiency.
479488

480489
## Server upgrades
481490

docs/guides/server-deployment/index.html

Lines changed: 46 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,6 +1460,19 @@
14601460
</ul>
14611461
</nav>
14621462

1463+
</li>
1464+
1465+
<li class="md-nav__item">
1466+
<a href="#ssh-proxy" class="md-nav__link">
1467+
<span class="md-ellipsis">
1468+
1469+
<span class="md-typeset">
1470+
SSH proxy
1471+
</span>
1472+
1473+
</span>
1474+
</a>
1475+
14631476
</li>
14641477

14651478
<li class="md-nav__item">
@@ -4577,6 +4590,19 @@
45774590
</ul>
45784591
</nav>
45794592

4593+
</li>
4594+
4595+
<li class="md-nav__item">
4596+
<a href="#ssh-proxy" class="md-nav__link">
4597+
<span class="md-ellipsis">
4598+
4599+
<span class="md-typeset">
4600+
SSH proxy
4601+
</span>
4602+
4603+
</span>
4604+
</a>
4605+
45804606
</li>
45814607

45824608
<li class="md-nav__item">
@@ -4899,6 +4925,10 @@ <h3 id="postgresql">PostgreSQL<a class="headerlink" href="#postgresql" title="Pe
48994925
<p>To store the server state in Postgres, set the <code>DSTACK_DATABASE_URL</code> environment variable:</p>
49004926
<div class="highlight"><pre><span></span><code>$<span class="w"> </span><span class="nv">DSTACK_DATABASE_URL</span><span class="o">=</span>postgresql+asyncpg://user:password@db-host:5432/dstack<span class="w"> </span>dstack<span class="w"> </span>server
49014927
</code></pre></div>
4928+
<p>The minimum requirements for the DB instance are 2 CPU, 2GB of RAM, and at least 50 <code>max_connections</code> per server replica
4929+
or a configured connection pooler to handle that many connections.
4930+
If you're using a smaller DB instance, you may need to set lower <code>DSTACK_DB_POOL_SIZE</code> and <code>DSTACK_DB_MAX_OVERFLOW</code>, e.g.
4931+
<code>DSTACK_DB_POOL_SIZE=10</code> and <code>DSTACK_DB_MAX_OVERFLOW=0</code>.</p>
49024932
<details class="info">
49034933
<summary>Migrate from SQLite to PostgreSQL</summary>
49044934
<p>You can migrate the existing state from SQLite to PostgreSQL using <code>pgloader</code>:</p>
@@ -5088,6 +5118,16 @@ <h3 id="gcs">GCS<a class="headerlink" href="#gcs" title="Permanent link">&para;<
50885118
storage.objects.update
50895119
</code></pre></div>
50905120
</details>
5121+
<h2 id="ssh-proxy">SSH proxy<a class="headerlink" href="#ssh-proxy" title="Permanent link">&para;</a></h2>
5122+
<p><a href="https://github.com/dstackai/sshproxy"><code>dstack-sshproxy</code></a> is an optional component that provides direct SSH access to workloads.</p>
5123+
<p>Without SSH proxy, in order to connect to a job via SSH or use an IDE URL, the <code>dstack attach</code> CLI command must be used, which configures user's SSH client in a backend-specific way for each job.</p>
5124+
<p>When SSH proxy is deployed, there is one well-known entry point – a proxy address – for all <code>dstack</code> jobs, which can be used for SSH access without any additional steps on the user's side (such as installing <code>dstack</code> and executing <code>dstack attach</code> each time). All the user has to do is to upload their public key to the <code>dstack</code> server once – there is a dedicated “SSH keys” tab on the user's page of the control plane UI.</p>
5125+
<p>To deploy SSH proxy, see <code>dstack-sshproxy</code> <a href="https://github.com/dstackai/sshproxy/blob/main/DEPLOYMENT.md">Deployment guide</a>.</p>
5126+
<p>To enable SSH proxy integration on the <code>dstack</code> server side, set the following environment variables:</p>
5127+
<ul>
5128+
<li><code>DSTACK_SSHPROXY_API_TOKEN</code> – a token used to authenticate SSH proxy API requests, must be the same value as when deploying <code>dstack-sshproxy</code>.</li>
5129+
<li><code>DSTACK_SERVER_SSHPROXY_ADDRESS</code> – an address where SSH proxy is available to <code>dstack</code> users, in the <code>HOSTNAME[:PORT]</code> form, where <code>HOSTNAME</code> is a domain name or an IP address, and <code>PORT</code>, if not specified, defaults to 22.</li>
5130+
</ul>
50915131
<h2 id="encryption">Encryption<a class="headerlink" href="#encryption" title="Permanent link">&para;</a></h2>
50925132
<p>By default, <code>dstack</code> stores data in plaintext. To enforce encryption, you
50935133
specify one or more encryption keys.</p>
@@ -5175,23 +5215,14 @@ <h2 id="backward-compatibility">Backward compatibility<a class="headerlink" href
51755215
<li>The client backward compatibility is maintained across patch releases. A new minor release indicates that the release breaks client backward compatibility. This means you don't need to update the server when you update the client to a new patch release. Still, upgrading a client to a new minor version requires upgrading the server too.</li>
51765216
</ul>
51775217
<h2 id="server-limits">Server limits<a class="headerlink" href="#server-limits" title="Permanent link">&para;</a></h2>
5178-
<p>A single <code>dstack</code> server replica can support:</p>
5218+
<p>A single <code>dstack</code> server replica can support at least</p>
51795219
<ul>
5180-
<li>Up to 150 active runs.</li>
5181-
<li>Up to 150 active jobs.</li>
5182-
<li>Up to 150 active instances.</li>
5220+
<li>1000 active instances</li>
5221+
<li>1000 active runs</li>
5222+
<li>1000 active jobs.</li>
51835223
</ul>
5184-
<p>Having more active resources will work but can affect server performance.
5185-
If you hit these limits, consider using Postgres with multiple server replicas.
5186-
You can also increase processing rates of a replica by setting the <code>DSTACK_SERVER_BACKGROUND_PROCESSING_FACTOR</code> environment variable.
5187-
You should also increase <code>DSTACK_DB_POOL_SIZE</code> and <code>DSTACK_DB_MAX_OVERFLOW</code> proportionally.
5188-
For example, to increase processing rates 4 times, set:</p>
5189-
<div class="highlight"><pre><span></span><code>export DSTACK_SERVER_BACKGROUND_PROCESSING_FACTOR=4
5190-
export DSTACK_DB_POOL_SIZE=80
5191-
export DSTACK_DB_MAX_OVERFLOW=80
5192-
</code></pre></div>
5193-
<p>You have to ensure your Postgres installation supports that many connections by
5194-
configuring <a href="https://www.postgresql.org/docs/current/runtime-config-connection.html#GUC-MAX-CONNECTIONS"><code>max_connections</code></a> and/or using connection pooler.</p>
5224+
<p>If you hit server performance limits, try scale up server instances and/or configure Postgres with multiple server replicas.
5225+
Also, please <a href="https://github.com/dstackai/dstack/issues">submit a GitHub issue</a> describing your setup – we strive to improve <code>dstack</code> scalability and efficiency.</p>
51955226
<h2 id="server-upgrades">Server upgrades<a class="headerlink" href="#server-upgrades" title="Permanent link">&para;</a></h2>
51965227
<p>When upgrading the <code>dstack</code> server, follow these guidelines to ensure a smooth transition and minimize downtime.</p>
51975228
<h3 id="before-upgrading">Before upgrading<a class="headerlink" href="#before-upgrading" title="Permanent link">&para;</a></h3>

docs/reference/api/rest/openapi.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/reference/plugins/rest/index.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4253,7 +4253,16 @@ <h1>REST API</h1>
42534253
</style>
42544254

42554255
<p><br></br></p>
4256-
<p>!! SWAGGER ERROR: File rest_plugin_openapi.json not found. !!</p>
4256+
<p><link type="text/css" rel="stylesheet" href="https://unpkg.com/swagger-ui-dist@5/swagger-ui.css"></p>
4257+
<div id="swagger-ui-2">
4258+
</div>
4259+
<script src="https://unpkg.com/swagger-ui-dist@5/swagger-ui-bundle.js" charset="UTF-8"></script>
4260+
<script>
4261+
SwaggerUIBundle({
4262+
url: 'rest_plugin_openapi.json',
4263+
dom_id: '#swagger-ui-2',
4264+
})
4265+
</script>
42574266

42584267

42594268

docs/reference/plugins/rest_plugin/rest_plugin_openapi.json renamed to docs/reference/plugins/rest/rest_plugin_openapi.json

File renamed without changes.

llms-full.txt

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6342,6 +6342,11 @@ To store the server state in Postgres, set the `DSTACK_DATABASE_URL` environment
63426342
$ DSTACK_DATABASE_URL=postgresql+asyncpg://user:password@db-host:5432/dstack dstack server
63436343
```
63446344

6345+
The minimum requirements for the DB instance are 2 CPU, 2GB of RAM, and at least 50 `max_connections` per server replica
6346+
or a configured connection pooler to handle that many connections.
6347+
If you're using a smaller DB instance, you may need to set lower `DSTACK_DB_POOL_SIZE` and `DSTACK_DB_MAX_OVERFLOW`, e.g.
6348+
`DSTACK_DB_POOL_SIZE=10` and `DSTACK_DB_MAX_OVERFLOW=0`.
6349+
63456350
??? info "Migrate from SQLite to PostgreSQL"
63466351
You can migrate the existing state from SQLite to PostgreSQL using `pgloader`:
63476352

@@ -6556,6 +6561,22 @@ The bucket must be created beforehand. `dstack` won't try to create it.
65566561
storage.objects.update
65576562
```
65586563

6564+
## SSH proxy
6565+
6566+
[`dstack-sshproxy`](https://github.com/dstackai/sshproxy) is an optional component that provides direct SSH access to workloads.
6567+
6568+
Without SSH proxy, in order to connect to a job via SSH or use an IDE URL, the `dstack attach` CLI command must be used, which configures user's SSH client in a backend-specific way for each job.
6569+
6570+
When SSH proxy is deployed, there is one well-known entry point – a proxy address – for all `dstack` jobs, which can be used for SSH access without any additional steps on the user's side (such as installing `dstack` and executing `dstack attach` each time). All the user has to do is to upload their public key to the `dstack` server once – there is a dedicated “SSH keys” tab on the user's page of the control plane UI.
6571+
6572+
6573+
To deploy SSH proxy, see `dstack-sshproxy` [Deployment guide](https://github.com/dstackai/sshproxy/blob/main/DEPLOYMENT.md).
6574+
6575+
To enable SSH proxy integration on the `dstack` server side, set the following environment variables:
6576+
6577+
* `DSTACK_SSHPROXY_API_TOKEN` – a token used to authenticate SSH proxy API requests, must be the same value as when deploying `dstack-sshproxy`.
6578+
* `DSTACK_SERVER_SSHPROXY_ADDRESS` – an address where SSH proxy is available to `dstack` users, in the `HOSTNAME[:PORT]` form, where `HOSTNAME` is a domain name or an IP address, and `PORT`, if not specified, defaults to 22.
6579+
65596580
## Encryption
65606581

65616582
By default, `dstack` stores data in plaintext. To enforce encryption, you
@@ -6663,26 +6684,14 @@ Backward compatibility is maintained based on these principles:
66636684

66646685
## Server limits
66656686

6666-
A single `dstack` server replica can support:
6667-
6668-
* Up to 150 active runs.
6669-
* Up to 150 active jobs.
6670-
* Up to 150 active instances.
6687+
A single `dstack` server replica can support at least
66716688

6672-
Having more active resources will work but can affect server performance.
6673-
If you hit these limits, consider using Postgres with multiple server replicas.
6674-
You can also increase processing rates of a replica by setting the `DSTACK_SERVER_BACKGROUND_PROCESSING_FACTOR` environment variable.
6675-
You should also increase `DSTACK_DB_POOL_SIZE` and `DSTACK_DB_MAX_OVERFLOW` proportionally.
6676-
For example, to increase processing rates 4 times, set:
6677-
6678-
```
6679-
export DSTACK_SERVER_BACKGROUND_PROCESSING_FACTOR=4
6680-
export DSTACK_DB_POOL_SIZE=80
6681-
export DSTACK_DB_MAX_OVERFLOW=80
6682-
```
6689+
* 1000 active instances
6690+
* 1000 active runs
6691+
* 1000 active jobs.
66836692

6684-
You have to ensure your Postgres installation supports that many connections by
6685-
configuring [`max_connections`](https://www.postgresql.org/docs/current/runtime-config-connection.html#GUC-MAX-CONNECTIONS) and/or using connection pooler.
6693+
If you hit server performance limits, try scale up server instances and/or configure Postgres with multiple server replicas.
6694+
Also, please [submit a GitHub issue](https://github.com/dstackai/dstack/issues) describing your setup – we strive to improve `dstack` scalability and efficiency.
66866695

66876696
## Server upgrades
66886697

search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)