[meta]
title = "Download Data"
[cylc]
UTC mode = True
[[parameters]]
# A list of the sources
source = a, b
[scheduling]
initial cycle point = 20150214T12Z
final cycle point = 20150215T12Z
[[dependencies]]
[[[PT1H]]]
# Repeat every one hours starting at the initial cycle point.
graph = """
download<source>
"""
[runtime]
[[download<source>]]
script = """
conda activate download_env
download $CYLC_TASK_PARAM_source -dt $CYLC_TASK_CYCLE_POINT; """
I get ~/anaconda3/etc/profile.d/conda.sh: line 55: PS1: unbound variable
Yeah that’s a long-standing bug in the conda activation script.
It surfaces in Cylc task job scripts because they use set -u to make it illegal to reference unbound variables, which is a common source of error in shell scripts. You can make it happen in the terminal too, like this:
[drugs-and-money]$ unset PS1 # (i.e. nuke the command prompt!)
set -u
conda activate toast
-bash: PS1: unbound variable
As @kinow suggests, you can make sure PS1 is set in your environment.
Or, you can turn off unbound variable checking temporarily, in your job script:
set +u
conda activate my-env
set -u
Note also you need to be careful about changing your Python environment in Cylc 7 task job scripts, because task status message uses the Cylc Python library. So if you conda environment includes its own Python version, deactivate it again after use: