Skip to content

Commit 6853688

Browse files
[Docs]: Service rolling deployments
Minor edits
1 parent 1783062 commit 6853688

1 file changed

Lines changed: 11 additions & 13 deletions

File tree

docs/docs/concepts/services.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -679,11 +679,9 @@ utilization_policy:
679679
[`max_price`](../reference/dstack.yml/service.md#max_price), and
680680
among [others](../reference/dstack.yml/service.md).
681681

682-
--8<-- "docs/concepts/snippets/manage-runs.ext"
683-
684-
## Deployments
682+
## Rolling deployment
685683

686-
To deploy a new version of the service, change its configuration or associated resources, such as files or repo contents. Then, re-run `dstack apply`.
684+
To deploy a new version of a service that is already `running`, use `dstack apply`. `dstack` will automatically detect changes and update replicas one by one. New and old replicas coexist and handle requests simultaneously until deployment finishes.
687685

688686
<div class="termy">
689687

@@ -702,11 +700,8 @@ Update the run? [y/n]:
702700

703701
</div>
704702

705-
If `dstack` can apply all the detected changes without a full service restart, it starts a rolling deployment. During the rolling deployment, `dstack` gradually updates the service replicas to the new version. First, it starts an extra replica. Then, it waits until this replica enters the `running` state. Finally, it terminates the old replica.
706-
707-
During deployment, new and old replicas can coexist and handle requests simultaneously. If the service has multiple replicas, they are updated one by one &mdash; there can be at most one extra replica above the desired number of replicas, as determined by the `replicas` and `scaling` properties.
708-
709-
You can track the deployment progress in the `dstack apply` output or in `dstack ps`. The `deployment` number will be lower for old replicas and higher for new ones.
703+
You can track the deployment progress in both `dstack apply` or `dstack ps`.
704+
Older replicas have lower `deployment` numbers; newer ones have higher.
710705

711706
<!--
712707
Not using termy for this example, since the example shows an intermediate CLI state,
@@ -723,14 +718,17 @@ $ dstack apply -f my-service.dstack.yml
723718
replica=1 job=0 deployment=1 aws (us-west-2) $0.0026 running 1 min ago
724719
```
725720

726-
A deployment stops either when all of the replicas are up to date or when the next deployment is submitted.
721+
The rolling deployment stops when all replicas are updated or when a new deployment is submitted.
727722

728723
<!-- NOTE: should be in sync with constants in server/services/runs.py -->
729724

730-
Rolling deployments apply to the following configuration properties: `resources`, `volumes`, `docker`, `files`, `image`, `user`, `privileged`, `entrypoint`, `working_dir`, `python`, `nvcc`, `single_branch`, `env`, `shell`, `commands`. They also apply to changes to [repo](repos.md) or [file](#files) contents.
725+
??? info "Force a redeployment"
726+
`dstack` automatically detects changes to `resources`, `volumes`, `docker`, `files`, `image`, `user`, `privileged`, `entrypoint`, `working_dir`, `python`, `nvcc`, `single_branch`, `env`, `shell`, `commands`, and to [repo](repos.md) and [files](#files) contents.
727+
728+
To trigger a rolling deployment when no properties have changed (e.g., after updating [secrets](secrets.md) or to restart all replicas),
729+
make a minor config change, such as adding a dummy [environment variable](#environment-variables).
731730

732-
??? info "Forcing a redeployment"
733-
Sometimes you may want to run a rolling deployment even if `dstack` detects no changes to the configuration or associated resources. This can be useful if you've changed the project [secrets](secrets.md) or if you just want to gradually restart all service replicas. Currently, this can be achieved by making an insignificant change to the configuration, such as adding a dummy [environment variable](#environment-variables).
731+
--8<-- "docs/concepts/snippets/manage-runs.ext"
734732

735733
!!! info "What's next?"
736734
1. Read about [dev environments](dev-environments.md), [tasks](tasks.md), and [repos](repos.md)

0 commit comments

Comments
 (0)