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

Cylc config add --platform-names #4576

Merged
merged 19 commits into from
Jan 27, 2022

Conversation

wxtim
Copy link
Member

@wxtim wxtim commented Jan 12, 2022

These changes close #4557

Asking for a review before I add changelog or doc.

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.
  • (master branch) I have opened a documentation PR at cylc/cylc-doc/pull/XXXX.

@wxtim wxtim self-assigned this Jan 12, 2022
@wxtim wxtim added the small label Jan 12, 2022
@wxtim wxtim added this to the cylc-8.0.0 milestone Jan 12, 2022
cylc/flow/scripts/config.py Outdated Show resolved Hide resolved
cylc/flow/scripts/config.py Outdated Show resolved Hide resolved
cylc/flow/scripts/config.py Outdated Show resolved Hide resolved
cylc/flow/scripts/config.py Outdated Show resolved Hide resolved
cylc/flow/scripts/config.py Outdated Show resolved Hide resolved
cylc/flow/scripts/config.py Outdated Show resolved Hide resolved
tests/unit/cfgspec/test_globalcfg.py Outdated Show resolved Hide resolved
tests/unit/scripts/test_config.py Outdated Show resolved Hide resolved
tests/unit/scripts/test_config.py Outdated Show resolved Hide resolved
@wxtim wxtim force-pushed the cylc_config_-_add_--platform-names branch 2 times, most recently from 1f38a9e to 9af97bc Compare January 17, 2022 07:43
Copy link
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

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

Looks fine, need to complete checkboxes in desc.

@oliver-sanders
Copy link
Member

tests/f/cylc-config/09-platforms.t failing

@wxtim
Copy link
Member Author

wxtim commented Jan 20, 2022

tests/f/cylc-config/09-platforms.t failing

Should have that fixed.

@oliver-sanders
Copy link
Member

oliver-sanders commented Jan 21, 2022

Tests are passing, looks good, just needs rebase squash'n.

@oliver-sanders oliver-sanders requested review from datamel and removed request for hjoliver January 21, 2022 16:45
…ed tests/cylc-get-config to tests/cylc-config
@wxtim wxtim force-pushed the cylc_config_-_add_--platform-names branch from 1ba95d5 to ac32e7e Compare January 23, 2022 10:38
@oliver-sanders oliver-sanders requested review from MetRonnie and removed request for datamel January 24, 2022 11:07
Copy link
Member

@MetRonnie MetRonnie left a comment

Choose a reason for hiding this comment

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

Small thing: with no [platform groups] in my global config,

$ cylc config --platform-meta
...
        submission polling intervals = PT1S
    [[_remote_background_shared_ssh]]
        hosts = els055
        communication method = ssh
        install target = localhost
ItemNotFoundError: You have not set "platform groups" in this config.

$ echo $?
1

Comment on lines 193 to 194
options_are_valid(options, workflow_id)

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be at the top of the function?

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you mean that the get_option_parser should always be directly above the main functions whose wrapper uses it?

I thought that it ought to go at the top, because it acts as a form of internal documentation. main() is generally written at the bottom, and that leaves these convenience functions in the middle.

Copy link
Member

Choose a reason for hiding this comment

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

The checking of options' validity should be at the beginning of main(), otherwise it's missed out. Only problem is that workflow_id is not defined until down here too

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, I missed your meaning: In general I'd agree, but you've spotted why I can't do that.

Copy link
Member

Choose a reason for hiding this comment

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

So what I'm saying is there needs to be a change to allow the validation to come first, otherwise it's not doing its job

Copy link
Member

Choose a reason for hiding this comment

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

I've pushed a change to fix this.

cylc/flow/scripts/config.py Outdated Show resolved Hide resolved
tests/unit/scripts/test_config.py Outdated Show resolved Hide resolved
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.

ItemNotFoundError: You have not set "platform groups" in this config.

Similarly, if no platforms are defined:

$ cylc config --platform-meta      
ItemNotFoundError: You have not set "platforms" in this config.

