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

Cli setting of rose opts #4023

Merged
merged 5 commits into from
Feb 5, 2021
Merged

Conversation

wxtim
Copy link
Member

@wxtim wxtim commented Jan 5, 2021

built on: #4000
sibling: cylc-rose PR20

Summary

These changes partially address #3819
These changes are downstream of changes in (cylc-rose:#20)[https://github.com/cylc/cylc-rose/pull/20]. The PR attempts to add command line options similar to the following rose suite-run options:

  • --opt-conf-key
  • --defines
  • --suite-defines

Checklist

  • Appropriate tests are included (unit and/or functional).
  • Appropriate change log entry included.
  • Documentation written as part of CLI, but not in Cylc docs. Is this OK for now?

@wxtim wxtim marked this pull request as draft January 5, 2021 16:59
@TomekTrzeciak
Copy link
Contributor

  • --opt-conf-key
  • --defines
  • --suite-defines

Sorry if I'm missing some context here, but would be the rationale of porting over --suite-defines instead of adding --set & --set-file to cylc install and making that work (#3913 made cylc and rose suite vars compatible)?

@oliver-sanders
Copy link
Member

@TomekTrzeciak responded on the issue - #3819 (comment)

@wxtim wxtim marked this pull request as ready for review January 18, 2021 10:54
@wxtim wxtim marked this pull request as draft January 18, 2021 10:55
@wxtim wxtim marked this pull request as ready for review January 18, 2021 16:21
@wxtim wxtim requested a review from datamel January 18, 2021 16:21
@wxtim wxtim self-assigned this Jan 18, 2021
@wxtim wxtim marked this pull request as draft January 18, 2021 16:32
@oliver-sanders
Copy link
Member

$ cylc install .
PluginError: Error in plugin cylc.pre_configure.rose
'NoneType' object has no attribute 'opt_conf_keys'

@oliver-sanders
Copy link
Member

oliver-sanders commented Jan 19, 2021

Ok, got it.

The pre_configure plugin hooks in cylc-flow are not passing the opts kwarg to the implementations in cylc-rose.

  • The plugin hook in cylc.flow.install should provide this argument.
    • This is required so that opt configs can effect file installation etc.
  • The plugin hook in cylc.flow.parsec.fileparse shouldn't provide this argument.
    • The flow config is not read in during installation (however, the global config is which is currently failing).

@wxtim
Copy link
Member Author

wxtim commented Jan 19, 2021

@oliver-sanders I think I've excluded rose-suite-cylc-install.conf from being rsynced.

@wxtim
Copy link
Member Author

wxtim commented Jan 20, 2021

Conflicted after merge with the cylc-install origin branch. Therefore tests aren't running.

@wxtim wxtim marked this pull request as ready for review January 20, 2021 12:01
@wxtim
Copy link
Member Author

wxtim commented Jan 26, 2021

Due to the way that this branch is effectively built on top of @datamel 's my merges to keep it updated have resulted in a horrid looking history. Given that the final diff is likely to be fairly small it's my intention to do a git diff with master once the cylc-install branch is merged and re-create this PR branch from that diff so that the history looks less awful.

@oliver-sanders
Copy link
Member

oliver-sanders commented Jan 26, 2021

Could try squashing your commits then you can cherry-pick them/it on top.

@datamel
Copy link
Contributor

datamel commented Jan 26, 2021

Due to the way that this branch is effectively built on top of @datamel 's my merges to keep it updated have resulted in a horrid looking history. Given that the final diff is likely to be fairly small it's my intention to do a git diff with master once the cylc-install branch is merged and re-create this PR branch from that diff so that the history looks less awful.

Yep, sorry my cylc-install history looks so terrible! Should look a bit better now I have rebased.

@wxtim wxtim force-pushed the cli-setting-of-rose-opts branch 2 times, most recently from 7e2e00c to ce0baa9 Compare January 27, 2021 12:11
@wxtim
Copy link
Member Author

wxtim commented Feb 1, 2021

Outstanding test failure will stop failing when cylc-rose PR20 is merged to master. tests/functional/cylc-clean/00-basic.t and tests/functions/cylc-install/03...t contain a test for the presence of cylc-rose and provides extra lines for the reference test output reflecting the new capabilities of cylc-rose. The tests only have the master branch installed not cylc-rose PR20, so the tests fail. I think that this OK.

Copy link
Contributor

@datamel datamel left a comment

Choose a reason for hiding this comment

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

I have read through the code and had a play around with it. I am happy with this PR, although I think consider adding functional tests cylc-flow side.

tests/functional/cylc-clean/00-basic.t Show resolved Hide resolved
cylc/flow/scripts/install.py Show resolved Hide resolved
@wxtim wxtim requested a review from datamel February 2, 2021 08:34
@wxtim wxtim changed the title Cli setting of rose opts [Test failure may be OK] Cli setting of rose opts Feb 2, 2021
@oliver-sanders oliver-sanders changed the title [Test failure may be OK] Cli setting of rose opts Cli setting of rose opts Feb 4, 2021
@oliver-sanders
Copy link
Member

oliver-sanders commented Feb 4, 2021

Tests passing with cylc-rose PR20 with latest commits.

Comment on lines +63 to +68
export ROSE_FILES=''
python -c "import cylc.rose" > /dev/null 2>&1 &&
export ROSE_FILES="
|-- opt
| \`-- rose-suite-cylc-install.conf
|-- rose-suite.conf"
Copy link
Member

Choose a reason for hiding this comment

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

Tested with and without cylc-rose installed, all good.

Comment on lines +56 to +68
export ROSE_FILES=''
if python -c "import cylc.rose" > /dev/null 2>&1; then
export ROSE_FILES="├── log
│   └── install
├── opt
│   └── rose-suite-cylc-install.conf
└── rose-suite.conf"
else
export ROSE_FILES="└── log
└── install"
fi

tree -a -v -I '*.log|03-file-transfer*' --charset UTF8 --noreport "${RND_SUITE_RUNDIR}/" > 'basic-tree.out'
Copy link
Member

Choose a reason for hiding this comment

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

Tested with and without cylc-rose all good.

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.

All good @datamel could you give this a quick once-over.

Copy link
Contributor

@datamel datamel left a comment

Choose a reason for hiding this comment

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

I have re-run the tests and read through the code changes since the last review. LGTM, thanks @wxtim

@datamel datamel merged commit 9bdd5c6 into cylc:master Feb 5, 2021
@wxtim wxtim deleted the cli-setting-of-rose-opts branch March 22, 2022 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants