Skip to content

Commit

Permalink
try again
Browse files Browse the repository at this point in the history
Signed-off-by: Gene Su <e870252314@gmail.com>
  • Loading branch information
GeneDer committed Feb 19, 2024
1 parent cb75726 commit 6aff081
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions python/ray/serve/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import pathlib
import re
import sys
import time
import traceback
from dataclasses import asdict
from typing import Any, Dict, List, Optional, Tuple
Expand Down Expand Up @@ -591,7 +590,9 @@ def run(
client.deploy_apps(config, _blocking=False)
cli_logger.success("Submitted deploy config successfully.")
else:
serve.run(app, name=name, route_prefix=route_prefix)
# This should not block if reload is true so the watchfiles can be triggered
should_block = blocking and not reload
serve.run(app, blocking=should_block, name=name, route_prefix=route_prefix)
cli_logger.success("Deployed app successfully.")

if reload:
Expand All @@ -618,14 +619,11 @@ def run(
app = _private_api.call_app_builder_with_args_if_necessary(
import_attr(import_path, reload_module=True), args_dict
)
serve.run(app, name=name, route_prefix=route_prefix)
serve.run(
target=app, blocking=True, name=name, route_prefix=route_prefix
)
cli_logger.success("Redeployed app successfully.")

if blocking:
while True:
# Block, letting Ray print logs to the terminal.
time.sleep(10)

except KeyboardInterrupt:
cli_logger.info("Got KeyboardInterrupt, shutting down...")
serve.shutdown()
Expand Down

0 comments on commit 6aff081

Please sign in to comment.