Skip to content

[Docs]: Service rolling deployments#2870

Merged
jvstme merged 6 commits intomasterfrom
issue_2180_docs
Jul 10, 2025
Merged

[Docs]: Service rolling deployments#2870
jvstme merged 6 commits intomasterfrom
issue_2180_docs

Conversation

@jvstme
Copy link
Copy Markdown
Collaborator

@jvstme jvstme commented Jul 3, 2025

@jvstme jvstme requested a review from peterschmidt85 July 3, 2025 13:32
Copy link
Copy Markdown
Contributor

@peterschmidt85 peterschmidt85 left a comment

Choose a reason for hiding this comment

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

Made minor edits. All looks good!

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

??? info "Force a redeployment"
`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.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It detects changes to all properties, these are just the ones that can be updated using a rolling deployment

Comment on lines -705 to -707
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.

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.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think the algorithm description is worth keeping in the docs, so that users know what to expect during deployments and better understand what they are seeing in dstack apply

@jvstme jvstme requested a review from peterschmidt85 July 7, 2025 07:19
Copy link
Copy Markdown
Contributor

@peterschmidt85 peterschmidt85 left a comment

Choose a reason for hiding this comment

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

Added minor edits. Looks good otherwise!

@peterschmidt85
Copy link
Copy Markdown
Contributor

@jvstme Shall we merge?

</div>

To update a replica, `dstack` starts a new replica, then waits until it becomes `running`, then terminates the old replica. If the service has multiple replicas, they are updated one by one &mdash; `dstack` does not proceed to updating the next replica until the previous one was fully updated. New and old replicas can coexist and handle requests simultaneously until deployment finishes.
If approved, `dstack` updates each replica one by one—waiting for each to reach the `running` state before updating the next.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'm still convinced we need to describe the algorithm. From this sentence, it is not clear what "updating" a replica actually means. One may think that dstack just restarts the replica, causing downtime.

waiting for each to reach the running state before updating the next

Not quite — it waits for the old version of the replica to reach the terminated state, and only then proceeds to the next replica.

@jvstme jvstme requested a review from peterschmidt85 July 9, 2025 21:44
@peterschmidt85
Copy link
Copy Markdown
Contributor

@jvstme Sure, please feel free to merge with your change.

@jvstme jvstme merged commit 6c08019 into master Jul 10, 2025
26 checks passed
@jvstme jvstme deleted the issue_2180_docs branch July 10, 2025 08:06
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.

2 participants