dstack apply¶
This command applies a given configuration. If a resource does not exist, dstack apply
creates the resource.
If a resource exists, dstack apply
updates the resource in-place or re-creates the resource if the update is not possible.
When applying run configurations, dstack apply
requires that you run dstack init
first,
or specify a repo to work with via -P
(or --repo
), or specify --no-repo
if you don't need any repo for the run.
Usage¶
$ dstack apply --help
Usage: dstack apply [--project NAME] [-h [TYPE]] [-f FILE] [-y] [--force] [-d]
[-P REPO] [--repo-branch REPO_BRANCH]
[--repo-hash REPO_HASH] [--no-repo] [-t OAUTH_TOKEN]
[--git-identity SSH_PRIVATE_KEY]
[--ssh-identity SSH_PRIVATE_KEY] [--local]
Options:
--project NAME The name of the project. Defaults to $DSTACK_PROJECT
-h, --help [TYPE] Show this help message and exit.
-f, --file FILE The path to the configuration file. Defaults to
$PWD/.dstack.yml
-y, --yes Do not ask for confirmation
--force Force apply when no changes detected
-d, --detach Exit immediately after sumbitting configuration
Repo Options:
-P, --repo REPO The repo to use for the run. Can be a local path or a
Git repo URL.
--repo-branch REPO_BRANCH
The repo branch to use for the run
--repo-hash REPO_HASH
The hash of the repo commit to use for the run
--no-repo Do not use any repo for the run
-t, --token OAUTH_TOKEN
An authentication token to access a private Git repo
--git-identity SSH_PRIVATE_KEY
The private SSH key path to access a private Git repo
--ssh-identity SSH_PRIVATE_KEY
The private SSH key path for SSH tunneling
--local Do not use Git