You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>By default, <code>dstack</code> automatically mounts the <ahref="../repos/">repo</a> directory where you ran <code>dstack init</code>to any run configuration. </p>
4392
-
<p>However, in some cases, you may not want to mount the entire directory (e.g., if it’s too large),
4393
-
or you might want to mount files outside of it. In such cases, you can use the <ahref="../../reference/dstack.yml/dev-environment/#files"><code>files</code></a>property.</p>
4390
+
<p>If you configured a <ahref="../repos/">repo</a>, <code>dstack</code>automatically mounts its content (incl. your local changes) inside the container.</p>
4391
+
<p>In some cases, you don’t need to mount an entire repo and can mount only specific directories. This can be done using
4392
+
<ahref="../../reference/dstack.yml/task/#_files"><code>files</code></a>instead of repos.</p>
<p><code>dstack</code> automatically excludes files and folders listed in <code>.gitignore</code> and <code>.dstackignore</code>.</p>
4438
+
<p>If you configured a <ahref="../repos/">repo</a> or <ahref="#files">files</a>, <code>dstack</code> excludes files and folders listed in <code>.gitignore</code> and <code>.dstackignore</code>.</p>
4440
4439
<p>Uploads are limited to 2MB. To avoid exceeding this limit, make sure to exclude unnecessary files.
4441
4440
You can increase the default server limit by setting the <code>DSTACK_SERVER_CODE_UPLOAD_LIMIT</code> environment variable.</p>
<p>Running a dev environment, task, or service with <ahref="../../reference/cli/dstack/apply/"><code>dstack apply</code></a> in a directory
4033
-
mounts the contents of that directory to the container’s <code>/workflow</code> directory and sets it as the container’s current working directory.
4034
-
This allows accessing the directory files from within the run.</p>
3980
+
<p>Repos allow mounting remote Git repos with workloads.</p>
3981
+
<blockquote>
3982
+
<p>Starting with 0.19.26, repos will be <ahref="https://github.com/dstackai/dstack/issues/2851" target="_blank">configurable <spanclass="twemoji external"><svgxmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><pathd="m11.93 5 2.83 2.83L5 17.59 6.42 19l9.76-9.75L19 12.07V5z"/></svg></span></a> in the run configuration. </p>
3983
+
</blockquote>
3984
+
<p>For now, to mount a repo with workloads, run <ahref="../../reference/cli/dstack/init/"><code>dstack init</code></a> in the repo directory, and then execute <ahref="../../reference/cli/dstack/apply/"><code>dstack apply</code></a> from the same directory. </p>
3985
+
<p>In this case, <code>dstack</code> mounts the contents of the repo to the container’s <code>/workflow</code> directory and sets it as the container’s current working directory. Note that <code>dstack</code> also includes any local changes.</p>
3986
+
<detailsclass="info">
3987
+
<summary>Files</summary>
3988
+
<p>In some cases, you don’t need to mount an entire repo and can mount only specific directories. This can be done using
3989
+
<ahref="../../reference/dstack.yml/task/#_files"><code>files</code></a> instead of repos.</p>
3990
+
</details>
4035
3991
<h2id="initialize-a-repo">Initialize a repo<aclass="headerlink" href="#initialize-a-repo" title="Permanent link">¶</a></h2>
4036
-
<p>To use a directory with <code>dstack apply</code>, it must first be initialized as a repo by running <ahref="../../reference/cli/dstack/init/"><code>dstack init</code></a>.
4037
-
The directory must be a cloned Git repo.</p>
4038
3992
<p><ahref="../../reference/cli/dstack/init/"><code>dstack init</code></a> is not required if you pass <code>-P</code> (or <code>--repo</code>) to <ahref="../../reference/cli/dstack/apply/"><code>dstack apply</code></a> (see below).</p>
<p><ahref="../../reference/cli/dstack/init/"><code>dstack init</code></a> grants the <code>dstack</code> server access by uploading the current user's default
@@ -4050,8 +4004,6 @@ <h3 id="gitignore-and-folder-size">.gitignore and folder size<a class="headerlin
4050
4004
<p>Uploads are limited to 2MB. Use <code>.gitignore</code> to exclude unnecessary files from being uploaded.
4051
4005
You can set the <code>DSTACK_SERVER_CODE_UPLOAD_LIMIT</code> environment variable to increase the default server limit.
4052
4006
Increasing the limit is recommended only if you <ahref="../../guides/server-deployment/">configure an object storage</a>.</p>
4053
-
<h3id="use-a-local-directory-instead-of-a-git-repo">Use a local directory instead of a Git repo<aclass="headerlink" href="#use-a-local-directory-instead-of-a-git-repo" title="Permanent link">¶</a></h3>
4054
-
<p>If the directory is not a cloned Git repo, use <ahref="../../reference/dstack.yml/task/#_files"><code>files</code></a>.</p>
4055
4007
<h2id="specify-the-repo">Specify the repo<aclass="headerlink" href="#specify-the-repo" title="Permanent link">¶</a></h2>
4056
4008
<p>By default, <code>dstack apply</code> uses the current directory as a repo if it is already initialized.
4057
4009
You can change this by explicitly specifying the repo to use for <code>dstack apply</code>.</p>
@@ -4086,11 +4038,13 @@ <h3 id="do-not-use-a-repo">Do not use a repo<a class="headerlink" href="#do-not-
4086
4038
4087
4039
</div>
4088
4040
4089
-
<h2id="store-the-repo-on-a-volume">Store the repo on a volume<aclass="headerlink" href="#store-the-repo-on-a-volume" title="Permanent link">¶</a></h2>
4090
-
<p>You can use <ahref="../volumes/">Volumes</a> to persist repo changes without pushing them to the Git remote.
4091
-
Attach a volume to the repo directory (<code>/workflow</code>) or any of its subdirectories.
4092
-
<code>dstack</code> will clone the repo to the volume on the first run.
4093
-
On subsequent runs, <code>dstack</code> will use the repo contents from the volume instead of cloning the repo.</p>
4041
+
<!-- ## Store the repo on a volume
4042
+
4043
+
You can use [Volumes](../concepts/volumes.md) to persist repo changes without pushing them to the Git remote.
4044
+
Attach a volume to the repo directory (`/workflow`) or any of its subdirectories.
4045
+
`dstack` will clone the repo to the volume on the first run.
4046
+
On subsequent runs, `dstack` will use the repo contents from the volume instead of cloning the repo. -->
<p>By default, <code>dstack</code> automatically mounts the <ahref="../repos/">repo</a> directory where you ran <code>dstack init</code> to any run configuration. </p>
4785
-
<p>However, in some cases, you may not want to mount the entire directory (e.g., if it’s too large),
4786
-
or you might want to mount files outside of it. In such cases, you can use the <ahref="../../reference/dstack.yml/dev-environment/#files"><code>files</code></a> property.</p>
4784
+
<p>If you configured a <ahref="../repos/">repo</a>, <code>dstack</code> automatically mounts its content (incl. your local changes) inside the container.</p>
4785
+
<p>In some cases, you don’t need to mount an entire repo and can mount only specific directories. This can be done using
4786
+
<ahref="../../reference/dstack.yml/task/#_files"><code>files</code></a> instead of repos.</p>
<p><code>dstack</code> automatically excludes files and folders listed in <code>.gitignore</code> and <code>.dstackignore</code>.</p>
4858
+
<p>If you configured a <ahref="../repos/">repo</a> or <ahref="#files">files</a>, <code>dstack</code> excludes files and folders listed in <code>.gitignore</code> and <code>.dstackignore</code>.</p>
4859
4859
<p>Uploads are limited to 2MB. To avoid exceeding this limit, make sure to exclude unnecessary files.
4860
4860
You can increase the default server limit by setting the <code>DSTACK_SERVER_CODE_UPLOAD_LIMIT</code> environment variable.</p>
<p>By default, <code>dstack</code> automatically mounts the <ahref="../repos/">repo</a> directory where you ran <code>dstack init</code>to any run configuration. </p>
4600
-
<p>However, in some cases, you may not want to mount the entire directory (e.g., if it’s too large),
4601
-
or you might want to mount files outside of it. In such cases, you can use the <ahref="../../reference/dstack.yml/dev-environment/#files"><code>files</code></a>property.</p>
4598
+
<p>If you configured a <ahref="../repos/">repo</a>, <code>dstack</code>automatically mounts its content (incl. your local changes) inside the container.</p>
4599
+
<p>In some cases, you don’t need to mount an entire repo and can mount only specific directories. This can be done using
4600
+
<ahref="../../reference/dstack.yml/task/#_files"><code>files</code></a>instead of repos.</p>
<p><code>dstack</code> automatically excludes files and folders listed in <code>.gitignore</code> and <code>.dstackignore</code>.</p>
4680
+
<p>If you configured a <ahref="../repos/">repo</a> or <ahref="#files">files</a>, <code>dstack</code> excludes files and folders listed in <code>.gitignore</code> and <code>.dstackignore</code>.</p>
4682
4681
<p>Uploads are limited to 2MB. To avoid exceeding this limit, make sure to exclude unnecessary files.
4683
4682
You can increase the default server limit by setting the <code>DSTACK_SERVER_CODE_UPLOAD_LIMIT</code> environment variable.</p>
0 commit comments