0

I have a problem where i need to trigger multiple Pipelinerun's at same time where the runs will take longer the 1 hour. The global timeout for the PipelineRun is 1 hours by default so it fails. The team managing the Openshift cluster does not want to change the global timeout so I have to override it in some way.

The resources I am using is an EventListener, TriggerBinding, TriggerTemplate, Pipeline and PipelineRun.

I have tried to set a timeout on the Pipeline tasks like:

      runAfter:
        - fetch-repository
      taskRef:
        kind: ClusterTask
        name: buildah
      timeout: "3h0m0s"

but the PipelineRun timeout seems to have precedence so it does not work.

  • Openshift version: 4.9.35
  • K8s version: v1.22.8
  • Tekton seems to be installed with Openshift and cannot find which version but probably very new.

Any ideas?

linkebon
  • 401
  • 1
  • 4
  • 12

2 Answers2

1

This is a known issue with OpenShift, I have a feature request filed with redhat support about this ... been over a year now ...

Although you mentioned using EventListeners: in that case, you should be able to force your own pipelinerun timeout, setting up your TriggerTemplate.

Try this:

apiVersion: triggers.tekton.dev/v1beta1
kind: TriggerTemplate
metadata:
  name: foo
spec:
  [...]
  resourcetemplates:
  - apiVersion: tekton.dev/v1beta1
    kind: PipelineRun
    metadata:
      generateName: foo-
    spec:
      timeout: 2h30m0s
      [...]

The only issue with this, is that you can't use them from OpenShift console. You would need to make sure your EventListener is used, starting that pipeline (eg: with curl, an oc plugin, ...), enforcing proper timeout configuration.

SYN
  • 4,476
  • 1
  • 20
  • 22
  • Thanks for the answer. I will definitely try to create a certain PipelineRun resource for the nightly builds that is called from the TriggerTemplate instead. – linkebon Oct 05 '22 at 13:02
1

You can specify a timeout in the PipelineRun:

spec:
  ...
  timeout: 12h0m0s

If you set it to 0, it will fail immediately upon encountering an error. For now it works on OpenShift Pipelines, but it might get deprecated as in Tekton (not fully deprecated, just syntax change).

miquelsi
  • 11
  • 2