Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Serve] Rolling update #3249

Merged
merged 95 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from 86 commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
e924368
Add rolling update args
Michaelvll Feb 28, 2024
797b2ba
format
Michaelvll Feb 28, 2024
7c5ab85
Merge branch 'master' of github.com:skypilot-org/skypilot into rollin…
Michaelvll Feb 28, 2024
49cf46f
fix merging error
Michaelvll Feb 28, 2024
b302e33
support rolling update
Michaelvll Feb 28, 2024
fbce04d
autoscaler for rolling update
Michaelvll Feb 28, 2024
53e2eb3
Merge branch 'master' of github.com:skypilot-org/skypilot into rollin…
Michaelvll Feb 29, 2024
5788c01
rolling update
Michaelvll Feb 29, 2024
6543d4a
change to update mode
Michaelvll Feb 29, 2024
7d1ba9b
default to rolling update
Michaelvll Feb 29, 2024
3fdf9c2
format
Michaelvll Feb 29, 2024
12b2de2
Add some logging
Michaelvll Feb 29, 2024
cddd5c4
Merge branch 'master' of github.com:skypilot-org/skypilot into rollin…
Michaelvll Feb 29, 2024
ccf41c8
mypy
Michaelvll Feb 29, 2024
dfafaf4
change the mode name
Michaelvll Feb 29, 2024
22d8aa4
Add smoke tests
Michaelvll Feb 29, 2024
9b51414
rename to --serve
Michaelvll Feb 29, 2024
9d3e007
rename to --serve
Michaelvll Feb 29, 2024
add0a98
rename to serve
Michaelvll Feb 29, 2024
b77b889
Fix some smoke tests for serve
Michaelvll Mar 1, 2024
885396a
Fix serve logs
Michaelvll Mar 1, 2024
6e0dbe5
Fix smoke test for concurrent tests
Michaelvll Mar 1, 2024
1216189
longer wait time
Michaelvll Mar 1, 2024
65bfc32
Fix key error
Michaelvll Mar 1, 2024
fd3d77c
fix
Michaelvll Mar 1, 2024
628b985
further fix tests
Michaelvll Mar 1, 2024
881137a
typo
Michaelvll Mar 1, 2024
c3e2b63
format
Michaelvll Mar 1, 2024
969ae51
scale down provisioning replicas if target num satisfies
Michaelvll Mar 1, 2024
38671ac
format
Michaelvll Mar 1, 2024
3c1bac9
longer time
Michaelvll Mar 1, 2024
bbc50ad
format
Michaelvll Mar 1, 2024
42fa84e
longer wait time
Michaelvll Mar 1, 2024
32963f2
longer time
Michaelvll Mar 1, 2024
3096b62
address comments and add replica_id env var
Michaelvll Mar 2, 2024
c700eb0
typo
Michaelvll Mar 2, 2024
47feb6c
Add env var and fix pytest serve
Michaelvll Mar 2, 2024
58a60e1
Merge branch 'master' of https://github.com/skypilot-org/skypilot int…
Michaelvll Mar 2, 2024
419a09a
Fix test smoke for until
Michaelvll Mar 2, 2024
00acf41
longer wait
Michaelvll Mar 3, 2024
d3d6fe9
fix smoke test
Michaelvll Mar 5, 2024
5db802b
longer wait time
Michaelvll Mar 5, 2024
1e6e4b5
longer wait
Michaelvll Mar 5, 2024
ea614c6
address comments
Michaelvll Mar 5, 2024
c5ec162
fix
Michaelvll Mar 5, 2024
df6432b
typo
Michaelvll Mar 5, 2024
67bddf6
longer initial timeout
Michaelvll Mar 5, 2024
2e4230b
larger concurrent launch
Michaelvll Mar 5, 2024
36bdedf
Fix status check
Michaelvll Mar 6, 2024
c070d88
update test for autoscaler update
Michaelvll Mar 6, 2024
9787c52
Update sky/serve/core.py
Michaelvll Mar 6, 2024
34aeff9
Do not teardown failed replicas
Michaelvll Mar 6, 2024
6ce2508
Merge branch 'rolling-update' of https://github.com/skypilot-org/skyp…
Michaelvll Mar 6, 2024
dae0a72
format
Michaelvll Mar 6, 2024
7621474
update comment
Michaelvll Mar 6, 2024
bea94f6
renaming variable and fix selecting scale down
Michaelvll Mar 7, 2024
cf6a127
format
Michaelvll Mar 7, 2024
35f5b65
longer initial delay seconds
Michaelvll Mar 7, 2024
3e8de25
fix
Michaelvll Mar 7, 2024
64f26b5
longer time
Michaelvll Mar 7, 2024
53ebf32
Fix autoscaler list filter
Michaelvll Mar 7, 2024
e1b6892
address comments
Michaelvll Mar 7, 2024
4320729
Merge branch 'master' of https://github.com/skypilot-org/skypilot int…
Michaelvll Mar 8, 2024
f050c4d
address comments
Michaelvll Mar 8, 2024
9eb4950
update doc
Michaelvll Mar 8, 2024
4ce1a17
Show service versions in `sky serve status`
Michaelvll Mar 8, 2024
e10ff3b
format
Michaelvll Mar 8, 2024
62ead6f
Let replica manager to set active versions instead of controller
Michaelvll Mar 9, 2024
0c877ea
fix active versions
Michaelvll Mar 9, 2024
aaf4ac3
Fix smoke test
Michaelvll Mar 9, 2024
89d2b8a
use min instead
Michaelvll Mar 9, 2024
2315488
use oldest version
Michaelvll Mar 9, 2024
6dd56bf
fix test
Michaelvll Mar 9, 2024
abb9982
format
Michaelvll Mar 9, 2024
0ed9a98
Update docs/source/serving/update.rst
Michaelvll Mar 11, 2024
5218476
address comments
Michaelvll Mar 12, 2024
0cb9d17
Merge branch 'rolling-update' of https://github.com/skypilot-org/skyp…
Michaelvll Mar 12, 2024
86f8e10
remove cloud specific ondemand_fallback
Michaelvll Mar 12, 2024
1c94416
fix state table
Michaelvll Mar 12, 2024
cda3fd1
fix name
Michaelvll Mar 12, 2024
8ea30f0
Merge branch 'master' of https://github.com/skypilot-org/skypilot int…
Michaelvll Mar 12, 2024
63e6cac
Use safe_cursor for serve
Michaelvll Mar 12, 2024
e3f4f4d
Merge branch 'use-safe-db-for-serve' of https://github.com/skypilot-o…
Michaelvll Mar 12, 2024
6eafd47
Fix user bug
Michaelvll Mar 12, 2024
6eeee27
Merge branch 'master' of https://github.com/skypilot-org/skypilot int…
Michaelvll Mar 12, 2024
9f60154
format
Michaelvll Mar 12, 2024
f5131dd
Merge branch 'master' of github.com:skypilot-org/skypilot into rollin…
Michaelvll Mar 14, 2024
446af97
Update docs/source/serving/update.rst
Michaelvll Mar 14, 2024
8e14b6b
Update docs/source/serving/update.rst
Michaelvll Mar 14, 2024
78d5444
Update sky/serve/core.py
Michaelvll Mar 14, 2024
b9b89c6
Update docs/source/serving/update.rst
Michaelvll Mar 14, 2024
0af6bf7
address comments
Michaelvll Mar 14, 2024
152debc
Merge branch 'rolling-update' of github.com:skypilot-org/skypilot int…
Michaelvll Mar 14, 2024
a7ab73d
format
Michaelvll Mar 14, 2024
e03167c
change vallue
Michaelvll Mar 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/source/reference/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ Sky Serve CLI
:prog: sky serve logs
:nested: full

