-
Notifications
You must be signed in to change notification settings - Fork 106
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
Fix Runner loading and refactor code #977
Conversation
ac8fab7
to
3c682b6
Compare
* Create a `_runner` submodule, where `util.py` lives * Maintains the hera.workflows.runner entrypoint Signed-off-by: Elliot Gunton <[email protected]>
* Isolating auto gen code changes, can ignore commit Signed-off-by: Elliot Gunton <[email protected]>
Signed-off-by: Elliot Gunton <[email protected]>
* Function is now testable, doesn't use global kwargs * Returns a value directly Signed-off-by: Elliot Gunton <[email protected]>
Signed-off-by: Elliot Gunton <[email protected]>
* Fixes value loading with a slightly hacky fix for now Signed-off-by: Elliot Gunton <[email protected]>
Signed-off-by: Elliot Gunton <[email protected]>
Signed-off-by: Elliot Gunton <[email protected]>
* Also tidy up types Signed-off-by: Elliot Gunton <[email protected]>
3c682b6
to
b0a913e
Compare
e7a055d
to
cb8417c
Compare
examples/workflows/upstream/title-and-descriptin-with-markdown.upstream.yaml
Outdated
Show resolved
Hide resolved
907425a
to
c7c610c
Compare
Signed-off-by: Elliot Gunton <[email protected]>
c7c610c
to
46e7098
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a relatively minor comment on "utils". Personally I am not a fan but it's also not a blocking thing. I approve bc this is not "critical" + these are private files for an experimental feature + gives us the chance to bring it up as a team and align on the convention we'd like to use (util vs specific modules vs something else)
examples/workflows/upstream/title-and-description-with-markdown.upstream.yaml
Show resolved
Hide resolved
) | ||
|
||
|
||
def _runner(entrypoint: str, kwargs_list: List) -> Any: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a very central runner function. I wonder if it can go into something more "significant" than a util file. I don't want to pick too much on "util", to be clear, but organizing into an abstract util does not tell contributors much atm :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I was also not 100% behind this, but I didn't want to have runner
in the path again, which would end up with patch(..._runner.runner._runner)
in tests.
Naming suggestions welcome!
* Script user guide was too long, split into main features. Fix internal links * Make pydantic io example into a runnable workflow - made it more obvious the scripts would need a custom image **Pull Request Checklist** - [x] Fixes #961 (fixes example) - [ ] Tests added - [x] Documentation/examples added - [x] [Good commit messages](https://cbea.ms/git-commit/) and/or PR title **Description of PR** Currently, the pydantic IO example does not work. Combined with fixes in PRs #974 and #977, this doc change shows how to use the Runner IO features. --------- Signed-off-by: Elliot Gunton <[email protected]>
**Pull Request Checklist** - [x] Fixes #962 - [x] Tests added - [ ] Documentation/examples added - [x] [Good commit messages](https://cbea.ms/git-commit/) and/or PR title **Description of PR** Primarily, this PR refactors the runner code. It also fixes the mapping and loading of kwargs to a RunnerInput object. Currently, the runner code is hard to follow. This PR refactors the functionality in the `runner.py` file into a `_runner` module with util submodules. The PR also makes the complex input mapping logic more testable. --------- Signed-off-by: Elliot Gunton <[email protected]>
**Pull Request Checklist** - [x] Fixes #962 - [x] Tests added - [ ] Documentation/examples added - [x] [Good commit messages](https://cbea.ms/git-commit/) and/or PR title **Description of PR** Currently, defaults are required when using Parameters in the RunnerInput. This PR allows defaults to be omitted. ## Changes from #977 - [x] Fixes #962 - [x] Tests added - [ ] Documentation/examples added - [x] [Good commit messages](https://cbea.ms/git-commit/) and/or PR title **Description of PR** Primarily, this PR refactors the runner code. It also fixes the mapping and loading of kwargs to a RunnerInput object. Currently, the runner code is hard to follow. This PR refactors the functionality in the `runner.py` file into a `_runner` module with util submodules. The PR also makes the complex input mapping logic more testable. ## Changes from #982 * Script user guide was too long, split into main features. Fix internal links * Make pydantic io example into a runnable workflow - made it more obvious the scripts would need a custom image **Pull Request Checklist** - [x] Fixes #961 (fixes example) - [ ] Tests added - [x] Documentation/examples added - [x] [Good commit messages](https://cbea.ms/git-commit/) and/or PR title **Description of PR** Currently, the pydantic IO example does not work. Combined with fixes in PRs #974 and #977, this doc change shows how to use the Runner IO features. --------- Signed-off-by: Elliot Gunton <[email protected]>
Pull Request Checklist
Description of PR
Primarily, this PR refactors the runner code. It also fixes the mapping and loading of kwargs to a RunnerInput object.
Currently, the runner code is hard to follow. This PR refactors the functionality in the
runner.py
file into a_runner
module with util submodules. The PR also makes the complex input mapping logic more testable.