Skip to content
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

clock-triggers: re-implement as xtriggers #5285

Closed
oliver-sanders opened this issue Jan 3, 2023 · 1 comment · Fixed by #5291
Closed

clock-triggers: re-implement as xtriggers #5285

oliver-sanders opened this issue Jan 3, 2023 · 1 comment · Fixed by #5291
Assignees
Milestone

Comments

@oliver-sanders
Copy link
Member

Cylc currently provides two mechanisms for clock-limiting tasks:

  • [xtriggers]wall_clock
    The new approach, the @clock trigger is used in the graph like regular dependencies. This has the advantage of transparency.
  • [special tasks]clock-trigger
    The old approach. marked as deprecated but still widely used. Allows listing of tasks which should be clock-limited.

We will presumably look to retire the old clock-triggers at some point after Cylc 7 back-compat mode is dropped, but this is still a way off. This means we need to keep these triggers working for the near future (which is something else to go wrong #5217).

Suggest converting clock-triggers to xtriggers at configure time. I think we can do this fairly easily at configure time something along the lines of:

# config.py
def convert_clock_triggers(self):
    for string in self.cfg['scheduling']['special tasks']['clock-trigger']:
        task_name, offset  = do_something(string)
        xtrig_name = f'_cylc_clock_trigger_{task_name}'
        self.cfg['scheduling']['xtriggers'][xtrig_name] = f'wall_clock({offset})'
        taskdef = self.taskdefs[task_name]
        taskdef.add_xtrig_label(xtrig_name)

This way the old triggers will continue working under the new logic allowing us to retire this feature early. The old triggers will also become visible in the UI once xtrigger support is added.

Pull requests welcome!

@oliver-sanders oliver-sanders added the question Flag this as a question for the next Cylc project meeting. label Jan 3, 2023
@oliver-sanders oliver-sanders added this to the cylc-8.x milestone Jan 3, 2023
@hjoliver
Copy link
Member

hjoliver commented Jan 3, 2023

Yes, good idea. Seems to me it should work fine.

@oliver-sanders oliver-sanders removed the question Flag this as a question for the next Cylc project meeting. label Jan 4, 2023
@hjoliver hjoliver self-assigned this Jan 6, 2023
@oliver-sanders oliver-sanders modified the milestones: cylc-8.x, cylc-8.2.0 Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants