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
Copy file name to clipboardExpand all lines: docs/docs/concepts/repos.md
+13-12Lines changed: 13 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,18 @@
1
1
# Repos
2
2
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.
6
4
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.
8
8
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
11
16
12
17
[`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).
13
18
@@ -30,10 +35,6 @@ Uploads are limited to 2MB. Use `.gitignore` to exclude unnecessary files from b
30
35
You can set the `DSTACK_SERVER_CODE_UPLOAD_LIMIT` environment variable to increase the default server limit.
31
36
Increasing the limit is recommended only if you [configure an object storage](../guides/server-deployment.md).
32
37
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
-
37
38
## Specify the repo
38
39
39
40
By default, `dstack apply` uses the current directory as a repo if it is already initialized.
Copy file name to clipboardExpand all lines: docs/docs/quickstart.md
+38-11Lines changed: 38 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,27 +1,33 @@
1
1
# Quickstart
2
2
3
3
> 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
6
4
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.
8
8
9
9
<divclass="termy">
10
10
11
11
```shell
12
12
$ mkdir quickstart &&cd quickstart
13
-
$ dstack init
14
13
```
15
14
16
15
</div>
17
16
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.
19
23
20
24
=== "Dev environment"
21
25
22
26
A dev environment lets you provision an instance and access it with your desktop IDE.
23
27
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:
25
31
26
32
<div editor-title=".dstack.yml">
27
33
@@ -42,6 +48,8 @@ $ dstack init
42
48
43
49
</div>
44
50
51
+
<h3>Apply the configuration</h3>
52
+
45
53
Apply the configuration via [`dstack apply`](reference/cli/dstack/apply.md):
46
54
47
55
<div class="termy">
@@ -73,7 +81,9 @@ $ dstack init
73
81
74
82
A task allows you to schedule a job or run a web app. Tasks can be distributed and can forward ports.
75
83
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:
77
87
78
88
<div editor-title="task.dstack.yml">
79
89
@@ -103,6 +113,8 @@ $ dstack init
103
113
By default, tasks run on a single instance. To run a distributed task, specify
104
114
[`nodes`](concepts/tasks.md#distributed-tasks), and `dstack` will run it on a cluster.
105
115
116
+
<h3>Apply the configuration</h3>
117
+
106
118
Run the configuration via [`dstack apply`](reference/cli/dstack/apply.md):
107
119
108
120
<div class="termy">
@@ -133,7 +145,9 @@ $ dstack init
133
145
134
146
A service allows you to deploy a model or any web app as an endpoint.
135
147
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:
137
151
138
152
<div editor-title="service.dstack.yml">
139
153
@@ -164,6 +178,8 @@ $ dstack init
164
178
165
179
</div>
166
180
181
+
<h3>Apply the configuration</h3>
182
+
167
183
Run the configuration via [`dstack apply`](reference/cli/dstack/apply.md):
168
184
169
185
<div class="termy">
@@ -198,14 +214,25 @@ $ dstack init
198
214
If you're using [dstack Sky :material-arrow-top-right-thin:{ .external }](https://sky.dstack.ai){:target="_blank"},
199
215
a gateway is pre-configured for you.
200
216
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.
203
230
204
231
## Troubleshooting
205
232
206
233
Something not working? See the [troubleshooting](guides/troubleshooting.md) guide.
207
234
208
235
!!! 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)
0 commit comments