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/dev-environments.md
+63-22Lines changed: 63 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -296,10 +296,7 @@ If you don't assign a value to an environment variable (see `HF_TOKEN` above),
296
296
297
297
### Files
298
298
299
-
If you configured a [repo](repos.md), `dstack` automatically mounts its content (incl. your local changes) inside the container.
300
-
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.
299
+
Sometimes, when you run a dev environment, you may want to mount local files. This is possible via the [`files`](../reference/dstack.yml/task.md#_files) property. Each entry maps a local directory or file to a path inside the container.
303
300
304
301
<div editor-title="examples/.dstack.yml">
305
302
@@ -316,12 +313,10 @@ ide: vscode
316
313
317
314
</div>
318
315
319
-
Each entry maps a local directory or file to a path inside the container. Both local and container paths can be relative or absolute.
320
-
321
-
- If the local path is relative, it’s resolved relative to the configuration file.
322
-
- If the container path is relative, it’s resolved relative to `/workflow`.
316
+
If the local path is relative, it’s resolved relative to the configuration file.
317
+
If the container path is relative, it’s resolved relative to `/workflow`.
323
318
324
-
The container path is optional. If not specified, it will be automatically calculated.
319
+
The container path is optional. If not specified, it will be automatically calculated:
325
320
326
321
<div editor-title="examples/.dstack.yml">
327
322
@@ -338,25 +333,71 @@ ide: vscode
338
333
339
334
</div>
340
335
341
-
Note: If you want to use `files` without mounting the entire repo directory,
342
-
make sure to pass `--no-repo` when running `dstack apply`:
336
+
??? info "Upload limit and excludes"
337
+
Whether its a file or folder, each entry is limited to 2MB. To avoid exceeding this limit, make sure to exclude unnecessary files
338
+
by listing it via `.gitignore` or `.dstackignore`.
339
+
The 2MB upload limit can be increased by setting the `DSTACK_SERVER_CODE_UPLOAD_LIMIT` environment variable.
343
340
344
-
<div class="termy">
341
+
### Repos
345
342
346
-
```shell
347
-
$ dstack apply -f examples/.dstack.yml --no-repo
343
+
Sometimes, you may want to mount an entire Git repo inside the container.
344
+
345
+
Imagine you have a cloned Git repo containing an `examples` subdirectory with a `.dstack.yml` file:
346
+
347
+
<div editor-title="examples/.dstack.yml">
348
+
349
+
```yaml
350
+
type: dev-environment
351
+
name: vscode
352
+
353
+
repos:
354
+
# Mounts the parent directory of `examples` (must be a Git repo)
355
+
# to `/workflow` (the default working directory)
356
+
- ..
357
+
358
+
ide: vscode
348
359
```
349
360
350
361
</div>
351
362
352
-
??? info ".gitignore and .dstackignore"
353
-
If you configured a [repo](repos.md) or [files](#files), `dstack` excludes files and folders listed in `.gitignore` and `.dstackignore`.
354
-
355
-
Uploads are limited to 2MB. To avoid exceeding this limit, make sure to exclude unnecessary files.
356
-
You can increase the default server limit by setting the `DSTACK_SERVER_CODE_UPLOAD_LIMIT` environment variable.
363
+
When you run it, `dstack` fetches the repo on the instance, applies your local changes, and mounts it—so the container matches your local repo.
364
+
365
+
The local path can be either relative to the configuration file or absolute.
366
+
367
+
??? info "Path"
368
+
Currently, `dstack` always mounts the repo to `/workflow` inside the container. It's the default working directory.
369
+
Starting with the next release, it will be possible to specify a custom container path.
370
+
371
+
??? info "Local diff limit and excludes"
372
+
The local diff size is limited to 2MB. To avoid exceeding this limit, exclude unnecessary files
373
+
via `.gitignore` or `.dstackignore`.
374
+
The 2MB local diff limit can be increased by setting the `DSTACK_SERVER_CODE_UPLOAD_LIMIT` environment variable.
375
+
376
+
??? info "Repo URL"
377
+
Sometimes you may want to mount a Git repo without cloning it locally. In this case, simply provide a URL in `repos`:
378
+
379
+
<div editor-title="examples/.dstack.yml">
380
+
381
+
```yaml
382
+
type: dev-environment
383
+
name: vscode
384
+
385
+
repos:
386
+
# Clone the specified repo to `/workflow` (the default working directory)
387
+
- https://github.com/dstackai/dstack
388
+
389
+
ide: vscode
390
+
```
391
+
392
+
</div>
393
+
394
+
??? info "Private repos"
395
+
If a Git repo is private, `dstack` will automatically try to use your default Git credentials (from
396
+
`~/.ssh/config`or `~/.config/gh/hosts.yml`).
397
+
398
+
If you want to use custom credentials, you can provide them with [`dstack init`](../reference/cli/dstack/init.md).
357
399
358
-
!!! warning "Experimental"
359
-
The `files` feature is experimental. Feedback is highly appreciated.
400
+
> Currently, you can configure up to one repo per run configuration.
360
401
361
402
### Retry policy
362
403
@@ -534,5 +575,5 @@ via the [`spot_policy`](../reference/dstack.yml/dev-environment.md#spot_policy)
534
575
--8<-- "docs/concepts/snippets/manage-runs.ext"
535
576
536
577
!!! info "What's next?"
537
-
1. Read about [tasks](tasks.md), [services](services.md), and [repos](repos.md)
578
+
1. Read about [tasks](tasks.md)and [services](services.md)
Copy file name to clipboardExpand all lines: docs/docs/concepts/services.md
+89-24Lines changed: 89 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -588,12 +588,7 @@ resources:
588
588
589
589
### Files
590
590
591
-
By default, `dstack` automatically mounts the [repo](repos.md) directory where you ran `dstack init` to any run configuration.
592
-
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.
591
+
Sometimes, when you run a service, you may want to mount local files. This is possible via the [`files`](../reference/dstack.yml/task.md#_files) property. Each entry maps a local directory or file to a path inside the container.
597
592
598
593
<!-- TODO: Add a more relevant example -->
599
594
@@ -625,14 +620,12 @@ resources:
625
620
626
621
Each entry maps a local directory or file to a path inside the container. Both local and container paths can be relative or absolute.
627
622
628
-
- If the local path is relative, it’s resolved relative to the configuration file.
629
-
- If the container path is relative, it’s resolved relative to `/workflow`.
623
+
If the local path is relative, it’s resolved relative to the configuration file. If the container path is relative, it’s resolved relative to `/workflow`.
630
624
631
625
The container path is optional. If not specified, it will be automatically calculated.
632
626
633
627
<!-- TODO: Add a more relevant example -->
634
628
635
-
636
629
<div editor-title="examples/.dstack.yml">
637
630
638
631
```yaml
@@ -659,27 +652,99 @@ resources:
659
652
660
653
</div>
661
654
662
-
Note: If you want to use `files` without mounting the entire repo directory,
663
-
make sure to pass `--no-repo` when running `dstack apply`:
655
+
??? info "Upload limit and excludes"
656
+
Whether its a file or folder, each entry is limited to 2MB. To avoid exceeding this limit, make sure to exclude unnecessary files
657
+
by listing it via `.gitignore` or `.dstackignore`.
658
+
The 2MB upload limit can be increased by setting the `DSTACK_SERVER_CODE_UPLOAD_LIMIT` environment variable.
664
659
665
-
<div class="termy">
660
+
### Repos
666
661
667
-
```shell
668
-
$ dstack apply -f examples/.dstack.yml --no-repo
662
+
Sometimes, you may want to mount an entire Git repo inside the container.
663
+
664
+
Imagine you have a cloned Git repo containing an `examples` subdirectory with a `.dstack.yml` file:
665
+
666
+
<!-- TODO: Add a more relevant example -->
667
+
668
+
<div editor-title="examples/.dstack.yml">
669
+
670
+
```yaml
671
+
type: service
672
+
name: llama-2-7b-service
673
+
674
+
repos:
675
+
# Mounts the parent directory of `examples` (must be a Git repo)
If a Git repo is private, `dstack` will automatically try to use your default Git credentials (from
742
+
`~/.ssh/config`or `~/.config/gh/hosts.yml`).
743
+
744
+
If you want to use custom credentials, you can provide them with [`dstack init`](../reference/cli/dstack/init.md).
745
+
746
+
> Currently, you can configure up to one repo per run configuration.
679
747
680
-
!!! warning "Experimental"
681
-
The `files` feature is experimental. Feedback is highly appreciated.
682
-
683
748
### Retry policy
684
749
685
750
By default, if `dstack` can't find capacity, or the service exits with an error, or the instance is interrupted, the run will fail.
@@ -858,7 +923,7 @@ The rolling deployment stops when all replicas are updated or when a new deploym
858
923
??? info "Supported properties"
859
924
<!-- NOTE: should be in sync with constants in server/services/runs.py -->
860
925
861
-
Rolling deployment supports changes to the following properties: `port`, `probes`, `resources`, `volumes`, `docker`, `files`, `image`, `user`, `privileged`, `entrypoint`, `working_dir`, `python`, `nvcc`, `single_branch`, `env`, `shell`, `commands`, as well as changes to [repo](repos.md) or [file](#files) contents.
926
+
Rolling deployment supports changes to the following properties: `port`, `probes`, `resources`, `volumes`, `docker`, `files`, `image`, `user`, `privileged`, `entrypoint`, `working_dir`, `python`, `nvcc`, `single_branch`, `env`, `shell`, `commands`, as well as changes to [repo](#repos) or [file](#files) contents.
862
927
863
928
Changes to `replicas` and `scaling` can be applied without redeploying replicas.
864
929
@@ -870,7 +935,7 @@ The rolling deployment stops when all replicas are updated or when a new deploym
870
935
--8<-- "docs/concepts/snippets/manage-runs.ext"
871
936
872
937
!!! info "What's next?"
873
-
1. Read about [dev environments](dev-environments.md), [tasks](tasks.md), and [repos](repos.md)
938
+
1. Read about [dev environments](dev-environments.md)and [tasks](tasks.md)
874
939
2. Learn how to manage [fleets](fleets.md)
875
940
3. See how to set up [gateways](gateways.md)
876
941
4. Check the [TGI :material-arrow-top-right-thin:{ .external }](../../examples/inference/tgi/index.md){:target="_blank"},
0 commit comments