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

Move timeout, affinity, nodeSelector to taskrun and pipelinerun #463

Merged
merged 2 commits into from
Feb 3, 2019

Conversation

nader-ziada
Copy link
Member

Proposed changes

  • move timeout, affinity, nodeselector from task to taskrun
  • move timeout, affinity, nodeselector from pipeline to pipelinerun

These are runtime parameters that are more concerned with the actual
running of a task more than the definition

/cc @bobcatfish @shashwathi

@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Feb 1, 2019
@knative-prow-robot knative-prow-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 Feb 1, 2019
@bobcatfish
Copy link
Collaborator

o no my docs

@nader-ziada
Copy link
Member Author

o no my docs

This will rebase on your docs once its merged in and I'll update the docs accordingly

@abayer
Copy link
Contributor

abayer commented Feb 1, 2019

I'm not convinced that Timeout should be on PipelineRun and TaskRun rather than Pipeline and Task - for example, this would mean that there's no way to have a single TaskRun created by a PipelineRun to have its own Timeout. In Jenkins Pipeline, there's heavy usage of timeouts for specific stages (i.e., Task equivalents) and whole pipelines as part of authoring the pipeline, and I think we really need the same behavior here.

@nader-ziada
Copy link
Member Author

@abayer this is a valid point, I was just proposing this change because it doesn't seem like there is agreement on where timeout should live.
I thought about having timeout in the run because the task and pipeline are just like templates for what steps are needed and everything else about the actual running of these steps comes from the run, for example the service account and values of params and so on

@abayer
Copy link
Contributor

abayer commented Feb 1, 2019

@pivotal-nader-ziada - I guess I think of timeout as part of the "template" in that case - though being able to override the timeout in a Task or Pipeline via TaskRun/PipelineRun sounds like a good idea to me.

@nader-ziada
Copy link
Member Author

@abayer can you give an example of how the timeout feature is used in jenkins that would not work in this model?

Copy link
Contributor

@shashwathi shashwathi left a comment

Choose a reason for hiding this comment

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

/lgtm

I have left some minor comment about simplifying timeout logic in pipelinerun controller. Rest looks great @pivotal-nader-ziada .

var taskRunTimeout = &metav1.Duration{Duration: 0 * time.Second}
if pr.Spec.Timeout != nil {
pTimeoutTime := pr.Status.StartTime.Add(pr.Spec.Timeout.Duration)
if time.Now().After(pTimeoutTime) {
Copy link
Contributor

@shashwathi shashwathi Feb 2, 2019

Choose a reason for hiding this comment

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

Can we simplify the timeout logic? I agree that this change was not in this PR.

taskRunTimeout = &metav1.Duration{Duration: 0 * time.Second}
if pr.Spec.Timeout != nil {
    pTimeoutTime := pr.Status.StartTime.Add(pr.Spec.Timeout.Duration)
              // set taskrun timeout only if its valid timeout
          if !time.Now().After(pTimeoutTime) {
            taskRunTimeout = pr.Spec.Timeout
        }
    } else {
     // set timeout as nil if PR timeout is not set
        taskRunTimeout = nil
    }

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 2, 2019
@knative-prow-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pivotal-nader-ziada, shashwathi

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:
  • OWNERS [pivotal-nader-ziada,shashwathi]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@shashwathi
Copy link
Contributor

/hold

@knative-prow-robot knative-prow-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 2, 2019
@shashwathi
Copy link
Contributor

I am adding hold to merge @bobcatfish docs PR first and address @abayer comments. This PR is good from my end

@shashwathi
Copy link
Contributor

/hold cancel

@knative-prow-robot knative-prow-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 2, 2019
- move timeout, affinity, nodeselector from task to taskrun
- move timeout, affinity, nodeselector from pipeline to pipelinerun

These are runtime parameters that are more concerned with the actual
running of a task and not the definition
- timeout now on taskRun and PipelineRun
@knative-prow-robot knative-prow-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 3, 2019
@knative-metrics-robot
Copy link

The following is the coverage report on pkg/.
Say /test pull-knative-build-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1alpha1/pipeline_validation.go 92.2% 91.7% -0.5
pkg/apis/pipeline/v1alpha1/pipelinerun_validation.go 92.3% 93.8% 1.4
pkg/reconciler/v1alpha1/pipelinerun/pipelinerun.go 84.8% 84.1% -0.8
pkg/reconciler/v1alpha1/taskrun/taskrun.go 74.0% 74.2% 0.3
test/builder/pipeline.go 95.0% 90.5% -4.5
test/builder/task.go 98.2% 95.9% -2.3

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 3, 2019
Copy link
Contributor

@shashwathi shashwathi left a comment

Choose a reason for hiding this comment

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

/lgtm

@knative-prow-robot knative-prow-robot merged commit 7b5938b into tektoncd:master Feb 3, 2019
@abayer
Copy link
Contributor

abayer commented Feb 3, 2019

@pivotal-nader-ziada My biggest concern is the inability to control timeouts for individual tasks from a Pipeline or PipelineRun, so I’m going to get a follow up to this up shortly to add timeouts to PipelineTask.

@abayer
Copy link
Contributor

abayer commented Feb 3, 2019

Actually, I'm going to hold off on that for the moment - lemme see how what you've implemented works out in practice. I still feel that there's a need to be able to say "if the execution of this Task in this Pipeline takes longer than X, time out", but I may be wrong.

@bobcatfish
Copy link
Collaborator

Actually, I'm going to hold off on that for the moment - lemme see how what you've implemented works out in practice. I still feel that there's a need to be able to say "if the execution of this Task in this Pipeline takes longer than X, time out", but I may be wrong.

Sounds good! We can definitely iterate on this @abayer :D

@nader-ziada nader-ziada deleted the timeout branch February 13, 2019 14:02
pradeepitm12 pushed a commit to pradeepitm12/pipeline that referenced this pull request Jan 28, 2021
Previously, if a user added an extra label, we'd propagate that to the
deployment and services.  However, in addition, we'd also update the selector
fields in both deployments and services to use this additional label. This is
unnecessary since the static set of default labels that we add on each resource
is enough to match and do not need to be updated throughout the lifecycle of
the resources.

Fixes tektoncd#463

Co-Authored-By: Vincent Tereso <vincent.desousa.tereso@gmail.com>

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants