Skip to content

Commit aa3366f

Browse files
authored
Update pipelinerun timeout format to timeouts (kubeflow#1031)
1 parent 5f2e4a3 commit aa3366f

File tree

135 files changed

+410
-138
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+410
-138
lines changed

sdk/python/kfp_tekton/compiler/compiler.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,12 @@
5454
TEKTON_GLOBAL_DEFAULT_TIMEOUT = strtobool(env.get('TEKTON_GLOBAL_DEFAULT_TIMEOUT', 'false'))
5555
# DISABLE_CEL_CONDITION should be True until CEL is officially merged into Tekton main API.
5656
DISABLE_CEL_CONDITION = True
57-
# Default timeout is one year
57+
# Default tasks timeout is one year
5858
DEFAULT_TIMEOUT_MINUTES = "525600m"
59+
# Default whole pipeline timeout is two year
60+
DEFAULT_TIMEOUT_WITH_FINALLY_MINUTES = "1051200m"
61+
# Default finally extension is 5 minutes
62+
DEFAULT_FINALLY_SECONDS = 300
5963

6064

6165
def _get_super_condition_template():
@@ -1391,11 +1395,13 @@ def get_when_task(input_task_when, depended_conditions):
13911395

13921396
# add workflow level timeout to pipeline run
13931397
if not TEKTON_GLOBAL_DEFAULT_TIMEOUT or pipeline.conf.timeout:
1398+
pipeline_run['spec']['timeouts'] = {'pipeline': '0s', 'tasks': '0s'}
13941399
if pipeline.conf.timeout > 0:
1395-
pipeline_run['spec']['timeout'] = '%ds' % pipeline.conf.timeout
1400+
pipeline_run['spec']['timeouts']['tasks'] = '%ds' % pipeline.conf.timeout
1401+
pipeline_run['spec']['timeouts']['pipeline'] = '%ds' % (pipeline.conf.timeout + DEFAULT_FINALLY_SECONDS)
13961402
else:
1397-
pipeline_run['spec']['timeout'] = DEFAULT_TIMEOUT_MINUTES
1398-
1403+
pipeline_run['spec']['timeouts']['tasks'] = DEFAULT_TIMEOUT_MINUTES
1404+
pipeline_run['spec']['timeouts']['pipeline'] = DEFAULT_TIMEOUT_WITH_FINALLY_MINUTES
13991405
# generate the Tekton podTemplate for image pull secret
14001406
if len(pipeline.conf.image_pull_secrets) > 0:
14011407
pipeline_run['spec']['podTemplate'] = pipeline_run['spec'].get('podTemplate', {})

sdk/python/tests/compiler/testdata/affinity.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,6 @@ spec:
6565
operator: In
6666
values:
6767
- linux
68-
timeout: 525600m
68+
timeouts:
69+
pipeline: 1051200m
70+
tasks: 525600m

sdk/python/tests/compiler/testdata/any_sequencer.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,4 +213,6 @@ spec:
213213
value: $(context.pipelineRun.name)
214214
- name: pipelineRun-namespace
215215
value: $(context.pipelineRun.namespace)
216-
timeout: 525600m
216+
timeouts:
217+
pipeline: 1051200m
218+
tasks: 525600m

sdk/python/tests/compiler/testdata/any_sequencer_looped.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,4 +249,6 @@ spec:
249249
metadata:
250250
labels:
251251
pipelines.kubeflow.org/cache_enabled: "true"
252-
timeout: 525600m
252+
timeouts:
253+
pipeline: 1051200m
254+
tasks: 525600m

sdk/python/tests/compiler/testdata/any_sequencer_looped_noninlined.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,6 @@ spec:
182182
params:
183183
- name: param-loop-item
184184
value: $(params.param)
185-
timeout: 525600m
185+
timeouts:
186+
pipeline: 1051200m
187+
tasks: 525600m

sdk/python/tests/compiler/testdata/artifact_outputs.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ spec:
130130
workspace: artifact-out-pipeline
131131
workspaces:
132132
- name: artifact-out-pipeline
133-
timeout: 525600m
133+
timeouts:
134+
pipeline: 1051200m
135+
tasks: 525600m
134136
workspaces:
135137
- name: artifact-out-pipeline
136138
volumeClaimTemplate:

sdk/python/tests/compiler/testdata/artifact_passing_using_volume.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,9 @@ spec:
350350
timeout: 525600m
351351
workspaces:
352352
- name: artifact-passing-pipeline
353-
timeout: 525600m
353+
timeouts:
354+
pipeline: 1051200m
355+
tasks: 525600m
354356
workspaces:
355357
- name: artifact-passing-pipeline
356358
persistentVolumeClaim:

sdk/python/tests/compiler/testdata/basic_no_decorator.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,6 @@ spec:
134134
taskPodTemplate:
135135
nodeSelector:
136136
kubernetes.io/os: linux
137-
timeout: 525600m
137+
timeouts:
138+
pipeline: 1051200m
139+
tasks: 525600m

sdk/python/tests/compiler/testdata/big_data_multi_volumes_1.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,6 @@ spec:
116116
- name: input-text
117117
mountPath: /tmp/inputs/input_text
118118
timeout: 525600m
119-
timeout: 525600m
119+
timeouts:
120+
pipeline: 1051200m
121+
tasks: 525600m

sdk/python/tests/compiler/testdata/big_data_multi_volumes_2.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,6 @@ spec:
125125
- name: input-text-1
126126
mountPath: /tmp/inputs/input_text_1
127127
timeout: 525600m
128-
timeout: 525600m
128+
timeouts:
129+
pipeline: 1051200m
130+
tasks: 525600m

0 commit comments

Comments
 (0)