-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
kind/feat: passing artifacts between tasks #7978
kind/feat: passing artifacts between tasks #7978
Conversation
Skipping CI for Draft Pull Request. |
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
00599d0
to
cd0b12d
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
46419a7
to
34c3828
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
Hi @vdemeester , I removed the syntax to get default artifact, please take a look when you have time. Thanks |
Just a ping @vdemeester when you have a chance. Thanks! |
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.
cc @lcarva
for _, vv := range v.Values { | ||
exists := false | ||
for _, av := range outputMap[v.Name] { | ||
if cmp.Equal(vv, av) { |
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.
Any reason to use cmp.Equal
here ?
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.
vv, av are instances of ArtifactValue struct, this struct contains a map, we so cannot use ==
operator to compare them, that's why cmp.Equal is used here.
type ArtifactValue struct {
Digest map[Algorithm]string `json:"digest,omitempty"` // Algorithm-specific digests for verifying the content (e.g., SHA256)
Uri string `json:"uri,omitempty"` // Location where the artifact value can be retrieved
}
if e.ArtifactsDirectory != "" { | ||
artifactsDir = e.ArtifactsDirectory | ||
} | ||
fp = filepath.Join(artifactsDir, "provenance.json") |
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.
We might want to make this an exported constant at least. Also, naive question, why the name provenance.json
?
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.
agreed about exported const.
provenance.json because it contains information about the location of the artifacts (i.e. Uri and digest). We can certainly change the name to something else. We thought that it was accurate.
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.
To make fp a constant value, it would require artifactsDir to be a constant first, but it needs to be a variable as we need to overwrite this value for test purpose. This is the same pattern used for resultDir
pipeline/pkg/entrypoint/entrypointer.go
Lines 267 to 273 in 34c3828
resultPath := pipeline.DefaultResultPath | |
if e.ResultsDirectory != "" { | |
resultPath = e.ResultsDirectory | |
} | |
if err := e.readResultsFromDisk(ctx, resultPath, result.TaskRunResultType); err != nil { | |
logger.Fatalf("Error while handling results: %s", err) | |
} |
34c3828
to
6ff6e9b
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
6ff6e9b
to
d2b4341
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
/retest |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chitrangpatel, vdemeester The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
d2b4341
to
1e5fb7f
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
/lgtm |
/retest |
fixes: #7870
Changes
Support passing artifacts between tasks as described in this tep
Task author can write task artifacts to
$(artifacts.path)
Tasks can consume artifacts from another tasks with similar syntax introduced for step Artifacts
$(tasks.<task-name>.outputs.<artifacts-category-name>)
, ,$(tasks.<task-name>.inputs.<artifacts-category-name>)
Note that both stepArtifacts which are written to
$(step.artifacts.path)
and task artifacts which are written to$(artifacts.path)
are aggregated into TaskRun.Status.Artifacts with deduplication.Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes