@@ -16,7 +16,7 @@ name: vscode
1616
1717python : " 3.11"
1818# Uncomment to use a custom Docker image
19- # image: dstackai/base:py3.13-0.7-cuda-12.1
19+ # image: huggingface/trl-latest-gpu
2020ide : vscode
2121
2222# Uncomment to leverage spot instances
@@ -86,13 +86,11 @@ property with a list of commands to run at startup:
8686
8787` ` ` yaml
8888type: dev-environment
89- # The name is optional, if not specified, generated randomly
9089name: vscode
9190
9291python: "3.11"
9392ide: vscode
9493
95- # Commands to run on startup
9694init:
9795 - pip install wandb
9896` ` `
@@ -129,23 +127,18 @@ resources:
129127
130128</div>
131129
132- The `cpu` property also allows you to specify the CPU architecture, `x86` or `arm`. Examples :
133- ` x86:16 ` (16 x86-64 cores) , `arm:8..` (at least 8 ARM64 cores) .
134- If the architecture is not specified, `dstack` tries to infer it from the `gpu` specification
135- using `x86` as the fallback value.
130+ The `cpu` property lets you set the architecture ( `x86` or `arm`) and core count — e.g., `x86:16` (16 x86 cores), `arm:8..` (at least 8 ARM cores).
131+ If not set , `dstack` infers it from the GPU or defaults to `x86` .
132+
133+ The `gpu` property lets you specify vendor, model, memory, and count — e.g., `nvidia` (one NVIDIA GPU), `A100` (one A100), `A10G,A100` (either), `A100:80GB` (one 80GB A100), `A100:2` (two A100), `24GB..40GB:2` (two GPUs with 24–40GB), `A100:40GB:2` (two 40GB A100s).
136134
137- The `gpu` property allows specifying not only memory size but also GPU vendor, names
138- and their quantity. Examples : ` nvidia` (one NVIDIA GPU), `A100` (one A100), `A10G,A100` (either A10G or A100),
139- ` A100:80GB` (one A100 of 80GB), `A100:2` (two A100), `24GB..40GB:2` (two GPUs between 24GB and 40GB),
140- ` A100:40GB:2` (two A100 GPUs of 40GB).
141- If the vendor is not specified, `dstack` tries to infer it from the GPU name using `nvidia` as the fallback value.
135+ If vendor is omitted, `dstack` infers it from the model or defaults to `nvidia`.
142136
143137??? info "Google Cloud TPU"
144138 To use TPUs, specify its architecture via the `gpu` property.
145139
146140 ` ` ` yaml
147141 type: dev-environment
148- # The name is optional, if not specified, generated randomly
149142 name: vscode
150143
151144 ide: vscode
@@ -163,69 +156,124 @@ If the vendor is not specified, `dstack` tries to infer it from the GPU name usi
163156> If you’re unsure which offers (hardware configurations) are available from the configured backends, use the
164157> [`dstack offer`](../reference/cli/dstack/offer.md#list-gpu-offers) command to list them.
165158
166- # ## Python version
159+ # ## Docker
160+
161+ # ### Default image
167162
168163If you don't specify `image`, `dstack` uses its base Docker image pre-configured with
169- ` python` , `pip`, `conda` (Miniforge), and essential CUDA drivers.
170- The `python` property determines which default Docker image is used.
164+ ` uv` , `python`, `pip`, essential CUDA drivers, and NCCL tests (under `/opt/nccl-tests/build`).
171165
172- ??? info "nvcc"
173- By default, the base Docker image doesn’t include `nvcc`, which is required for building custom CUDA kernels.
174- If you need `nvcc`, set the [`nvcc`](../reference/dstack.yml/dev-environment.md#nvcc) property to true.
166+ Set the `python` property to pre-install a specific version of Python.
175167
176- # ## Docker
168+ <div editor-title=".dstack.yml">
169+
170+ ` ` ` yaml
171+ type: dev-environment
172+ name: vscode
173+
174+ python: 3.12
175+
176+ ide: vscode
177+ ` ` `
178+
179+ </div>
180+
181+ # ### NVCC
182+
183+ By default, the base Docker image doesn’t include `nvcc`, which is required for building custom CUDA kernels.
184+ If you need `nvcc`, set the [`nvcc`](../reference/dstack.yml/dev-environment.md#nvcc) property to true.
185+
186+ <div editor-title=".dstack.yml">
187+
188+ ` ` ` yaml
189+ type: dev-environment
190+ name: vscode
191+
192+ python: 3.12
193+ nvcc: true
194+
195+ ide: vscode
196+ init:
197+ - uv pip install flash_attn --no-build-isolation
198+ ` ` `
199+
200+ </div>
201+
202+ # ### Custom image
177203
178204If you want, you can specify your own Docker image via `image`.
179205
180206<div editor-title=".dstack.yml">
181207
182208` ` ` yaml
183209type: dev-environment
184- # The name is optional, if not specified, generated randomly
185210name: vscode
186211
187- # Any custom Docker image
188- image: ghcr.io/huggingface/text-generation-inference:latest
212+ image: huggingface/trl-latest-gpu
189213
190214ide: vscode
191215` ` `
192216
193217</div>
194218
195- !!! info "Privileged mode"
196- To enable privileged mode, set [`privileged`](../reference/dstack.yml/dev-environment.md#privileged) to `true`.
197- This mode allows using [Docker and Docker Compose](../guides/protips.md#docker-and-docker-compose) inside `dstack` runs.
219+ # ### Docker in Docker
198220
199- Not supported with `runpod`, `vastai`, and `kubernetes` .
221+ Set `docker` to `true` to enable the `docker` CLI in your dev environment, e.g., to run or build Docker images, or use Docker Compose .
200222
201- ??? info "Private registry"
202- Use the [`registry_auth`](../reference/dstack.yml/dev-environment.md#registry_auth) property to provide credentials for a private Docker registry.
223+ <div editor-title=".dstack.yml">
203224
204- ` ` ` yaml
205- type: dev-environment
206- # The name is optional, if not specified, generated randomly
207- name: vscode
225+ ` ` ` yaml
226+ type: dev-environment
227+ name: vscode
228+
229+ docker: true
230+
231+ ide: vscode
232+ init:
233+ - docker run --gpus all nvidia/cuda:12.3.0-base-ubuntu22.04 nvidia-smi
234+ ` ` `
235+
236+ </div>
237+
238+ Cannot be used with `python` or `image`. Not supported on `runpod`, `vastai`, or `kubernetes`.
208239
209- # Any private Docker image
210- image: ghcr.io/huggingface/text-generation-inference:latest
211- # Credentials of the private Docker registry
212- registry_auth:
213- username: peterschmidt85
214- password: ghp_e49HcZ9oYwBzUbcSk2080gXZOU2hiT9AeSR5
240+ # ### Privileged mode
241+
242+ To enable privileged mode, set [`privileged`](../reference/dstack.yml/dev-environment.md#privileged) to `true`.
243+
244+ Not supported with `runpod`, `vastai`, and `kubernetes`.
245+
246+ # ### Private registry
215247
216- ide: vscode
217- ` ` `
248+ Use the [`registry_auth`](../reference/dstack.yml/dev-environment.md#registry_auth) property to provide credentials for a private Docker registry.
249+
250+ <div editor-title=".dstack.yml">
251+
252+ ` ` ` yaml
253+ type: dev-environment
254+ name: vscode
255+
256+ env:
257+ - NGC_API_KEY
258+
259+ image: nvcr.io/nim/deepseek-ai/deepseek-r1-distill-llama-8b
260+ registry_auth:
261+ username: $oauthtoken
262+ password: ${{ env.NGC_API_KEY }}
263+
264+ ide: vscode
265+ ` ` `
266+
267+ </div>
218268
219269# ## Environment variables
220270
221271<div editor-title=".dstack.yml">
222272
223273` ` ` yaml
224274type: dev-environment
225- # The name is optional, if not specified, generated randomly
226275name: vscode
227276
228- # Environment variables
229277env:
230278 - HF_TOKEN
231279 - HF_HUB_ENABLE_HF_TRANSFER=1
@@ -282,6 +330,7 @@ to automatically stop the dev environment after a configured period of inactivit
282330` ` ` yaml
283331type: dev-environment
284332name: vscode
333+
285334ide: vscode
286335
287336# Stop if inactive for 2 hours
@@ -296,12 +345,12 @@ If you go offline without stopping anything manually, the dev environment will a
296345within about 3 minutes.
297346
298347If `inactivity_duration` is configured for your dev environment, you can see how long
299- it has been inactive in `dstack ps --verbose`.
348+ it has been inactive in `dstack ps --verbose` (or `-v`) .
300349
301350<div class="termy">
302351
303352` ` ` shell
304- $ dstack ps --verbose
353+ $ dstack ps -v
305354 NAME BACKEND RESOURCES PRICE STATUS SUBMITTED
306355 vscode cudo 2xCPU, 8GB, $0.0286 running 8 mins ago
307356 100.0GB (disk) (inactive for 2m 34s)
0 commit comments