Add replica groups in dstack-service #3408
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Steps To Test
Step1: Create
replica-groups-service.ymlStep2:
dstack apply -f replica-groups-service.ymlStep3: Run
load_test_replica_groups.pyby subsituting yourURLandTOKENExpected Output
Each group gets one replica
Later, both groups scale respecting group configs.
group0 scales to 2 replicas,
and group1 scales to 3.
Below is the expected output
Step4: Check whether replica specific commands were executed.
Attach to the desired replica
Eg:
dstack attach -replica 2 replica-groups-testssh replica-groups-test-0-2 'cat /tmp/version.txt'output: Group 1 - Version 0Step5: Check rolling deployment.
Important:
Rolling deployments are currently affected by a race condition that also impacts the non–replica group implementation and must be addressed separately (issue). However, when each replica group is configured with a single replica, this race condition does not affect rolling deployments.
Testing instructions:
Scale down each replica group to 1 replica.
Restart the load-testing script with RPS = 2.
After all groups have scaled down to a single replica, re-apply the configuration:
Re-apply
dstack apply -f replica-groups-service.yml