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

Allow platform default directives #4896

Merged
merged 5 commits into from
May 27, 2022

Conversation

wxtim
Copy link
Member

@wxtim wxtim commented May 24, 2022

This is a change with no associated Issue.

The issue

Cylc 7 allowed the setting of default job runner (batch system) directives using [test battery][batch systems][SYSTEM][directives].

Allow the setting of default directives in Cylc 8.

Requirements check-list

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Applied any dependency changes to both setup.cfg and conda-environment.yml.
  • Appropriate tests are included (unit and/or functional).
  • Appropriate change log entry included.
  • Self documentation included in changes for globalcfg.py

In this case the suggested refactor would IMO make the code
less rather than more readable.
@wxtim wxtim requested review from hjoliver and MetRonnie May 24, 2022 11:57
@wxtim wxtim self-assigned this May 24, 2022
@wxtim wxtim added this to the cylc-8.0rc4 milestone May 24, 2022
@wxtim wxtim added could be better Not exactly a bug, but not ideal. config change Involves a change to global or workflow config labels May 24, 2022
@wxtim wxtim force-pushed the allow_platform_default_directives branch from d7d7e51 to 5179e5b Compare May 24, 2022 12:03
@wxtim wxtim force-pushed the allow_platform_default_directives branch from 5179e5b to bdd609f Compare May 24, 2022 12:07
Copy link
Member

@hjoliver hjoliver left a comment

Choose a reason for hiding this comment

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

Looks good, thanks @wxtim

CHANGES.md Outdated Show resolved Hide resolved
Comment on lines 1317 to 1320
Job runner (batch scheduler) directives.

Default directives for :cylc:conf:
`flow.cylc[runtime][<namespace>][directives]`
Copy link
Member

Choose a reason for hiding this comment

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

Looks like the precedent for this kind of thing is

Suggested change
Job runner (batch scheduler) directives.
Default directives for :cylc:conf:
`flow.cylc[runtime][<namespace>][directives]`
:Defaults for: :cylc:conf:`flow.cylc[runtime][<namespace>][directives]`

(avoiding duplicating the description)

Copy link
Member Author

@wxtim wxtim May 25, 2022

Choose a reason for hiding this comment

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

Sorry, Dave and I have had a discussion about this, which we've not documented, but we have it in mind to go through all these cases: I think the agreement was that there should be:

  • A headline description [both]
  • A fuller description [only one config]
  • A link to the other conifg [both]

Is that the conclusion you remember @dpmatthews

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough, in that case

Suggested change
Job runner (batch scheduler) directives.
Default directives for :cylc:conf:
`flow.cylc[runtime][<namespace>][directives]`
:Defaults for: :cylc:conf:`flow.cylc[runtime][<namespace>][directives]`
Job runner (batch scheduler) directives.

:Defaults for: is some kind of sphinx directive by the look of it, possibly from cylc-sphinx-extensions

cylc/flow/task_job_mgr.py Outdated Show resolved Hide resolved
@wxtim wxtim requested a review from MetRonnie May 25, 2022 13:40
@@ -1299,7 1299,9 @@ def get_job_conf(
itask.platform['job runner command template']
),
'dependencies': itask.state.get_resolved_dependencies(),
'directives': rtconfig['directives'],
'directives': {
Copy link
Member Author

Choose a reason for hiding this comment

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

@MetRonnie - I knew there should be a 1-line for this!

@wxtim wxtim requested a review from MetRonnie May 26, 2022 13:10
Co-authored-by: Ronnie Dutta <61982285 [email protected]>
@wxtim wxtim force-pushed the allow_platform_default_directives branch from 229858c to fc67717 Compare May 26, 2022 13:13
cylc/flow/cfgspec/globalcfg.py Outdated Show resolved Hide resolved
Co-authored-by: Ronnie Dutta <61982285 [email protected]>
@wxtim wxtim requested a review from MetRonnie May 27, 2022 07:03
@MetRonnie
Copy link
Member

(Functional test failures due to Codecov upload failures)

@MetRonnie MetRonnie merged commit 0083a4d into cylc:master May 27, 2022
wxtim added a commit to wxtim/cylc that referenced this pull request May 27, 2022
* 'master' of https://github.com/cylc/cylc: (47 commits)
  Global platform default directives (cylc#4896)
  Raise an error if the user tries to set owner. (cylc#4860)
  Raise error if there is a relative path in `global.cylc[install]source dirs` (cylc#4887)
  Added a noqa tag to a new flake8-simplify case. (cylc#4895)
  Update change log.
  Don't prompt to clean no workflows.
  Bump to next dev version
  Fix task matching bug (cylc#4881)
  Expand comma separated platform names correctly (cylc#4880)
  resolvers: add a couple of comments
  Prepare release 8.0rc3
  Fix change log.
  Add & amalgamate jinja2 error tests
  shellcheck fix
  Tweak show help text.
  Fix wrong context lines for jinja2 error
  Fix missing context lines for jinja2 error
  Improve new func. test.
  Syntax highlighting: don't symlink files now they are extracted using cylc get-resources
  Emacs syntax highlighting: fix filename pattern matching
  ...
wxtim added a commit to wxtim/cylc that referenced this pull request May 27, 2022
Allow setting of default batch system directives in the platform config
wxtim added a commit to wxtim/cylc that referenced this pull request May 27, 2022
* upstream/master:
  Global platform default directives (cylc#4896)
@hjoliver hjoliver removed this from the cylc-8.0rc4 milestone Jul 5, 2022
@hjoliver hjoliver added this to the cylc-8.0.0 milestone Jul 5, 2022
@wxtim wxtim deleted the allow_platform_default_directives branch October 10, 2022 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config change Involves a change to global or workflow config could be better Not exactly a bug, but not ideal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants