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

Reduce the number of imageDigestExporter step to one per Task #1126

Conversation

vdemeester
Copy link
Member

Changes

Currently, if a Task uses one or more image output we add a
imageDigestExporter for each step defined in the Task. This is not
required as only one step/container can do the work and handle
multiple images.

This change reduce to one the number of imageDigestExporter to one
step, after the last user-defined step.

Closes #1104

Signed-off-by: Vincent Demeester vdemeest@redhat.com

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Double check this list of stuff that's easy to miss:

Release Notes

Reduce the number of imageDigestExporter step to one per Task instead of one for each steps in a Task

@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Jul 25, 2019
@tekton-robot tekton-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 25, 2019
@vdemeester
Copy link
Member Author

/hold
I feel we need a e2e test with multiple images 👼

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 25, 2019
Currently, if a `Task` uses one or more image output we add a
`imageDigestExporter` for each step defined in the `Task`. This is not
required as only one step/container can do the work and handle
multiple images.

This change reduce to one the number of `imageDigestExporter` to one
step, after the last user-defined step.

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
@vdemeester vdemeester force-pushed the 1104-imagedigest-only-once-per-taskrun branch from b7b5cba to 22acced Compare July 25, 2019 13:03
@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/v1alpha1/taskrun/resources/image_exporter.go 88.1% 87.8% -0.3

@bobcatfish
Copy link
Collaborator

I'm trying to remember the details of the reason we had an image after each step - I even paired with @nader-ziada on this and I can't quite remember 🤣 I'm really kicking myself that we didn't make it clear in comments :S

Part of the reason was that it seemed like we couldn't guarantee that we knew which step was exporting the image - maybe to handle a case where we export 2 images, each in a different step?? But it sounds like we're handling that already - all I can come up with is that maybe it was to handle a case where the same image is getting exported multiple times but I'm not sure now why we'd want to support that 🤷‍♀

Might as well go ahead with this for now unless @nader-ziada is around and can remember why we did it? 😅

Copy link
Member

@dibyom dibyom left a comment

Choose a reason for hiding this comment

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

Thanks @vdemeester !!!

@nader-ziada
Copy link
Member

Agree with @bobcatfish it had to do with building same image in multiple steps, but makes sense to me to have just one step in the end.

Copy link
Member

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

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

This looks good to me, but I feel we need to document what type of restrictions we have in terms of using the image pipeline resources and build the output.
I think it makes sense to have a Task producing one image - multi-stage docker files can be used where needed, so in general only one output of type image should be available in a Task.
It's fine to do that as a follow-up.

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afrittoli, dibyom, 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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@vdemeester
Copy link
Member Author

This looks good to me, but I feel we need to document what type of restrictions we have in terms of using the image pipeline resources and build the output.
I think it makes sense to have a Task producing one image - multi-stage docker files can be used where needed, so in general only one output of type image should be available in a Task.
It's fine to do that as a follow-up.

Well, it's possible for a task to build and push multiple images 👼

Copy link
Collaborator

@bobcatfish bobcatfish left a comment

Choose a reason for hiding this comment

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

I only had one tiny little bit of feedback that is so minor I'm gonna just lgtm anyway 😅

/lgtm

🎉 hooray for simplification!

augmentedSteps = append(augmentedSteps, imageDigestExporterContainer(s.Name, imagesJSON))
}
augmentedSteps = append(augmentedSteps, taskSpec.Steps...)
augmentedSteps = append(augmentedSteps, imageDigestExporterContainer(imagesJSON))
Copy link
Collaborator

Choose a reason for hiding this comment

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

at this point we probably don't even need augmentedSteps ? could use taskSpec.Steps directly

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 26, 2019
@bobcatfish
Copy link
Collaborator

/meow space

@tekton-robot
Copy link
Collaborator

@bobcatfish: cat image

In response to this:

/meow space

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@vdemeester
Copy link
Member Author

/hold cancel

@tekton-robot tekton-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 26, 2019
@tekton-robot tekton-robot merged commit dc91bdc into tektoncd:master Jul 26, 2019
@vdemeester vdemeester deleted the 1104-imagedigest-only-once-per-taskrun branch July 26, 2019 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Why do we run imageDigestExporter after each step in a taskrun?
7 participants