Skip to content

Commit

Permalink
Fix modal launch no longer showing progress (#2168)
Browse files Browse the repository at this point in the history
This was a side-effect of #2030, it turned off all the CLI output for modal launch. Actually not bad, since it's cleaner, but it also shuts off image build progress which is not ideal since it just looks like it's frozen to users.
  • Loading branch information
ekzhang authored Aug 30, 2024
1 parent 100b633 commit 4980c2e
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions modal/cli/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from typer import Typer

from .._output import enable_output
from ..app import App
from ..exception import _CliUserExecutionError
from ..runner import run_app
Expand Down Expand Up @@ -35,14 +36,15 @@ def _launch_program(name: str, filename: str, args: Dict[str, Any]) -> None:
# `launch/` scripts must have a `local_entrypoint()` with no args, for simplicity here.
func = entrypoint.info.raw_f
isasync = inspect.iscoroutinefunction(func)
with run_app(app):
try:
if isasync:
asyncio.run(func())
else:
func()
except Exception as exc:
raise _CliUserExecutionError(inspect.getsourcefile(func)) from exc
with enable_output():
with run_app(app):
try:
if isasync:
asyncio.run(func())
else:
func()
except Exception as exc:
raise _CliUserExecutionError(inspect.getsourcefile(func)) from exc


@launch_cli.command(name="jupyter", help="Start Jupyter Lab on Modal.")
Expand Down

0 comments on commit 4980c2e

Please sign in to comment.