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

TEP-0011: Add StdoutConfig and StderrConfig to steps. #4882

Merged
merged 1 commit into from
Jul 15, 2022
Merged

TEP-0011: Add StdoutConfig and StderrConfig to steps. #4882

merged 1 commit into from
Jul 15, 2022

Conversation

bradbeck
Copy link
Contributor

@bradbeck bradbeck commented May 17, 2022

Changes

Implements Option 1 of TEP-0011

Resurrects #3103

Closes #2925

Signed-off-by: Brad Beck bradley.beck@gmail.com

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Docs included if any changes are user facing
  • Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Release notes block below has been filled in
    (if there are no user facing changes, use release note "NONE")

Release Notes

Users can specify `stdoutConfig` and `stderrConfig` in steps to capture steps' stdout and stderr to local files. This feature can be used to capture stdout and stderr into task results.

@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label May 17, 2022
@tekton-robot tekton-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label May 17, 2022
@tekton-robot
Copy link
Collaborator

Hi @bradbeck. 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.

@tekton-robot tekton-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 17, 2022
@pritidesai
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 May 17, 2022
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/io.go Do not exist 86.8%
cmd/entrypoint/runner.go 81.5% 81.0% -0.4
pkg/apis/pipeline/v1beta1/step_replacements.go 40.0% 66.7% 26.7

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/io.go Do not exist 86.8%
cmd/entrypoint/runner.go 81.5% 81.0% -0.4
pkg/apis/pipeline/v1beta1/step_replacements.go 40.0% 66.7% 26.7
pkg/pod/entrypoint.go 88.3% 88.9% 0.6

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/io.go Do not exist 86.8%
cmd/entrypoint/runner.go 81.5% 81.0% -0.4
pkg/apis/pipeline/v1beta1/step_replacements.go 40.0% 66.7% 26.7
pkg/pod/entrypoint.go 88.3% 88.9% 0.6

@vdemeester vdemeester self-assigned this May 18, 2022
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/io.go Do not exist 86.8%
cmd/entrypoint/runner.go 81.5% 79.3% -2.2
pkg/apis/pipeline/v1beta1/step_replacements.go 40.0% 66.7% 26.7
pkg/pod/entrypoint.go 88.3% 88.9% 0.6

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/io.go Do not exist 86.8%
cmd/entrypoint/runner.go 81.5% 84.7% 3.2
pkg/apis/pipeline/v1beta1/step_replacements.go 40.0% 66.7% 26.7
pkg/pod/entrypoint.go 88.3% 88.9% 0.6

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/io.go Do not exist 86.8%
cmd/entrypoint/runner.go 81.5% 83.6% 2.1
pkg/apis/pipeline/v1beta1/step_replacements.go 40.0% 66.7% 26.7
pkg/pod/entrypoint.go 88.3% 88.9% 0.6

@bradbeck
Copy link
Contributor Author

/test pull-tekton-pipeline-alpha-integration-tests

@tekton-robot tekton-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jun 9, 2022
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/io.go Do not exist 86.8%
cmd/entrypoint/runner.go 81.5% 83.6% 2.1
pkg/apis/pipeline/v1beta1/step_replacements.go 40.0% 66.7% 26.7
pkg/pod/entrypoint.go 88.3% 88.9% 0.6

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/io.go Do not exist 86.8%
cmd/entrypoint/runner.go 77.8% 83.6% 5.8
pkg/apis/pipeline/v1beta1/step_replacements.go 40.0% 66.7% 26.7
pkg/pod/entrypoint.go 88.3% 88.9% 0.6

@pritidesai pritidesai added this to the Pipelines v0.38 milestone Jun 13, 2022
@bradbeck
Copy link
Contributor Author

@vdemeester @imjasonh Please take a look.

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 17, 2022
@@ -45,6 +45,8 @@ var (
terminationPath = flag.String("termination_path", "/tekton/termination", "If specified, file to write upon termination")
results = flag.String("results", "", "If specified, list of file names that might contain task results")
timeout = flag.Duration("timeout", time.Duration(0), "If specified, sets timeout for step")
stdoutPath = flag.String("stdout_path", "", "If specified, file to copy stdout to")
stderrPath = flag.String("stderr_path", "", "If specified, file to copy stdout to")
Copy link
Member

Choose a reason for hiding this comment

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

s/stdout/stderr/

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

LGTM, the only question I have is wether we want to add this behind a feature-flag or not — as it is additive only, I think it is fine to add it directly, but maybe we want to hide it behind the alpha feature flag.

@bradbeck 👍🏼

@bradbeck
Copy link
Contributor Author

LGTM, the only question I have is wether we want to add this behind a feature-flag or not — as it is additive only, I think it is fine to add it directly, but maybe we want to hide it behind the alpha feature flag.

@bradbeck 👍🏼

@vdemeester Thanks for the feedback. Working on understanding what it takes to put this behind the alpha feature flag.

@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 23, 2022
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/io.go Do not exist 86.8%
cmd/entrypoint/runner.go 77.8% 82.1% 4.3
pkg/apis/pipeline/v1beta1/step_replacements.go 40.0% 66.7% 26.7
pkg/pod/entrypoint.go 88.3% 88.9% 0.6

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/io.go Do not exist 86.8%
cmd/entrypoint/runner.go 81.5% 83.6% 2.1
pkg/apis/pipeline/v1beta1/step_replacements.go 40.0% 66.7% 26.7
pkg/pod/entrypoint.go 88.3% 88.9% 0.6

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/io.go Do not exist 86.8%
cmd/entrypoint/runner.go 77.8% 81.7% 3.9
pkg/apis/pipeline/v1beta1/step_replacements.go 40.0% 66.7% 26.7
pkg/apis/pipeline/v1beta1/task_validation.go 97.6% 97.7% 0.0
pkg/pod/entrypoint.go 88.8% 89.3% 0.5

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/io.go Do not exist 86.8%
cmd/entrypoint/runner.go 77.8% 81.7% 3.9
pkg/apis/pipeline/v1beta1/step_replacements.go 40.0% 66.7% 26.7
pkg/apis/pipeline/v1beta1/task_validation.go 97.6% 97.7% 0.0
pkg/pod/entrypoint.go 88.8% 89.3% 0.5

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/io.go Do not exist 86.8%
cmd/entrypoint/runner.go 77.8% 81.7% 3.9
pkg/apis/pipeline/v1beta1/step_replacements.go 40.0% 66.7% 26.7
pkg/apis/pipeline/v1beta1/task_validation.go 97.6% 97.7% 0.0
pkg/pod/entrypoint.go 88.8% 89.4% 0.7

pkg/pod/entrypoint.go Outdated Show resolved Hide resolved
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/io.go Do not exist 86.8%
cmd/entrypoint/runner.go 77.8% 80.3% 2.5
pkg/apis/pipeline/v1beta1/step_replacements.go 40.0% 66.7% 26.7
pkg/apis/pipeline/v1beta1/task_validation.go 97.6% 97.7% 0.0
pkg/pod/entrypoint.go 88.8% 89.3% 0.5

@bradbeck
Copy link
Contributor Author

/retest

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/io.go Do not exist 86.8%
cmd/entrypoint/runner.go 81.5% 81.7% 0.2
pkg/apis/pipeline/v1beta1/step_replacements.go 40.0% 66.7% 26.7
pkg/apis/pipeline/v1beta1/task_validation.go 97.6% 97.7% 0.0
pkg/pod/entrypoint.go 88.8% 89.3% 0.5

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/io.go Do not exist 86.8%
cmd/entrypoint/runner.go 81.5% 81.7% 0.2
pkg/apis/pipeline/v1beta1/step_replacements.go 40.0% 66.7% 26.7
pkg/apis/pipeline/v1beta1/task_validation.go 97.6% 97.7% 0.0
pkg/pod/entrypoint.go 88.8% 89.3% 0.5

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/io.go Do not exist 86.8%
cmd/entrypoint/runner.go 81.5% 81.7% 0.2
pkg/apis/pipeline/v1beta1/step_replacements.go 40.0% 66.7% 26.7
pkg/apis/pipeline/v1beta1/task_validation.go 97.6% 97.7% 0.0
pkg/pod/entrypoint.go 88.8% 89.3% 0.5

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/io.go Do not exist 83.0%
cmd/entrypoint/runner.go 81.5% 78.9% -2.6
pkg/apis/pipeline/v1beta1/step_replacements.go 40.0% 66.7% 26.7
pkg/apis/pipeline/v1beta1/task_validation.go 97.6% 97.7% 0.0
pkg/pod/entrypoint.go 88.8% 89.3% 0.5

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/io.go Do not exist 86.8%
cmd/entrypoint/runner.go 81.5% 81.7% 0.2
pkg/apis/pipeline/v1beta1/step_replacements.go 40.0% 66.7% 26.7
pkg/apis/pipeline/v1beta1/task_validation.go 97.6% 97.7% 0.0
pkg/pod/entrypoint.go 88.8% 89.3% 0.5

@afrittoli
Copy link
Member

yay, tests passing now!! 😎

@@ -1239,6 +1239,171 @@ spec:
}
}

func TestAlphaReconcile(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

🤩

Comment on lines +497 to +501
volumeMounts:
- name: data
mountPath: /data
volumes:
- name: data
Copy link
Member

Choose a reason for hiding this comment

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

We generally discourage use of volumes in favour of workspaces which is the preferred authoring time abstraction. Could you change the example here to use workspaces instead, as users will often copy examples from the reference docs. Thank you!


> NOTE:
>
> - If the intent is to share output between `Step`s via a file, the user must ensure that the paths provided are shared between the `Step`s (e.g via `volumes`).
Copy link
Member

Choose a reason for hiding this comment

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

Users should use a workspace rather than a volume. The workspace can be bound at runtime to an emptyDir is the required sharing is only within the Task.

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.

Thank you so much for this feature! 🎉

I would very much like to see the suggested update to the docs before this is merged, but otherwise everything LGTM, code, docs and test coverage.

/approve

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afrittoli

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 Jul 15, 2022
Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 15, 2022
@tekton-robot tekton-robot merged commit a0c7d31 into tektoncd:main Jul 15, 2022
@bradbeck bradbeck deleted the tep-0011-stdoutconfig-stderrconfig branch July 15, 2022 12:54
@pritidesai
Copy link
Member

Very excited to try this out 🎉 Thank you @bradbeck for implementing this 🙏

Thank you @afrittoli and @vdemeester for the reviews 🙏

@abayer abayer mentioned this pull request Jul 20, 2022
jerop added a commit to jerop/community that referenced this pull request Mar 21, 2023
TEP-0011 was implemented in tektoncd/pipeline#4882.
This change updates the TEP state from `implementable` to `implemented`.
tekton-robot pushed a commit to tektoncd/community that referenced this pull request Mar 21, 2023
TEP-0011 was implemented in tektoncd/pipeline#4882.
This change updates the TEP state from `implementable` to `implemented`.
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. kind/feature Categorizes issue or PR as related to a new feature. 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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make it possible to extract results from a container's stdout
6 participants