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

[CLI] Improve interactive node configurability #123

Merged
merged 12 commits into from
Dec 29, 2021

Conversation

gmittal
Copy link
Collaborator

@gmittal gmittal commented Dec 23, 2021

This should really be sky up ARGS and then sky gpunode/sky tpunode/sky cpunode are just aliases with single node defaults.

prototype/sky/cli.py Outdated Show resolved Hide resolved
prototype/sky/cli.py Show resolved Hide resolved
help='If true, attach using screen.')
def gpunode(cluster: str, port_forward: Optional[List[int]], screen):
@_interactive_node_cli_command
def gpunode(cluster: str, port_forward: Optional[List[int]],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Lots of shared code between the XYZ nodes. Good to abstract them out?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I took a second look and it seems reasonable inlined as is (the defaults for each command are different after all). Did you have specific blocks in mind that should get their own function?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes like move all the checking of tmux and screen into its own function.

prototype/sky/cli.py Outdated Show resolved Hide resolved
@concretevitamin
Copy link
Member

What's the thinking on specifying the common case -- requesting some GPUs -- with minimal typing? Current:

    num_accelerators_option = click.option(
        '--num-accelerators',
        '-n',
        default=None,
        type=int,
        help='Number of accelerators (GPU/TPU) to use.')
    accelerator_type_option = click.option('--accelerator-type',
                                           '-g',
                                           default=None,
                                           type=str,
                                           help='Accelerator type to use.')

seems a bit verbose. Have you thought about parsing them out from a single flag, something like sky gpunode [--gpus=V100] [--gpus=V100:8].

@gmittal gmittal force-pushed the user/gmittal/interactive-node-config branch from 2a8e6d7 to adb9283 Compare December 28, 2021 05:45
@gmittal gmittal changed the title Improve interactive node configurability [CLI] Improve interactive node configurability Dec 28, 2021
prototype/sky/cli.py Outdated Show resolved Hide resolved
prototype/sky/cli.py Outdated Show resolved Hide resolved
prototype/sky/cli.py Outdated Show resolved Hide resolved
commands += ['screen', '-D', '-R']
if screen_manager == 'tmux':
commands += ['tmux']
Copy link
Member

Choose a reason for hiding this comment

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

Probably want options to re-attach back. tmux a only works when tmux is created, so needs something else.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

sg

prototype/sky/cli.py Outdated Show resolved Hide resolved
prototype/sky/cli.py Outdated Show resolved Hide resolved
prototype/sky/cli.py Outdated Show resolved Hide resolved
prototype/sky/cli.py Outdated Show resolved Hide resolved
name = cluster
if name is None:
name = _default_interactive_node_name('cpunode')

cloud_provider = task_lib.CLOUD_REGISTRY.get(cloud, sky.AWS())
Copy link
Member

Choose a reason for hiding this comment

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

Does it make sense to use cloud.upper()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think it really saves much here since we still need to check if cloud is None and raise a click.UsageError if cloud not in ['aws', 'gcp', 'azure'].

Copy link
Member

@concretevitamin concretevitamin left a comment

Choose a reason for hiding this comment

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

Awesome!

prototype/sky/cli.py Outdated Show resolved Hide resolved
prototype/sky/cli.py Show resolved Hide resolved
@gmittal gmittal merged commit fa3ab26 into master Dec 29, 2021
@gmittal gmittal deleted the user/gmittal/interactive-node-config branch December 29, 2021 09:39
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

Successfully merging this pull request may close these issues.

4 participants