Skip to content

Support service scaling via in-place updates#1958

Merged
r4victor merged 6 commits intomasterfrom
issue_1926_service_inplace_update
Nov 5, 2024
Merged

Support service scaling via in-place updates#1958
r4victor merged 6 commits intomasterfrom
issue_1926_service_inplace_update

Conversation

@r4victor
Copy link
Copy Markdown
Collaborator

@r4victor r4victor commented Nov 5, 2024

Closes #1926
Closes #1762

This PR allows updating services replicas and scaling parameters without re-creating the runs, which allows users to scale services manually:

✗ dstack apply -f .dstack/confs/service.yaml
 Project                main                           
 User                   admin                          

...

Active run service4 already exists. Detected configuration changes that can be updated
in-place: ['replicas']
Update the run? [y/n]: y

PR summary:

  • Add /api/project/{project_name}/runs/apply endpoint that implements server-side apply (creates or updates a run given run plan input).
  • Improve dstack apply CLI command to show different plan messages depending on apply action (create/update/override/etc).
  • Add process_runs logic that scales services if the run_spec replicas/scaling parameters change.

Next steps:

  • Support services redeployment via rolling deployments. This will allow updating any services parameters and deploy new services versions with zero downtime.

@r4victor r4victor merged commit 7c8460c into master Nov 5, 2024
@r4victor r4victor deleted the issue_1926_service_inplace_update branch November 5, 2024 06:53
superprat pushed a commit to bahaal-tech/dstack that referenced this pull request Dec 20, 2024
* Implement basic services in-place update

* Improve dstack apply update messages

* Allow commands update

* Test in-place updates

* Handle client backward compatibility

* Add comments
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.

Support services in-place updates via dstack apply [Feature] Provide a public API to scale services

1 participant