Skip to content

Commit 9047529

Browse files
Deploying to gh-pages from @ dstackai/dstack@056eb71 🚀
1 parent 079c3ee commit 9047529

File tree

6 files changed

+181
-126
lines changed

6 files changed

+181
-126
lines changed

docs/concepts/fleets/index.html

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4795,9 +4795,7 @@ <h4 id="ssh-placement">Placement<a class="headerlink" href="#ssh-placement" titl
47954795
<p>For more details on optimal inter-node connectivity, read the <a href="../../guides/clusters/">Clusters</a> guide.</p>
47964796
</blockquote>
47974797
<h4 id="ssh-blocks">Blocks<a class="headerlink" href="#ssh-blocks" title="Permanent link">&para;</a></h4>
4798-
<p>By default, a single job occupies the entire instance, so if the instance has 8 GPUs, the job will use all of them.</p>
4799-
<p>To make it more efficient, you can set the blocks property to specify how many blocks you’d like the instance to be
4800-
divided into, allowing multiple jobs to use these blocks concurrently.</p>
4798+
<p>By default, a job uses the entire instance—e.g., all 8 GPUs. To allow multiple jobs on the same instance, set the <code>blocks</code> property to divide the instance. Each job can then use one or more blocks, up to the full instance.</p>
48014799
<div editor-title=".dstack.yml">
48024800

48034801
<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>
@@ -4819,13 +4817,13 @@ <h4 id="ssh-blocks">Blocks<a class="headerlink" href="#ssh-blocks" title="Perman
48194817

48204818
</div>
48214819

4822-
<p>For instance, with 8 GPUs, 128 CPUs, and 2TB of memory, setting blocks to 8 would assign 1 GPU, 16 CPUs, and 256 GB of
4823-
memory to each block. These blocks can be used concurrently, and a single job can occupy multiple blocks if needed.</p>
4824-
<blockquote>
4825-
<p>GPUs and CPUs must be divisible by the number of blocks. All resources (GPU, CPU, memory) are split proportionally,
4826-
except disk storage, which is shared.</p>
4827-
</blockquote>
4828-
<p>You can also set <code>blocks</code> to <code>auto</code>, which automatically sets the number of blocks to match the number of GPUs.</p>
4820+
<p>All resources (GPU, CPU, memory) are split evenly across blocks, while disk is shared.</p>
4821+
<p>For example, with 8 GPUs, 128 CPUs, and 2TB RAM, setting <code>blocks</code> to <code>8</code> gives each block 1 GPU, 16 CPUs, and 256 GB RAM.</p>
4822+
<p>Set <code>blocks</code> to <code>auto</code> to match the number of blocks to the number of GPUs.</p>
4823+
<div class="admonition info">
4824+
<p class="admonition-title">Distributed tasks</p>
4825+
<p>Distributed tasks require exclusive access to all host resources and therefore must use all blocks on each node.</p>
4826+
</div>
48294827
<h4 id="environment-variables">Environment variables<a class="headerlink" href="#environment-variables" title="Permanent link">&para;</a></h4>
48304828
<p>If needed, you can specify environment variables that will be used by <code>dstack-shim</code> and passed to containers.</p>
48314829
<p>For example, these variables can be used to configure a proxy:</p>

docs/guides/protips/index.html

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,19 @@
11661166
</span>
11671167
</a>
11681168

1169+
</li>
1170+
1171+
<li class="md-nav__item">
1172+
<a href="#projects" class="md-nav__link">
1173+
<span class="md-ellipsis">
1174+
1175+
<span class="md-typeset">
1176+
Projects
1177+
</span>
1178+
1179+
</span>
1180+
</a>
1181+
11691182
</li>
11701183

11711184
<li class="md-nav__item">
@@ -4112,6 +4125,19 @@
41124125
</span>
41134126
</a>
41144127

4128+
</li>
4129+
4130+
<li class="md-nav__item">
4131+
<a href="#projects" class="md-nav__link">
4132+
<span class="md-ellipsis">
4133+
4134+
<span class="md-typeset">
4135+
Projects
4136+
</span>
4137+
4138+
</span>
4139+
</a>
4140+
41154141
</li>
41164142

41174143
<li class="md-nav__item">
@@ -4439,6 +4465,20 @@ <h2 id="docker-and-docker-compose">Docker and Docker Compose<a class="headerlink
44394465
</code></pre></div>
44404466
</details>
44414467
<p>See more Docker examples <a href="https://github.com/dstackai/dstack/tree/master/examples/misc/docker-compose">here</a>.</p>
4468+
<h2 id="projects">Projects<a class="headerlink" href="#projects" title="Permanent link">&para;</a></h2>
4469+
<p>If you're using multiple <code>dstack</code> projects (e.g., from different <code>dstack</code> servers),<br />
4470+
you can switch between them using the <a href="../../reference/cli/dstack/project/"><code>dstack project</code></a> command.</p>
4471+
<p>Alternatively, you can install <a href="https://direnv.net/" target="_blank"><code>direnv</code> <span class="twemoji external"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m11.93 5 2.83 2.83L5 17.59 6.42 19l9.76-9.75L19 12.07V5z"/></svg></span></a><br />
4472+
to automatically apply environment variables from the <code>.envrc</code> file in your project directory.</p>
4473+
<div editor-title=".envrc">
4474+
4475+
<div class="highlight"><pre><span></span><code><span class="nb">export</span><span class="w"> </span><span class="nv">DSTACK_PROJECT</span><span class="o">=</span>main
4476+
</code></pre></div>
4477+
4478+
</div>
4479+
4480+
<p>Now, <code>dstack</code> will always use this project within this directory.</p>
4481+
<p>Remember to add <code>.envrc</code> to <code>.gitignore</code> to avoid committing it to the repo. </p>
44424482
<h2 id="environment-variables">Environment variables<a class="headerlink" href="#environment-variables" title="Permanent link">&para;</a></h2>
44434483
<p>If a configuration requires an environment variable that you don't want to hardcode in the YAML, you can define it
44444484
without assigning a value:</p>
@@ -4481,8 +4521,8 @@ <h2 id="environment-variables">Environment variables<a class="headerlink" href="
44814521
</code></pre></div>
44824522
</div>
44834523
<p>If you install <a href="https://direnv.net/" target="_blank"><code>direnv</code> <span class="twemoji external"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m11.93 5 2.83 2.83L5 17.59 6.42 19l9.76-9.75L19 12.07V5z"/></svg></span></a>,
4484-
it will automatically pass the environment variables from the <code>.env</code> file to the <code>dstack apply</code> command.</p>
4485-
<p>Remember to add <code>.env</code> to <code>.gitignore</code> to avoid pushing it to the repo. </p>
4524+
it will automatically apply the environment variables from the <code>.envrc</code> file to the <code>dstack apply</code> command.</p>
4525+
<p>Remember to add <code>.envrc</code> to <code>.gitignore</code> to avoid committing it to the repo. </p>
44864526
</details>
44874527
<h2 id="attached-mode">Attached mode<a class="headerlink" href="#attached-mode" title="Permanent link">&para;</a></h2>
44884528
<p>By default, <code>dstack apply</code> runs in attached mode.

docs/reference/cli/dstack/project/index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4052,6 +4052,23 @@ <h1 id="dstack-project">dstack project<a class="headerlink" href="#dstack-projec
40524052
<p>The <code>dstack server</code> command automatically creates the default <code>main</code> project and adds its configuration in <code>~/.dstack/config.yml</code>.</p>
40534053
</blockquote>
40544054
<p>The <code>dstack project set-default</code> command can be used to switch between multiple projects.</p>
4055+
<details class="info">
4056+
<summary>Environment variable</summary>
4057+
<p>Alternatively to <code>dstack project set-default</code>, you can set the <code>DSTACK_PROJECT</code> environment variable. It overrides the default project set in <code>~/.dstack/config.yml</code>.</p>
4058+
<div class="termy">
4059+
<div class="highlight"><pre><span></span><code>$<span class="w"> </span><span class="nv">DSTACK_PROJECT</span><span class="o">=</span>main
4060+
$<span class="w"> </span>dstack<span class="w"> </span>apply<span class="w"> </span>-f<span class="w"> </span>examples/.dstack.yml
4061+
</code></pre></div>
4062+
</div>
4063+
<p>Also, you can install <a href="https://direnv.net/" target="_blank"><code>direnv</code> <span class="twemoji external"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m11.93 5 2.83 2.83L5 17.59 6.42 19l9.76-9.75L19 12.07V5z"/></svg></span></a><br />
4064+
to automatically apply environment variables from the <code>.envrc</code> file in your project directory.</p>
4065+
<p><div editor-title=".envrc"> </p>
4066+
<div class="highlight"><pre><span></span><code><span class="nb">export</span><span class="w"> </span><span class="nv">DSTACK_PROJECT</span><span class="o">=</span>main
4067+
</code></pre></div>
4068+
</div>
4069+
<p>Now, <code>dstack</code> will always use this project within this directory.</p>
4070+
<p>Remember to add <code>.envrc</code> to <code>.gitignore</code> to avoid committing it to the repo. </p>
4071+
</details>
40554072
<h2 id="dstack-project-add">dstack project add<a class="headerlink" href="#dstack-project-add" title="Permanent link">&para;</a></h2>
40564073
<p>This command adds a new project configuration.</p>
40574074
<div class="termy">

search/search_index.json

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

0 commit comments

Comments
 (0)