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/concepts/services.md
+11-13Lines changed: 11 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -679,11 +679,9 @@ utilization_policy:
679
679
[`max_price`](../reference/dstack.yml/service.md#max_price), and
680
680
among [others](../reference/dstack.yml/service.md).
681
681
682
-
--8<-- "docs/concepts/snippets/manage-runs.ext"
683
-
684
-
## Deployments
682
+
## Rolling deployment
685
683
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.
687
685
688
686
<div class="termy">
689
687
@@ -702,11 +700,8 @@ Update the run? [y/n]:
702
700
703
701
</div>
704
702
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 — 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.
710
705
711
706
<!--
712
707
Not using termy for this example, since the example shows an intermediate CLI state,
replica=1 job=0 deployment=1 aws (us-west-2) $0.0026 running 1 min ago
724
719
```
725
720
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.
727
722
728
723
<!-- NOTE: should be in sync with constants in server/services/runs.py -->
729
724
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).
731
730
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"
734
732
735
733
!!! info "What's next?"
736
734
1. Read about [dev environments](dev-environments.md), [tasks](tasks.md), and [repos](repos.md)
0 commit comments