It should just print nothing, and exit 0.

cylc/flow/cfgspec/globalcfg.py Outdated Show resolved Hide resolved
cylc/flow/scripts/config.py Outdated Show resolved Hide resolved
wxtim and others added 4 commits January 25, 2022 10:58
Co-authored-by: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com>
Co-authored-by: Hilary James Oliver <hilary.j.oliver@gmail.com>
…/cylc into cylc_config_-_add_--platform-names

* 'cylc_config_-_add_--platform-names' of github.com:wxtim/cylc:
  Apply suggestions from code review
  Update cylc/flow/scripts/config.py
CHANGES.md Outdated Show resolved Hide resolved
cylc/flow/cfgspec/globalcfg.py Outdated Show resolved Hide resolved
@wxtim wxtim requested a review from hjoliver January 26, 2022 13:11
wxtim and others added 3 commits January 26, 2022 13:20
…/cylc into cylc_config_-_add_--platform-names

* 'cylc_config_-_add_--platform-names' of github.com:wxtim/cylc:
  Update cylc/flow/scripts/config.py
Co-authored-by: Hilary James Oliver <hilary.j.oliver@gmail.com>
@wxtim
Copy link
Member Author

wxtim commented Jan 26, 2022

@MetRonnie - I think that I've resolved Hilary's suggestion, and responded to your outstanding comment.

wxtim and others added 7 commits January 26, 2022 15:33
…ed tests/cylc-get-config to tests/cylc-config
Co-authored-by: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com>
Co-authored-by: Hilary James Oliver <hilary.j.oliver@gmail.com>
Co-authored-by: Hilary James Oliver <hilary.j.oliver@gmail.com>
…/cylc into cylc_config_-_add_--platform-names

* 'cylc_config_-_add_--platform-names' of github.com:wxtim/cylc:
  Apply suggestions from code review
  response to review
  Update cylc/flow/scripts/config.py
  refactor testing
  Apply suggestions from code review
  Update cylc/flow/scripts/config.py
  created cylc config --platform-names and --platform-meta options; Moved tests/cylc-get-config to tests/cylc-config
@MetRonnie
Copy link
Member

Sorry for not being clear - I've added a comment: #4576 (comment)

@oliver-sanders
Copy link
Member

oliver-sanders commented Jan 26, 2022

I think you've merged something into this branch that wasn't supposed to be there, the diff is now much larger than expected.

@MetRonnie
Copy link
Member

MetRonnie commented Jan 26, 2022

Might be a case of GitHub dot com UI not coping (locally checked out in VSCode only showing 22 files changed compared to master). But the latest commit edd8bf8 is certainly strange, and doesn't appear to be needed?

…g_-_add_--platform-names

* 'master' of https://github.com/cylc/cylc:
  added cylc get-resources --tutorials (cylc#4580)
  GH Actions: allow debug of tutorial workflow tests in event of timeout
@wxtim
Copy link
Member Author

wxtim commented Jan 26, 2022

@MetRonnie and @oliver-sanders - I've merged with master, and the extra diff is gone again.

@hjoliver
Copy link
Member

hjoliver commented Jan 26, 2022

(Some One? broken test s)

@hjoliver
Copy link
Member

hjoliver commented Jan 27, 2022

@wxtim - please check my final commits on this branch in case you think further tweaks are warranted.

Just because "time is of the essence" for rc1 release, I've pushed up:

  • a func test fix
  • refactored option checking a bit (this involved removing a unit test that might need replacing in some form)

If CI passes I'll merge...

@hjoliver hjoliver force-pushed the cylc_config_-_add_--platform-names branch from ae211d3 to 341f7d4 Compare January 27, 2022 02:04
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.

🎉

@hjoliver hjoliver merged commit d3c8c48 into cylc:master Jan 27, 2022
@wxtim wxtim deleted the cylc_config_-_add_--platform-names branch January 27, 2022 08:47
MetRonnie pushed a commit to MetRonnie/cylc-flow that referenced this pull request Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cylc config --list-platforms
4 participants