|
886 | 886 | </span> |
887 | 887 | </a> |
888 | 888 |
|
| 889 | +</li> |
| 890 | + |
| 891 | + <li class="md-nav__item"> |
| 892 | + <a href="#spot-policy" class="md-nav__link"> |
| 893 | + <span class="md-ellipsis"> |
| 894 | + |
| 895 | + <span class="md-typeset"> |
| 896 | + Spot policy |
| 897 | + </span> |
| 898 | + |
| 899 | + </span> |
| 900 | + </a> |
| 901 | + |
889 | 902 | </li> |
890 | 903 |
|
891 | 904 | <li class="md-nav__item"> |
|
4179 | 4192 | </span> |
4180 | 4193 | </a> |
4181 | 4194 |
|
| 4195 | +</li> |
| 4196 | + |
| 4197 | + <li class="md-nav__item"> |
| 4198 | + <a href="#spot-policy" class="md-nav__link"> |
| 4199 | + <span class="md-ellipsis"> |
| 4200 | + |
| 4201 | + <span class="md-typeset"> |
| 4202 | + Spot policy |
| 4203 | + </span> |
| 4204 | + |
| 4205 | + </span> |
| 4206 | + </a> |
| 4207 | + |
4182 | 4208 | </li> |
4183 | 4209 |
|
4184 | 4210 | <li class="md-nav__item"> |
@@ -4624,12 +4650,32 @@ <h4 id="pre-provisioning">Pre-provisioning<a class="headerlink" href="#pre-provi |
4624 | 4650 | </details> |
4625 | 4651 | <h3 id="resources">Resources<a class="headerlink" href="#resources" title="Permanent link">¶</a></h3> |
4626 | 4652 | <p>Backend fleets allow you to specify the resource requirements for the instances to be provisioned. The <code>resources</code> property syntax is the same as for <a href="../dev-environments/#resources">run configurations</a>.</p> |
4627 | | -<blockquote> |
4628 | | -<p>Not directly related, but in addition to <code>resources</code>, you can specify <a href="../../reference/dstack.yml/fleet/#instance_types"><code>spot_policy</code></a>, <a href="../../reference/dstack.yml/fleet/#instance_types"><code>instance_types</code></a>, <a href="../../reference/dstack.yml/fleet/#max_price"><code>max_price</code></a>, <a href="../../reference/dstack.yml/fleet/#max_price"><code>region</code></a>, and other <a href="../../reference/dstack.yml/fleet/">options</a>.</p> |
4629 | | -</blockquote> |
4630 | | -<!-- TODO: add dedicated spot policy example --> |
| 4653 | +<h3 id="spot-policy">Spot policy<a class="headerlink" href="#spot-policy" title="Permanent link">¶</a></h3> |
| 4654 | +<p>Backend fleets allow you to specify a <code>spot policy</code>. By default, it is set to <code>on-demand</code>. If you want to use spot instances, you must set it to <code>auto</code> if you plan to use both on-demand and spot instances, or to <code>spot</code> if only spot instances are allowed.</p> |
| 4655 | +<div editor-title="fleet.dstack.yml"> |
| 4656 | + |
| 4657 | +<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> |
| 4658 | +<span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">my-fleet</span> |
| 4659 | + |
| 4660 | +<span class="nt">nodes</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">0..2</span> |
| 4661 | + |
| 4662 | +<span class="c1"># Uncomment to ensure instances are inter-connected</span> |
| 4663 | +<span class="c1">#placement: cluster</span> |
| 4664 | + |
| 4665 | +<span class="c1"># Allows both on-demand and spot</span> |
| 4666 | +<span class="nt">spot_policy</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">auto</span> |
| 4667 | + |
| 4668 | +<span class="nt">idle_duration</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">1h</span> |
| 4669 | + |
| 4670 | +<span class="nt">resources</span><span class="p">:</span> |
| 4671 | +<span class="w"> </span><span class="nt">gpu</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">0..8</span> |
| 4672 | +</code></pre></div> |
| 4673 | + |
| 4674 | +</div> |
4631 | 4675 |
|
| 4676 | +<p>Note that run configurations must specify their own <code>spot policy</code> which is also set to <code>on-demand</code> by default.</p> |
4632 | 4677 | <h3 id="backends_1">Backends<a class="headerlink" href="#backends_1" title="Permanent link">¶</a></h3> |
| 4678 | +<p>Backend fleets allow you to set <code>backends</code> to specify which backends are allowed to be used.</p> |
4633 | 4679 | <h3 id="idle-duration">Idle duration<a class="headerlink" href="#idle-duration" title="Permanent link">¶</a></h3> |
4634 | 4680 | <p>By default, instances of a backend fleet stay <code>idle</code> for 3 days and can be reused within that time. |
4635 | 4681 | If an instance is not reused within this period, it is automatically terminated.</p> |
@@ -4754,7 +4800,7 @@ <h3 id="environment-variables">Environment variables<a class="headerlink" href=" |
4754 | 4800 | </code></pre></div> |
4755 | 4801 | <div class="admonition info"> |
4756 | 4802 | <p class="admonition-title">Reference</p> |
4757 | | -<p>The fleet configuration file supports many more options. See the <a href="../../reference/dstack.yml/fleet/">reference</a>.</p> |
| 4803 | +<p>The fleet configuration file supports additional options, including <a href="../../reference/dstack.yml/fleet/#instance_types"><code>instance_types</code></a>, <a href="../../reference/dstack.yml/fleet/#max_price"><code>max_price</code></a>, <a href="../../reference/dstack.yml/fleet/#max_price"><code>regions</code></a>, among others. For the complete list, see the <a href="../../reference/dstack.yml/fleet/">reference</a>.</p> |
4758 | 4804 | </div> |
4759 | 4805 | <h2 id="manage-fleets">Manage fleets<a class="headerlink" href="#manage-fleets" title="Permanent link">¶</a></h2> |
4760 | 4806 | <h3 id="list-fleets">List fleets<a class="headerlink" href="#list-fleets" title="Permanent link">¶</a></h3> |
|
0 commit comments