-
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
Make cylc remove
flow-aware and extend to historical tasks
#6370
base: master
Are you sure you want to change the base?
Conversation
3b5fab1
to
ef5ea12
Compare
cylc remove
: make flow aware and extend to historical taskscylc remove
flow-aware and extend to historical tasks
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.
Code looks good!
ef5ea12
to
4f3aabe
Compare
This comment was marked as resolved.
This comment was marked as resolved.
4f3aabe
to
b6b3cc0
Compare
This comment was marked as outdated.
This comment was marked as outdated.
Have been trying this out for sub-graph re-run use cases. The remove functionality is all working correctly 👍, I am able to re-run sub-graphs cleanly without using new flows 🚀. I have encountered some hitches (not related to this PR, all for consideration in follow-on work):
|
5c362a0
to
40045e3
Compare
fb49bcf
to
8f72cb4
Compare
What's the status on these TODO items from the OP:
|
Will either come in a follow-up PR or this one depending on how soon @hjoliver reviews this |
await run_cmd(remove_tasks(schd, ['1/a1'], [FLOW_ALL])) | ||
await schd.update_data_structure() | ||
|
||
assert a1 not in schd.pool.get_tasks() # removed from pool |
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 the comments would be easier to read the line above the assert statements.
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
- Read the code and tests
- Tried to break it manually.
`json.dumps()`/`json.loads()` are relatively slow (~1us). But these functions are likely to be called many times with `flow={1}`.
97f09c7
to
f6a7d29
Compare
This comment was marked as resolved.
This comment was marked as resolved.
(Edited) I've updated the OP |
…tasks in the given flow(s)
- Update data store with changed prereqs - Don't un-queue downstream task if: - the task is already preparing - the task exists in flows other than that being removed - the task's prereqs are still satisfied overall - Remove the downstream task from the pool if it no longer has any satisfied prerequisite tasks
f6a7d29
to
39be53f
Compare
Partially addresses #5643
Summary
This mostly implements the "Cylc Remove Extension" proposal.
Flow numbers
cylc remove
now has a--flow
option for removing a task from specific flows.If not used, it will remove the task from all flows that it belongs to.
If the removed task is active/waiting, if it is removed from a subset of flows that it belongs to, it will remain in the task pool; if it is removed from all flows that it belongs to, it will be removed from the task pool (as is the current behaviour).
If a task is removed from all flows that it belongs to, it will become a no-flow task (
flow=None
).For ease of reviewing, you can use my UI branch that displays flow numbers: https://github.com/MetRonnie/cylc-ui/tree/flow-nums 1.
Historical tasks
cylc remove
now can remove tasks that are no longer active, making it look like they never ran. It does this by removing the task from the specified flows in the database (in thetask_states
andtask_outputs
tables)2, and un-setting any prerequisites of active tasks that the removed task had naturally satisfied3. If a task is removed from all flows that it belongs to, a no-flow task is left in the DB for provenance.The above also applies to active/waiting tasks that
cylc remove
is used on.What's left to do
When removing an active task from all its flows, kill the task.
Should probably add a functional test with the
--flow
option.Need to check this one:
Check List
CONTRIBUTING.md
and added my name as a Code Contributor.?.?.x
branch.Footnotes
Waiting tasks that are not yet in the pool have greyed out flow numbers at the moment. ↩
If removing flows would result in two rows in the DB no longer being unique, the SQLite
UPDATE OR REPLACE
statement is used, so the first entry will be removed and the most recent entry will remain. ↩Prerequisites manually satisfied by
cylc set --pre
are not affected bycylc remove
. ↩