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

Improve CLI for Workflow #41

Open
sgoldenCS opened this issue Jul 17, 2024 · 1 comment
Open

Improve CLI for Workflow #41

sgoldenCS opened this issue Jul 17, 2024 · 1 comment
Assignees

Comments

@sgoldenCS
Copy link
Contributor

Currently, our drivers usually use argparse (or worse, nothing at all) to parse input arguments. This works ok, but requires explicit definitions for every configurable argument and can get quite messy. Even when set up well, using argparse to set up environments and configurations requires very long commands.

My suggestion is we build CLI tools using something like Click or Typer (python modules for CLI) that allow for loading an "environment" of sorts that can be modified with further commands. I think it would work well with the DAG runtime that I built a while ago.

An example I could see would be something like:

workflow load <workflow "environment">
workflow config set_file
workflow config view
workflow config set <key> <value>
workflow modules list     # lists modules used by current workflow
# or alternatively 
# workflow config update <file to pull updates from>
workflow run ifarm

Of course, you could run multiple configuration set up commands, the set or update commands could ask for confirmation of a change (e.g. "You are changing from to . Do you want to continue?") which could be avoided with a -y command (like pip installs). The run command could include extra add-ons like ifarm or polaris that would call special scripts to properly allocate GPUs/Nodes/etc on the respective machines.

These behaviors are somewhat inspired from using things like the git and docker CLI systems which use sub-commands to access just a portion of the system.

Unfortunately, I don't have any projects that I can do this work for at the moment, so it may end up languishing here for a while. Just wanted to make sure the idea was captured in writing somewhere.

@sgoldenCS sgoldenCS self-assigned this Jul 17, 2024
@sgoldenCS
Copy link
Contributor Author

Just wanted to add the websites for Click and Typer if people are curious. Click seems to be the faster, lighter one, but Typer has some nice autocomplete things that might be worth it for us.

Click: https://click.palletsprojects.com/en/8.1.x/
Typer: https://typer.tiangolo.com/

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

1 participant