-
Notifications
You must be signed in to change notification settings - Fork 222
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 of adding pipelinerun.spec.taskruntemplate #783
Conversation
Related Issue: tektoncd/pipeline#5302 PR is not ready for review now! 😂 |
/kind tep |
/assign @lbernick |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @yuzp1996! would you mind removing the formatting changes from this PR?
## Proposal | ||
Add filed taskRunSpecTemplate to PipelineRun.Spec then we can specify the common configuration in taskRunSpecTemplate, and the configuration will apply to all the TasRun. | ||
|
||
```yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to have an example of how the new field would be used to meet one of these use cases. For example, for use case number 1 (service accounts), the user might have a pipeline that clones and then runs unit tests, integration tests, and linters. They might want to use the same service account for all the tests, but a different service account for the clone. It would be helpful to include the pipeline definition as well. In this example, the taskRunTemplate has the same configuration as taskRunSpecs, which a user is unlikely to do.
vault.hashicorp.com/agent-inject-secret-foo: "/path/to/foo" | ||
vault.hashicorp.com/role: role-name | ||
// Add the following filed that same as taskRunSpecs | ||
+ taskRunSpecTemplate: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should call this taskRunTemplate
instead of taskRunSpecTemplate
.
Expand pipelinerun.Spec and add taskRunSpecTemplate | ||
|
||
|
||
```go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to include all this code here-- that can be discussed in a pull request. Instead, I'd recommend including an example of a user-configured PipelineRun before this change, and the same PipelineRun after this change.
(A good example is in the matrix TEP: https://github.com/tektoncd/community/blob/main/teps/0090-matrix.md#substituting-string-parameters-in-the-tasks. There's an example of what a PipelineRun would look like with this feature, and the same PipelineRun without this feature.)
I want to specify compute resources that each TaskRun in my PipelineRun should run with, and don't want to have to specify them individually for each TaskRun. | ||
|
||
## Proposal | ||
Add filed taskRunTemplate to PipelineRun.Spec then users can specify common configuration in taskRunTemplate and the configuration will apply to all the TaskRun. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add filed taskRunTemplate to PipelineRun.Spec then users can specify common configuration in taskRunTemplate and the configuration will apply to all the TaskRun. | |
Add field taskRunTemplate to PipelineRun.Spec so that users can specify common configuration in taskRunTemplate that will apply to all the TaskRuns. |
@@ -0,0 +1,179 @@ | |||
--- | |||
status: proposed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be "implementable"
ComputeResources *corev1.ResourceRequirements `json:"computeResources,omitempty"` | ||
} | ||
|
||
// Reference PipelineTaskRunTemplate in PipelineRunSpec as filed TaskRunSpecTemplate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Reference PipelineTaskRunTemplate in PipelineRunSpec as filed TaskRunSpecTemplate | |
// Reference PipelineTaskRunTemplate in PipelineRunSpec via the field TaskRunSpecTemplate |
computeResources: | ||
requests: | ||
cpu: 2 | ||
stepOverrides: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would you mind removing stepOverrides
from this example, as it can't be used along with computeResources
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your review @lbernick! I have synced the latest changes!
But I don't know why stepOverrides can not be used along with computeResources. Could you please help tell me the reason? Thanks! If so does this mean sidecarOverrides can only not be used along with computeResources either? 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tektoncd/core-maintainers need a non-googler assignee, please take a look |
@yuzp1996 would you mind updating this TEP to address moving podTemplate and serviceAccountName under taskRunTemplate, and clarifying that the changes will be made in v1 only? Thanks :) |
I don't mind at all 😁. I'll do it when I'm fine. |
479b78d
to
231c446
Compare
@vdemeester @lbernick Changes are synced, please correct me if I don't understand correctly. |
this looks good to me! I'll let vincent take another look |
We want to provide a convenient way to specify taskrun configuration Now there is ServiceAccountName and PodTemplate can do the same thing so we merge these two field to PipelineTaskRunTemplate and add metadata sidecarOverrides annd computeResources to PipelineTaskRunTemplate. Signed-off-by: yuzhipeng <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lbernick, 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 |
/lgtm |
FYI @jerop @abayer I realized this may affect pipelines in pipelines since the TEP states that |
sure, let's gather initial feedback on also noticed the title calls it |
it's the latter |
No description provided.