Skip to content

Commit b2796cb

Browse files
[Docs] Add .dstack/profiles.yml to Reference and Protips (#3093)
1 parent 1541372 commit b2796cb

File tree

3 files changed

+46
-19
lines changed

3 files changed

+46
-19
lines changed

docs/assets/stylesheets/extra.css

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ body {
804804
display: inline-block;
805805
font-size: 17px;
806806
font-weight: 600;
807-
line-height: 1.4rem;
807+
/* line-height: 1.4rem; */
808808
/*letter-spacing: -0.5px;*/
809809
position: relative;
810810
left: -11px;
@@ -866,7 +866,7 @@ body {
866866
}
867867

868868
.md-sidebar--primary .md-nav__link, .md-sidebar--post .md-nav__link {
869-
padding: 5px 15px 4px;
869+
padding: 4px 15px 4px;
870870
margin-top: 0;
871871
}
872872

@@ -989,6 +989,10 @@ html .md-footer-meta.md-typeset a:is(:focus,:hover) {
989989
.md-nav--integrated>.md-nav__list>.md-nav__item--active .md-nav--secondary {
990990
margin-bottom: 0;
991991
}
992+
993+
.md-nav--primary .md-nav__list {
994+
padding-bottom: .2rem;
995+
}
992996
}
993997

994998
.md-typeset :where(ol, ul) {

docs/docs/guides/protips.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,33 @@ retry:
321321

322322
</div>
323323

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+
324351
## Projects
325352

326353
If you're using multiple `dstack` projects (e.g., from different `dstack` servers),
Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,32 @@
1-
# profiles.yml
1+
# .dstack/profiles.yml
22

3-
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`.
44

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`.
66

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:
148

159
<div editor-title=".dstack/profiles.yml">
1610

1711
```yaml
1812
profiles:
1913
- name: my-profile
14+
# If set to true, this profile will be applied automatically
15+
default: true
2016

2117
# The spot pololicy can be "spot", "on-demand", or "auto"
2218
spot_policy: auto
23-
2419
# Limit the maximum price of the instance per hour
2520
max_price: 1.5
26-
2721
# Stop any run if it runs longer that this duration
2822
max_duration: 1d
29-
3023
# Use only these backends
3124
backends: [azure, lambda]
32-
33-
# If set to true, this profile will be applied automatically
34-
default: true
3525
```
3626
3727
</div>
3828
39-
The profile configuration supports many properties. See below.
29+
The profile configuration supports most properties that a run configuration supports — see below.
4030
4131
### Root reference
4232
@@ -51,3 +41,9 @@ The profile configuration supports many properties. See below.
5141
#SCHEMA# dstack._internal.core.models.profiles.ProfileRetry
5242
overrides:
5343
show_root_heading: false
44+
45+
### `utilization_policy`
46+
47+
#SCHEMA# dstack._internal.core.models.profiles.UtilizationPolicy
48+
overrides:
49+
show_root_heading: false

0 commit comments

Comments
 (0)