Skip to content

Commit 5f700f0

Browse files
[Docs] Improve the docs regarding dstack init and repos to reflect the recent changes. (#3015)
1 parent 58ad2de commit 5f700f0

File tree

5 files changed

+67
-40
lines changed

5 files changed

+67
-40
lines changed

docs/docs/concepts/dev-environments.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ To open in VS Code Desktop, use this link:
5151
5252
</div>
5353
54-
`dstack apply` automatically provisions an instance, uploads the contents of the repo (incl. your local uncommitted changes),
55-
and sets up an IDE on the instance.
54+
`dstack apply` automatically provisions an instance and sets up an IDE on it.
5655

5756
??? info "Windows"
5857
On Windows, `dstack` works both natively and inside WSL. But, for dev environments,
@@ -297,10 +296,10 @@ If you don't assign a value to an environment variable (see `HF_TOKEN` above),
297296

298297
### Files
299298

300-
By default, `dstack` automatically mounts the [repo](repos.md) directory where you ran `dstack init` to any run configuration.
299+
If you configured a [repo](repos.md), `dstack` automatically mounts its content (incl. your local changes) inside the container.
301300

302-
However, in some cases, you may not want to mount the entire directory (e.g., if it’s too large),
303-
or you might want to mount files outside of it. In such cases, you can use the [`files`](../reference/dstack.yml/dev-environment.md#files) property.
301+
In some cases, you don’t need to mount an entire repo and can mount only specific directories. This can be done using
302+
[`files`](../reference/dstack.yml/task.md#_files) instead of repos.
304303

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

@@ -351,7 +350,7 @@ $ dstack apply -f examples/.dstack.yml --no-repo
351350
</div>
352351

353352
??? info ".gitignore and .dstackignore"
354-
`dstack` automatically excludes files and folders listed in `.gitignore` and `.dstackignore`.
353+
If you configured a [repo](repos.md) or [files](#files), `dstack` excludes files and folders listed in `.gitignore` and `.dstackignore`.
355354

356355
Uploads are limited to 2MB. To avoid exceeding this limit, make sure to exclude unnecessary files.
357356
You can increase the default server limit by setting the `DSTACK_SERVER_CODE_UPLOAD_LIMIT` environment variable.

docs/docs/concepts/repos.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
# Repos
22

3-
Running a dev environment, task, or service with [`dstack apply`](../reference/cli/dstack/apply.md) in a directory
4-
mounts the contents of that directory to the container’s `/workflow` directory and sets it as the container’s current working directory.
5-
This allows accessing the directory files from within the run.
3+
Repos allow mounting remote Git repos with workloads.
64

7-
## Initialize a repo
5+
> Starting with 0.19.26, repos will be [configurable :material-arrow-top-right-thin:{ .external }](https://github.com/dstackai/dstack/issues/2851){:target="_blank"} in the run configuration.
6+
7+
For now, to mount a repo with workloads, run [`dstack init`](../reference/cli/dstack/init.md) in the repo directory, and then execute [`dstack apply`](../reference/cli/dstack/apply.md) from the same directory.
88

9-
To use a directory with `dstack apply`, it must first be initialized as a repo by running [`dstack init`](../reference/cli/dstack/init.md).
10-
The directory must be a cloned Git repo.
9+
In this case, `dstack` mounts the contents of the repo to the container’s `/workflow` directory and sets it as the container’s current working directory. Note that `dstack` also includes any local changes.
10+
11+
??? info "Files"
12+
In some cases, you don’t need to mount an entire repo and can mount only specific directories. This can be done using
13+
[`files`](../reference/dstack.yml/task.md#_files) instead of repos.
14+
15+
## Initialize a repo
1116

1217
[`dstack init`](../reference/cli/dstack/init.md) is not required if you pass `-P` (or `--repo`) to [`dstack apply`](../reference/cli/dstack/apply.md) (see below).
1318

@@ -30,10 +35,6 @@ Uploads are limited to 2MB. Use `.gitignore` to exclude unnecessary files from b
3035
You can set the `DSTACK_SERVER_CODE_UPLOAD_LIMIT` environment variable to increase the default server limit.
3136
Increasing the limit is recommended only if you [configure an object storage](../guides/server-deployment.md).
3237

33-
### Use a local directory instead of a Git repo
34-
35-
If the directory is not a cloned Git repo, use [`files`](../reference/dstack.yml/task.md#_files).
36-
3738
## Specify the repo
3839

3940
By default, `dstack apply` uses the current directory as a repo if it is already initialized.
@@ -81,12 +82,12 @@ $ dstack apply -f .dstack.yml --no-repo
8182

8283
</div>
8384

84-
## Store the repo on a volume
85+
<!-- ## Store the repo on a volume
8586
8687
You can use [Volumes](../concepts/volumes.md) to persist repo changes without pushing them to the Git remote.
8788
Attach a volume to the repo directory (`/workflow`) or any of its subdirectories.
8889
`dstack` will clone the repo to the volume on the first run.
89-
On subsequent runs, `dstack` will use the repo contents from the volume instead of cloning the repo.
90+
On subsequent runs, `dstack` will use the repo contents from the volume instead of cloning the repo. -->
9091

9192
## What's next?
9293

docs/docs/concepts/services.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ Model meta-llama/Meta-Llama-3.1-8B-Instruct is published at:
6363

6464
</div>
6565

66-
`dstack apply` automatically provisions instances, uploads the contents of the repo (incl. your local uncommitted changes),
67-
and runs the service.
66+
`dstack apply` automatically provisions instances and runs the service.
6867

6968
If a [gateway](gateways.md) is not configured, the service’s endpoint will be accessible at
7069
`<dstack server URL>/proxy/services/<project name>/<run name>/`.
@@ -591,8 +590,10 @@ resources:
591590

592591
By default, `dstack` automatically mounts the [repo](repos.md) directory where you ran `dstack init` to any run configuration.
593592

594-
However, in some cases, you may not want to mount the entire directory (e.g., if it’s too large),
595-
or you might want to mount files outside of it. In such cases, you can use the [`files`](../reference/dstack.yml/dev-environment.md#files) property.
593+
If you configured a [repo](repos.md), `dstack` automatically mounts its content (incl. your local changes) inside the container.
594+
595+
In some cases, you don’t need to mount an entire repo and can mount only specific directories. This can be done using
596+
[`files`](../reference/dstack.yml/task.md#_files) instead of repos.
596597

597598
<!-- TODO: Add a more relevant example -->
598599

@@ -670,7 +671,7 @@ $ dstack apply -f examples/.dstack.yml --no-repo
670671
</div>
671672

672673
??? info ".gitignore and .dstackignore"
673-
`dstack` automatically excludes files and folders listed in `.gitignore` and `.dstackignore`.
674+
If you configured a [repo](repos.md) or [files](#files), `dstack` excludes files and folders listed in `.gitignore` and `.dstackignore`.
674675

675676
Uploads are limited to 2MB. To avoid exceeding this limit, make sure to exclude unnecessary files.
676677
You can increase the default server limit by setting the `DSTACK_SERVER_CODE_UPLOAD_LIMIT` environment variable.

docs/docs/concepts/tasks.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ Launching `axolotl-train`...
6565

6666
</div>
6767

68-
`dstack apply` automatically provisions instances, uploads the contents of the repo (incl. your local uncommitted changes),
69-
and runs the commands.
68+
`dstack apply` automatically provisions instances and runs the task.
7069

7170
## Configuration options
7271

@@ -463,10 +462,10 @@ If you don't assign a value to an environment variable (see `HF_TOKEN` above),
463462

464463
### Files
465464

466-
By default, `dstack` automatically mounts the [repo](repos.md) directory where you ran `dstack init` to any run configuration.
465+
If you configured a [repo](repos.md), `dstack` automatically mounts its content (incl. your local changes) inside the container.
467466

468-
However, in some cases, you may not want to mount the entire directory (e.g., if it’s too large),
469-
or you might want to mount files outside of it. In such cases, you can use the [`files`](../reference/dstack.yml/dev-environment.md#files) property.
467+
In some cases, you don’t need to mount an entire repo and can mount only specific directories. This can be done using
468+
[`files`](../reference/dstack.yml/task.md#_files) instead of repos.
470469

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

@@ -551,7 +550,7 @@ $ dstack apply -f examples/.dstack.yml --no-repo
551550
</div>
552551

553552
??? info ".gitignore and .dstackignore"
554-
`dstack` automatically excludes files and folders listed in `.gitignore` and `.dstackignore`.
553+
If you configured a [repo](repos.md) or [files](#files), `dstack` excludes files and folders listed in `.gitignore` and `.dstackignore`.
555554

556555
Uploads are limited to 2MB. To avoid exceeding this limit, make sure to exclude unnecessary files.
557556
You can increase the default server limit by setting the `DSTACK_SERVER_CODE_UPLOAD_LIMIT` environment variable.

docs/docs/quickstart.md

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,33 @@
11
# Quickstart
22

33
> Before using `dstack`, ensure you've [installed](installation/index.md) the server, or signed up for [dstack Sky :material-arrow-top-right-thin:{ .external }](https://sky.dstack.ai){:target="_blank"}.
4-
5-
## Initialize a repo
64
7-
Before using `dstack`'s CLI in a directory, initialize the directory as a repo with [`dstack init`](reference/cli/dstack/init.md).
5+
## Set up a directory
6+
7+
Set up a directory where you'll store you project files and `dstack` configurations.
88

99
<div class="termy">
1010

1111
```shell
1212
$ mkdir quickstart && cd quickstart
13-
$ dstack init
1413
```
1514

1615
</div>
1716

18-
## Apply a configuration
17+
> If the directory is a remote Git repo that you want to mount with workloads, run `dstack init`.
18+
> Starting with 0.19.26, repos will be [configurable :material-arrow-top-right-thin:{ .external }](https://github.com/dstackai/dstack/issues/2851){:target="_blank"} in the run configuration.
19+
20+
## Run your first workload
21+
22+
`dstack` supports three types of workloads.
1923

2024
=== "Dev environment"
2125

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

24-
Create the following configuration file inside the repo:
28+
<h3>Define a configuration</h3>
29+
30+
Create the following run configuration inside your project folder:
2531

2632
<div editor-title=".dstack.yml">
2733

@@ -42,6 +48,8 @@ $ dstack init
4248

4349
</div>
4450

51+
<h3>Apply the configuration</h3>
52+
4553
Apply the configuration via [`dstack apply`](reference/cli/dstack/apply.md):
4654

4755
<div class="termy">
@@ -73,7 +81,9 @@ $ dstack init
7381

7482
A task allows you to schedule a job or run a web app. Tasks can be distributed and can forward ports.
7583

76-
Create the following configuration file inside the repo:
84+
<h3>Define a configuration</h3>
85+
86+
Create the following run configuration inside your project folder:
7787

7888
<div editor-title="task.dstack.yml">
7989

@@ -103,6 +113,8 @@ $ dstack init
103113
By default, tasks run on a single instance. To run a distributed task, specify
104114
[`nodes`](concepts/tasks.md#distributed-tasks), and `dstack` will run it on a cluster.
105115

116+
<h3>Apply the configuration</h3>
117+
106118
Run the configuration via [`dstack apply`](reference/cli/dstack/apply.md):
107119

108120
<div class="termy">
@@ -133,7 +145,9 @@ $ dstack init
133145

134146
A service allows you to deploy a model or any web app as an endpoint.
135147

136-
Create the following configuration file inside the repo:
148+
<h3>Define a configuration</h3>
149+
150+
Create the following run configuration inside your project folder:
137151

138152
<div editor-title="service.dstack.yml">
139153

@@ -164,6 +178,8 @@ $ dstack init
164178

165179
</div>
166180

181+
<h3>Apply the configuration</h3>
182+
167183
Run the configuration via [`dstack apply`](reference/cli/dstack/apply.md):
168184

169185
<div class="termy">
@@ -198,14 +214,25 @@ $ dstack init
198214
If you're using [dstack Sky :material-arrow-top-right-thin:{ .external }](https://sky.dstack.ai){:target="_blank"},
199215
a gateway is pre-configured for you.
200216

201-
> `dstack apply` automatically provisions instances, uploads the contents of the repo (incl. your local uncommitted changes),
202-
and runs the configuration.
217+
`dstack apply` automatically provisions instances and runs the workload according to the configuration.
218+
219+
??? info "Repo is not initialized"
220+
221+
If you don't run `dstack init`, you may see the following warning:
222+
223+
```
224+
Repo is not initialized. Use --repo <dir> or --no-repo to initialize it.
225+
Starting from 0.19.26, repos will be configured via YAML and this message won't appear.
226+
```
227+
228+
From 0.19.26 onward, this message will no longer be shown since repos can be
229+
[configured :material-arrow-top-right-thin:{ .external }](https://github.com/dstackai/dstack/issues/2851){:target="_blank"} in the run configuration.
203230

204231
## Troubleshooting
205232

206233
Something not working? See the [troubleshooting](guides/troubleshooting.md) guide.
207234

208235
!!! info "What's next?"
209-
1. Read about [backends](concepts/backends.md), [dev environments](concepts/dev-environments.md), [tasks](concepts/tasks.md), and [services](concepts/services.md)
236+
1. Read about [backends](concepts/backends.md), [dev environments](concepts/dev-environments.md), [tasks](concepts/tasks.md), [services](concepts/services.md), and [fleets](concepts/services.md)
210237
2. Browse [examples](../examples.md)
211238
3. Join [Discord :material-arrow-top-right-thin:{ .external }](https://discord.gg/u8SmfwPpMd)

0 commit comments

Comments
 (0)