cylc-flow-8.6.4/ 0000775 0001750 0001750 00000000000 15202510312 013603 5 ustar alastair alastair cylc-flow-8.6.4/setup.cfg 0000664 0001750 0001750 00000017162 15202510242 015435 0 ustar alastair alastair # THIS FILE IS PART OF THE CYLC WORKFLOW 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 .
[metadata]
name = cylc-flow
version = attr: cylc.flow.__version__
author = Hilary Oliver
url=https://cylc.org/
description = A workflow engine for cycling systems
long_description=file: README.md
long_description_content_type=text/markdown
project_urls =
Documentation = https://cylc.github.io/cylc-doc/stable/html/index.html
Source = https://github.com/cylc/cylc-flow
Tracker = https://github.com/cylc/cylc-flow/issues
keywords =
cycling-workflows
hpc
job-scheduler
metascheduler
workflow-automation
workflow-engine
workflow-management
scheduling
license = GPL
license_file = COPYING
platforms = any
classifiers =
Environment :: Console
Environment :: Web Environment
Intended Audience :: Developers
Intended Audience :: System Administrators
Intended Audience :: Science/Research
License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Operating System :: POSIX :: Linux
Programming Language :: Python
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: Implementation :: CPython
Topic :: Scientific/Engineering :: Atmospheric Science
[options]
packages = find_namespace:
include_package_data = True
python_requires = >=3.12
install_requires =
ansimarkup>=1.0.0
colorama>=0.4,<1
graphql-core>=3.2,<3.3
graphene>=3.4.0,<3.5
# Note: can't pin jinja2 any higher than this until we give up on Cylc 7 back-compat
jinja2==3.0.*
metomi-isodatetime>=1!3.0.0,<1!3.2.0
# Constrain protobuf version for compatible Scheduler-UIS comms across hosts
packaging
protobuf>=5,<8
psutil>=5.6.0
pyzmq>=22
# NOTE: exclude two urwid versions that were not compatible with Tui
urwid>=2.2,!=2.6.2,!=2.6.3,<4
[options.packages.find]
include = cylc*
[options.extras_require]
graph =
pillow
main_loop-log_data_store =
pympler
matplotlib
main_loop-log_main_loop =
matplotlib
main_loop-log_memory =
pympler
matplotlib
main_loop-log_db =
sqlparse
report-timings =
pandas==1.*
matplotlib
tests =
aiosmtpd
async_generator
bandit>=1.7.0
coverage>=7.9.0
flake8-broken-line>=0.3.0
flake8-bugbear>=21.0.0
flake8-builtins>=1.5.0
flake8-comprehensions>=3.5.0
flake8-debugger>=4.0.0
flake8-implicit-str-concat>=0.4
flake8-mutable>=1.2.0
flake8-simplify>=0.14.0; python_version<"3.14"
flake8-type-checking
flake8>=3.0.0
mypy>=0.910
# https://github.com/pytest-dev/pytest-asyncio/issues/706
pytest-asyncio>=0.21.2,!=0.23.*
pytest-cov>=2.8.0
pytest-xdist>=2
pytest-mock>=3.7
pytest>=6
testfixtures>=6.11.0
towncrier>=24.7.0
# Type annotation stubs
# http://mypy-lang.blogspot.com/2021/05/the-upcoming-switch-to-modular-typeshed.html
types-Jinja2>=0.1.3
types-protobuf>=0.1.10,!=5.29.1.20250402
tutorials =
h5py
requests
all =
%(graph)s
%(main_loop-log_data_store)s
%(main_loop-log_db)s
%(main_loop-log_main_loop)s
%(main_loop-log_memory)s
%(tests)s
%(tutorials)s
[options.entry_points]
# top level shell commands
console_scripts =
clyc = cylc.flow.scripts.cylc:main
cylc = cylc.flow.scripts.cylc:main
# cylc subcommands
cylc.command =
broadcast = cylc.flow.scripts.broadcast:main
cat-log = cylc.flow.scripts.cat_log:main
check-versions = cylc.flow.scripts.check_versions:main
clean = cylc.flow.scripts.clean:main
client = cylc.flow.scripts.client:main
completion-server = cylc.flow.scripts.completion_server:main
config = cylc.flow.scripts.config:main
cycle-point = cylc.flow.scripts.cycle_point:main
diff = cylc.flow.scripts.diff:main
dump = cylc.flow.scripts.dump:main
ext-trigger = cylc.flow.scripts.ext_trigger:main
get-resources = cylc.flow.scripts.get_resources:main
function-run = cylc.flow.scripts.function_run:main
get-workflow-contact = cylc.flow.scripts.get_workflow_contact:main
get-workflow-version = cylc.flow.scripts.get_workflow_version:main
graph = cylc.flow.scripts.graph:main
hold = cylc.flow.scripts.hold:main
install = cylc.flow.scripts.install:main
jobs-kill = cylc.flow.scripts.jobs_kill:main
jobs-poll = cylc.flow.scripts.jobs_poll:main
jobs-submit = cylc.flow.scripts.jobs_submit:main
kill = cylc.flow.scripts.kill:main
lint = cylc.flow.scripts.lint:main
list = cylc.flow.scripts.list:main
message = cylc.flow.scripts.message:main
pause = cylc.flow.scripts.pause:main
ping = cylc.flow.scripts.ping:main
play = cylc.flow.scripts.play:main
poll = cylc.flow.scripts.poll:main
psutils = cylc.flow.scripts.psutil:main
reinstall = cylc.flow.scripts.reinstall:main
release = cylc.flow.scripts.release:main
reload = cylc.flow.scripts.reload:main
remote-init = cylc.flow.scripts.remote_init:main
remote-tidy = cylc.flow.scripts.remote_tidy:main
remove = cylc.flow.scripts.remove:main
report-timings = cylc.flow.scripts.report_timings:main [report-timings]
scan = cylc.flow.scripts.scan:cli
show = cylc.flow.scripts.show:main
set = cylc.flow.scripts.set:main
stop = cylc.flow.scripts.stop:main
subscribe = cylc.flow.scripts.subscribe:main
verbosity = cylc.flow.scripts.verbosity:main
workflow-state = cylc.flow.scripts.workflow_state:main
tui = cylc.flow.scripts.tui:main
trigger = cylc.flow.scripts.trigger:main
validate = cylc.flow.scripts.validate:main
view = cylc.flow.scripts.view:main
vip = cylc.flow.scripts.validate_install_play:main
vr = cylc.flow.scripts.validate_reinstall:main
# async functions to run within the scheduler main loop
cylc.main_loop =
health_check = cylc.flow.main_loop.health_check
auto_restart = cylc.flow.main_loop.auto_restart
log_data_store = cylc.flow.main_loop.log_data_store [main_loop-log_data_store]
log_db = cylc.flow.main_loop.log_db [main_loop-log_db]
log_main_loop = cylc.flow.main_loop.log_main_loop [main_loop-log_main_loop]
log_memory = cylc.flow.main_loop.log_memory [main_loop-log_memory]
reset_bad_hosts = cylc.flow.main_loop.reset_bad_hosts
# NOTE: all entry points should be listed here even if Cylc Flow does not
# provide any implementations, to make entry point scraping easier
cylc.pre_configure =
cylc.post_install =
log_vc_info = cylc.flow.install_plugins.log_vc_info:main
# NOTE: Built-in xtrigger modules
# - must contain a function (the xtrigger) with the same name as the module
# - and may contain a "validate" function to check arguments
cylc.xtriggers =
echo = cylc.flow.xtriggers.echo
wall_clock = cylc.flow.xtriggers.wall_clock
workflow_state = cylc.flow.xtriggers.workflow_state
suite_state = cylc.flow.xtriggers.suite_state
xrandom = cylc.flow.xtriggers.xrandom
[bdist_rpm]
requires =
python3-colorama
python-isodatetime
python3-jinja2
python3-MarkupSafe
python3-zmq
cylc-flow-8.6.4/tests/ 0000775 0001750 0001750 00000000000 15202510242 014747 5 ustar alastair alastair cylc-flow-8.6.4/tests/functional/ 0000775 0001750 0001750 00000000000 15202510242 017111 5 ustar alastair alastair cylc-flow-8.6.4/tests/functional/include-files/ 0000775 0001750 0001750 00000000000 15202510242 021634 5 ustar alastair alastair cylc-flow-8.6.4/tests/functional/include-files/workflow/ 0000775 0001750 0001750 00000000000 15202510242 023506 5 ustar alastair alastair cylc-flow-8.6.4/tests/functional/include-files/workflow/scheduling.cylc 0000664 0001750 0001750 00000000217 15202510242 026507 0 ustar alastair alastair [scheduling]
initial cycle point = 20130101T00
final cycle point = 20130101T00
[[graph]]
R1 = foo => bar
T00 = bar
cylc-flow-8.6.4/tests/functional/include-files/workflow/ref-inlined.cylc 0000664 0001750 0001750 00000000456 15202510242 026563 0 ustar alastair alastair [meta]
title = "A test with nested include-files"
[scheduler]
allow implicit tasks = True
[scheduling]
initial cycle point = 20130101T00
final cycle point = 20130101T00
[[graph]]
R1 = foo => bar
T00 = bar
[runtime]
[[root]]
script = "echo Hello World"
cylc-flow-8.6.4/tests/functional/include-files/workflow/body.cylc 0000664 0001750 0001750 00000000057 15202510242 025321 0 ustar alastair alastair %include scheduling.cylc
%include runtime.cylc
cylc-flow-8.6.4/tests/functional/include-files/workflow/runtime.cylc 0000664 0001750 0001750 00000000073 15202510242 026045 0 ustar alastair alastair [runtime]
[[root]]
script = "echo Hello World"
cylc-flow-8.6.4/tests/functional/include-files/workflow/flow.cylc 0000664 0001750 0001750 00000000167 15202510242 025335 0 ustar alastair alastair [meta]
title = "A test with nested include-files"
[scheduler]
allow implicit tasks = True
%include body.cylc
cylc-flow-8.6.4/tests/functional/include-files/test_header 0000777 0001750 0001750 00000000000 15202510242 030151 2../lib/bash/test_header ustar alastair alastair cylc-flow-8.6.4/tests/functional/include-files/00-basic.t 0000664 0001750 0001750 00000003626 15202510242 023326 0 ustar alastair alastair #!/usr/bin/env bash
# THIS FILE IS PART OF THE CYLC WORKFLOW 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 include-file inlining
. "$(dirname "$0")/test_header"
#-------------------------------------------------------------------------------
set_test_number 3
#-------------------------------------------------------------------------------
install_workflow "${TEST_NAME_BASE}" workflow
#-------------------------------------------------------------------------------
TEST_NAME="${TEST_NAME_BASE}-validate"
# test raw workflow validates
run_ok "${TEST_NAME}.1" cylc validate "${WORKFLOW_NAME}"
# test workflow validates as inlined during editing
mkdir inlined
cylc view --inline "${WORKFLOW_NAME}" > inlined/flow.cylc
run_ok "${TEST_NAME}.2" cylc validate ./inlined
#-------------------------------------------------------------------------------
# compare inlined workflow def with reference copy
TEST_NAME=${TEST_NAME_BASE}-compare
cmp_ok inlined/flow.cylc "${TEST_SOURCE_DIR}/workflow/ref-inlined.cylc"
rm -rf inlined
#-------------------------------------------------------------------------------
purge
#-------------------------------------------------------------------------------
cylc-flow-8.6.4/tests/functional/remote/ 0000775 0001750 0001750 00000000000 15202510242 020404 5 ustar alastair alastair cylc-flow-8.6.4/tests/functional/remote/05-remote-init.t 0000664 0001750 0001750 00000004123 15202510242 023247 0 ustar alastair alastair #!/usr/bin/env bash
# THIS FILE IS PART OF THE CYLC WORKFLOW 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 remote initialisation - when remote init fails for an install target,
# check other platforms with same install target can be initialised.
export REQUIRE_PLATFORM='loc:remote fs:indep comms:tcp'
. "$(dirname "$0")/test_header"
#-------------------------------------------------------------------------------
set_test_number 5
create_test_global_config "" "
[platforms]
[[belle]]
hosts = ${CYLC_TEST_HOST}
install target = ${CYLC_TEST_INSTALL_TARGET}
ssh command = garbage
"
#-------------------------------------------------------------------------------
install_workflow
run_ok "${TEST_NAME_BASE}-validate" cylc validate "${WORKFLOW_NAME}"
workflow_run_fail "${TEST_NAME_BASE}-run" \
cylc play --debug --no-detach "${WORKFLOW_NAME}"
NAME='select-task-jobs.out'
DB_FILE="${WORKFLOW_RUN_DIR}/log/db"
sqlite3 "${DB_FILE}" \
'SELECT name, submit_status, run_status, platform_name
FROM task_jobs ORDER BY name' \
>"${NAME}"
cmp_ok "${NAME}" <<__SELECT__
a|1||belle
b|1||belle
e|0|0|${CYLC_TEST_PLATFORM}
f|0|0|${CYLC_TEST_PLATFORM}
g|0|0|localhost
__SELECT__
grep_ok "ERROR - Incomplete tasks:" "${TEST_NAME_BASE}-run.stderr"
grep_ok "1/a did not complete the required outputs" "${TEST_NAME_BASE}-run.stderr"
purge
exit
cylc-flow-8.6.4/tests/functional/remote/01-file-install.t 0000664 0001750 0001750 00000006772 15202510242 023406 0 ustar alastair alastair #!/usr/bin/env bash
# THIS FILE IS PART OF THE CYLC WORKFLOW 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 file installation to remote platforms
export REQUIRE_PLATFORM='loc:remote comms:?(tcp|ssh)'
. "$(dirname "$0")/test_header"
set_test_number 6
create_files () {
# dump some files into the run dir
for DIR in "bin" "ana" "app" "etc" "lib" "dir1" "dir2" "etc/share" "share"
do
mkdir -p "${WORKFLOW_RUN_DIR}/${DIR}"
touch "${WORKFLOW_RUN_DIR}/${DIR}/moo"
done
for FILE in "file1" "file2"
do
touch "${WORKFLOW_RUN_DIR}/${FILE}"
done
}
# Test configured files/directories along with default files/directories
# (ana, app, bin, etc, lib) are correctly installed on the remote platform.
TEST_NAME="${TEST_NAME_BASE}-default-paths"
init_workflow "${TEST_NAME}" <<__FLOW_CONFIG__
[scheduling]
[[graph]]
R1 = foo
[runtime]
[[foo]]
platform = $CYLC_TEST_PLATFORM
__FLOW_CONFIG__
RUN_DIR_REL="${WORKFLOW_RUN_DIR#"${HOME}"/}"
create_files
# run the flow
run_ok "${TEST_NAME}-validate" cylc validate "${WORKFLOW_NAME}" \
-s "CYLC_TEST_PLATFORM='${CYLC_TEST_PLATFORM}'"
workflow_run_ok "${TEST_NAME}-run1" cylc play "${WORKFLOW_NAME}" \
--no-detach \
-s "CYLC_TEST_PLATFORM='${CYLC_TEST_PLATFORM}'"
# ensure these files get installed on the remote platform
SSH="$(cylc config -d -i "[platforms][$CYLC_TEST_PLATFORM]ssh command")"
${SSH} "${CYLC_TEST_HOST}" \
find "${RUN_DIR_REL}/"{ana,app,bin,etc,lib} -type f | sort > 'find.out'
cmp_ok 'find.out' <<__OUT__
${RUN_DIR_REL}/ana/moo
${RUN_DIR_REL}/app/moo
${RUN_DIR_REL}/bin/moo
${RUN_DIR_REL}/etc/moo
${RUN_DIR_REL}/etc/share/moo
${RUN_DIR_REL}/lib/moo
__OUT__
purge
# -----------------------------------------------------------------------------
# Test the [scheduler]install configuration
TEST_NAME="${TEST_NAME_BASE}-configured-paths"
init_workflow "${TEST_NAME}" <<__FLOW_CONFIG__
[scheduler]
install = dir1/, dir2/, file1, file2
[scheduling]
[[graph]]
R1 = foo
[runtime]
[[foo]]
platform = $CYLC_TEST_PLATFORM
__FLOW_CONFIG__
RUN_DIR_REL="${WORKFLOW_RUN_DIR#"${HOME}"/}"
create_files
run_ok "${TEST_NAME}-validate" cylc validate "${WORKFLOW_NAME}" \
-s "CYLC_TEST_PLATFORM='${CYLC_TEST_PLATFORM}'"
workflow_run_ok "${TEST_NAME}-run2" cylc play "${WORKFLOW_NAME}" \
--no-detach \
-s "CYLC_TEST_PLATFORM='${CYLC_TEST_PLATFORM}'"
${SSH} "${CYLC_TEST_HOST}" \
find "${RUN_DIR_REL}/"{ana,app,bin,dir1,dir2,file1,file2,etc,lib} -type f | sort > 'find.out'
cmp_ok 'find.out' <<__OUT__
${RUN_DIR_REL}/ana/moo
${RUN_DIR_REL}/app/moo
${RUN_DIR_REL}/bin/moo
${RUN_DIR_REL}/dir1/moo
${RUN_DIR_REL}/dir2/moo
${RUN_DIR_REL}/etc/moo
${RUN_DIR_REL}/etc/share/moo
${RUN_DIR_REL}/file1
${RUN_DIR_REL}/file2
${RUN_DIR_REL}/lib/moo
__OUT__
purge
exit
cylc-flow-8.6.4/tests/functional/remote/basic/ 0000775 0001750 0001750 00000000000 15202510242 021465 5 ustar alastair alastair cylc-flow-8.6.4/tests/functional/remote/basic/reference.log 0000664 0001750 0001750 00000000070 15202510242 024123 0 ustar alastair alastair Initial point: 1
Final point: 1
1/foo -triggered off []
cylc-flow-8.6.4/tests/functional/remote/basic/flow.cylc 0000664 0001750 0001750 00000000327 15202510242 023312 0 ustar alastair alastair #!Jinja2
[scheduler]
[[events]]
stall timeout = PT0S
[scheduling]
[[graph]]
R1 = foo
[runtime]
[[foo]]
script = hostname -f
platform = {{ environ['CYLC_TEST_PLATFORM'] }}
cylc-flow-8.6.4/tests/functional/remote/03-polled-task-started/ 0000775 0001750 0001750 00000000000 15202510242 024507 5 ustar alastair alastair cylc-flow-8.6.4/tests/functional/remote/03-polled-task-started/reference.log 0000664 0001750 0001750 00000000243 15202510242 027147 0 ustar alastair alastair 1/picard -triggered off []
1/worf -triggered off ['1/picard']
1/riker -triggered off ['1/picard']
1/janeway -triggered off []
1/tuvok -triggered off ['1/janeway']
cylc-flow-8.6.4/tests/functional/remote/03-polled-task-started/flow.cylc 0000664 0001750 0001750 00000001570 15202510242 026335 0 ustar alastair alastair #!Jinja2
[scheduler]
allow implicit tasks = True
[[events]]
expected task failures = 1/janeway
[scheduling]
cycling mode = integer
[[graph]]
R1 = """
picard:start => worf
picard => riker
janeway:start => tuvok
janeway:fail => !janeway # Makes test workflow shut down without a fuss
"""
[runtime]
[[root]]
platform = {{ environ['CYLC_TEST_PLATFORM'] }}
[[picard, janeway]]
# Longer polling so that they finish before the first poll is done
submission polling intervals = PT10S
execution polling intervals = PT10S
[[picard]]
script = true
[[[events]]]
started handlers = echo "THERE ARE FOUR LIGHTS"
[[janeway]]
script = false
[[[events]]]
started handlers = echo "THERE'S COFFEE IN THAT NEBULA"
cylc-flow-8.6.4/tests/functional/remote/03-polled-task-started.t 0000664 0001750 0001750 00000003206 15202510242 024675 0 ustar alastair alastair #!/bin/bash
# THIS FILE IS PART OF THE CYLC WORKFLOW 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 that a quickly finishing task's `:start` trigger does not get missed
# when using polling to get remote task status.
export REQUIRE_PLATFORM='loc:remote comms:poll'
. "$(dirname "$0")/test_header"
set_test_number 4
install_workflow
run_ok "${TEST_NAME_BASE}-validate" cylc validate "$WORKFLOW_NAME"
workflow_run_ok "${TEST_NAME_BASE}-run" cylc play --reference-test --no-detach "$WORKFLOW_NAME"
# Check 'started' event handlers ran
PICARD_ACTIVITY_LOG="${WORKFLOW_RUN_DIR}/log/job/1/picard/01/job-activity.log"
grep_ok "[(('event-handler-00', 'started'), 1) out] THERE ARE FOUR LIGHTS" "$PICARD_ACTIVITY_LOG" -F
JANEWAY_ACTIVITY_LOG="${WORKFLOW_RUN_DIR}/log/job/1/janeway/01/job-activity.log"
grep_ok "[(('event-handler-00', 'started'), 1) out] THERE'S COFFEE IN THAT NEBULA" "$JANEWAY_ACTIVITY_LOG" -F
purge
exit
cylc-flow-8.6.4/tests/functional/remote/05-remote-init/ 0000775 0001750 0001750 00000000000 15202510242 023062 5 ustar alastair alastair cylc-flow-8.6.4/tests/functional/remote/05-remote-init/flow.cylc 0000664 0001750 0001750 00000002056 15202510242 024710 0 ustar alastair alastair #!Jinja2
[scheduler]
[[events]]
abort on stall timeout = true
stall timeout = PT0S
abort on inactivity timeout = true
[scheduling]
[[graph]]
R1 = """
a & b & g
# a & b setup to submit-fail, g (localhost) does not require remote init
b:submitted? => c
b:start => d
# c & d should not be triggered
b:submit-fail? => e & f
# e and f on a same install target but with a different platform name - these should execute
"""
[runtime]
[[task]]
script="sleep 1; echo hello"
[[a]]
inherit = task
platform = belle
[[b]]
inherit = task
platform = belle
[[c]]
inherit = task
platform = belle
[[d]]
inherit=task
platform = belle
[[e]]
inherit=task
# ariel
platform = {{ environ['CYLC_TEST_PLATFORM'] }}
[[f]]
inherit=task
# ariel
platform = {{ environ['CYLC_TEST_PLATFORM'] }}
[[g]]
inherit=task
platform = localhost
cylc-flow-8.6.4/tests/functional/remote/07-slow-file-install.t 0000664 0001750 0001750 00000003312 15202510242 024361 0 ustar alastair alastair #!/usr/bin/env bash
# THIS FILE IS PART OF THE CYLC WORKFLOW 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 file install completes before dependent tasks are executed
export REQUIRE_PLATFORM='loc:remote comms:?(tcp|ssh)'
. "$(dirname "$0")/test_header"
set_test_number 2
create_test_global_config "" "
[platforms]
[[${CYLC_TEST_PLATFORM}]]
rsync command = my-rsync.sh
"
TEST_NAME="${TEST_NAME_BASE}-installation-timing"
install_workflow "${TEST_NAME}" "${TEST_NAME_BASE}"
for DIR in "dir1" "dir2"; do
mkdir -p "${WORKFLOW_RUN_DIR}/${DIR}"
echo "hello" > "${WORKFLOW_RUN_DIR}/${DIR}/moo"
done
run_ok "${TEST_NAME}-validate" cylc validate "${WORKFLOW_NAME}"
export PATH="${WORKFLOW_RUN_DIR}/bin:$PATH"
# shellcheck disable=SC2029
ssh -n "${CYLC_TEST_HOST}" "mkdir -p 'cylc-run/${WORKFLOW_NAME}/'"
rsync -a 'bin' "${CYLC_TEST_HOST}:cylc-run/${WORKFLOW_NAME}/"
workflow_run_ok "${TEST_NAME}-run" \
cylc play --debug --no-detach "${WORKFLOW_NAME}"
purge
exit
cylc-flow-8.6.4/tests/functional/remote/09-restart-running-file-install.t 0000664 0001750 0001750 00000005655 15202510242 026555 0 ustar alastair alastair #!/usr/bin/env bash
# THIS FILE IS PART OF THE CYLC WORKFLOW 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 remote init, file install and task messaging works for running tasks
# The test works as follows:
# - Starts workflow off with a remote starter task which will not complete
# until restarted. It greps for updated file which will be remote installed on
# restart.
# - On start of this starter task, update the file that is included in
# remote file install for starter task.
# - Stop the workflow - this will leave starter task orphaned
# - Restart, starter task should remote install, authentication keys will be
# updated which is verified by checking task messaging works (checks for
# "(received)succeeded" in the logs).
export REQUIRE_PLATFORM='loc:remote fs:indep comms:?(tcp|ssh)'
. "$(dirname "$0")/test_header"
set_test_number 6
init_workflow "${TEST_NAME_BASE}" <<'__FLOW_CONFIG__'
[scheduler]
install = changing-file
[[events]]
abort on inactivity timeout = True
inactivity timeout = PT1M
[scheduling]
[[graph]]
R1 = """
starter:start => file-changer => stopper
"""
[runtime]
[[starter]]
platform = ${CYLC_TEST_PLATFORM}
script = """
while ! grep 'Restart Play' "${CYLC_WORKFLOW_RUN_DIR}/changing-file"; do
sleep 1
done
"""
[[stopper]]
script = cylc stop --now "${CYLC_WORKFLOW_ID}"
[[file-changer]]
script = echo Restart Play > ${CYLC_WORKFLOW_RUN_DIR}/changing-file
__FLOW_CONFIG__
echo "First Play" > "${WORKFLOW_RUN_DIR}/changing-file"
run_ok "${TEST_NAME_BASE}-validate" cylc validate "${WORKFLOW_NAME}"
workflow_run_ok "${TEST_NAME_BASE}-start" \
cylc play --debug --no-detach "${WORKFLOW_NAME}"
workflow_run_ok "${TEST_NAME_BASE}-restart" \
cylc play --debug --no-detach "${WORKFLOW_NAME}"
LOG="${WORKFLOW_RUN_DIR}/log/scheduler/log"
grep_ok "remote file install complete" "${LOG}"
grep_ok "\[1/starter/01:running\] (received)succeeded" "${LOG}"
ls "${WORKFLOW_RUN_DIR}/log/remote-install" > 'ls.out'
cmp_ok ls.out <<__RLOGS__
01-start-${CYLC_TEST_INSTALL_TARGET}.log
02-restart-${CYLC_TEST_INSTALL_TARGET}.log
__RLOGS__
purge
exit
cylc-flow-8.6.4/tests/functional/remote/04-symlink-dirs/ 0000775 0001750 0001750 00000000000 15202510242 023252 5 ustar alastair alastair cylc-flow-8.6.4/tests/functional/remote/04-symlink-dirs/flow.cylc 0000664 0001750 0001750 00000000305 15202510242 025073 0 ustar alastair alastair #!jinja2
[scheduler]
allow implicit tasks = True
[scheduling]
[[graph]]
R1 = holder => held
[runtime]
[[holder]]
script = true
platform = {{CYLC_TEST_PLATFORM}}
cylc-flow-8.6.4/tests/functional/remote/test_header 0000777 0001750 0001750 00000000000 15202510242 026721 2../lib/bash/test_header ustar alastair alastair cylc-flow-8.6.4/tests/functional/remote/02-install-target.t 0000664 0001750 0001750 00000003314 15202510242 023743 0 ustar alastair alastair #!/usr/bin/env bash
# THIS FILE IS PART OF THE CYLC WORKFLOW 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 remote installation only happens when appropriate
export REQUIRE_PLATFORM='loc:remote fs:shared comms:?(tcp|ssh)'
. "$(dirname "$0")/test_header"
set_test_number 3
init_workflow "${TEST_NAME_BASE}" <<'__FLOW_CONFIG__'
#!jinja2
[scheduling]
[[graph]]
graph = remote
[runtime]
[[remote]]
# this should not require remote-init because the platform
# has a shared filesystem (same install target)
script = true
platform = {{CYLC_TEST_PLATFORM}}
__FLOW_CONFIG__
run_ok "${TEST_NAME_BASE}-validate" cylc validate "${WORKFLOW_NAME}" \
-s "CYLC_TEST_PLATFORM='${CYLC_TEST_PLATFORM}'"
workflow_run_ok "${TEST_NAME_BASE}-run" cylc play --debug \
--no-detach \
"${WORKFLOW_NAME}" -s "CYLC_TEST_PLATFORM='${CYLC_TEST_PLATFORM}'"
grep_ok "REMOTE INIT NOT REQUIRED for localhost" "${WORKFLOW_RUN_DIR}/log/scheduler/log"
purge
exit
cylc-flow-8.6.4/tests/functional/remote/07-slow-file-install/ 0000775 0001750 0001750 00000000000 15202510242 024175 5 ustar alastair alastair cylc-flow-8.6.4/tests/functional/remote/07-slow-file-install/bin/ 0000775 0001750 0001750 00000000000 15202510242 024745 5 ustar alastair alastair cylc-flow-8.6.4/tests/functional/remote/07-slow-file-install/bin/my-rsync.sh 0000775 0001750 0001750 00000000055 15202510242 027065 0 ustar alastair alastair #!/usr/bin/env bash
sleep 30
exec rsync "$@"
cylc-flow-8.6.4/tests/functional/remote/07-slow-file-install/flow.cylc 0000664 0001750 0001750 00000001220 15202510242 026013 0 ustar alastair alastair [scheduler]
install = dir1/, dir2/
[[events]]
abort on stall timeout = true
stall timeout = PT0S
abort on inactivity timeout = true
[scheduling]
[[graph]]
R1 = olaf => sven
[runtime]
[[olaf]]
# task dependent on file install already being complete
script = """
cat ${CYLC_WORKFLOW_RUN_DIR}/dir1/moo
"""
platform = $CYLC_TEST_PLATFORM
[[sven]]
# task dependent on file install already being complete
script = """
rm -r ${CYLC_WORKFLOW_RUN_DIR}/dir1 ${CYLC_WORKFLOW_RUN_DIR}/dir2
"""
platform = $CYLC_TEST_PLATFORM
cylc-flow-8.6.4/tests/functional/remote/04-symlink-dirs.t 0000664 0001750 0001750 00000012033 15202510242 023436 0 ustar alastair alastair #!/usr/bin/env bash
# THIS FILE IS PART OF THE CYLC WORKFLOW 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 .
#-------------------------------------------------------------------------------
# Checks configured symlinks are created for run, work, share, share/cycle, log
# # directories on localhost and the remote platform.
export REQUIRE_PLATFORM='loc:remote comms:tcp fs:indep'
. "$(dirname "$0")/test_header"
if [[ -z ${TMPDIR:-} || -z ${USER:-} || $TMPDIR/$USER == "$HOME" ]]; then
skip_all '"TMPDIR" or "USER" not defined or "TMPDIR"/"USER" is "HOME"'
fi
set_test_number 14
create_test_global_config "" "
[install]
[[symlink dirs]]
[[[localhost]]]
run = \$TMPDIR/\$USER/cylctb_tmp_run_dir
share = \$TMPDIR/\$USER
log = \$TMPDIR/\$USER
log/job = \$TMPDIR/\$USER/cylctb_tmp_log_job_dir
share/cycle = \$TMPDIR/\$USER/cylctb_tmp_share_dir
work = \$TMPDIR/\$USER
[[[$CYLC_TEST_INSTALL_TARGET]]]
run = \$TMPDIR/\$USER/test_cylc_symlink/ctb_tmp_run_dir
share = \$TMPDIR/\$USER/test_cylc_symlink/
log = \$TMPDIR/\$USER/test_cylc_symlink/
log/job = \$TMPDIR/\$USER/cylctb_tmp_log_job_dir
share/cycle = \$TMPDIR/\$USER/test_cylc_symlink/ctb_tmp_share_dir
work = \$TMPDIR/\$USER/test_cylc_symlink/
"
install_workflow "${TEST_NAME_BASE}" "${TEST_NAME_BASE}"
run_ok "${TEST_NAME_BASE}-validate" cylc validate "${WORKFLOW_NAME}" \
-s "CYLC_TEST_PLATFORM='${CYLC_TEST_PLATFORM}'"
workflow_run_ok "${TEST_NAME_BASE}-run-ok" cylc play "${WORKFLOW_NAME}" \
-s "CYLC_TEST_PLATFORM='${CYLC_TEST_PLATFORM}'" --debug
poll_grep_workflow_log 'remote file install complete'
TEST_SYM="${TEST_NAME_BASE}-run-symlink-exists-ok"
if [[ $(readlink "$HOME/cylc-run/${WORKFLOW_NAME}") == \
"$TMPDIR/$USER/cylctb_tmp_run_dir/cylc-run/${WORKFLOW_NAME}" ]]; then
ok "$TEST_SYM.localhost"
else
fail "$TEST_SYM.localhost"
fi
TEST_SYM="${TEST_NAME_BASE}-share/cycle-symlink-exists-ok"
if [[ $(readlink "$HOME/cylc-run/${WORKFLOW_NAME}/share/cycle") == \
"$TMPDIR/$USER/cylctb_tmp_share_dir/cylc-run/${WORKFLOW_NAME}/share/cycle" ]]; then
ok "$TEST_SYM.localhost"
else
fail "$TEST_SYM.localhost"
fi
TEST_SYM="${TEST_NAME_BASE}-log/job-symlink-exists-ok"
if [[ $(readlink "$HOME/cylc-run/${WORKFLOW_NAME}/log/job") == \
"$TMPDIR/$USER/cylctb_tmp_log_job_dir/cylc-run/${WORKFLOW_NAME}/log/job" ]]; then
ok "$TEST_SYM.localhost"
else
fail "$TEST_SYM.localhost"
fi
for DIR in 'work' 'share' 'log'; do
TEST_SYM="${TEST_NAME_BASE}-${DIR}-symlink-exists-ok"
if [[ $(readlink "$HOME/cylc-run/${WORKFLOW_NAME}/${DIR}") == \
"$TMPDIR/$USER/cylc-run/${WORKFLOW_NAME}/${DIR}" ]]; then
ok "$TEST_SYM.localhost"
else
fail "$TEST_SYM.localhost"
fi
done
SSH="$(cylc config -d -i "[platforms][$CYLC_TEST_PLATFORM]ssh command")"
# shellcheck disable=SC2016
LINK="$(${SSH} "${CYLC_TEST_HOST}" 'readlink "$HOME/cylc-run/'"$WORKFLOW_NAME"'"')"
if [[ "$LINK" == *"/test_cylc_symlink/ctb_tmp_run_dir/cylc-run/${WORKFLOW_NAME}" ]]; then
ok "${TEST_NAME_BASE}-run-symlink-exists-ok.remotehost"
else
fail "${TEST_NAME_BASE}-run-symlink-exists-ok.remotehost"
fi
# shellcheck disable=SC2016
LINK="$(${SSH} "${CYLC_TEST_HOST}" 'readlink "$HOME/cylc-run/'"$WORKFLOW_NAME"/share/cycle'"')"
if [[ "$LINK" == *"/test_cylc_symlink/ctb_tmp_share_dir/cylc-run/${WORKFLOW_NAME}/share/cycle" ]]; then
ok "${TEST_NAME_BASE}-share/cycle-symlink-exists-ok.remotehost"
else
fail "${TEST_NAME_BASE}-share/cycle-symlink-exists-ok.remotehost"
fi
# shellcheck disable=SC2016
LINK="$(${SSH} "${CYLC_TEST_HOST}" 'readlink "$HOME/cylc-run/'"$WORKFLOW_NAME"/log/job'"')"
if [[ "$LINK" == *"/cylctb_tmp_log_job_dir/cylc-run/${WORKFLOW_NAME}/log/job" ]]; then
ok "${TEST_NAME_BASE}-log/job-symlink-exists-ok.remotehost"
else
fail "${TEST_NAME_BASE}-log/job-symlink-exists-ok.remotehost"
fi
for DIR in 'work' 'share' 'log'; do
# shellcheck disable=SC2016
LINK="$(${SSH} "${CYLC_TEST_HOST}" 'readlink "$HOME/cylc-run/'"$WORKFLOW_NAME"/$DIR'"')"
if [[ "$LINK" == *"/test_cylc_symlink/cylc-run/${WORKFLOW_NAME}/${DIR}" ]]; then
ok "${TEST_NAME_BASE}-${DIR}-symlink-exists-ok.remotehost"
else
fail "${TEST_NAME_BASE}-${DIR}-symlink-exists-ok.remotehost"
fi
done
# clean up remote
${SSH} "${CYLC_TEST_HOST}" rm -rf "${TMPDIR}/${USER}/test_cylc_symlink/"
purge
exit
cylc-flow-8.6.4/tests/functional/remote/06-poll.t 0000664 0001750 0001750 00000003671 15202510242 021771 0 ustar alastair alastair #!/usr/bin/env bash
# THIS FILE IS PART OF THE CYLC WORKFLOW 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 remote host settings.
export REQUIRE_PLATFORM='loc:remote comms:poll'
. "$(dirname "$0")/test_header"
#-------------------------------------------------------------------------------
set_test_number 4
create_test_global_config "" "
[platforms]
[[$CYLC_TEST_PLATFORM]]
retrieve job logs = True
"
#-------------------------------------------------------------------------------
init_workflow "${TEST_NAME_BASE}" <<__HERE__
[scheduling]
[[graph]]
R1 = foo
[runtime]
[[foo]]
script = cylc message -- foo
platform = $CYLC_TEST_PLATFORM
[[[outputs]]]
foo = foo
__HERE__
#-------------------------------------------------------------------------------
TEST_NAME="${TEST_NAME_BASE}-validate"
run_ok "${TEST_NAME}" cylc validate "${WORKFLOW_NAME}"
TEST_NAME="${TEST_NAME_BASE}-run"
workflow_run_ok "${TEST_NAME}" \
cylc play "${WORKFLOW_NAME}" \
--debug \
--no-detach
log_scan \
"${TEST_NAME_BASE}-poll" \
"$(cylc cat-log -m p "$WORKFLOW_NAME")" \
10 \
1 \
'\[1/foo.* (polled)foo' \
'\[1/foo.* (polled)succeeded'
purge
exit
cylc-flow-8.6.4/tests/functional/remote/08-symlink-dir-target-exist.t 0000664 0001750 0001750 00000004020 15202510242 025672 0 ustar alastair alastair #!/usr/bin/env bash
# THIS FILE IS PART OF THE CYLC WORKFLOW 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 remote init fails if symlink dir target already exists
export REQUIRE_PLATFORM='loc:remote fs:indep comms:tcp'
. "$(dirname "$0")/test_header"
set_test_number 5
SSH_CMD="$(cylc config -d -i "[platforms][${CYLC_TEST_PLATFORM}]ssh command")"
create_test_global_config "" "
[install]
[[symlink dirs]]
[[[${CYLC_TEST_INSTALL_TARGET}]]]
run = \$TMPDIR/\$USER/sym-run
"
install_workflow "${TEST_NAME_BASE}" basic
run_ok "${TEST_NAME_BASE}-val" cylc validate "$WORKFLOW_NAME"
# Run once to setup symlink dirs on remote install target
workflow_run_ok "${TEST_NAME_BASE}-run" cylc play --no-detach "$WORKFLOW_NAME"
# Remove remote run dir symlink (but not its target)
$SSH_CMD "$CYLC_TEST_HOST" "rm -rf ~/cylc-run/${WORKFLOW_NAME}"
# New run should abort
delete_db
TEST_NAME="${TEST_NAME_BASE}-run-again"
workflow_run_fail "$TEST_NAME" cylc play --no-detach "$WORKFLOW_NAME"
grep_ok "ERROR - platform: .* initialisation did not complete" "${TEST_NAME}.stderr"
grep_ok "WorkflowFilesError: Symlink dir target already exists" "${TEST_NAME}.stderr"
# Clean up remote symlink dir target
# shellcheck disable=SC2016
$SSH_CMD "$CYLC_TEST_HOST" 'rm -rf "${TMPDIR}/${USER}/sym-run"'
purge
cylc-flow-8.6.4/tests/functional/remote/00-basic.t 0000664 0001750 0001750 00000004605 15202510242 022074 0 ustar alastair alastair #!/usr/bin/env bash
# THIS FILE IS PART OF THE CYLC WORKFLOW 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 remote host settings.
export REQUIRE_PLATFORM='loc:remote'
. "$(dirname "$0")/test_header"
#-------------------------------------------------------------------------------
set_test_number 4
create_test_global_config "" "
[platforms]
[[$CYLC_TEST_PLATFORM]]
retrieve job logs = True
"
#-------------------------------------------------------------------------------
install_workflow "${TEST_NAME_BASE}" basic
#-------------------------------------------------------------------------------
TEST_NAME="${TEST_NAME_BASE}-validate"
run_ok "${TEST_NAME}" cylc validate "${WORKFLOW_NAME}"
#-------------------------------------------------------------------------------
TEST_NAME="${TEST_NAME_BASE}-run"
workflow_run_ok "${TEST_NAME}" cylc play --reference-test --debug --no-detach "${WORKFLOW_NAME}"
#-------------------------------------------------------------------------------
TEST_NAME=${TEST_NAME_BASE}-platform
sqlite3 "${WORKFLOW_RUN_DIR}/log/db" \
"SELECT platform_name FROM task_jobs WHERE name=='foo'" >'foo-host.txt'
cmp_ok 'foo-host.txt' <<<"${CYLC_TEST_PLATFORM}"
#-------------------------------------------------------------------------------
# Check that the remote job has actually been run on the correct remote by
# checking it's job.out file for @CYLC_TEST_HOST
REMOTE_HOST_FQDN="$(ssh "${CYLC_TEST_HOST}" hostname -f)"
TEST_NAME=${TEST_NAME_BASE}-ensure-remote-run
grep_ok \
"^$REMOTE_HOST_FQDN" \
"${WORKFLOW_RUN_DIR}/log/job/1/foo/NN/job.out"
#-------------------------------------------------------------------------------
purge
exit
cylc-flow-8.6.4/tests/functional/cylc-remove/ 0000775 0001750 0001750 00000000000 15202510242 021336 5 ustar alastair alastair cylc-flow-8.6.4/tests/functional/cylc-remove/00-simple.t 0000775 0001750 0001750 00000001647 15202510242 023244 0 ustar alastair alastair #!/usr/bin/env bash
# THIS FILE IS PART OF THE CYLC WORKFLOW 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 cylc remove
. "$(dirname "$0")/test_header"
set_test_number 2
reftest
exit
cylc-flow-8.6.4/tests/functional/cylc-remove/02-cycling/ 0000775 0001750 0001750 00000000000 15202510242 023205 5 ustar alastair alastair cylc-flow-8.6.4/tests/functional/cylc-remove/02-cycling/reference.log 0000664 0001750 0001750 00000000456 15202510242 025653 0 ustar alastair alastair Run mode: live
Initial point: 2020
Final point: 2021
Cold Start 2020
2020/remover -triggered off []
2020/foo -triggered off []
2021/foo -triggered off []
2020/bar -triggered off ['2020/foo']
2021/bar -triggered off ['2021/foo']
2020/baz -triggered off ['2020/foo']
2021/baz -triggered off ['2021/foo']
cylc-flow-8.6.4/tests/functional/cylc-remove/02-cycling/flow.cylc 0000664 0001750 0001750 00000002053 15202510242 025030 0 ustar alastair alastair # Abort on stall timeout unless we successfully remove some failed and waiting tasks.
[scheduler]
UTC mode = True
cycle point format = %Y
[[events]]
stall timeout = PT30S
abort on stall timeout = True
expected task failures = 2020/bar, 2021/baz
[scheduling]
initial cycle point = 2020
final cycle point = 2021
[[graph]]
R1 = remover
P1Y = foo => bar & baz => waz
[runtime]
[[remover]]
script = """
cylc__job__poll_grep_workflow_log -E '2020/bar/01.* failed'
cylc__job__poll_grep_workflow_log -E '2021/baz/01.* failed'
# Remove the two unhandled failed tasks.
cylc remove "$CYLC_WORKFLOW_ID//*/ba*:failed"
# Remove the two unsatisfied waiting tasks.
cylc remove "$CYLC_WORKFLOW_ID//*/waz"
# Exit so workflow can shut down.
"""
[[foo, waz]]
script = true
[[bar]]
script = [[ $CYLC_TASK_CYCLE_POINT != 2020 ]]
[[baz]]
script = [[ $CYLC_TASK_CYCLE_POINT != 2021 ]]
cylc-flow-8.6.4/tests/functional/cylc-remove/04-kill/ 0000775 0001750 0001750 00000000000 15202510242 022512 5 ustar alastair alastair cylc-flow-8.6.4/tests/functional/cylc-remove/04-kill/reference.log 0000664 0001750 0001750 00000000164 15202510242 025154 0 ustar alastair alastair Initial point: 1
Final point: 1
1/a -triggered off []
1/b -triggered off []
1/remover -triggered off ['1/a', '1/b']
cylc-flow-8.6.4/tests/functional/cylc-remove/04-kill/flow.cylc 0000664 0001750 0001750 00000002210 15202510242 024330 0 ustar alastair alastair [scheduler]
allow implicit tasks = True
[[events]]
expected task failures = 1/a, 1/b
stall timeout = PT0S
abort on stall timeout = True
[scheduling]
[[graph]]
R1 = """
a:started => remover
a:failed => u
b:submitted? => remover
b:submit-failed? => v
"""
[runtime]
[[a, b]]
script = sleep 40
[[[events]]]
submitted handlers = echo %(event)s
failed handlers = echo %(event)s
submission failed handlers = echo %(event)s
[[b]]
platform = old_street
[[remover]]
script = """
cylc remove "$CYLC_WORKFLOW_ID//1/a" "$CYLC_WORKFLOW_ID//1/b"
# Task proxies become "transient" on removal (it means, not in the
# task pool), after which the job kill will be logged but the
# state change to "failed" or "sumbit-failed" will not (we don't
# care about the state of removed tasks).
cylc__job__poll_grep_workflow_log -E '1\/a.* job killed'
cylc__job__poll_grep_workflow_log -E '1\/b.* job killed'
"""
cylc-flow-8.6.4/tests/functional/cylc-remove/04-kill.t 0000664 0001750 0001750 00000005022 15202510242 022676 0 ustar alastair alastair #!/usr/bin/env bash
# THIS FILE IS PART OF THE CYLC WORKFLOW 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 that removing submited/running tasks causes them to be killed.
# Any downstream tasks that depend on the `:submit-fail`/`:fail` outputs
# should NOT run.
# Handlers for the `submission failed`/`failed` events should not run either.
export REQUIRE_PLATFORM='runner:at'
. "$(dirname "$0")/test_header"
set_test_number 10
# Create platform that ensures job b will be in submitted state for long enough
create_test_global_config '' "
[platforms]
[[old_street]]
job runner = at
job runner command template = at now + 5 minutes
hosts = localhost
install target = localhost
"
install_and_validate
reftest_run
grep_workflow_log_ok "${TEST_NAME_BASE}-grep-a" \
"[1/a/01(flows=none):failed(held)] job killed" -F
J_LOG_A="${WORKFLOW_RUN_DIR}/log/job/1/a/NN/job-activity.log"
# Failed handler should not run:
grep_fail "[(('event-handler-00', 'failed'), 1) out]" "$J_LOG_A" -F
# (Check submitted handler as a control):
grep_ok "[(('event-handler-00', 'submitted'), 1) out]" "$J_LOG_A" -F
grep_workflow_log_ok "${TEST_NAME_BASE}-grep-b" \
"[1/b/01(flows=none):submit-failed(held)] job killed" -F
J_LOG_B="${WORKFLOW_RUN_DIR}/log/job/1/b/NN/job-activity.log"
grep_fail "[(('event-handler-00', 'submission failed'), 1) out]" "$J_LOG_B" -F
grep_ok "[(('event-handler-00', 'submitted'), 1) out]" "$J_LOG_B" -F
# Check task state updated in DB despite removal from task pool:
sqlite3 "${WORKFLOW_RUN_DIR}/.service/db" \
"SELECT status, flow_nums FROM task_states WHERE name='a';" > task_states.out
cmp_ok task_states.out - <<< "failed|[]"
# Check job updated in DB:
sqlite3 "${WORKFLOW_RUN_DIR}/.service/db" \
"SELECT run_status, time_run_exit FROM task_jobs WHERE cycle='1' AND name='a';" > task_jobs.out
cmp_ok_re task_jobs.out - <<< "1\|[\w:+-]+"
purge
cylc-flow-8.6.4/tests/functional/cylc-remove/03-flow.t 0000664 0001750 0001750 00000003175 15202510242 022720 0 ustar alastair alastair #!/usr/bin/env bash
# THIS FILE IS PART OF THE CYLC WORKFLOW 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 .
# High-level test of `cylc remove --flow` option.
# Integration tests exist for more comprehensive coverage.
. "$(dirname "$0")/test_header"
set_test_number 6
init_workflow "${TEST_NAME_BASE}" <<'__EOF__'
[scheduler]
allow implicit tasks = True
[scheduling]
[[graph]]
R1 = foo
__EOF__
run_ok "${TEST_NAME_BASE}-validate" cylc validate "${WORKFLOW_NAME}"
workflow_run_ok "${TEST_NAME_BASE}-run" cylc play "${WORKFLOW_NAME}" --pause
run_ok "${TEST_NAME_BASE}-remove" cylc remove "${WORKFLOW_NAME}//1/foo" --flow 1 --flow 2
cylc stop "${WORKFLOW_NAME}"
poll_workflow_stopped
grep_workflow_log_ok "${TEST_NAME_BASE}-grep" "Removed tasks: 1/foo (flows=1)"
# Simple additional test of DB:
TEST_NAME="${TEST_NAME_BASE}-workflow-state"
run_ok "$TEST_NAME" cylc workflow-state "$WORKFLOW_NAME"
cmp_ok "${TEST_NAME}.stdout" <<__EOF__
1/foo:waiting(flows=none)
__EOF__
purge
cylc-flow-8.6.4/tests/functional/cylc-remove/test_header 0000777 0001750 0001750 00000000000 15202510242 027653 2../lib/bash/test_header ustar alastair alastair cylc-flow-8.6.4/tests/functional/cylc-remove/02-cycling.t 0000775 0001750 0001750 00000001736 15202510242 023404 0 ustar alastair alastair #!/usr/bin/env bash
# THIS FILE IS PART OF THE CYLC WORKFLOW 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 cylc remove in a cycling workflow (spawn before remove, and not).
. "$(dirname "$0")/test_header"
set_test_number 2
reftest
exit
cylc-flow-8.6.4/tests/functional/cylc-remove/00-simple/ 0000775 0001750 0001750 00000000000 15202510242 023044 5 ustar alastair alastair cylc-flow-8.6.4/tests/functional/cylc-remove/00-simple/reference.log 0000664 0001750 0001750 00000000155 15202510242 025506 0 ustar alastair alastair Initial point: 1
Final point: 1
1/a -triggered off []
1/cleaner -triggered off []
1/b -triggered off ['1/a']
cylc-flow-8.6.4/tests/functional/cylc-remove/00-simple/flow.cylc 0000664 0001750 0001750 00000001411 15202510242 024664 0 ustar alastair alastair # Abort on stall timeout unless we remove unhandled failed and waiting task.
[scheduler]
[[events]]
stall timeout = PT30S
abort on stall timeout = True
expected task failures = 1/b
[scheduling]
[[graph]]
R1 = """
a => b => c
cleaner
"""
[runtime]
[[a,c]]
script = true
[[b]]
script = false
[[cleaner]]
script = """
cylc__job__poll_grep_workflow_log -E '1/b/01.* failed'
# Remove the unhandled failed task
cylc remove "$CYLC_WORKFLOW_ID//1/b"
# Remove waiting 1/c
# (not auto-removed because parent 1/b, an unhandled fail, is not finished.)
cylc remove "$CYLC_WORKFLOW_ID//1/c:waiting"
"""
cylc-flow-8.6.4/tests/functional/cylc-ping/ 0000775 0001750 0001750 00000000000 15202510242 020776 5 ustar alastair alastair cylc-flow-8.6.4/tests/functional/cylc-ping/00-simple.t 0000664 0001750 0001750 00000001657 15202510242 022702 0 ustar alastair alastair #!/usr/bin/env bash
# THIS FILE IS PART OF THE CYLC WORKFLOW 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 cylc ping behaviour
. "$(dirname "$0")/test_header"
set_test_number 2
reftest
exit
cylc-flow-8.6.4/tests/functional/cylc-ping/03-check-keys-local.t 0000664 0001750 0001750 00000003372 15202510242 024526 0 ustar alastair alastair #!/usr/bin/env bash
# THIS FILE IS PART OF THE CYLC WORKFLOW 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 .
#-------------------------------------------------------------------------------
# Checks ZMQ keys are created and deleted on shutdown - local.
. "$(dirname "$0")/test_header"
set_test_number 10
init_workflow "${TEST_NAME_BASE}" <<'__FLOW_CONFIG__'
[scheduler]
cycle point format = %Y
allow implicit tasks = True
[scheduling]
initial cycle point = 2020
[[graph]]
R1 = t1
__FLOW_CONFIG__
run_ok "${TEST_NAME_BASE}-validate" cylc validate "${WORKFLOW_NAME}"
SRVD="${WORKFLOW_RUN_DIR}/.service"
workflow_run_ok "${TEST_NAME_BASE}-run-pause" cylc play --pause "${WORKFLOW_NAME}"
exists_ok "${SRVD}/client.key_secret"
exists_ok "${SRVD}/server.key_secret"
exists_ok "${SRVD}/server.key"
exists_ok "${SRVD}/client_public_keys/client_localhost.key"
cylc stop --max-polls=60 --interval=1 "${WORKFLOW_NAME}"
exists_fail "${SRVD}/client.key_secret"
exists_fail "${SRVD}/server.key_secret"
exists_fail "${SRVD}/server.key"
exists_fail "${SRVD}/client_public_keys/client_localhost.key"
purge
exit
cylc-flow-8.6.4/tests/functional/cylc-ping/04-check-keys-remote.t 0000664 0001750 0001750 00000005211 15202510242 024722 0 ustar alastair alastair #!/usr/bin/env bash
# THIS FILE IS PART OF THE CYLC WORKFLOW 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 .
#-------------------------------------------------------------------------------
# Checks remote ZMQ keys are created and deleted on shutdown.
export REQUIRE_PLATFORM='loc:remote'
. "$(dirname "$0")/test_header"
set_test_number 5
create_test_global_config '' "
[platforms]
[[$CYLC_TEST_PLATFORM]]
retrieve job logs = True
"
init_workflow "${TEST_NAME_BASE}" <<__FLOW_CONFIG__
[scheduling]
[[graph]]
R1 = keys
[runtime]
[[keys]]
platform = $CYLC_TEST_PLATFORM
script = """
find \
"\${CYLC_WORKFLOW_RUN_DIR}" \
-type f \
-name "*key*" \
| awk -F/ '{print \$NF}'|sort > "\${CYLC_TASK_LOG_ROOT}-find-out"
"""
[[[environment]]]
LANG = C
__FLOW_CONFIG__
run_ok "${TEST_NAME_BASE}-validate" cylc validate \
"${WORKFLOW_NAME}"
workflow_run_ok "${TEST_NAME_BASE}-run" cylc play \
"${WORKFLOW_NAME}" \
--no-detach
KEYS_FILE="$(cylc cat-log -m p "$WORKFLOW_NAME//1/keys" -f job-find-out)"
if [[ "$CYLC_TEST_PLATFORM" == *shared* ]]; then
cmp_ok "$KEYS_FILE" <<__OUT__
client.key_secret
client_${CYLC_TEST_INSTALL_TARGET}.key
server.key
server.key_secret
__OUT__
else
cmp_ok "$KEYS_FILE" <<__OUT__
client.key_secret
client_${CYLC_TEST_INSTALL_TARGET}.key
server.key
__OUT__
fi
if [[ "$CYLC_TEST_PLATFORM" == *shared* ]]; then
skip 1
else
# NOTE: remote tidy happens on a random platform picked from the install
# target so might not be $CYLC_TEST_PLATFORM
grep_ok \
"platform: .* - remote tidy (on $CYLC_TEST_HOST)" \
"${WORKFLOW_RUN_DIR}/log/scheduler/log"
fi
# ensure the keys got removed again afterwards
SSH='ssh -n -oBatchMode=yes -oConnectTimeout=5'
${SSH} "${CYLC_TEST_HOST}" \
LANG=C find "cylc-run/${WORKFLOW_NAME}" -type f -name "*key*"|awk -F/ '{print $NF}'|sort >'find.out'
cmp_ok 'find.out'