File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,6 +51,16 @@ def main():
5151 print ("Deployment details: " , deployment )
5252
5353 """
54+ ### Scale replicas in place (no new revision / no rolling update)
55+ # Changing only min_replicas and/or max_replicas on the same Create*
56+ # request updates the selected revision in place; revision_number stays put.
57+ # Any other field change still creates a new revision.
58+ qwen_config.min_replicas = 2
59+ qwen_config.max_replicas = 4
60+ cclient.update_cserve(deployment.id, qwen_config)
61+ scaled = cclient.get_cserve(deployment.id)
62+ print(f"Scaled to {scaled.min_replicas}-{scaled.max_replicas}; revision {scaled.revision_number}")
63+
5464 ### Pause the deployment
5565 cclient.pause(deployment.id)
5666
Original file line number Diff line number Diff line change @@ -58,9 +58,15 @@ def main():
5858 # client.resume(deployment.id)
5959 # client.delete(deployment.id)
6060 #
61- # To update a Dynamo deployment, construct a new
62- # CreateDynamoDeploymentRequest and call:
63- # client.update_dynamo(deployment.id, updated_request)
61+ # Scale replicas in place (no new revision / no rolling update):
62+ # Changing only min_replicas and/or max_replicas on the same Create*
63+ # request updates the selected revision in place; revision_number stays put.
64+ # Any other field change still creates a new revision.
65+ # request.min_replicas = 2
66+ # request.max_replicas = 4
67+ # client.update_dynamo(deployment.id, request)
68+ # scaled = client.get_dynamo(deployment.id)
69+ # print(f"Scaled to {scaled.min_replicas}-{scaled.max_replicas}; revision {scaled.revision_number}")
6470
6571 print (f"Created Dynamo deployment { deployment .id } : { deployment .endpoint_url } " )
6672 print (f"Model: { deployment .model } " )
Original file line number Diff line number Diff line change @@ -38,6 +38,16 @@ def main():
3838 print ("Deployment details: " , deployment )
3939
4040 '''
41+ ### Scale replicas in place (no new revision / no rolling update)
42+ # Changing only min_replicas and/or max_replicas on the same Create*
43+ # request updates the selected revision in place; revision_number stays put.
44+ # Any other field change still creates a new revision.
45+ request.min_replicas = 2
46+ request.max_replicas = 5
47+ cclient.update_inference(deployment.id, request)
48+ scaled = cclient.get_inference(deployment.id)
49+ print(f"Scaled to {scaled.min_replicas}-{scaled.max_replicas}; revision {scaled.revision_number}")
50+
4151 ### Pause the deployment
4252 cclient.pause(deployment.id)
4353
Original file line number Diff line number Diff line change @@ -37,6 +37,16 @@ def main():
3737 print ("Deployment details: " , deployment )
3838
3939 '''
40+ ### Scale replicas in place (no new revision / no rolling update)
41+ # Changing only min_replicas and/or max_replicas on the same Create*
42+ # request updates the selected revision in place; revision_number stays put.
43+ # Any other field change still creates a new revision.
44+ request.min_replicas = 1
45+ request.max_replicas = 3
46+ cclient.update_inference(deployment.id, request)
47+ scaled = cclient.get_inference(deployment.id)
48+ print(f"Scaled to {scaled.min_replicas}-{scaled.max_replicas}; revision {scaled.revision_number}")
49+
4050 ### Pause the deployment
4151 cclient.pause(deployment.id)
4252
You can’t perform that action at this time.
0 commit comments