diff --git a/cylc/flow/cfgspec/suite.py b/cylc/flow/cfgspec/suite.py index e4a8c75b78f..ad79b1fe728 100644 --- a/cylc/flow/cfgspec/suite.py +++ b/cylc/flow/cfgspec/suite.py @@ -198,15 +198,6 @@ (e.g. ``+05:30``), given that the time zone is used as part of task output filenames. ''') - Conf('disable automatic shutdown', VDR.V_BOOLEAN, desc=''' - This has the same effect as the ``--no-auto-shutdown`` flag for - the suite run commands: it prevents the suite server program from - shutting down normally when all tasks have finished (a suite - timeout can still be used to stop the daemon after a period of - inactivity, however). This option can make it easier to re-trigger - tasks manually near the end of a suite run, during suite - development and debugging. - ''') with Conf('main loop'): with Conf(''): @@ -1369,6 +1360,7 @@ def upg(cfg, descr): u.obsolete('8.0.0', ['cylc', 'abort if any task fails']) u.obsolete('8.0.0', ['cylc', 'events', 'abort if any task fails']) u.obsolete('8.0.0', ['cylc', 'events', 'mail retry delays']) + u.obsolete('8.0.0', ['cylc', 'disable automatic shutdown']) u.deprecate( '8.0.0', ['cylc', 'task event mail interval'], diff --git a/cylc/flow/etc/syntax/cylc.lang b/cylc/flow/etc/syntax/cylc.lang index 5116bbd84eb..a8176e35fa0 100644 --- a/cylc/flow/etc/syntax/cylc.lang +++ b/cylc/flow/etc/syntax/cylc.lang @@ -171,7 +171,6 @@ exclude at start-up exclude env-script - disable automatic shutdown description default node attributes default edge attributes diff --git a/cylc/flow/etc/syntax/cylc.xml b/cylc/flow/etc/syntax/cylc.xml index d8118dd9853..8335eb7babe 100644 --- a/cylc/flow/etc/syntax/cylc.xml +++ b/cylc/flow/etc/syntax/cylc.xml @@ -98,7 +98,6 @@ - diff --git a/cylc/flow/scheduler.py b/cylc/flow/scheduler.py index 9178ec88498..ecf3ccb41d0 100644 --- a/cylc/flow/scheduler.py +++ b/cylc/flow/scheduler.py @@ -178,7 +178,6 @@ class Scheduler: options: Values = None # suite params - can_auto_stop: bool = True stop_mode: StopMode = None stop_task: str = None stop_clock_time: int = None @@ -525,14 +524,6 @@ async def configure(self): if self.options.profile_mode: self.previous_profile_point = 0 self.count = 0 - if self.options.no_auto_shutdown is not None: - self.can_auto_stop = not self.options.no_auto_shutdown - elif ( - self.config.cfg['scheduler']['disable automatic shutdown'] - is not None - ): - self.can_auto_stop = ( - not self.config.cfg['scheduler']['disable automatic shutdown']) self.profiler.log_memory("scheduler.py: end configure") @@ -1179,13 +1170,6 @@ def _load_suite_params(self, row_idx, row): if self.options.holdcp is None: self.options.holdcp = value LOG.info('+ hold point = %s', value) - elif key == self.suite_db_mgr.KEY_NO_AUTO_SHUTDOWN: - value = bool(int(value)) - if self.options.no_auto_shutdown is None: - self.options.no_auto_shutdown = value - LOG.info('+ no auto shutdown = %s', value) - else: - LOG.debug('- no auto shutdown = %s (ignored)', value) elif key == self.suite_db_mgr.KEY_STOP_CLOCK_TIME: value = int(value) if time() <= value: @@ -1738,8 +1722,6 @@ def stop_clock_done(self): def check_auto_shutdown(self): """Check if we should do an automatic shutdown: main pool empty.""" - if not self.can_auto_stop: - return False self.pool.release_runahead_tasks() if self.pool.get_tasks(): return False diff --git a/cylc/flow/scheduler_cli.py b/cylc/flow/scheduler_cli.py index aa29fd7e76d..33aae47dcbb 100644 --- a/cylc/flow/scheduler_cli.py +++ b/cylc/flow/scheduler_cli.py @@ -108,18 +108,6 @@ def get_option_parser(is_restart, add_std_opts=False): help="Do not daemonize the suite (infers --format=plain)", action="store_true", dest="no_detach") - parser.add_option( - "-a", "--no-auto-shutdown", help="Do not shut down" - " the suite automatically when all tasks have finished." - " This flag overrides the corresponding suite config item.", - action="store_true", dest="no_auto_shutdown") - - parser.add_option( - "--auto-shutdown", help="Shut down" - " the suite automatically when all tasks have finished." - " This flag overrides the corresponding suite config item.", - action="store_false", dest="no_auto_shutdown") - parser.add_option( "--profile", help="Output profiling (performance) information", action="store_true", dest="profile_mode") diff --git a/cylc/flow/suite_db_mgr.py b/cylc/flow/suite_db_mgr.py index e88ceac7516..62cf9654115 100644 --- a/cylc/flow/suite_db_mgr.py +++ b/cylc/flow/suite_db_mgr.py @@ -55,7 +55,6 @@ class SuiteDatabaseManager: KEY_UTC_MODE = 'UTC_mode' KEY_HOLD = 'is_held' KEY_HOLD_CYCLE_POINT = 'holdcp' - KEY_NO_AUTO_SHUTDOWN = 'no_auto_shutdown' KEY_RUN_MODE = 'run_mode' KEY_STOP_CLOCK_TIME = 'stop_clock_time' KEY_STOP_TASK = 'stop_task' @@ -316,10 +315,6 @@ def put_suite_params(self, schd): if value is not None: self.db_inserts_map[self.TABLE_SUITE_PARAMS].append({ "key": key, "value": value}) - if schd.options.no_auto_shutdown is not None: - self.db_inserts_map[self.TABLE_SUITE_PARAMS].append({ - "key": self.KEY_NO_AUTO_SHUTDOWN, - "value": int(schd.options.no_auto_shutdown)}) for key in (self.KEY_STOP_CLOCK_TIME, self.KEY_STOP_TASK): value = getattr(schd, key, None) if value is not None: diff --git a/tests/flakyfunctional/events/31-dont-stall-succeeded.t b/tests/flakyfunctional/events/31-dont-stall-succeeded.t deleted file mode 100755 index 225ebba91c1..00000000000 --- a/tests/flakyfunctional/events/31-dont-stall-succeeded.t +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash -# THIS FILE IS PART OF THE CYLC SUITE ENGINE. -# Copyright (C) NIWA & British Crown (Met Office) & Contributors. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -#------------------------------------------------------------------------------- -# Test no stall when task pool has succeeded tasks only. -. "$(dirname "$0")/test_header" -set_test_number 4 - -install_suite "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" -run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" -run_ok "${TEST_NAME_BASE}-run" cylc run "${SUITE_NAME}" -TIMEOUT=$(($(date +%s) + 60)) -while (($(date +%s) < TIMEOUT)) && \ - ! grep -q '\[t1\.1\] .* succeeded' "${SUITE_RUN_DIR}/log/suite/log" -do - sleep 1 -done -grep_ok '\[t1\.1\] .*succeeded' "${SUITE_RUN_DIR}/log/suite/log" - -sleep 5 -cylc stop --max-polls=10 --interval=2 "${SUITE_NAME}" 1>'/dev/null' 2>&1 -run_fail "${TEST_NAME_BASE}-stall" \ - grep -q -F 'WARNING - suite stalled' "${SUITE_RUN_DIR}/log/suite/log" -purge -exit diff --git a/tests/flakyfunctional/events/31-dont-stall-succeeded/flow.cylc b/tests/flakyfunctional/events/31-dont-stall-succeeded/flow.cylc deleted file mode 100644 index 82f05578d6e..00000000000 --- a/tests/flakyfunctional/events/31-dont-stall-succeeded/flow.cylc +++ /dev/null @@ -1,13 +0,0 @@ -#!jinja2 -[scheduler] - disable automatic shutdown = True - [[events]] - abort on stalled = True - abort on inactivity = True - inactivity = PT1M -[scheduling] - [[graph]] - R1=t1 -[runtime] - [[t1]] - script = true diff --git a/tests/flakyfunctional/restart/47-no-auto-stop.t b/tests/flakyfunctional/restart/47-no-auto-stop.t deleted file mode 100644 index 26f47066365..00000000000 --- a/tests/flakyfunctional/restart/47-no-auto-stop.t +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env bash -# THIS FILE IS PART OF THE CYLC SUITE ENGINE. -# Copyright (C) NIWA & British Crown (Met Office) & Contributors. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -#------------------------------------------------------------------------------- -# Test restart with auto shutdown disabled - -. "$(dirname "$0")/test_header" - -dumpdbtables() { - sqlite3 "${SUITE_RUN_DIR}/log/db" \ - 'SELECT * FROM suite_params WHERE key=="no_auto_shutdown";' \ - >'noautoshutdown.out' - sqlite3 "${SUITE_RUN_DIR}/log/db" \ - 'SELECT cycle, name, status FROM task_pool ORDER BY cycle, name;' >'taskpool.out' -} - -set_test_number 8 - -# Event should look like this: -# Start suite with auto shutdown disabled -# At t2.1, stop suite -# Restart, should retain auto shutdown -# Suite runs to final task, then fails on inactivity after 10s -init_suite "${TEST_NAME_BASE}" <<'__FLOW_CONFIG__' -[scheduler] - [[parameters]] - i = 1..10 - [[events]] - abort on stalled = True - abort on inactivity = True - inactivity = PT10S -[scheduling] - [[graph]] - R1 = t => t -[runtime] - [[t]] - script = true - [[t]] - script = cylc stop "${CYLC_SUITE_NAME}" -__FLOW_CONFIG__ - -run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" - -suite_run_ok "${TEST_NAME_BASE}-run" cylc run "${SUITE_NAME}" --no-detach -a -dumpdbtables -cmp_ok 'noautoshutdown.out' <<<"no_auto_shutdown|1" -cmp_ok 'taskpool.out' <<'__OUT__' -1|t_i03|waiting -__OUT__ - -suite_run_fail "${TEST_NAME_BASE}-restart-1" \ - cylc restart "${SUITE_NAME}" --no-detach -dumpdbtables -cmp_ok 'noautoshutdown.out' <<<'no_auto_shutdown|1' -cut -d ' ' -f 4- "${SUITE_RUN_DIR}/log/suite/log" >'log.edited' -contains_ok 'log.edited' <<__LOG__ -+ no auto shutdown = True -Suite shutting down - Abort on suite inactivity is set -__LOG__ -cmp_ok 'taskpool.out' <'/dev/null' - -purge -exit diff --git a/tests/functional/deprecations/01-cylc8-basic/flow.cylc b/tests/functional/deprecations/01-cylc8-basic/flow.cylc index c9462f43410..62c794b4c88 100644 --- a/tests/functional/deprecations/01-cylc8-basic/flow.cylc +++ b/tests/functional/deprecations/01-cylc8-basic/flow.cylc @@ -8,6 +8,7 @@ required run mode = force run mode = task event mail interval = + disable automatic shutdown = [[events]] mail to = mail from = @@ -39,5 +40,3 @@ mail to = mail smtp = mail retry delays = - - diff --git a/tests/functional/deprecations/01-cylc8-basic/validation.stderr b/tests/functional/deprecations/01-cylc8-basic/validation.stderr index 6db7935b4c7..349dc955cc1 100644 --- a/tests/functional/deprecations/01-cylc8-basic/validation.stderr +++ b/tests/functional/deprecations/01-cylc8-basic/validation.stderr @@ -13,6 +13,7 @@ WARNING - * (8.0.0) [cylc][reference test][suite shutdown event handler] - DELE WARNING - * (8.0.0) [runtime][foo, cat, dog][job][shell] - DELETED (OBSOLETE) WARNING - * (8.0.0) [runtime][foo, cat, dog][events][mail retry delays] - DELETED (OBSOLETE) WARNING - * (8.0.0) [cylc][abort if any task fails] - DELETED (OBSOLETE) +WARNING - * (8.0.0) [cylc][disable automatic shutdown] - DELETED (OBSOLETE) WARNING - * (8.0.0) [cylc][task event mail interval] -> [cylc][mail][task event batch interval] - value unchanged WARNING - * (8.0.0) [cylc][events][mail to] -> [cylc][mail][to] - value unchanged WARNING - * (8.0.0) [cylc][events][mail from] -> [cylc][mail][from] - value unchanged diff --git a/tests/functional/restart/48-enable-auto-stop.t b/tests/functional/restart/48-enable-auto-stop.t deleted file mode 100644 index 9a29f794b3d..00000000000 --- a/tests/functional/restart/48-enable-auto-stop.t +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env bash -# THIS FILE IS PART OF THE CYLC SUITE ENGINE. -# Copyright (C) NIWA & British Crown (Met Office) & Contributors. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -#------------------------------------------------------------------------------- -# Test restart with override to reverse no auto shutdown setting in flow.cylc - -. "$(dirname "$0")/test_header" - -dumpdbtables() { - sqlite3 "${SUITE_RUN_DIR}/log/db" \ - 'SELECT * FROM suite_params WHERE key=="no_auto_shutdown";' \ - >'noautoshutdown.out' - sqlite3 "${SUITE_RUN_DIR}/log/db" \ - 'SELECT cycle, name, status FROM task_pool ORDER BY cycle, name;' >'taskpool.out' -} - -set_test_number 8 - -# Event should look like this: -# Suite configured with: disable automatic shutdown = True -# Start suite with auto shutdown enabled -# At t2.1, stop suite -# Restart, should retain auto shutdown enabled option -# Suite runs to final task and shuts down normally -init_suite "${TEST_NAME_BASE}" <<'__FLOW_CONFIG__' -[scheduler] - disable automatic shutdown = True - [[parameters]] - i = 1..5 - [[events]] - abort on stalled = True - abort on inactivity = True - inactivity = PT1M -[scheduling] - [[graph]] - R1 = t => t -[runtime] - [[t]] - script = true - [[t]] - script = cylc stop "${CYLC_SUITE_NAME}" -__FLOW_CONFIG__ - -run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" - -suite_run_ok "${TEST_NAME_BASE}-run" \ - cylc run "${SUITE_NAME}" --no-detach --auto-shutdown -dumpdbtables -cmp_ok 'noautoshutdown.out' <<<"no_auto_shutdown|0" -cmp_ok 'taskpool.out' <<'__OUT__' -1|t_i3|waiting -__OUT__ - -suite_run_ok "${TEST_NAME_BASE}-restart-1" \ - cylc restart "${SUITE_NAME}" --no-detach --debug -dumpdbtables -cmp_ok 'noautoshutdown.out' <<<'no_auto_shutdown|0' -cut -d ' ' -f 4- "${SUITE_RUN_DIR}/log/suite/log" >'log.edited' -contains_ok 'log.edited' <<__LOG__ -+ no auto shutdown = False -__LOG__ -cmp_ok 'taskpool.out' <'/dev/null' - -purge -exit diff --git a/tests/functional/restart/49-enable-auto-stop-2.t b/tests/functional/restart/49-enable-auto-stop-2.t deleted file mode 100644 index 49d6e2ff3c8..00000000000 --- a/tests/functional/restart/49-enable-auto-stop-2.t +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env bash -# THIS FILE IS PART OF THE CYLC SUITE ENGINE. -# Copyright (C) NIWA & British Crown (Met Office) & Contributors. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -#------------------------------------------------------------------------------- -# Test restart with override to reverse original no auto shutdown setting - -. "$(dirname "$0")/test_header" - -dumpdbtables() { - sqlite3 "${SUITE_RUN_DIR}/log/db" \ - 'SELECT * FROM suite_params WHERE key=="no_auto_shutdown";' \ - >'noautoshutdown.out' - sqlite3 "${SUITE_RUN_DIR}/log/db" \ - 'SELECT cycle, name, status FROM task_pool ORDER BY cycle, name;' >'taskpool.out' -} - -set_test_number 8 - -# Event should look like this: -# Start suite with auto shutdown disabled -# At t2.1, stop suite -# Restart with auto shutdown enabled, should override original -# Suite runs to final task and shuts down normally -init_suite "${TEST_NAME_BASE}" <<'__FLOW_CONFIG__' -[scheduler] - [[parameters]] - i = 1..5 - [[events]] - abort on stalled = True - abort on inactivity = True - inactivity = PT1M -[scheduling] - [[graph]] - R1 = t => t -[runtime] - [[t]] - script = true - [[t]] - script = cylc stop "${CYLC_SUITE_NAME}" -__FLOW_CONFIG__ - -run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" - -suite_run_ok "${TEST_NAME_BASE}-run" \ - cylc run "${SUITE_NAME}" --no-detach -a -dumpdbtables -cmp_ok 'noautoshutdown.out' <<<"no_auto_shutdown|1" -cmp_ok 'taskpool.out' <<'__OUT__' -1|t_i3|waiting -__OUT__ - -suite_run_ok "${TEST_NAME_BASE}-restart-1" \ - cylc restart "${SUITE_NAME}" --no-detach --debug --auto-shutdown -dumpdbtables -cmp_ok 'noautoshutdown.out' <<<'no_auto_shutdown|0' -cut -d ' ' -f 4- "${SUITE_RUN_DIR}/log/suite/log" >'log.edited' -contains_ok 'log.edited' <<__LOG__ -- no auto shutdown = True (ignored) -__LOG__ -cmp_ok 'taskpool.out' <'/dev/null' - -purge -exit diff --git a/tests/functional/shutdown/05-auto.t b/tests/functional/shutdown/05-auto.t index 4936d5b3f62..33b91dec0d6 100755 --- a/tests/functional/shutdown/05-auto.t +++ b/tests/functional/shutdown/05-auto.t @@ -17,35 +17,16 @@ #------------------------------------------------------------------------------- # Test auto shutdown after all tasks have finished. . "$(dirname "$0")/test_header" -#------------------------------------------------------------------------------- -set_test_number 6 -#------------------------------------------------------------------------------- + +set_test_number 2 install_suite "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" -#------------------------------------------------------------------------------- + TEST_NAME="${TEST_NAME_BASE}-validate" run_ok "${TEST_NAME}" cylc validate "${SUITE_NAME}" -#------------------------------------------------------------------------------- -# Test that normal auto-shutdown works. + TEST_NAME=${TEST_NAME_BASE}-auto-stop suite_run_ok "${TEST_NAME}" cylc run --debug --no-detach "${SUITE_NAME}" -#------------------------------------------------------------------------------- -# Test that auto-shutdown can be disabled (CLI) -TEST_NAME=${TEST_NAME_BASE}-no-autostop-ping -cylc run --no-auto-shutdown "${SUITE_NAME}" -sleep 15 -run_ok "${TEST_NAME}" cylc ping "${SUITE_NAME}" -#------------------------------------------------------------------------------- -TEST_NAME=${TEST_NAME_BASE}-stop -run_ok "${TEST_NAME}" cylc stop --max-polls=10 --interval=2 "${SUITE_NAME}" -#------------------------------------------------------------------------------- -# Test that auto-shutdown can be disabled (flow.cylc) -export SUITE_DISABLE_AUTO_SHUTDOWN=true -TEST_NAME=${TEST_NAME_BASE}-no-autostop-ping-2 -cylc run "${SUITE_NAME}" -sleep 15 -run_ok "${TEST_NAME}" cylc ping "${SUITE_NAME}" -#------------------------------------------------------------------------------- -TEST_NAME=${TEST_NAME_BASE}-stop-2 -run_ok "${TEST_NAME}" cylc stop --max-polls=10 --interval=2 "${SUITE_NAME}" -#------------------------------------------------------------------------------- + +poll_suite_stopped + purge diff --git a/tests/functional/shutdown/05-auto/flow.cylc b/tests/functional/shutdown/05-auto/flow.cylc index a0e8af60a1a..fd173019851 100644 --- a/tests/functional/shutdown/05-auto/flow.cylc +++ b/tests/functional/shutdown/05-auto/flow.cylc @@ -1,7 +1,6 @@ #!Jinja2 [scheduler] - disable automatic shutdown = {{environ['SUITE_DISABLE_AUTO_SHUTDOWN'] | default(false)}} [[events]] timeout = PT2M abort on timeout = true diff --git a/tests/integration/test_examples.py b/tests/integration/test_examples.py index bf577fd8fb0..9ec5c94abb5 100644 --- a/tests/integration/test_examples.py +++ b/tests/integration/test_examples.py @@ -204,8 +204,8 @@ async def myflow(mod_flow, mod_scheduler, mod_one_conf): def test_module_one(myflow): - # Ensure can_auto_stop defaults to True - assert myflow.can_auto_stop is True + # Ensure a particular scheduler property defaults to False + assert myflow.is_restart is False def test_module_two(myflow):