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 the imageID for each step to the TaskRun.Spec.Status object. #1026

Merged
merged 1 commit into from
Aug 12, 2019

Conversation

dlorenc
Copy link
Contributor

@dlorenc dlorenc commented Jun 27, 2019

Changes

This allows users to trace the exact steps (including digest) used in each TaskRun.
This information is already available on a Pod, but we need to assume completed Pods
will be GC'ed and not available long after the run is complete.

Fixes #1025

Submitter Checklist

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

Release Notes

Adds a field called `ImageID` to `TaskRun.Spec.Status.Steps`, which contains the full image ID and digest used to run each step.

@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Jun 27, 2019
@tekton-robot tekton-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 27, 2019
@dlorenc dlorenc force-pushed the digest branch 2 times, most recently from c50ad3e to 97b5ebe Compare June 27, 2019 01:52
@tekton-robot tekton-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 27, 2019
@imjasonh
Copy link
Member

This is great. Would it be useful to have an integration test that checks that imageID is populated as expected?

I'm imagining a test that uses ggcr to resolve some public image's digest then runs that image by tag as a step and checks that the step state reports the image at the same digest.

@afrittoli
Copy link
Member

This is great. Would it be useful to have an integration test that checks that imageID is populated as expected?

I'm imagining a test that uses ggcr to resolve some public image's digest then runs that image by tag as a step and checks that the step state reports the image at the same digest.

I think such E2E test could be interesting to have, but what it would verify additionally is that the image specified in the Step is passed properly into the container spec, and that k8s pulls the image correctly. I think that the fact that the image + digest from the pod is passed to the step status is already verified by the unit test.
If we setup such a test I would use a registry that the test has control on, as opposed to a public one.

@afrittoli
Copy link
Member

/test pull-tekton-pipeline-integration-tests

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.

LGTM, thank you, this looks useful to have.

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afrittoli, dlorenc

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

@dlorenc
Copy link
Contributor Author

dlorenc commented Aug 8, 2019

/test pull-tekton-pipeline-integration-tests

@dlorenc dlorenc force-pushed the digest branch 3 times, most recently from ddd1f38 to e5736e5 Compare August 12, 2019 17:46
@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 12, 2019
@tekton-robot tekton-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 12, 2019
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 think this makes sense!

Couple quick requests 😇 :

@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 12, 2019
@dlorenc
Copy link
Contributor Author

dlorenc commented Aug 12, 2019

  • I think @afrittoli was asking for this as well but can this PR include an update to an end to end test to verify this field? if we update an example Task to use a specific image at a specific sha then we dont have to worry about the value changing or anything. (i.e. at least one test where we don't cmpopts.IgnoreFields(v1alpha1.StepState{}, "ImageID") for all imageID fields)

Whoops, added!

Done!

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.

One super minor println away!

docs/taskruns.md Show resolved Hide resolved
test/taskrun_test.go Outdated Show resolved Hide resolved
@dlorenc dlorenc force-pushed the digest branch 2 times, most recently from 7b0483f to 2869209 Compare August 12, 2019 18:48
This allows users to trace the exact steps (including digest) used in each TaskRun.
This information is already available on a Pod, but we need to assume completed Pods
will be GC'ed and not available long after the run is complete.
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.

/lgtm
/meow space

@@ -18,7 +18,8 @@ A `TaskRun` runs until all `steps` have completed or until a failure occurs.
- [Overriding where resources are copied from](#overriding-where-resources-are-copied-from)
- [Service Account](#service-account)
- [Pod Template](#pod-template)
- [Steps](#steps)
- [Status](#status)
- [Steps](#steps)
Copy link
Collaborator

Choose a reason for hiding this comment

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

❤️

@tekton-robot
Copy link
Collaborator

@bobcatfish: cat image

In response to this:

/lgtm
/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.

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

interesting definition of "space"

@tekton-robot tekton-robot merged commit f86e63b into tektoncd:master Aug 12, 2019
@dlorenc dlorenc deleted the digest branch August 13, 2019 14:32
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: Extend the TaskRun Status to contain the exact digest of all images used as steps.
6 participants