Skip to content

Commit d2a01b2

Browse files
authored
Merge pull request #390 from MetRonnie/env-vars
Create reference section for job script environment variables
2 parents b26db3e + 25eceb9 commit d2a01b2

File tree

5 files changed

+71
-61
lines changed

5 files changed

+71
-61
lines changed

src/reference/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ Reference
55
.. toctree::
66
:maxdepth: 2
77

8-
architecture/index
98
config/index
9+
job-script-vars/index
10+
architecture/index
1011
api/index
1112
environments/conda.rst
1213
dev-history-major-changes
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Job Script Environment Variables
2+
================================
3+
4+
These variables provided by the :term:`scheduler` are available to Cylc job scripts:
5+
6+
.. literalinclude:: var-list.txt
7+
:language: sub
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
CYLC_DEBUG # Debug mode, true or not defined
2+
CYLC_VERSION # Version of cylc installation used
3+
4+
CYLC_CYCLING_MODE # Cycling mode, e.g. gregorian
5+
ISODATETIMECALENDAR # Calendar mode for the `isodatetime` command,
6+
# defined with the value of CYLC_CYCLING_MODE
7+
# when in any datetime cycling mode
8+
9+
CYLC_WORKFLOW_FINAL_CYCLE_POINT # Final cycle point
10+
CYLC_WORKFLOW_INITIAL_CYCLE_POINT # Initial cycle point
11+
CYLC_WORKFLOW_ID # Workflow ID
12+
CYLC_WORKFLOW_NAME # Workflow name
13+
# (the workflow ID without the run name)
14+
CYLC_UTC # UTC mode, True or False
15+
CYLC_VERBOSE # Verbose mode, True or False
16+
TZ # Set to "UTC" in UTC mode or not defined
17+
18+
CYLC_WORKFLOW_RUN_DIR # Location of the run directory in
19+
# job host, e.g. ~/cylc-run/foo
20+
CYLC_WORKFLOW_HOST # Host running the workflow process
21+
CYLC_WORKFLOW_OWNER # User ID running the workflow process
22+
23+
CYLC_WORKFLOW_SHARE_DIR # Workflow (or task!) shared directory (see below)
24+
CYLC_WORKFLOW_UUID # Workflow UUID string
25+
CYLC_WORKFLOW_WORK_DIR # Workflow work directory (see below)
26+
27+
CYLC_TASK_JOB # Task job identifier expressed as
28+
# CYCLE-POINT/TASK-NAME/SUBMIT-NUMBER
29+
# e.g. 20110511T1800Z/t1/01
30+
31+
CYLC_TASK_CYCLE_POINT # Cycle point, e.g. 20110511T1800Z
32+
ISODATETIMEREF # Reference time for the `isodatetime` command,
33+
# defined with the value of CYLC_TASK_CYCLE_POINT
34+
# when in any datetime cycling mode
35+
36+
CYLC_TASK_NAME # Job's task name, e.g. t1
37+
CYLC_TASK_SUBMIT_NUMBER # Job's submit number, e.g. 1,
38+
# increments with every submit
39+
CYLC_TASK_TRY_NUMBER # Number of execution tries, e.g. 1
40+
# increments with automatic retry-on-fail
41+
CYLC_TASK_ID # Task instance identifier TASK-NAME.CYCLE-POINT
42+
# e.g. t1.20110511T1800Z
43+
CYLC_TASK_LOG_DIR # Location of the job log directory
44+
# e.g. ~/cylc-run/foo/log/job/20110511T1800Z/t1/01/
45+
CYLC_TASK_LOG_ROOT # The task job file path
46+
# e.g. ~/cylc-run/foo/log/job/20110511T1800Z/t1/01/job
47+
CYLC_TASK_WORK_DIR # Location of task work directory (see below)
48+
# e.g. ~/cylc-run/foo/work/20110511T1800Z/t1
49+
CYLC_TASK_NAMESPACE_HIERARCHY # Linearised family namespace of the task,
50+
# e.g. root postproc t1
51+
CYLC_TASK_DEPENDENCIES # List of met dependencies that triggered the task
52+
# e.g. 1/foo 1/bar
53+
54+
CYLC_TASK_COMMS_METHOD # Set to "ssh" if communication method is "ssh"
55+
CYLC_TASK_SSH_LOGIN_SHELL # With "ssh" communication, if set to "True",
56+
# use login shell on workflow host

src/tutorial/runtime/runtime-configuration.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ Environment Variables
4646
The :term:`cycle point` for the associated task
4747
*(e.g. 20171009T0950)*.
4848

49-
There are many more environment variables - see the `Cylc User Guide`_ for more
50-
information.
49+
.. seealso::
50+
51+
There are many more environment variables - see
52+
:ref:`Task Job Script Variables` for more information.
5153

5254
.. ifslides::
5355

src/user-guide/writing-workflows/runtime.rst

Lines changed: 2 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -290,64 +290,8 @@ Task Job Script Variables
290290

291291
These variables provided by the :term:`scheduler` are available to task job scripts:
292292

293-
.. code-block:: sub
294-
295-
CYLC_DEBUG # Debug mode, true or not defined
296-
CYLC_VERSION # Version of cylc installation used
297-
298-
CYLC_CYCLING_MODE # Cycling mode, e.g. gregorian
299-
ISODATETIMECALENDAR # Calendar mode for the `isodatetime` command,
300-
# defined with the value of CYLC_CYCLING_MODE
301-
# when in any datetime cycling mode
302-
303-
CYLC_WORKFLOW_FINAL_CYCLE_POINT # Final cycle point
304-
CYLC_WORKFLOW_INITIAL_CYCLE_POINT # Initial cycle point
305-
CYLC_WORKFLOW_ID # Workflow ID
306-
CYLC_WORKFLOW_NAME # Workflow name
307-
# (the workflow ID without the run name)
308-
CYLC_UTC # UTC mode, True or False
309-
CYLC_VERBOSE # Verbose mode, True or False
310-
TZ # Set to "UTC" in UTC mode or not defined
311-
312-
CYLC_WORKFLOW_RUN_DIR # Location of the run directory in
313-
# job host, e.g. ~/cylc-run/foo
314-
CYLC_WORKFLOW_HOST # Host running the workflow process
315-
CYLC_WORKFLOW_OWNER # User ID running the workflow process
316-
317-
CYLC_WORKFLOW_SHARE_DIR # Workflow (or task!) shared directory (see below)
318-
CYLC_WORKFLOW_UUID # Workflow UUID string
319-
CYLC_WORKFLOW_WORK_DIR # Workflow work directory (see below)
320-
321-
CYLC_TASK_JOB # Task job identifier expressed as
322-
# CYCLE-POINT/TASK-NAME/SUBMIT-NUMBER
323-
# e.g. 20110511T1800Z/t1/01
324-
325-
CYLC_TASK_CYCLE_POINT # Cycle point, e.g. 20110511T1800Z
326-
ISODATETIMEREF # Reference time for the `isodatetime` command,
327-
# defined with the value of CYLC_TASK_CYCLE_POINT
328-
# when in any datetime cycling mode
329-
330-
CYLC_TASK_NAME # Job's task name, e.g. t1
331-
CYLC_TASK_SUBMIT_NUMBER # Job's submit number, e.g. 1,
332-
# increments with every submit
333-
CYLC_TASK_TRY_NUMBER # Number of execution tries, e.g. 1
334-
# increments with automatic retry-on-fail
335-
CYLC_TASK_ID # Task instance identifier TASK-NAME.CYCLE-POINT
336-
# e.g. t1.20110511T1800Z
337-
CYLC_TASK_LOG_DIR # Location of the job log directory
338-
# e.g. ~/cylc-run/foo/log/job/20110511T1800Z/t1/01/
339-
CYLC_TASK_LOG_ROOT # The task job file path
340-
# e.g. ~/cylc-run/foo/log/job/20110511T1800Z/t1/01/job
341-
CYLC_TASK_WORK_DIR # Location of task work directory (see below)
342-
# e.g. ~/cylc-run/foo/work/20110511T1800Z/t1
343-
CYLC_TASK_NAMESPACE_HIERARCHY # Linearised family namespace of the task,
344-
# e.g. root postproc t1
345-
CYLC_TASK_DEPENDENCIES # List of met dependencies that triggered the task
346-
# e.g. 1/foo 1/bar
347-
348-
CYLC_TASK_COMMS_METHOD # Set to "ssh" if communication method is "ssh"
349-
CYLC_TASK_SSH_LOGIN_SHELL # With "ssh" communication, if set to "True",
350-
# use login shell on workflow host
293+
.. literalinclude:: ../../reference/job-script-vars/var-list.txt
294+
:language: sub
351295

352296
Some global shell variables are also defined in the task job script, but not
353297
exported to subshells:

0 commit comments

Comments
 (0)