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

Save dummy outputs when runner script raises an exception #949

Merged
merged 2 commits into from
Feb 12, 2024

Conversation

elliotgunton
Copy link
Collaborator

Pull Request Checklist

Description of PR
When running a script via the Hera Runner, if it raises an error, the declared outputs of the (script) template are not created as files in the container, leading to confusing Argo logs such as:

msg="cannot save parameter /tmp/hera-outputs/parameters/my-parameter"
argo=true
error="open /tmp/hera-outputs/parameters/my-parameter: no such file or directory"`

This PR makes the runner catch the exception, write dummy values, then pass the exception up.

@elliotgunton elliotgunton changed the base branch from main to pydantic-io-docs January 31, 2024 14:59
@elliotgunton elliotgunton added semver:patch A change requiring a patch version bump type:enhancement A general enhancement labels Jan 31, 2024
@elliotgunton
Copy link
Collaborator Author

JFYI - This PR is on top of the Runner IO models to avoid redoing the work

Signed-off-by: Elliot Gunton <egunton@bloomberg.net>
@samj1912 samj1912 merged commit 2385dc1 into pydantic-io-docs Feb 12, 2024
3 of 5 checks passed
@samj1912 samj1912 deleted the write-outputs-on-error branch February 12, 2024 12:40
@samj1912 samj1912 restored the write-outputs-on-error branch February 12, 2024 12:41
@elliotgunton elliotgunton deleted the write-outputs-on-error branch February 12, 2024 12:47
elliotgunton added a commit that referenced this pull request Feb 12, 2024
**Pull Request Checklist**
- [x] Fixes #948 
- [x] Tests added
- [ ] Documentation/examples added
- [x] [Good commit messages](https://cbea.ms/git-commit/) and/or PR
title

**Description of PR**
When running a script via the Hera Runner, if it raises an error, the
declared outputs of the (script) template are not created as files in
the container, leading to confusing Argo logs such as:

```
msg="cannot save parameter /tmp/hera-outputs/parameters/my-parameter"
argo=true
error="open /tmp/hera-outputs/parameters/my-parameter: no such file or directory"`
```

This PR makes the runner catch the exception, write dummy values, then
pass the exception up.

Signed-off-by: Elliot Gunton <egunton@bloomberg.net>
Co-authored-by: Sambhav Kothari <skothari44@bloomberg.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:patch A change requiring a patch version bump type:enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Save dummy outputs when runner script raises an exception
2 participants