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

moved execution and submission items from [task][job] to [task] #3480

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
42 changes: 17 additions & 25 deletions cylc/flow/cfgspec/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
# where:
# - value_type: value type (compulsory).
# - default: the default value (optional).
# - allowed_2, ...: the only other allowed values of this setting (optional).
SPEC = {
'meta': {
'description': [VDR.V_STRING, ''],
Expand Down Expand Up @@ -149,6 +148,9 @@
},
'runtime': {
'__MANY__': {
'execution polling intervals': [VDR.V_INTERVAL_LIST, None],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've attempted to put these items in alphabetical order. Given the level of alphabetism in the previous version this was tricky.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked up "alphabetism", learned something new! http://www.glottopedia.org/index.php/Alphabetism (albeit not how you intended it, I guess).

'execution retry delays': [VDR.V_INTERVAL_LIST, None],
'execution time limit': [VDR.V_INTERVAL],
'platform': [VDR.V_STRING],
'inherit': [VDR.V_STRING_LIST],
'init-script': [VDR.V_STRING],
Expand All @@ -157,6 +159,8 @@
'exit-script': [VDR.V_STRING],
'pre-script': [VDR.V_STRING],
'script': [VDR.V_STRING],
'submission polling intervals': [VDR.V_INTERVAL_LIST, None],
'submission retry delays': [VDR.V_INTERVAL_LIST, None],
'post-script': [VDR.V_STRING],
'extra log files': [VDR.V_STRING_LIST],
'work sub-directory': [VDR.V_STRING],
Expand All @@ -181,13 +185,6 @@
'job': {
'batch system': [VDR.V_STRING, 'background'],
'batch submit command template': [VDR.V_STRING],
# TODO All the remaining items to be moved to top level of TASK
# When platforms work is completed.
'execution polling intervals': [VDR.V_INTERVAL_LIST, None],
'execution retry delays': [VDR.V_INTERVAL_LIST, None],
'execution time limit': [VDR.V_INTERVAL],
'submission polling intervals': [VDR.V_INTERVAL_LIST, None],
'submission retry delays': [VDR.V_INTERVAL_LIST, None],
},
'remote': {
'host': [VDR.V_STRING],
Expand All @@ -208,7 +205,6 @@
'mail smtp': [VDR.V_STRING],
'mail to': [VDR.V_STRING],
'submission timeout': [VDR.V_INTERVAL],

'expired handler': [VDR.V_STRING_LIST, None],
'late offset': [VDR.V_INTERVAL, None],
'late handler': [VDR.V_STRING_LIST, None],
Expand Down Expand Up @@ -305,22 +301,18 @@ def upg(cfg, descr):
['cylc', 'abort if any task fails'],
['cylc', 'events', 'abort if any task fails'])
u.obsolete('8.0.0', ['runtime', '__MANY__', 'job', 'shell'])
# TODO uncomment these deprecations when ready - see todo in
# [runtime][__MANY__] section.
# for job_setting in [
# 'execution polling intervals',
# 'execution retry delays',
# 'execution time limit',
# 'submission polling intervals',
# 'submission retry delays'
# ]:
# u.deprecate(
# '8.0.0',
# ['runtime', '__MANY__', 'job', job_setting],
# ['runtime', '__MANY__', job_setting]
# )
# TODO - there are some simple changes to the config (items from [remote]
# and [job] moved up 1 level for example) which should be upgraded here.
for job_setting in [
'execution polling intervals',
'execution retry delays',
'execution time limit',
'submission polling intervals',
'submission retry delays'
]:
u.deprecate(
'8.0.0',
['runtime', '__MANY__', 'job', job_setting],
['runtime', '__MANY__', job_setting]
)
u.upgrade()

# Upgrader cannot do this type of move.
Expand Down
4 changes: 2 additions & 2 deletions cylc/flow/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,7 @@ def configure_sim_modes(self):
for tdef in self.taskdefs.values():
# Compute simulated run time by scaling the execution limit.
rtc = tdef.rtconfig
limit = rtc['job']['execution time limit']
limit = rtc['execution time limit']
speedup = rtc['simulation']['speedup factor']
if limit and speedup:
sleep_sec = (DurationParser().parse(
Expand All @@ -1234,7 +1234,7 @@ def configure_sim_modes(self):
sleep_sec = DurationParser().parse(
str(rtc['simulation']['default run length'])
).get_seconds()
rtc['job']['execution time limit'] = (
rtc['execution time limit'] = (
sleep_sec + DurationParser().parse(str(
rtc['simulation']['time limit buffer'])).get_seconds()
)
Expand Down
4 changes: 2 additions & 2 deletions cylc/flow/task_job_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ def _set_retry_timers(itask, rtconfig=None):
for key, cfg_key in [
(TASK_STATUS_SUBMIT_RETRYING, 'submission retry delays'),
(TASK_STATUS_RETRYING, 'execution retry delays')]:
delays = rtconfig['job'][cfg_key]
delays = rtconfig[cfg_key]
if delays is None:
delays = []
try:
Expand Down Expand Up @@ -860,7 +860,7 @@ def _prep_submit_task_job_impl(self, suite, itask, rtconfig):
batch_sys_conf = {}
try:
itask.summary[self.KEY_EXECUTE_TIME_LIMIT] = float(
rtconfig['job']['execution time limit'])
rtconfig['execution time limit'])
except TypeError:
pass

Expand Down
3 changes: 1 addition & 2 deletions flakytests/database/01-broadcast/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ t1:submit => recover-t1
[runtime]
[[t1]]
script=test -n "${HELLO}"
[[[job]]]
execution retry delays=PT10M # prevent task failure
execution retry delays=PT10M # prevent task failure
[[[environment]]]
HELLO=
[[recover-t1]]
Expand Down
3 changes: 1 addition & 2 deletions flakytests/database/02-retry/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@
[runtime]
[[t1]]
script=test "${CYLC_TASK_SUBMIT_NUMBER}" -gt 2
[[[job]]]
execution retry delays=2*PT0S
execution retry delays=2*PT0S
6 changes: 2 additions & 4 deletions flakytests/events/01-task/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ do
done
cylc task message -p WARNING 'this is a user-defined warning message'
"""
[[[job]]]
execution retry delays = PT3S
execution retry delays = PT3S
[[[events]]]
succeeded handler = {{ HANDLER }}
warning handler = {{ HANDLER }}
Expand All @@ -53,11 +52,10 @@ cylc task message -p WARNING 'this is a user-defined warning message'

[[bar]]
# submission retry and submission failed
submission retry delays = PT3S
[[[events]]]
submission failed handler = {{ HANDLER }}
submission retry handler = {{ HANDLER }}
[[[job]]]
submission retry delays = PT3S
[[[remote]]]
host = NOHOST.NODOMAIN

Expand Down
5 changes: 2 additions & 3 deletions flakytests/execution-time-limit/04-poll/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,5 @@ __STATUS__
fi
exit
"""
[[[job]]]
execution time limit = PT10S
execution retry delays = PT0S
execution time limit = PT10S
execution retry delays = PT0S
3 changes: 1 addition & 2 deletions flakytests/hold-release/14-hold-kill/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@
sleep 120
fi
"""
[[[job]]]
execution retry delays = PT1S
execution retry delays = PT1S
3 changes: 1 addition & 2 deletions tests/cylc-edit/00-basic/include/suite-runtime.rc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[runtime]
[[foo, bar]]
script=true
[[[job]]]
execution retry delays = 0.1
execution retry delays = 0.1
Loading