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

modal run -q option does not do what it says #2076

Open
zsiegel92 opened this issue Aug 8, 2024 · 4 comments
Open

modal run -q option does not do what it says #2076

zsiegel92 opened this issue Aug 8, 2024 · 4 comments

Comments

@zsiegel92
Copy link
Contributor

zsiegel92 commented Aug 8, 2024

Hello,

During development, I frequently run Modal applications like this:

@app.local_entrypoint()
def main():
    outputs = some_modal_function.remote()
    import ipdb; ipdb.set_trace()  # fmt: skip # noqa

That starts a debugging shell where the output can be inspected, etc. I have been using pdb and ipdb in this way for many years.

It is necessary to run a script like this with the -q option. That is, modal run -iq script.py is necessary, or else the Modal progress indicators get in the way of the debug shell.

modal run --help shows the following:

  -q, --quiet        Don't show Modal progress indicators.

But actually, modal run -q script.py doesn't just hide the Modal progress indicators, it also redirects all console output that remote functions print to stdout and stderr. To see this output, I have to open a browser tab to modal.com, which I usually have open anyway.

This is a bit annoying, but more importantly it deviates from the CLI's description of that argument. For me, if it honored the CLI description (hide Modal progress indicators but don't hide other output), that would be ideal. I suppose if that's a huge lift you could just edit the CLI description to say "Don't show Modal progress indicators or stdout/stderr from remote containers.", but for me that would not be preferred.

Thanks so much!

@mwaskom
Copy link
Contributor

mwaskom commented Aug 12, 2024

Hi, sorry about the misleading option description here. That said, I think most people would expect a --quiet flag to suppress all output rather than continuing to emit stdout/stderr. Maybe that's wrong -- but it's also the current behavior and might break people were it to change unexpectedly. So I think the action item here is probably to emend the description.

@zsiegel92
Copy link
Contributor Author

Hi, sorry about the misleading option description here. That said, I think most people would expect a --quiet flag to suppress all output rather than continuing to emit stdout/stderr. Maybe that's wrong -- but it's also the current behavior and might break people were it to change unexpectedly. So I think the action item here is probably to emend the description.

Totally makes sense! If you are willing to add another option that only omits the progress bar but still shows stdout/stderr, that would be a killer feature for me. Again, I want the progress bar rarely (since I use pdb/ipdb debugger, which is unusable with progress bar) but I want logs almost always.

If not able to prioritize this I understand! Keep up the amazing work.

@mwaskom
Copy link
Contributor

mwaskom commented Sep 3, 2024

Apparently this is actually a fairly recent regression and -q used to behave more similarly to what you are expecting (showing logs but disabling the information added by the local Modal app). We're looking into a fix (it arose from some complicated refactoring of our output management system so not trivial to revert).

@zsiegel92
Copy link
Contributor Author

@mwaskom thanks for the response! Looking forward to updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants