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

Correctly report step start times #1722

Merged
merged 1 commit into from
Jan 8, 2020
Merged

Correctly report step start times #1722

merged 1 commit into from
Jan 8, 2020

Conversation

othomann
Copy link
Contributor

@othomann othomann commented Dec 10, 2019

Changes

These changes are setting accurate starting time for the different steps in the task.

This is accomplished by hijacking the terminationMessagePath (which is now always set to /tekton/termination), and having the injected entrypoint binary write the start time to that path when the step completes.

This is then picked up in pkg/pod/status.go to extract the reported start time and overwrite the container's StartedAt value.

Fixes #1512

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:

Reviewer Notes

If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.

Release Notes

This should fix issue https://github.com/tektoncd/pipeline/issues/1512

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 10, 2019
@tekton-robot
Copy link
Collaborator

Hi @othomann. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@imjasonh
Copy link
Member

/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 10, 2019
@othomann
Copy link
Contributor Author

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit and removed cla: no labels Dec 10, 2019
@imjasonh imjasonh changed the title Proposal for issue https://github.com/tektoncd/pipeline/issues/1512 Correctly report step start times Dec 10, 2019
pkg/termination/termination_test.go Outdated Show resolved Hide resolved
pkg/termination/termination_test.go Outdated Show resolved Hide resolved
pkg/termination/termination_test.go Outdated Show resolved Hide resolved
pkg/termination/termination_test.go Outdated Show resolved Hide resolved
pkg/termination/termination_test.go Outdated Show resolved Hide resolved
pkg/pod/status.go Outdated Show resolved Hide resolved
pkg/pod/status.go Outdated Show resolved Hide resolved
pkg/pod/status.go Outdated Show resolved Hide resolved
pkg/pod/status.go Outdated Show resolved Hide resolved
pkg/termination/termination.go Outdated Show resolved Hide resolved
@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/termination/termination.go Do not exist 69.6%

@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/termination/termination.go Do not exist 68.4%

@tekton-robot tekton-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 17, 2019
@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/entrypoint/entrypointer.go 100.0% 95.2% -4.8
pkg/termination/termination.go Do not exist 70.0%

@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/entrypoint/entrypointer.go 100.0% 95.2% -4.8
pkg/termination/termination.go Do not exist 70.0%

@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/entrypoint/entrypointer.go 100.0% 95.2% -4.8
pkg/termination/termination.go Do not exist 70.0%

@tekton-robot tekton-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 17, 2019
@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/entrypoint/entrypointer.go 100.0% 95.2% -4.8
pkg/termination/termination.go Do not exist 70.0%
test/builder/container.go 91.7% 86.8% -4.8

@othomann
Copy link
Contributor Author

/test pull-tekton-pipeline-build-tests

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to determine that you authored the commits in this PR. Maybe you used a different email address in the git commits than was used to sign the CLA? If someone else authored these commits, then please add them to this pull request and have them confirm that they're okay with them being contributed to Google. If there are co-authors, make sure they're formatted properly.

In order to pass this check, please resolve this problem and then comment@googlebot I fixed it... If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: no and removed cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit labels Jan 7, 2020
@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/entrypoint/entrypointer.go 100.0% 95.5% -4.5
pkg/termination/termination.go Do not exist 70.0%
test/builder/container.go 91.7% 86.8% -4.8

@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/entrypoint/entrypointer.go 100.0% 95.5% -4.5
pkg/termination/termination.go Do not exist 70.0%
test/builder/container.go 91.7% 86.8% -4.8

@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/entrypoint/entrypointer.go 100.0% 95.5% -4.5
pkg/termination/termination.go Do not exist 70.0%
test/builder/container.go 91.7% 86.8% -4.8

@othomann
Copy link
Contributor Author

othomann commented Jan 7, 2020

@googlebot I fixed it

@tekton-robot tekton-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 7, 2020
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit and removed cla: no labels Jan 7, 2020
@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/entrypoint/entrypointer.go 100.0% 95.5% -4.5
pkg/termination/termination.go Do not exist 70.0%
test/builder/container.go 91.7% 86.8% -4.8

@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/entrypoint/entrypointer.go 100.0% 95.5% -4.5
pkg/termination/termination.go Do not exist 70.0%
test/builder/container.go 91.7% 86.8% -4.8

@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/entrypoint/entrypointer.go 100.0% 95.5% -4.5
pkg/termination/termination.go Do not exist 70.0%
test/builder/container.go 91.7% 86.8% -4.8

Copy link
Member

@imjasonh imjasonh left a comment

Choose a reason for hiding this comment

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

Mostly looks good, just some style/readability comments.

cmd/git-init/main.go Outdated Show resolved Hide resolved
cmd/imagedigestexporter/main.go Outdated Show resolved Hide resolved
pkg/entrypoint/entrypointer.go Outdated Show resolved Hide resolved
pkg/entrypoint/entrypointer_test.go Outdated Show resolved Hide resolved
pkg/entrypoint/entrypointer_test.go Outdated Show resolved Hide resolved
pkg/pod/status.go Outdated Show resolved Hide resolved
pkg/pod/status.go Outdated Show resolved Hide resolved
pkg/termination/termination.go Show resolved Hide resolved
pkg/termination/termination_test.go Outdated Show resolved Hide resolved
pkg/termination/termination_test.go Outdated Show resolved Hide resolved
@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/entrypoint/entrypointer.go 100.0% 95.2% -4.8
pkg/termination/termination.go Do not exist 68.4%
test/builder/container.go 91.7% 86.8% -4.8

@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/entrypoint/entrypointer.go 100.0% 95.2% -4.8
pkg/termination/termination.go Do not exist 68.4%
test/builder/container.go 91.7% 86.8% -4.8

pkg/entrypoint/entrypointer_test.go Outdated Show resolved Hide resolved
pkg/entrypoint/entrypointer.go Outdated Show resolved Hide resolved
pkg/entrypoint/entrypointer.go Outdated Show resolved Hide resolved
for _, s := range pod.Status.ContainerStatuses {
if isContainerStep(s.Name) {
if s.State.Terminated != nil && len(s.State.Terminated.Message) != 0 {
msg := s.State.Terminated.Message
logger.Infof("json message to parse '%q'", msg)
Copy link
Member

Choose a reason for hiding this comment

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

Still seeing this debug logging.

pkg/pod/status.go Outdated Show resolved Hide resolved
@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/entrypoint/entrypointer.go 100.0% 95.0% -5.0
pkg/termination/termination.go Do not exist 68.4%
test/builder/container.go 91.7% 86.8% -4.8

@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/entrypoint/entrypointer.go 100.0% 95.0% -5.0
pkg/termination/termination.go Do not exist 68.4%
test/builder/container.go 91.7% 86.8% -4.8

@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/entrypoint/entrypointer.go 100.0% 95.0% -5.0
pkg/termination/termination.go Do not exist 68.4%
test/builder/container.go 91.7% 86.8% -4.8

Copy link
Member

@imjasonh imjasonh left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

🎉

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 8, 2020
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ImJasonH

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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 8, 2020
@tekton-robot tekton-robot merged commit 82dbcf8 into tektoncd:master Jan 8, 2020
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Step start times are reported inaccurately
5 participants