Skip to content

[Feature] Add alias -R for --reuse with dstack apply #2032

Merged
peterschmidt85 merged 3 commits intomasterfrom
2030-feature-add-alias-r-for-reuse-with-dstack-apply
Nov 23, 2024
Merged

[Feature] Add alias -R for --reuse with dstack apply #2032
peterschmidt85 merged 3 commits intomasterfrom
2030-feature-add-alias-r-for-reuse-with-dstack-apply

Conversation

@peterschmidt85
Copy link
Copy Markdown
Contributor

Fixes #2030

@peterschmidt85 peterschmidt85 linked an issue Nov 22, 2024 that may be closed by this pull request
Comment on lines +196 to +212
## Creation policy

[//]: # (By default, when running dev environments, tasks, and services, `dstack apply` tries to reuse `idle` )
[//]: # (instances from existing fleets. )
[//]: # (If no `idle` instances meet the requirements, it creates a new fleet automatically.)
[//]: # (To avoid creating new fleet, specify pass `--reuse` to `dstack apply` or (or set [)
[//]: # (`creation_policy`](../reference/dstack.yml/dev-environment.md#creation_policy) to `reuse` in the configuration).)
By default, `dstack apply` reuses `idle` instances from an existing [fleet](../concepts/fleets.md),
or automatically creates a new fleet via backends.

To ensure `dstack apply` doesn't create a new fleet but reuses an existing one,
pass `-R` (or `--reuse`) to `dstack apply`.

<div class="termy">

```shell
$ dstack apply -R -f examples/.dstack.yml
```

</div>

Alternatively, set [`creation_policy`](reference/dstack.yml/dev-environment.md#creation_policy) to `reuse` in the task configuration.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this section is supposed to be here, as creation policies are relevant for runs and this page is about fleets. Every paragraph is a bit confusing 👇

By default, dstack apply reuses idle instances from an existing [fleet](../concepts/fleets.md),

This link references the current page itself.
It's also not clear that dstack apply here refers to applying run configurations, not fleet configurations discussed in this page.

pass -R (or --reuse) to dstack apply.

Not clear that --reuse is an option when applying run configurations, not fleet configurations discussed in this page.

Alternatively, set [creation_policy](reference/dstack.yml/dev-environment.md#creation_policy) to reuse in the task configuration.

Not only in the task configuration, it can be set in service and dev-environment configurations too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Fixed.

- [Docs] Addressing feedback from the review; plus minor improvements
@peterschmidt85 peterschmidt85 merged commit 3b7bdbc into master Nov 23, 2024
@peterschmidt85 peterschmidt85 deleted the 2030-feature-add-alias-r-for-reuse-with-dstack-apply branch November 23, 2024 12:10
superprat pushed a commit to bahaal-tech/dstack that referenced this pull request Dec 20, 2024
…2032)

* - [Feature] Add alias `-R` for `--reuse` with `dstack apply` dstackai#2030
- [Docs] Addressing feedback from the review; plus minor improvements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add alias -R for --reuse with dstack apply

2 participants