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
| `DSTACK_GPUS_NUM` | The total number of GPUs in the run |
589
+
| `DSTACK_WORKING_DIR` | The working directory of the run |
590
+
| `DSTACK_REPO_DIR` | The directory where the repo is mounted (if any) |
586
591
587
592
<!-- TODO: Ellaborate on using environment variables in `registry_auth` -->
588
593
594
+
### Working directory
595
+
596
+
If `working_dir` is not specified, it defaults to `/workflow`.
597
+
598
+
!!! info "No commands"
599
+
If you’re using a custom `image` without `commands`, then `working_dir` is taken from `image`.
600
+
601
+
The `working_dir` must be an absolute path. The tilde (`~`) is supported (e.g., `~/my-working-dir`).
602
+
603
+
<!-- TODO: In a future version, the default working directory will be taken from `image`. -->
604
+
605
+
<!-- TODO: Elaborate on `entrypoint` -->
606
+
589
607
### Files
590
608
591
609
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.
@@ -652,7 +670,7 @@ resources:
652
670
653
671
</div>
654
672
655
-
??? info "Upload limit and excludes"
673
+
??? info "File size"
656
674
Whether its a file or folder, each entry is limited to 2MB. To avoid exceeding this limit, make sure to exclude unnecessary files
657
675
by listing it via `.gitignore` or `.dstackignore`.
658
676
The 2MB upload limit can be increased by setting the `DSTACK_SERVER_CODE_UPLOAD_LIMIT` environment variable.
@@ -696,14 +714,46 @@ When you run it, `dstack` fetches the repo on the instance, applies your local c
696
714
697
715
The local path can be either relative to the configuration file or absolute.
698
716
699
-
??? info "Path"
700
-
Currently, `dstack` always mounts the repo to `/workflow` inside the container. It's the default working directory.
701
-
Starting with the next release, it will be possible to specify a custom container path.
717
+
??? info "Repo directory"
718
+
By default, `dstack` mounts the repo to `/workflow` (the default working directory).
719
+
720
+
<!-- TODO: In a future version, the default working directory will come from the image, so this should be revisited. -->
721
+
722
+
You can override the repo directory using either a relative or an absolute path:
723
+
724
+
<div editor-title="examples/.dstack.yml">
725
+
726
+
```yaml
727
+
type: service
728
+
name: llama-2-7b-service
729
+
730
+
repos:
731
+
# Mounts the parent directory of `examples` (must be a Git repo)
0 commit comments