-
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
cylc vip #5121
cylc vip #5121
Conversation
fc088e7
to
9e821ec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is running smoothly for me with basic examples. I will test passing various options and re-review. A couple of comments so far.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There a quite a few of these kicking about, worth running through the lot to make sure.
FYI: PyPa / flake8 / black now agree that operators should proceed statements rather than follow e.g:
# do this
foo = (
1
+ 2
- 3
+ 4
)
# not this
foo = (
1 +
2 -
3 +
4
)
- Reads better.
- Better association of operators.
- Safer to add/remove lines.
- Super obvious when an operator is missing.
For the same reason I prefer preceding whitespace:
foo = (
'Lorel'
' ipsum'
' dolor.'
'\nSid'
' amet'
' apising'
' ellet!'
)
Which makes it really easy to spot missing whitespace in text like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Next lot of small comments from me.
The text version of what your highlighting? Not the operator example? (I found plenty of the former, but none of the latter (I also found a string which had become accidentally truncated)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is working well for me. A couple of small comments...
When cylc vip
is not given any arguments, we get traceback with a TypeError, rather than the standard cylc: error: Wrong number of arguments (too few)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I seem to be hitting a missing positional argument issue?
$ cylc vip
Traceback (most recent call last):
File "~/mambaforge/envs/cylc.dev/bin/cylc", line 33, in <module>
sys.exit(load_entry_point('cylc-flow', 'console_scripts', 'cylc')())
File "/net~/cylc-flow/cylc/flow/scripts/cylc.py", line 657, in main
execute_cmd(command, *cmd_args)
File "/net~/cylc-flow/cylc/flow/scripts/cylc.py", line 284, in execute_cmd
entry_point.resolve()(*args)
File "/net~/cylc-flow/cylc/flow/terminal.py", line 229, in wrapper
wrapped_function(*wrapped_args, **wrapped_kwargs)
TypeError: main() missing 1 required positional argument: 'workflow_id'
a23a00c
to
ba5cd5e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The OptionSettings
approach is looking much cleaner / more intuitive for people adding new args 👍.
I think the kwarg constants (e.g. APPEND
, HELP
& DEST
) can be removed now?
icp_option = Option( | ||
*ICP_OPTION.args, **ICP_OPTION.kwargs) # type: ignore[arg-type] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI you can provide args as kwargs and vice versa:
>>> def foo(a, b=2):
... print(a, b)
...
>>> foo(1, b=3)
1 3
>>> foo(1, 3)
1 3
>>> foo(a=1, b=3)
1 3
>>> foo(b=3, a=1)
1 3
So you could potentially absorb the positional args into the kwargs for simplicity.
Testing going well so far. I've spotted one oddity in the logged command: $ cylc vip generic --workflow-name foo --no-run-name
$ cylc validate ~/cylc-src/generic
Valid for cylc-8.1.0.dev
$ cylc install .
INSTALLED foo from ~/cylc-src/generic
$ cylc play foo The logged output says |
The install part of vip seems to be skipping the previous-run check. If I install the workflow directly... $ cylc install generic --workflow-name foo
INSTALLED foo/run3 from ~/cylc-src/generic
NOTE: 2 runs of "foo" are already active:
▶ foo/run1 vld601.cmpd1.metoffice.gov.uk:43118
▶ foo/run2 vld601.cmpd1.metoffice.gov.uk:43002
You can stop them all with:
cylc stop 'foo/*'
See "cylc stop --help" for options. ... any previous runs are listed. Whereas $ cylc vip generic --workflow-name foo
$ cylc validate ~/cylc-src/generic
Valid for cylc-8.1.0.dev
$ cylc install .
INSTALLED foo/run2 from ~/cylc-src/generic
$ cylc play foo
▪ ■ Cylc Workflow Engine 8.1.0.dev
██ Copyright (C) 2008-2022 NIWA
▝▘ & British Crown (Met Office) & Contributors
INFO - Extracting job.sh to ~/cylc-run/foo/run2/.service/etc/job.sh
foo/run2: vld601.cmpd1.metoffice.gov.uk PID=128496 This also means the Should try to get the previous-run-scanning working in |
I think this is straightforward - I was looking at that code yesterday. |
|
All looking good to me, will finish off tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small flake8 fix needed. I have checked this branch out and have been working with it for a while.
I have read the code and run the tests locally, I have run a bunch of manual tests, no problems from me found. I'm happy to approve once CI passing.
Co-authored-by: Melanie Hall <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've double checked the remote re-invocation is working correctly. Thanks @wxtim, great change, super handy one to have in!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorted 🚀!
I especially love how fast this is compared to rose suite-ruin
!
cp -r "${TEST_SOURCE_DIR}/${TEST_NAME_BASE}/flow.cylc" . | ||
cp -r "${TEST_SOURCE_DIR}/${TEST_NAME_BASE}/reference.log" . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cp -r "${TEST_SOURCE_DIR}/${TEST_NAME_BASE}/flow.cylc" . | |
cp -r "${TEST_SOURCE_DIR}/${TEST_NAME_BASE}/reference.log" . | |
cp "${TEST_SOURCE_DIR}/${TEST_NAME_BASE}/flow.cylc" . | |
cp "${TEST_SOURCE_DIR}/${TEST_NAME_BASE}/reference.log" . |
@@ -10,7 +10,7 @@ def main(): | |||
os.path.join(os.getenv("CYLC_WORKFLOW_RUN_DIR"), "log", "db")) | |||
lockf(handle, LOCK_SH) | |||
call([ | |||
"cylc", "task", "message", "I have locked the public database file"]) | |||
"cylc", "task-message", "I have locked the public database file"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"cylc", "task-message", "I have locked the public database file"]) | |
"cylc", "message", "I have locked the public database file"]) |
@@ -11,7 +11,7 @@ def main(): | |||
os.path.join(os.getenv("CYLC_WORKFLOW_RUN_DIR"), "log", "db")) | |||
lockf(handle, LOCK_SH) | |||
call([ | |||
"cylc", "task", "message", "I have locked the public database file"]) | |||
"cylc", "task-message", "I have locked the public database file"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"cylc", "task-message", "I have locked the public database file"]) | |
"cylc", "message", "I have locked the public database file"]) |
Replaces #5094
#3896 - Implements the validate install play (VIP) working practice. I think that it works in principle for the other working practices.
Check List
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
andconda-environment.yml
.CHANGES.md
entry included if this is a change that can affect users