Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clear cylc options at reload #6065

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions cylc/flow/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1262,11 +1262,17 @@ def _configure_contact(self) -> None:

def load_flow_file(self, is_reload=False):
"""Load, and log the workflow definition."""
# Local workflow environment set therein.
# Allow -S and -D to take effect in Cylc VR.
# https://github.com/cylc/cylc-flow/issues/5968
self.options.rose_template_vars = []
self.options.defines = []
if is_reload:
# If the workflow is reloaded clear any existing rose options
# The reload command doesn't have the ability to set these but
# if the user has used VR to re-install before reload they will
# expect the changed values not the ones stored on the scheduler.
# Note: Does NOT apply to reload on restart, because the play
# command used to restart can have template variables attached.
Comment on lines +1267 to +1271
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused

  • If the user has used cylc vr running-workflow -S (reinstall + reload), how are the changed values getting through to the scheduler then?
  • What do you mean by "reload on restart"? If the user has used cylc vr stopped-workflow -S (reinstall + restart), then there is no reload, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the user has used cylc vr running-workflow -S (reinstall + reload), how are the changed values getting through to the scheduler then?

The reinstall updates the rose-suite-cylc-install.conf which the reload reads. The reload doesn't have the -S option so clearing that here only affects options set on the scheduler by an earlier Cylc play.

Your question has however revealed a horrid case where this doesn't work:

cylc vip -S 'VAR=1' --pause
cylc vr bugs/5968

Do you think that the correct options might be to allow Cylc Reload to set -S and it's friends, becuase to me that looks like the simplest way of doing things?

What do you mean by "reload on restart"? If the user has used cylc vr stopped-workflow -S (reinstall + restart), then there is no reload, right?

Oliver described it as an implicit reload.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your question has however revealed a horrid case where this doesn't work

What does happen with this example, and what is meant to happen?

# See https://github.com/cylc/cylc-flow/pull/5996
Comment on lines +1270 to +1272
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This explanation doesn't make much sense to me as the play command used to start the workflow in the first place can also have template variables attached?

Copy link
Member Author

@wxtim wxtim Apr 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you do

cylc play x --pause -S 'foo=1'
cylc stop x
cylc reinstall x -S foo=2
cylc play x -S 'foo=3'

Do you want foo=1 or 2 or 3?

This is also safe against

cylc play x --pause -S 'foo=1'
cylc stop x
cylc reinstall x -S foo=2
cylc play x

because the restart involves re-reading the rose config files too.

self.options.rose_template_vars = []
self.options.defines = []
self.options.opt_conf_keys = []
return WorkflowConfig(
self.workflow,
self.flow_file,
Expand Down
Loading