How to force global.cylc get reloaded/reevaluated?

We use environment variables and jinja2 to add project-specific elements to what our workflows see when they load the global.cylc file. However, we’ve noticed that when we run cylc reload workflow that the global.cylc file does not appear to be re-evaluated. This means that our variables are not updated in the workflows.

For example, we inject project-specific variables into their init-scripts:

export PRJCONDAENVS_VM=/home/project_dply/project/v1.0.0/workflow_pp/envs

however, if a new deploy changes the tagged version, we’d want that to become:

export PRJCONDAENVS_VM=/home/project_dply/project/v1.1.0/workflow_pp/envs

Is there a way to tell Cylc to always re-evaluate the global.cylc file on a workflow reload? We would prefer to not have to stop/play, but if that’s what we have to do, we need to tell our users.

To update global config you do need to stop and restart the scheduler.

That’s not too onerous with cylc stop --now (no need to wait for active tasks).

However, it might be a good idea to provide on-demand reload. I’ll post an issue… Reload global config on demand · Issue #6486 · cylc/cylc-flow · GitHub

We are aware of one use case for having a dynamic global config, configuring the [symlink dirs] on a per-project basis (this can now be controlled by env vars in a rose-suite.conf file).

But, I’m not aware of any use case for having a global config that is both dynamic to the workflow and which varies over the life of the workflow? Which of the global.cylc configs are dynamic in this setup?

We did consider getting Cylc to reload the global config at a configured interval, however, we haven’t started on this work yet. Whilst trivial to implement as a main-loop plugin, Cylc has a number of caches and object states which would need to be cleared in order for this to work correctly, so there would be a little work involved in getting it off the ground.