Skip to content

dev-environment

The dev-environment configuration type allows running dev environments.

Root reference

ide - The IDE to run. Supported values include vscode and cursor.
version - (Optional) The version of the IDE.
init - (Optional) The bash commands to run on startup.
inactivity_duration - (Optional) The maximum amount of time the dev environment can be inactive (e.g., 2h, 1d, etc). After it elapses, the dev environment is automatically stopped. Inactivity is defined as the absence of SSH connections to the dev environment, including VS Code connections, ssh <run name> shells, and attached dstack apply or dstack attach commands. Use off for unlimited duration. Can be updated in-place. Defaults to off.
name - (Optional) The run name. If not specified, a random name is generated.
image - (Optional) The name of the Docker image to run.
user - (Optional) The user inside the container, user_name_or_id[:group_name_or_id] (e.g., ubuntu, 1000:1000). Defaults to the default image user.
privileged - (Optional) Run the container in privileged mode.
entrypoint - (Optional) The Docker entrypoint.
working_dir - (Optional) The path to the working directory inside the container. It's specified relative to the repository directory (/workflow) and should be inside it. Defaults to "." .
registry_auth - (Optional) Credentials for pulling a private Docker image.
python - (Optional) The major version of Python. Mutually exclusive with image.
nvcc - (Optional) Use image with NVIDIA CUDA Compiler (NVCC) included. Mutually exclusive with image.
single_branch - (Optional) Whether to clone and track only the current branch or all remote branches. Relevant only when using remote Git repos. Defaults to false for dev environments and to true for tasks and services.
env - (Optional) The mapping or the list of environment variables.
resources - (Optional) The resources requirements to run the configuration.
volumes - (Optional) The volumes mount points.
ports - (Optional) Port numbers/mapping to expose.
backends - (Optional) The backends to consider for provisioning (e.g., [aws, gcp]).
regions - (Optional) The regions to consider for provisioning (e.g., [eu-west-1, us-west4, westeurope]).
availability_zones - (Optional) The availability zones to consider for provisioning (e.g., [eu-west-1a, us-west4-a]).
instance_types - (Optional) The cloud-specific instance types to consider for provisioning (e.g., [p3.8xlarge, n1-standard-4]).
reservation - (Optional) The existing reservation to use for instance provisioning. Supports AWS Capacity Reservations and Capacity Blocks.
spot_policy - (Optional) The policy for provisioning spot or on-demand instances: spot, on-demand, or auto. Defaults to on-demand.
retry - (Optional) The policy for resubmitting the run. Defaults to false.
max_duration - (Optional) The maximum duration of a run (e.g., 2h, 1d, etc). After it elapses, the run is automatically stopped. Use off for unlimited duration. Defaults to off.
stop_duration - (Optional) The maximum duration of a run graceful stopping. After it elapses, the run is automatically forced stopped. This includes force detaching volumes used by the run. Use off for unlimited duration. Defaults to 5m.
max_price - (Optional) The maximum instance price per hour, in dollars.
creation_policy - (Optional) The policy for using instances from fleets. Defaults to reuse-or-create.
idle_duration - (Optional) Time to wait before terminating idle instances. Defaults to 5m for runs and 3d for fleets. Use off for unlimited duration.
utilization_policy - (Optional) Run termination policy based on utilization.

retry

on_events - (Optional) The list of events that should be handled with retry. Supported events are no-capacity, interruption, and error. Omit to retry on all events.
duration - (Optional) The maximum period of retrying the run, e.g., 4h or 1d.

utilization_policy

min_gpu_utilization - Minimum required GPU utilization, percent. If any GPU has utilization below specified value during the whole time window, the run is terminated.
time_window - The time window of metric samples taking into account to measure utilization (e.g., 30m, 1h). Minimum is 5m.

resources

cpu - (Optional) The number of CPU cores. Defaults to 2...
memory - (Optional) The RAM size (e.g., 8GB). Defaults to 8GB...
shm_size - (Optional) The size of shared memory (e.g., 8GB). If you are using parallel communicating processes (e.g., dataloaders in PyTorch), you may need to configure this.
gpu - (Optional) The GPU requirements.
disk - (Optional) The disk resources.

resources.gpu

vendor - (Optional) The vendor of the GPU/accelerator, one of: nvidia, amd, google (alias: tpu), intel.
name - (Optional) The name of the GPU (e.g., A100 or H100).
count - (Optional) The number of GPUs. Defaults to 1.
memory - (Optional) The RAM size (e.g., 16GB). Can be set to a range (e.g. 16GB.., or 16GB..80GB).
total_memory - (Optional) The total RAM size (e.g., 32GB). Can be set to a range (e.g. 16GB.., or 16GB..80GB).
compute_capability - (Optional) The minimum compute capability of the GPU (e.g., 7.5).

resources.disk

size - Disk size.

registry_auth

username - The username.
password - The password or access token.

volumes[n]

name - The network volume name or the list of network volume names to mount. If a list is specified, one of the volumes in the list will be mounted. Specify volumes from different backends/regions to increase availability..
path - The absolute container path to mount the volume at.
instance_path - The absolute path on the instance (host).
path - The absolute path in the container.
optional - (Optional) Allow running without this volume in backends that do not support instance volumes.
Short syntax

The short syntax for volumes is a colon-separated string in the form of source:destination

  • volume-name:/container/path for network volumes
  • /instance/path:/container/path for instance volumes