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

Skip Mode #6039

Merged
merged 60 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
1344836
Implement Skip Mode
wxtim Apr 25, 2024
c34bc64
Suggestions from review.
wxtim Sep 19, 2024
cb73b59
Ensure that platforms for skip and simulation contain default
wxtim Oct 3, 2024
24aef08
Simpler Suggestions from @metronnie
wxtim Oct 16, 2024
3e516a9
* Remove nonlive.py and move it's only function into skip.py
wxtim Oct 16, 2024
d751f0d
Unit tests and improved docs for parse_fail_cycle_points
wxtim Oct 16, 2024
c71ade2
Apply suggestions from code review
wxtim Oct 16, 2024
6582225
fix broken test
wxtim Oct 16, 2024
4165ee4
fix mypy failures
wxtim Oct 16, 2024
2a4b320
restored missing code
wxtim Oct 16, 2024
c407e7c
small ruff fixes
wxtim Oct 16, 2024
67cd776
re-added missing test
wxtim Oct 18, 2024
9333731
Type checking improved.
wxtim Oct 19, 2024
b51ff06
Update cylc/flow/task_outputs.py
wxtim Oct 21, 2024
d051fd1
fix outstanding broken test
wxtim Oct 23, 2024
509db85
undo some overzealous fixes to mypy.
wxtim Oct 23, 2024
31a753a
sort test parameters: Prevents distribution clashes
wxtim Oct 23, 2024
1f39b2c
restore error message on restarting in a different mode
wxtim Oct 23, 2024
7c38690
use Enum correctly in a test
wxtim Oct 23, 2024
0c5e639
Review suggestions
wxtim Oct 31, 2024
2ec57e9
remove un-needed check for itask.run_mode
wxtim Oct 31, 2024
51f6585
restore validate --run-mode
wxtim Oct 31, 2024
40183c3
doc changes
wxtim Oct 31, 2024
f9e8a83
Partially revert changes to `Prerequisite` (#64)
MetRonnie Nov 5, 2024
48c69fb
Apply suggestions from code review
wxtim Nov 12, 2024
6eaab2c
Merge remote-tracking branch 'upstream/master' into feature.skip_mode
wxtim Nov 12, 2024
0cc5b9e
fix merge
wxtim Nov 12, 2024
3f96ce7
remove now not needed taskdef.runmode infor
wxtim Nov 12, 2024
995ab27
Response to review
wxtim Nov 12, 2024
60a75b3
Clear up terminology (#66)
MetRonnie Nov 14, 2024
9855cd3
Response to review
wxtim Nov 15, 2024
f5aa5ea
Skip mode tests (#67)
MetRonnie Nov 15, 2024
91636bf
[skip-ci]try with rename
wxtim Nov 18, 2024
1a4255c
Update cylc/flow/cfgspec/workflow.py
wxtim Nov 19, 2024
10dbd39
Update cylc/flow/cfgspec/workflow.py
wxtim Nov 19, 2024
46f29b7
Fix setting task run mode in Edit Runtime (#65)
MetRonnie Nov 19, 2024
8136da6
check that `cylc set --out skip` doesn't trigger warnings because sk…
wxtim Nov 20, 2024
4a69dc8
@metronnies suggested streamlining of some task pool code.
wxtim Nov 25, 2024
8e60f55
Merge branch 'master' into feature.skip_mode
wxtim Nov 25, 2024
ef8e315
Small tidies
wxtim Nov 25, 2024
a32d20d
Apply suggestions from code review
wxtim Nov 25, 2024
833ebfb
Upped testing of run_modes.__init__ to 100%
wxtim Nov 25, 2024
9690389
Apply suggestions from code review
wxtim Nov 25, 2024
1426d3f
Merge branch 'master' into feature.skip_mode
wxtim Nov 28, 2024
e080927
fix lint fail
wxtim Nov 28, 2024
b31f4ff
Merge 'upstream/master' into skip-mode-deconflict
MetRonnie Nov 28, 2024
82a39b5
Merge pull request #70 from MetRonnie/skip-mode-deconflict
wxtim Nov 28, 2024
8d327a8
rm unecessary else and sort out lint rebase mistake
wxtim Nov 28, 2024
a5a5447
Make `cylc set --pre` & `cylc set --out skip` not override already-sa…
MetRonnie Nov 29, 2024
3504e63
Merge pull request #71 from MetRonnie/prereq
wxtim Nov 29, 2024
f89719d
Suggestions from Hilary
wxtim Dec 2, 2024
644a41c
Update cylc/flow/cfgspec/workflow.py
wxtim Dec 2, 2024
2304d57
record run times for Dummy and Sim mode tasks
wxtim Dec 2, 2024
5a5432a
fix refs
wxtim Dec 2, 2024
4f659de
Update cylc/flow/cfgspec/workflow.py
wxtim Dec 3, 2024
a6c1f94
Update cylc/flow/scheduler_cli.py
wxtim Dec 3, 2024
de13f75
Update cylc/flow/cfgspec/workflow.py
wxtim Dec 3, 2024
30a91ae
Update changes.d/6039.feat.md
wxtim Dec 3, 2024
e7c3f3f
Merge branch 'master' into feature.skip_mode
wxtim Dec 3, 2024
414496c
fix
wxtim Dec 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes.d/6039.feat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added a new task run mode "skip", which allows skipping of tasks in a running workflow as well as creation of dummy tasks as part of workflow design.
wxtim marked this conversation as resolved.
Show resolved Hide resolved
63 changes: 63 additions & 0 deletions cylc/flow/cfgspec/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@
from cylc.flow.platforms import (
fail_if_platform_and_host_conflict, get_platform_deprecated_settings,
is_platform_definition_subshell)
from cylc.flow.run_modes import RunMode
from cylc.flow.task_events_mgr import EventData
from cylc.flow.run_modes import TASK_CONFIG_RUN_MODES


# Regex to check whether a string is a command
REC_COMMAND = re.compile(r'(`|\$\()\s*(.*)\s*([`)])$')
Expand Down Expand Up @@ -1334,6 +1337,28 @@ def get_script_common_text(this: str, example: Optional[str] = None):
"[platforms][<platform name>]submission retry delays"
)
)
Conf(
'run mode', VDR.V_STRING,
options=list(TASK_CONFIG_RUN_MODES),
default=RunMode.LIVE.value,
desc=f'''
When the workflow is running in live mode, run this *task*
in one of the following modes:

``{RunMode.LIVE.value}`` (default):
{RunMode.LIVE.describe()}
``{RunMode.SKIP.value}``:
{RunMode.SKIP.describe()}

wxtim marked this conversation as resolved.
Show resolved Hide resolved

.. seealso::

- :ref:`task-run-modes`
- :cylc:conf:`flow.cylc[runtime][<namespace>][skip]`

.. versionadded:: 8.4.0

''')
with Conf('meta', desc=r'''
Metadata for the task or task family.

Expand Down Expand Up @@ -1406,7 +1431,45 @@ def get_script_common_text(this: str, example: Optional[str] = None):
determine how an event handler responds to task failure
events.
''')
with Conf('skip', desc='''
Task configuration for :ref:`task-run-modes.skip`.

.. seealso::

- :ref:`task-run-modes.skip`
- :cylc:conf:`flow.cylc[runtime][<namespace>]run mode`

.. versionadded:: 8.4.0
'''):
Conf(
'outputs',
VDR.V_STRING_LIST,
desc='''
Outputs to be emitted by a task in skip mode.

* By default, all required outputs will be generated
plus succeeded if success is optional.
* If skip-mode outputs is specified and does not
include either succeeded or failed then succeeded
will be produced.
* The outputs submitted and started are always
produced and do not need to be defined in here.

.. versionadded:: 8.4.0
'''
)
Conf(
'disable task event handlers',
VDR.V_BOOLEAN,
default=True,
desc='''
Task event handlers are turned off by default for
skip mode tasks. Changing this setting to ``False``
will re-enable task event handlers.

.. versionadded:: 8.4.0
'''
)
with Conf('simulation', desc='''
Task configuration for workflow *simulation* and *dummy* run
modes.
Expand Down
6 changes: 2 additions & 4 deletions cylc/flow/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,9 @@
from cylc.flow.log_level import log_level_to_verbosity
from cylc.flow.network.schema import WorkflowStopMode
from cylc.flow.parsec.exceptions import ParsecError
from cylc.flow.run_modes import RunMode
from cylc.flow.task_id import TaskID
from cylc.flow.workflow_status import (
RunMode,
StopMode,
)
from cylc.flow.workflow_status import StopMode


if TYPE_CHECKING:
Expand Down
20 changes: 11 additions & 9 deletions cylc/flow/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
is_relative_to,
)
from cylc.flow.task_qualifiers import ALT_QUALIFIERS
from cylc.flow.simulation import configure_sim_modes
from cylc.flow.run_modes.simulation import configure_sim_mode
from cylc.flow.run_modes.skip import skip_mode_validate
from cylc.flow.subprocctx import SubFuncContext
from cylc.flow.task_events_mgr import (
EventData,
Expand All @@ -98,6 +99,7 @@
get_trigger_completion_variable_maps,
trigger_to_completion_variable,
)
from cylc.flow.run_modes import RunMode
from cylc.flow.task_trigger import TaskTrigger, Dependency
from cylc.flow.taskdef import TaskDef
from cylc.flow.unicode_rules import (
Expand All @@ -113,7 +115,6 @@
WorkflowFiles,
check_deprecation,
)
from cylc.flow.workflow_status import RunMode
from cylc.flow.xtrigger_mgr import XtriggerCollator

if TYPE_CHECKING:
Expand Down Expand Up @@ -512,9 +513,10 @@ def __init__(

self.process_runahead_limit()

run_mode = self.run_mode()
run_mode = RunMode.get(self.options)
if run_mode in {RunMode.SIMULATION, RunMode.DUMMY}:
configure_sim_modes(self.taskdefs.values(), run_mode)
for taskdef in self.taskdefs.values():
configure_sim_mode(taskdef.rtconfig, None, False)

self.configure_workflow_state_polling_tasks()

Expand Down Expand Up @@ -566,6 +568,8 @@ def __init__(

self.mem_log("config.py: end init config")

skip_mode_validate(self.taskdefs)

@staticmethod
def _warn_if_queues_have_implicit_tasks(
config, taskdefs, max_warning_lines
Expand Down Expand Up @@ -1700,10 +1704,6 @@ def process_config_env(self):
]
)

def run_mode(self) -> str:
"""Return the run mode."""
return RunMode.get(self.options)

def _check_task_event_handlers(self):
"""Check custom event handler templates can be expanded.

Expand Down Expand Up @@ -2455,7 +2455,9 @@ def _get_taskdef(self, name: str) -> TaskDef:

# Get the taskdef object for generating the task proxy class
taskd = TaskDef(
name, rtcfg, self.run_mode(), self.start_point,
name,
rtcfg,
self.start_point,
self.initial_point)

# TODO - put all taskd.foo items in a single config dict
Expand Down
1 change: 1 addition & 0 deletions cylc/flow/data_messages.proto
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ message PbRuntime {
optional string environment = 16;
optional string outputs = 17;
optional string completion = 18;
optional string run_mode = 19;
}


Expand Down
100 changes: 50 additions & 50 deletions cylc/flow/data_messages_pb2.py

Large diffs are not rendered by default.

Loading
Loading