Repository navigation
services: validate-reinstall - #746
Conversation
| args: Dict[str, Any], | ||
| workflows_mgr: 'WorkflowsManager', | ||
| log: 'Logger', | ||
| ) -> List[Union[bool, str]]: |
There was a problem hiding this comment.
Changed from list[bool | str] to tuple[bool, str] as this is safer for the way we are trying to use it (('msg', False) would have been acceptable before).
| try: | ||
| ret_code = proc.wait(timeout=timeout) | ||
| except TimeoutExpired as exc: | ||
| proc.kill() | ||
| ret_code = 124 # mimic `timeout` command error code | ||
| # NOTE: preserve any stderr that the command produced this | ||
| # far as this may help with debugging | ||
| out, err = proc.communicate() | ||
| err = str(exc) + (('\n' + err) if err else '') |
There was a problem hiding this comment.
So, it turns out this timeout logic was bunk. You have to actually .kill() to process if you want it to stop.
https://docs.python.org/3/library/subprocess.html#subprocess.Popen.communicate
Additionally, this will now log the command's stderr which might be useful in the event of a timeout.
|
|
||
| if command == 'clean': # noqa: SIM116 | ||
| return await Services.clean( | ||
| self.workflows_mgr, |
There was a problem hiding this comment.
Switched arg order for consistency.
|
FYI: style tests will fail until #748 |
wxtim
left a comment
There was a problem hiding this comment.
- Read Code
- Tried in practice.
n.b. I think that VR should be on the shortened list of commands, but that's a Cylc UI change
There'll be a cylc-ui and cylc-doc counterpart. |
f8f0f51 to
f6a6e5e
Compare
|
@wxtim, since last review:
|
* The `reload` mutation isn't the most helpful command post `cylc install`. * Swap it out in the workflow command shortlist for the [newly added](cylc/cylc-uiserver#746) `validateReinstall` mutation which has wider scope.
|
(drafting whilst I look at how hard it will be to combine ALL play and reload opts) |
oliver-sanders
left a comment
There was a problem hiding this comment.
This is now the "full" solution which should support all relevant usages/args.
Reviewers, please give attention to the newly-added arguments to ensure they are working as intended:
https://github.com/cylc/cylc-uiserver/pull/746/changes#r2833158708
| Set the Cylc version that the workflow starts with. | ||
| ''') | ||
| ) | ||
| # cylc-rose |
There was a problem hiding this comment.
Cylc-rose arguments (all new):
- opt_conf_key
- clear_rose_install_options
- define
- rose_template_variable
| ''') | ||
| resolver = partial(mutator, command='validate_reinstall') | ||
|
|
||
| class Arguments(Reinstall.Arguments, Reload.Arguments): |
There was a problem hiding this comment.
Reload arguments (all new):
- reload_global
* The `reload` mutation isn't the most helpful command post `cylc install`. * Swap it out in the workflow command shortlist for the [newly added](cylc/cylc-uiserver#746) `validateReinstall` mutation which has wider scope.
MetRonnie
left a comment
There was a problem hiding this comment.
I tried adding opt conf keys in the command form but they were not passed to the cylc reinstall command
|
|
(tests should pass now) |
MetRonnie
left a comment
There was a problem hiding this comment.
Still have the duplicated cylc version option (#746 (comment)) but otherwise I think this is all good
* Closes cylc#526 * Add basic support for the `cylc vr` command.
* We were applying a timeout to the `Popen.wait` method, however, this doesn't actually kill the process (as one might expect) when the timeout elapses, it just stops waiting for it?!
* Provide full coverage for the `cylc vr` command. * Separate the command into two GraphQL mutations: * [validate-]reinstall-reload. * [validate-]reinstall-restart.
* The `reload` mutation isn't the most helpful command post `cylc install`. * Swap it out in the workflow command shortlist for the [newly added](cylc/cylc-uiserver#746) `validateReinstall` mutation which has wider scope.
Closes #526
I somehow forgot that we have
cylc vrsupport in the Tui, but not the GUI!Trivial to add support. Supporting the
cylc installcommand is also possible, however, that will require #512.UI sibling: cylc/cylc-ui#2347
Check List
CONTRIBUTING.mdand added my name as a Code Contributor.setup.cfg(andconda-environment.ymlif present).?.?.xbranch.