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

Automatically create named directories for each output resource in a … #1156

Merged
merged 1 commit into from
Aug 5, 2019

Conversation

dlorenc
Copy link
Contributor

@dlorenc dlorenc commented Aug 5, 2019

…TaskRun.

Changes

TaskRuns are expected to place files related to an Output in a directory named
for each Output. Right now, we expect Task authors to create this directory before
placing files there. This is onerous and error-prone, so we should automatically create
them.

There are a few approaches to doing this:

  • a mkdir init container
  • a volume
  • a mkdir pod container

I chose to use the final one, a mkdir pod container for consistency with Input resources.
This is prepended to the Task steps.

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.

Release Notes

Tekton now automatically creates directories for each Output resource during a Taskrun.

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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

@tekton-robot tekton-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 5, 2019
@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Aug 5, 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/reconciler/v1alpha1/taskrun/resources/output_resource.go 91.8% 92.2% 0.3

@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/output_resource.go 91.8% 92.2% 0.3

@dlorenc
Copy link
Contributor Author

dlorenc commented Aug 5, 2019

/test pull-tekton-pipeline-integration-tests

@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/output_resource.go 91.8% 92.2% 0.3

…TaskRun.

TaskRuns are expected to place files related to an Output in a directory named
for each Output. Right now, we expect Task authors to create this directory before
placing files there. This is onerous and error-prone, so we should automatically create
them.

There are a few approaches to doing this:
- a mkdir init container
- a volume
- a mkdir pod container

I chose to use the final one, a mkdir pod container for consistency with Input resources.
This is prepended to the Task steps.
@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/output_resource.go 91.8% 92.2% 0.3
pkg/reconciler/v1alpha1/taskrun/taskrun.go Do not exist 71.0%

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 for this, it's really helpful!

I'm a bit worried that the number of containers created by Tekton is exploding - so we may need to create a way to separate in the YAML user-step containers from those generated by Tekton.

Perhaps in future we could have a pre-process and post-process container where to hooks any extra step needed by Tekton, so that it's more obvious which containers run user steps and which run pre/post processing steps?

@afrittoli
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 5, 2019
@tekton-robot tekton-robot merged commit ba25d4e into tektoncd:master Aug 5, 2019
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.

None yet

4 participants