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/guides/protips.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -321,6 +321,33 @@ retry:
321
321
322
322
</div>
323
323
324
+
## Profiles
325
+
326
+
Sometimes, you may want to reuse parameters across runs or set defaults so you don’t have to repeat them in every configuration. You can do this by defining a profile.
327
+
328
+
??? info ".dstack/profiles.yml"
329
+
A profile file can be created either globally in `~/.dstack/profiles.yml` or locally in `.dstack/profiles.yml`:
330
+
331
+
```yaml
332
+
profiles:
333
+
- name: my-profile
334
+
# If set to true, this profile will be applied automatically
335
+
default: true
336
+
337
+
# The spot pololicy can be "spot", "on-demand", or "auto"
338
+
spot_policy: auto
339
+
# Limit the maximum price of the instance per hour
340
+
max_price: 1.5
341
+
# Stop any run if it runs longer that this duration
342
+
max_duration: 1d
343
+
# Use only these backends
344
+
backends: [azure, lambda]
345
+
```
346
+
347
+
Check [`.dstack/profiles.yml`](../reference/profiles.yml.md) to see what properties can be defined there.
348
+
349
+
A profile can be set as `default` to apply automatically to any run, or specified with `--profile NAME` in `dstack apply`.
350
+
324
351
## Projects
325
352
326
353
If you're using multiple `dstack` projects (e.g., from different `dstack` servers),
Sometimes, you may want to reuse the same parameters across different [`.dstack.yml`](dstack.yml.md) configurations.
3
+
Sometimes, you may want to reuse the same parameters across runs or set your own defaults so you don’t have to repeat them in every run configuration. You can do this by defining a profile, either globally in `~/.dstack/profiles.yml` or locally in `.dstack/profiles.yml`.
4
4
5
-
This can be achieved by defining those parameters in a profile.
5
+
A profile can be set as `default` to apply automatically to any run, or specified with `--profile NAME` in `dstack apply`.
6
6
7
-
Profiles can be defined on the repository level (via the `.dstack/profiles.yml` file in the root directory of the
8
-
repository) or on the global level (via the `~/.dstack/profiles.yml` file).
9
-
10
-
Any profile can be marked as default so that it will be applied automatically for any run. Otherwise, you can refer to a specific profile
11
-
via `--profile NAME` in `dstack apply`.
12
-
13
-
### Example
7
+
Example:
14
8
15
9
<diveditor-title=".dstack/profiles.yml">
16
10
17
11
```yaml
18
12
profiles:
19
13
- name: my-profile
14
+
# If set to true, this profile will be applied automatically
15
+
default: true
20
16
21
17
# The spot pololicy can be "spot", "on-demand", or "auto"
22
18
spot_policy: auto
23
-
24
19
# Limit the maximum price of the instance per hour
25
20
max_price: 1.5
26
-
27
21
# Stop any run if it runs longer that this duration
28
22
max_duration: 1d
29
-
30
23
# Use only these backends
31
24
backends: [azure, lambda]
32
-
33
-
# If set to true, this profile will be applied automatically
34
-
default: true
35
25
```
36
26
37
27
</div>
38
28
39
-
The profile configuration supports many properties. See below.
29
+
The profile configuration supports most properties that a run configuration supports — see below.
40
30
41
31
### Root reference
42
32
@@ -51,3 +41,9 @@ The profile configuration supports many properties. See below.
0 commit comments