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

Overriding Pipeline timeout does not work #8114

Open
MarijnJV opened this issue Jul 12, 2024 · 2 comments
Open

Overriding Pipeline timeout does not work #8114

MarijnJV opened this issue Jul 12, 2024 · 2 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@MarijnJV
Copy link

MarijnJV commented Jul 12, 2024

Expected Behavior

A PipelineRun, created by a Pipeline should not timeout after 1 hour, but rather after 2h30m.

I used the following configuration:

apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
  name: pipeline-name
spec:
  tasks:
    - name: task-name
      taskRef:
        kind: Task
        name: task-name
      timeout: "2h30m0s"

Actual Behavior

A PipelineRun, created by a Pipeline runs out after 1 hour:

PipelineRun "pipeline-name-id" failed to finish within "1h0m0s"

The PipelineRun yaml configuration contains the following:

spec:
  pipelineRef:
    name: pipeline-name
  taskRunTemplate:
    serviceAccountName: pipeline
  timeouts:
    pipeline: 1h0m0s

The pipeline timeout is not overwritten and the pipeline fails.

Steps to Reproduce the Problem

  1. Create a Pipeline with a task that takes over an hour to complete.
  2. Set the timeout of the task to more than 1 hour (as shown in the "Expected Behavior" section).
  3. Run the Pipeline. Check the created PipelineRun config for the timeout limits

Additional Info

I am running a pipeline with 2 tasks, one of which takes longer than an hour. I have specified the timeout limit for this task. However, when a PipelineRun is created by the Pipeline, the default value of 1 hour is not overwritten. I have followed the documentation on how to set a timeout for a pipeline, which seems to have to be done on the task-level.

In the PipelineRun yaml, created by the Pipeline, both:

tasks:
      - name: task-name
        taskRef:
          kind: Task
          name: task-name
        timeout: 2h30m0s

and

spec:
  pipelineRef:
    name: pipeline-name
  taskRunTemplate:
    serviceAccountName: pipeline
  timeouts:
    pipeline: 1h0m0s

are present. Because the pipeline timeout is shorter than the task timeout, the pipeline will fail after an hour.

I have also tried to set the default timeout value to 2 hours via a ConfigMap. This did not work either:

apiVersion: v1
kind: ConfigMap
metadata:
  name: config-defaults
  namespace: tekton-pipelines
data:
  default-timeout-minutes: "150"

This still resulted in a 1 hour timeout limit.

PipelineRun

Using the following configuration for a PipelineRun does work. In this case the default value of 1 hour is overwritten by 2h40m. However, I would like to not have to create my PipelineRuns manually.

apiVersion: triggers.tekton.dev/v1alpha1
kind: TriggerTemplate
metadata:
  name: trigger
spec:
  resourcetemplates:
    - apiVersion: tekton.dev/v1beta1
      kind: PipelineRun
      metadata:
        generateName: triggered
      spec:
        pipelineRef:
          name: pipeline-name
        timeout: "2h40m0s"

  • Kubernetes version: v1.27.10+28ed2d7 (OpenShift 4.4)

    Output of kubectl version:

Client Version: v1.27.4
Kustomize Version: v5.0.1
Server Version: v1.27.10+28ed2d7
  • Tekton Pipeline version: tekton.dev/v1beta1
@MarijnJV MarijnJV added the kind/bug Categorizes issue or PR as related to a bug. label Jul 12, 2024
@vdemeester
Copy link
Member

Using the following configuration for a PipelineRun does work. In this case the default value of 1 hour is overwritten by 2h40m. However, I would like to not have to create my PipelineRuns manually.

How is the PipelineRun created in your setup ? Asking this because, it is most likely, on the "thing" that creates the PipelineRun to set the timeouts correctly.

Tekton Pipeline version: tekton.dev/v1beta1

v1beta1 is the API version, we also need the pipeline instance version (tkn version should display this)

@MarijnJV
Copy link
Author

MarijnJV commented Jul 15, 2024

The PipelineRun where the timeout value is correct is created with a Cronjob and EventListener. A PipelineRun created by a Pipeline does not seem to set the timeout value correctly.

I hope that answers your question regarding how the PipelineRun is created.

tkn version:

Client version: 0.33.0
Chains version: v0.19.0
Pipeline version: v0.53.3
Triggers version: v0.25.3
Operator version: v0.69.1

Edit: To add to the first answer: I use the OpenShift UI to start a PipelineRun, which I assume runs something similar to tkn pipeline start pipeline-name

@MarijnJV MarijnJV changed the title Overwriting Pipeline timeout does not work Overriding Pipeline timeout does not work Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants