run-house / runhouse

Dispatch and distribute your ML training to "serverless" clusters in Python, like PyTorch for ML infra. Iterable, debuggable, multi-cloud/on-prem, identical across research and production.
https://run.house
Apache License 2.0
971 stars 37 forks source link

Consider adding `-y` option to `runhouse login` CLI command #52

Closed olokobayusuf closed 1 year ago

olokobayusuf commented 1 year ago

Feature

Simple use case is logging in with system command instead of Python API:

!runhouse login [TOKEN]

Currently, the CLI is hardcoded with interactive=True: https://github.com/run-house/runhouse/blob/560a52880a333e17e8a1aca01c1048f4527fc375/runhouse/main.py#L27

Motivation

It's a minor quality of life improvement.

Ideal Solution

See above

Additional context

Excited to get Runhouse integration up on NatML 😄

olokobayusuf commented 1 year ago

Following up on this, I seem to have stumbled upon a bug. The following:

import runhouse as rh

rh.login(token)

Still requires interaction:

Screenshot 2023-04-13 at 11 47 30 AM

Even though runhouse.login uses a default interactive=False: https://github.com/run-house/runhouse/blob/560a52880a333e17e8a1aca01c1048f4527fc375/runhouse/rns/login.py#L17-L25

This prevents me from automatically logging in on e.g. a Dockerfile build.

carolineechen commented 1 year ago

Hi @olokobayusuf, thanks for bringing this up! Opening up a PR now to add --yes/-y support to automatically download/upload configs/secrets (token must be provided for a truly non-interactive flow, otherwise it will still ask for the token).

Regarding your comment, rh.login() additionally takes in various args, so the current behavior is that if those aren't all provided, running the Python code will still interactively request values for those. I get that this doesn't seem very intuitive, so will add a comment/exception to explain this in the code. To get around that, you can manually pass in the values for those args when calling rh.login.

Let me know if this all makes sense, or if you have any other comments/suggestions!