.. click:: sky.cli:serve_update
Michaelvll marked this conversation as resolved.
Show resolved Hide resolved
:prog: sky serve update
:nested: full

Managed Spot Jobs CLI
---------------------------

Expand Down
6 changes: 6 additions & 0 deletions docs/source/running-jobs/environment-variables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ Environment variables for ``setup``
* - ``SKYPILOT_SETUP_NODE_IPS``
- A string of IP addresses of the nodes in the cluster with the same order as the node ranks, where each line contains one IP address.
- 1.2.3.4
* - ``SKYPILOT_SERVE_REPLICA_ID``
Michaelvll marked this conversation as resolved.
Show resolved Hide resolved
- The ID of a replica within the service (starting from 1). Available only for a :ref:`service <sky-serve>`'s replica task.
- 1

Since setup commands always run on all nodes of a cluster, SkyPilot ensures both of these environment variables (the ranks and the IP list) never change across multiple setups on the same cluster.

Expand Down Expand Up @@ -139,6 +142,9 @@ Environment variables for ``run``
If a task is run as a :ref:`managed spot job <spot-jobs>`, then all
recoveries of that job will have the same ID value. Read more :ref:`here <spot-jobs-end-to-end>`.
- sky-2023-07-06-21-18-31-563597_myclus_id-1
* - ``SKYPILOT_SERVE_REPLICA_ID``
- The ID of a replica within the service (starting from 1). Available only for a :ref:`service <sky-serve>`'s replica task.
- 1

