-
Notifications
You must be signed in to change notification settings - Fork 93
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
Optional outputs extension #6046
Optional outputs extension #6046
Conversation
That is very cool 🎖️
Good call. |
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.
Completed a first pass through the non-test code - it looks really good.
$ cylc show ...
output completion: incomplete
x | succeeded The output completion formatting here could easily be misinterpreted as saying the incomplete condition is "output x OR succeeded", especially as Maybe change to "vector cross product" and "dotted fence" - see side PR oliver-sanders#68 |
Had a good play with this today, nice. |
ece0379
to
05e6f82
Compare
Tests now mostly there. |
abf2708
to
6420012
Compare
Tests are all passing locally, but these two are kicking up a fuss on CI for as yet undetermined reasons:
[edit] Still a mystery, but got it fixed, it's something to do with newlines in greps, ensure multiline patterns end in a newline and it seems to work. |
6420012
to
4f00913
Compare
4f00913
to
2b07c20
Compare
@MetRonnie Don't we only use this label when we change a config rather than add one? I'm not sure what the point of the "config change" label is? Why do we have it? |
I think originally to keep track of all the config changes from 7 to 8, I see no reason not to continue using it |
Example discussed in person:
validates without an error. But if you add
|
|
Ronnie's example isn't being caught at present because I'll try and get Ronnies example to fail validation and address the review comments, we're running another training session at the moment so might take a couple of days... |
4257a4f
to
f7d65ff
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.
Recent changes looks good.
How easy would it be to tolerate present-tense versions of the task state outputs (success
, fail
etc.)?
In completion expressions? Possible, but we would need to run regex substitutions on each completion expression as we load it in the config, this would be sufficient:
Does make more sense to use the past tense in the completion expression though. Could potentially use validation to provide a more helpful error message for these cases? |
Seeing as we support the present tense elsewhere and it is always shorter to type, I see value in supporting it here |
I don't think that we should support the alternative names here, this muddies the water, makes expressions harder to validate and/or more expensive to evaluate. The expression will be reported (ala logs, |
23567bc
to
a88733a
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.
I think it's well explained in the reference docs now. Can't think of any more functional examples to test out
``succeeded or (failed and my_error)`` | ||
The task can fail, but only if it also yields the custom | ||
output ``my_error``. |
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 output could be either my_error
or my-error
couldn't it?
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.
Yes.
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.
- been through the code again, looks great
- tested the hell out of it, works great
Nice work 👍
Actually, after a bit more testing: This fails validation with [scheduling]
[[graph]]
R1 = "foo:x => bar"
[runtime]
[[foo]]
[[bar]] But this validates and runs without stalling, even though [scheduling]
[[graph]]
R1 = "foo:x"
[runtime]
[[foo]]
[[bar]] If I define the output (but don't generate it at run time), then it validates and stalls 👍 |
Sorry Oliver, I came back again post-approval and found a couple of very minor issues. This is as good as done though, brilliant! To get the coverage up a few percent, see also a side PR with some additional integration tests, for a handful of missed error conditions: |
Added some integration tests.
77593a5
to
7247838
Compare
To get this show on the road, I deconflicted the branch and pushed several small commits for my trivial and uncontroversial review suggestions. Two tweaks to the CI environment were needed too. See Element chat. Will merge if tests pass. |
Summary
Note
As the result of recent terminology wrangling, the term "incomplete task" has now been dropped. I have not gone through the cylc-flow codebase to strip these references out (that's a separate task), but I have tried to avoid introducing any new references on this PR.
Approach
The approach taken on this PR is to replace the current logic for evaluating task output completion with a single expression that returns True/False.
Implicit (i.e. derived) Expressions
This expression is automatically determined from the use of optional outputs in the graph.
Take the following workflow for example.
The derived completion expressions are exposed in the config, so we can inspect the derived completion expressions with
cylc config
:By default tasks must succeed. If failure, expiry or submission failure are permitted, these are added onto the end of the expression with an
or
operator.The derived expressions should all match current behaviour with the exception of the handling of the expired state, which may now lead to incomplete outputs and potentially awkward edge cases with no required outputs which may not have been properly handled before.
Explicit (i.e. user-provided) expressions
The completion expression can be overridden for a task. If a completion expression is provided, then it must be logically consistent with the use of optional outputs in the graph.
E.G. Here the outputs
a:x
,a:y
anda:z
are marked as required in the graph:However, they are optional in the completion expression (because the completion expression can be satisfied without
a:x
we can deduce thata:x
is optional), so this will result in an error:To fix the error, change either the completion expression or the graph to match, e.g:
Compatibility Mode
Completion expressions are also used for compatibility mode, however, the logic remains as previously implemented:
Visibility
Derived completion expressions are added to the config to make them visible via
cylc config
.Completion expressions have also been added to the Protobuf and GraphQL schemas so they can be queried from the CLI, GUI and Tui.
I've built a simple text based reporting thinggy to help expose to users why a task's outputs are or aren't complete, here's how it looks in the logs:
And here's how it looks in cylc-show:
(note, switched from
+
/-
to✓
/x
as some folks have been confused by-
for some reason)So the completion expression status is visible in the workflow logs (for final tasks with incomplete outputs), on the CLI (via
cylc show
) and in the Tui (via theshow
context option). This will become exposed in the GUI via the "Metadata View".Check List
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
(andconda-environment.yml
if present).CHANGES.md
entry included if this is a change that can affect users?.?.x
branch.