-
Notifications
You must be signed in to change notification settings - Fork 94
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: command aliases #3896
Comments
Now that we are starting to onboard users the pressure on this one is rapidly rising as users are looking to translate their working patterns to Cylc 8. We now have enough test users running Cylc 8 that we can start polling their opinion on these matters. Working Patterns
Here are what I think are the main components of most working patterns:
I've associated each with a letter for illustrative purposes, any combination of these stages is valid. We only really need to support the main use cases but it might be possible to implement a generic framework to allow any/all combinations if we feel that it would actually help. Rose 2019 Aliases
Here are the combinations provided by Rose 2019 for comparison: 1) rose suite-run --local-install-only
cylc install # yay this is easy now
2) rose suite-run --validate-suite-only
cylc validate # yay this is easy now
3) rose suite-run [--run]
# NOTE: the `vp` bit is not useful any more since play also performs validation)
cylc ivpg
4) rose suite-run --restart
# NOTE: the `vp` bit is not useful any more since play also performs validation)
cylc rvp
5) rose suite-run --reload
cylc ro # was there a validate step in here anywhere?
6) rose suite-run --new
cylc clean; cylc ivpg
7-12) rose stem ...
# The same as 1-6 but with `rose stem` rather than `cylc install`
Possible Cylc 8 AliasesExample combinations to start the debate: # I would expect this to be the most common working pattern
cylc vip
cylc vip[gte] # +ui
# the rose-stem equivalent (validate doesn't make sense for rose stem)
cylc sp
cylc sp[gte] # +ui (tui likely to be a popular choice w/ `rose stem`)
# modified pattern for complex workflows where validation time >> install time
# (is this still a problem, it's been a while since I have tested configuration load times)
cylc ip
cylc ip[gte] # +ui
# validate & install & reload
cylc rvo # easy - but the validate is of no use since the damage has already been done by install
cylc vro # hard - need to read CLI options from the run dir in order to validate the src dir:
# * rose optional config (contains Rose optional config & template vars specified to `cylc install`)
# * workflow DB (contains template vars specified to `cylc play`) OpinionI think the most important aliases to implement are:
To find out for sure we will have to poll users. Naming the AliasesThe letters I've used are illustrative, we could go with them, however, commands such as # this:
cylc validate-install-play
# is barely better than this:
cylc validate; cylc install; cylc play We could follow the Rose pattern and make these things tag-on options to install: $ cylc install --play
$ cylc reinstall --reload But that doesn't cover cases which start with validate and makes passing CLI arguments tricky. We could potentially give aliases a prefix such as Technical HurdlesThe biggest barrier is working out how to handle the CLI options e.g. with |
To add to this, today I have been using the following pattern which also incorporates
... as part of a rapid workflow development cycle. In this case I had no reason to keep old runs once I was done with them so was cleaning as I went to keep things cleaner. I wasn't using |
Proposal
Implement the following commands:
Intermingle the CLI options e.g: # -s goes to validate & play
# --pause goes to play
cylc vip -s ANSWER=42 --pause Attempt to do this in a way which minimises duplication, drop any incompatible arguments. Dump all of the options into a single object and provide it to each of the commands called. Examples: # validate "foo" from "[install]source dirs" then install and play it
$ cylc vip foo
# validate the source of bar/run1 (using CLI options scraped from run dir)
# then reinstall and play/reload it depending on workflow state
cylc vrp "bar/run1"
# install and run the rose stem workflow defined in $PWD
$ cylc sp
$ cylc vip foo --gui # closest approximation of rose suite-run
$ rose sp --gui # closet approximation of rose stem (@ Rose 2019), possibly `cylc sp`, WIP... |
I'm not convinced the benefits are worth the effort and - by some measures at least - extra complexity (even for users, who will likely have to know the base commands and the "alias" commands, and the command option constraints for different aliases).
But if we can't think of equally intuitive alias names, is there much benefit? It's not that hard to type What about just giving users the power to create their own aliases, like git aliases? (If good old shell aliases are insufficient). |
Doesn't really work because of the need to distribute the CLI options e.g. consider: $ cylc validate -s ANSWER=42 --opt-conf-key=foo; cylc install --opt-conf-key=foo; cylc play -s ANSWER=42
To give a vauge idea of required effort:
|
Validate before reinstall is good practise but currently not easy to do (you need to know what install/play options were used) - Another advantage of providing these commands is that we can also provide access to them in the UI - users are going to want this. |
OK, fair points - agreed. |
Or just do some options, and listen
I don't think that we should worry too much about UIs because 2/3 of them are long term open.
Might it be possible to allow both - I have it in my head that it'd be nice if Cylc Reminded people what the contraction was every time they use it. (In my head $ cylc vip
[NOTE] Cylc vip is short for cylc validate-install-play
....
$ cylc validate-install-play
[NOTE] Cylc validate-install-play can be contracted to cylc vip
... |
@hjoliver Are you happy for the Question label to be removed now? |
(I do this too) |
@wxtim I quite like this idea. I know people who use aliases so often (normally their own shell aliases) that they can't communicate with others anymore, in terms of the real command names 🙄 |
To start with we could do something like this (where the cylc validate-install-play
<b>$ cylc validate</b>
WARNING: ...
INFO: ...
valid for ...
<b>$ cylc install</b>
...
<b>$ cylc play</b>
... Long term we could do something more Tui style (e.g. #4778 (comment)) and make it dynamic (i.e. collapse the previous section of output when moving onto the next, excluding warnings of course) and avoid duplicating the warning output from parsing the config twice (i.e. we need config warnings for validate OR play not both). But for the short term something quick and simple. |
Review of possible clashes of CLI args
|
VIP (validate-install-play)
|
VRP/VRA (validate-reinstall-play/reload(apply?))
|
SPSame issues as VIP. |
Is |
Pushing the |
Pushing the |
Finally punting the |
Consider supporting aliases for common command combinations e.g:
For inspiration look at
git
"transactions" e.g:git pull
(git fetch
+git merge
).And
git
"aliases" e.g:git config --global alias.co checkout
Also consider ways of exposing these aliases via the UIS so they can be used in the UI as GraphQL mutations.
The text was updated successfully, but these errors were encountered: