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

Add get_artifact for template invocator use #1284

Merged
merged 6 commits into from
Dec 9, 2024
Merged

Conversation

elliotgunton
Copy link
Collaborator

@elliotgunton elliotgunton commented Dec 4, 2024

Pull Request Checklist

Description of PR
Adds get_artifact to IOMixin to allow tasks to get artifacts from the parent (DAG/Steps) template.

Also added on-cluster test using Artifacts, which requires extra set up steps to add minio and configure it as the artifact repository.

@elliotgunton elliotgunton added semver:minor A change requiring a minor version bump type:enhancement A general enhancement labels Dec 4, 2024
@elliotgunton elliotgunton changed the title Add get artifact Add get_artifact for template invocator use Dec 4, 2024
Copy link

codecov bot commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.2%. Comparing base (52597f2) to head (b4d8894).
Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1284   +/-   ##
=====================================
  Coverage   86.1%   86.2%           
=====================================
  Files         60      60           
  Lines       4079    4089   +10     
  Branches     648     652    +4     
=====================================
+ Hits        3516    3526   +10     
  Misses       392     392           
  Partials     171     171           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@elliotgunton elliotgunton force-pushed the add-get-artifact branch 3 times, most recently from d3cd835 to 016dc4e Compare December 5, 2024 10:44
@elliotgunton elliotgunton marked this pull request as ready for review December 5, 2024 11:10
* Similarly to `get_parameter`, allows subnodes like Tasks and Steps
to "get" an artifact from the parent template (DAG or Steps)

Signed-off-by: Elliot Gunton <[email protected]>
* Tidy up Makefile targets
* Add set-up-artifacts target to add minio storage from the argoproj-labs training materials

Signed-off-by: Elliot Gunton <[email protected]>
Signed-off-by: Elliot Gunton <[email protected]>
Signed-off-by: Elliot Gunton <[email protected]>
Copy link
Collaborator

@alicederyn alicederyn left a comment

Choose a reason for hiding this comment

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

Just a question for my edification, LGTM I think :)

raise KeyError(f"No artifacts set. Artifact {name} not found.")
for artifact in inputs.artifacts:
if artifact.name == name:
return Artifact(name=name, from_=f"{{{{inputs.artifacts.{artifact.name}}}}}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure why we're copying across all the fields in get_parameter, but only name in this function.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We probably shouldn't copy everything in get_parameter, as all the other fields are irrelevant when used as an argument

@elliotgunton elliotgunton merged commit 25ac420 into main Dec 9, 2024
25 checks passed
@elliotgunton elliotgunton deleted the add-get-artifact branch December 9, 2024 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:minor A change requiring a minor version bump type:enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Template Invocators (Steps/DAG) have no 'get_artifact'
2 participants