The values of these variables are filled in by SkyPilot at task execution time.

Expand Down
201 changes: 159 additions & 42 deletions docs/source/serving/update.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ SkyServe supports *updating* a deployed service, which can be used to change:
* Service spec in ``service`` (e.g., number of replicas or autoscaling spec)

During an update, the service will remain accessible with no downtime and its
endpoint will remain the same.
endpoint will remain the same. By default, `rolling update <rolling-update>`__
is applied, while you can also specify a `blue-green update <blue-green-update>`__.
.. _rolling-update:

Rolling Update
---------------

To update an existing service, use ``sky serve update``:
cblmemo marked this conversation as resolved.
Show resolved Hide resolved

Expand All @@ -22,33 +27,17 @@ SkyServe will launch new replicas described by ``new_service.yaml`` with the fol

* An update is initiated, and traffic will continue to be redirected to existing (old) replicas.
* New replicas (with new settings) are brought up in the background.
* Once ``min_replicas`` new replicas are ready, new traffic will start to be redirected to the new
replicas, while old replicas will stop receiving traffic and will be scaled down.


For example, suppose we have a running service hosting an AI model with the following resource configuration:

.. code-block:: yaml

resources:
memory: 32+
accelerators: T4
* Whenever the total number of old and new replicas exceeds the expected number of replicas (based on autoscaler's decision), extra old replicas will be scaled down.
cblmemo marked this conversation as resolved.
Show resolved Hide resolved
* Traffic will be redirected to both old and new replicas until all new replicas are ready.

It is possible to update it to use a new resource configuration for all replicas, such as:
.. hint::

.. code-block:: yaml

resources:
memory: 128+
accelerators: A100

To support updates, a service and its replicas are versioned (starting from 1).
During an update, traffic is entirely serviced by either old-versioned or
new-versioned replicas. :code:`sky serve status` shows the latest service
version and each replica's version.
When only the ``service`` field is updated and no ``workdir`` or ``file_mounts`` is specified in the service task, SkyServe will reuse the old replicas
by applying the new service spec and bumping its version (See :code:`sky serve status` for the versions). This will significantly reduce the time to
update the service.
Michaelvll marked this conversation as resolved.
Show resolved Hide resolved

Example
~~~~~~~
~~~~~~~~
Michaelvll marked this conversation as resolved.
Show resolved Hide resolved

We first launch a `simple HTTP service <https://github.com/skypilot-org/skypilot/blob/master/examples/serve/http_server/task.yaml>`_:

Expand All @@ -73,8 +62,8 @@ We can use :code:`sky serve status http-server` to check the status of the servi

Service ``http-server`` has an initial version of 1.

Suppose we want to update the service to use 4 vCPUs instead of 2. We can update
the task yaml ``examples/serve/http_server/task.yaml``, by changing the ``cpu``
Suppose we want to update the service to have at least 3 replicas instead of 2. We can update
Michaelvll marked this conversation as resolved.
Show resolved Hide resolved
the task yaml ``examples/serve/http_server/task.yaml``, by changing the ``replicas``
field:

.. code-block:: yaml
Expand All @@ -85,11 +74,11 @@ field:
readiness_probe:
path: /health
initial_delay_seconds: 20
replicas: 2
replicas: 3

resources:
ports: 8081
cpus: 4+
cpus: 2+

workdir: examples/serve/http_server

Expand All @@ -101,57 +90,185 @@ We can then use :code:`sky serve update` to update the service:

$ sky serve update http-server examples/serve/http_server/task.yaml

SkyServe will trigger launching two new replicas with 4 vCPUs. Before
``min_replicas`` (set to ``service.replicas`` when unspecified; i.e., 2) new
replicas are ready, SkyServe will only send traffic to the old replicas. When
the number of new replicas reaches ``min_replicas``, SkyServe will scale down
old replicas to save cost. The service's version is updated from 1 to 2.
Replicas 3 and 4 are the new replicas with 4 vCPUs. Replicas 1 and 2 are the
old replicas with 2 vCPUs.
SkyServe will trigger launching three new replicas.
cblmemo marked this conversation as resolved.
Show resolved Hide resolved

.. code-block:: console

$ sky serve status http-server

Services
NAME VERSION UPTIME STATUS REPLICAS ENDPOINT
http-server 2 6m 15s READY 2/5 44.206.240.249:30002

Service Replicas
SERVICE_NAME ID VERSION IP LAUNCHED RESOURCES STATUS REGION
http-server 1 1 54.173.203.169 6 mins ago 1x AWS(vCPU=2) READY us-east-1
http-server 2 1 52.87.241.103 6 mins ago 1x AWS(vCPU=2) READY us-east-1
http-server 3 2 - 21 secs ago 1x AWS(vCPU=2) PROVISIONING us-east-1
http-server 4 2 - 21 secs ago 1x AWS(vCPU=2) PROVISIONING us-east-1
http-server 5 2 - 21 secs ago 1x AWS(vCPU=2) PROVISIONING us-east-1


Whenever a new replica is ready, the traffic will be redirected to both old and new replicas.

.. code-block:: console

$ sky serve status http-server

Services
NAME VERSION UPTIME STATUS REPLICAS ENDPOINT
http-server 1,2 10m 4s READY 3/5 44.206.240.249:30002

Service Replicas
SERVICE_NAME ID VERSION IP LAUNCHED RESOURCES STATUS REGION
http-server 1 1 54.173.203.169 10 mins ago 1x AWS(vCPU=2) READY us-east-1
http-server 2 1 52.87.241.103 10 mins ago 1x AWS(vCPU=2) READY us-east-1
http-server 3 2 3.93.241.163 1 min ago 1x AWS(vCPU=2) READY us-east-1
http-server 4 2 - 1 min ago 1x AWS(vCPU=2) PROVISIONING us-east-1
http-server 5 2 - 1 min ago 1x AWS(vCPU=2) PROVISIONING us-east-1


Once the total number of both old and new replicas exceeds the requested number, old replicas will be scaled down.

.. code-block:: console

$ sky serve status http-server

Services
NAME VERSION UPTIME STATUS REPLICAS ENDPOINT
http-server 1,2 10m 4s READY 3/5 44.206.240.249:30002

Service Replicas
SERVICE_NAME ID VERSION IP LAUNCHED RESOURCES STATUS REGION
http-server 1 1 54.173.203.169 10 mins ago 1x AWS(vCPU=2) SHUTTING_DOWN us-east-1
http-server 2 1 52.87.241.103 10 mins ago 1x AWS(vCPU=2) READY us-east-1
http-server 3 2 3.93.241.163 1 min ago 1x AWS(vCPU=2) READY us-east-1
http-server 4 2 18.206.226.82 1 min ago 1x AWS(vCPU=2) READY us-east-1
http-server 5 2 - 1 min ago 1x AWS(vCPU=2) PROVISIONING us-east-1

Eventually, we will only have new replicas ready to serve user requests.

.. code-block:: console

$ sky serve status http-server

Services
NAME VERSION UPTIME STATUS REPLICAS ENDPOINT
http-server 2 11m 42s READY 3/3 44.206.240.249:30002

Service Replicas
SERVICE_NAME ID VERSION IP LAUNCHED RESOURCES STATUS REGION
http-server 3 2 3.93.241.163 3 mins ago 1x AWS(vCPU=2) READY us-east-1
http-server 4 2 18.206.226.82 3 mins ago 1x AWS(vCPU=2) READY us-east-1
http-server 5 2 3.26.232.31 1 min ago 1x AWS(vCPU=2) READY us-east-1



.. _blue-green-update:

Blue-Green Update
------------------

SkyServe also supports blue-green updates, by the following command:

.. code-block:: console

$ sky serve update --mode blue_green service-name new_service.yaml


In this update mode, SkyServe will launch new replicas described by ``new_service.yaml`` with the following behavior:

* An update is initiated, and traffic will continue to be redirected to existing (old) replicas.
* New replicas (with new settings) are brought up in the background.
* Traffic will be redirected to new replicas only when all new replicas are ready.
* Old replicas are scaled down after all new replicas are ready.


During an update, traffic is entirely serviced by either old-versioned or
new-versioned replicas. :code:`sky serve status` shows the latest service
version and each replica's version.

Example
~~~~~~~

We use the same service ``http-server`` as an example. We can then use :code:`sky serve update --mode blue_green` to update the service:

.. code-block:: console

$ sky serve update http-server --mode blue_green examples/serve/http_server/task.yaml


SkyServe will trigger launching three new replicas.

.. code-block:: console

$ sky serve status http-server

Services
NAME VERSION UPTIME STATUS REPLICAS ENDPOINT
http-server 2 6m 15s READY 2/4 44.206.240.249:30002
http-server 2 6m 15s READY 2/5 44.206.240.249:30002

Service Replicas
SERVICE_NAME ID VERSION IP LAUNCHED RESOURCES STATUS REGION
http-server 1 1 54.173.203.169 6 mins ago 1x AWS(vCPU=2) READY us-east-1
http-server 2 1 52.87.241.103 6 mins ago 1x AWS(vCPU=2) READY us-east-1
http-server 3 2 - 21 secs ago 1x AWS(vCPU=4) PROVISIONING us-east-1
http-server 4 2 - 21 secs ago 1x AWS(vCPU=4) PROVISIONING us-east-1
http-server 3 2 - 21 secs ago 1x AWS(vCPU=2) PROVISIONING us-east-1
http-server 4 2 - 21 secs ago 1x AWS(vCPU=2) PROVISIONING us-east-1
http-server 5 2 - 21 secs ago 1x AWS(vCPU=2) PROVISIONING us-east-1

The old replicas will be scaled down when the new replicas are ready. At this point, SkyServe will start sending traffic to the new replicas.

When a new replica is ready, the traffic will still be redirected to old replicas.

.. code-block:: console

$ sky serve status http-server

Services
NAME VERSION UPTIME STATUS REPLICAS ENDPOINT
http-server 2 10m 4s READY 2/4 44.206.240.249:30002
http-server 1 10m 4s READY 3/5 44.206.240.249:30002

Service Replicas
SERVICE_NAME ID VERSION IP LAUNCHED RESOURCES STATUS REGION
http-server 1 1 54.173.203.169 10 mins ago 1x AWS(vCPU=2) READY us-east-1
http-server 2 1 52.87.241.103 10 mins ago 1x AWS(vCPU=2) READY us-east-1
http-server 3 2 3.93.241.163 1 min ago 1x AWS(vCPU=4) READY us-east-1
http-server 4 2 - 1 min ago 1x AWS(vCPU=4) PROVISIONING us-east-1
http-server 5 2 - 1 min ago 1x AWS(vCPU=4) PROVISIONING us-east-1


Once the total number of new replicas satisfies the requirements, traffics will be redirected to new replicas and old replicas will be scaled down.

.. code-block:: console

$ sky serve status http-server

Services
NAME VERSION UPTIME STATUS REPLICAS ENDPOINT
http-server 2 10m 4s READY 3/5 44.206.240.249:30002

Service Replicas
SERVICE_NAME ID VERSION IP LAUNCHED RESOURCES STATUS REGION
http-server 1 1 54.173.203.169 10 mins ago 1x AWS(vCPU=2) SHUTTING_DOWN us-east-1
http-server 2 1 52.87.241.103 10 mins ago 1x AWS(vCPU=2) SHUTTING_DOWN us-east-1
http-server 3 2 3.93.241.163 1 min ago 1x AWS(vCPU=4) READY us-east-1
http-server 4 2 18.206.226.82 1 min ago 1x AWS(vCPU=4) READY us-east-1
http-server 5 2 3.26.232.31 1 min ago 1x AWS(vCPU=4) READY us-east-1

Eventually, we will only have new replicas ready to serve user requests.
Eventually, same as rolling update, we will only have new replicas ready to serve user requests.
Michaelvll marked this conversation as resolved.
Show resolved Hide resolved

.. code-block:: console

$ sky serve status http-server

Services
NAME VERSION UPTIME STATUS REPLICAS ENDPOINT
http-server 2 11m 42s READY 2/2 44.206.240.249:30002
http-server 2 11m 42s READY 3/3 44.206.240.249:30002

Service Replicas
SERVICE_NAME ID VERSION IP LAUNCHED RESOURCES STATUS REGION
http-server 3 2 3.93.241.163 3 mins ago 1x AWS(vCPU=4) READY us-east-1
http-server 4 2 18.206.226.82 3 mins ago 1x AWS(vCPU=4) READY us-east-1
http-server 5 2 3.26.232.31 1 min ago 1x AWS(vCPU=4) READY us-east-1



26 changes: 24 additions & 2 deletions sky/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3756,6 +3756,14 @@ def serve_up(
nargs=-1,
**_get_shell_complete_args(_complete_file_name))
@_add_click_options(_TASK_OPTIONS + _EXTRA_RESOURCES_OPTIONS)
@click.option('--mode',
default=serve_lib.UpdateMode.ROLLING.value,
type=click.Choice([m.value for m in serve_lib.UpdateMode],
case_sensitive=False),
required=False,
help=('Update mode. If "rolling", SkyServe will update the '
'service with rolling update. If "blue_green", SkyServe '
'will update the service with blue-green update. '))
cblmemo marked this conversation as resolved.
Show resolved Hide resolved
@click.option('--yes',
'-y',
is_flag=True,
Expand Down Expand Up @@ -3783,21 +3791,35 @@ def serve_update(
memory: Optional[str],
disk_size: Optional[int],
disk_tier: Optional[str],
mode: str,
yes: bool,
):
"""Update a SkyServe service.

service_yaml must point to a valid YAML file.

SkyServe will reuse old replicas, if only the service section is changed
and no file mounts are specified.
Otherwise, SkyServe will terminate the old replicas and start new replicas.

service_yaml must point to a valid YAML file.
Two update modes are supported:
- "rolling": (default) SkyServe will update the service with rolling update,
i.e., it will terminate one old replica whenever one new replica is
ready. Traffic can be mixed on old and new replicas.
- "blue_green": SkyServe will update the service with blue-green update,
i.e., it will wait for new replicas to be ready and then terminate old
replicas. Traffic will only be switched from old to new replicas after
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
replicas. Traffic will only be switched from old to new replicas after
replicas. Traffic will only be served from old to new replicas after

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It might be more clear with switched since it means we change from the old to new replicas only after the number of replicas is enough.

enough new replicas are ready.
Michaelvll marked this conversation as resolved.
Show resolved Hide resolved

Example:

.. code-block:: bash

# Update an existing service with rolling update
sky serve update sky-service-16aa new_service.yaml
cblmemo marked this conversation as resolved.
Show resolved Hide resolved
# Use blue-green update
sky serve update --mode blue_green sky-service-16aa new_service.yaml

"""
task = _generate_task_with_service(
service_name=service_name,
Expand Down Expand Up @@ -3835,7 +3857,7 @@ def serve_update(
abort=True,
show_default=True)

serve_lib.update(task, service_name)
serve_lib.update(task, service_name, mode=serve_lib.UpdateMode(mode))


@serve.command('status', cls=_DocumentedCodeCommand)
Expand Down
2 changes: 2 additions & 0 deletions sky/serve/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from sky.serve.serve_utils import ServeCodeGen
from sky.serve.serve_utils import ServiceComponent
from sky.serve.serve_utils import SKY_SERVE_CONTROLLER_NAME
from sky.serve.serve_utils import UpdateMode
from sky.serve.service_spec import SkyServiceSpec

os.makedirs(os.path.expanduser(SKYSERVE_METADATA_DIR), exist_ok=True)
Expand All @@ -43,4 +44,5 @@
'tail_logs',
'up',
'update',
'UpdateMode',
]
Loading
Loading