Skip to content

Commit 1ba195e

Browse files
authored
fix(sdk): add default labels for caching (kubeflow#1078)
1 parent 2ec7b6e commit 1ba195e

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

sdk/python/kfp_tekton/compiler/compiler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ def __init__(self, **kwargs):
137137
self.custom_task_crs = []
138138
self.uuid = self._get_unique_id_code()
139139
self._group_names = []
140-
self.pipeline_labels = {}
141-
self.pipeline_annotations = {}
140+
self.pipeline_labels = {'pipelines.kubeflow.org/pipelinename': '', 'pipelines.kubeflow.org/generation': ''}
141+
self.pipeline_annotations = {'tekton.dev/template': ''}
142142
self.tekton_inline_spec = True
143143
self.resource_in_separate_yaml = False
144144
self.produce_taskspec = True

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,15 @@ metadata:
2727
tekton.dev/artifact_items: '{"exit-handler": [], "frequent-word": [["word", "$(results.word.path)"]],
2828
"save-message": []}'
2929
sidecar.istio.io/inject: "false"
30+
tekton.dev/template: ''
3031
pipelines.kubeflow.org/big_data_passing_format: $(workspaces.$TASK_NAME.path)/artifacts/$ORIG_PR_NAME/$TASKRUN_NAME/$TASK_PARAM_NAME
3132
pipelines.kubeflow.org/pipeline_spec: '{"description": "Get Most Frequent Word
3233
and Save to GCS", "inputs": [{"default": "When flies fly behind flies", "name":
3334
"message"}, {"default": "default_output", "name": "outputpath"}], "name": "Save
3435
Most Frequent Word"}'
36+
labels:
37+
pipelines.kubeflow.org/pipelinename: ''
38+
pipelines.kubeflow.org/generation: ''
3539
spec:
3640
params:
3741
- name: message

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@ metadata:
3030
tekton.dev/artifact_items: '{"download": [["downloaded", "$(results.downloaded.path)"]],
3131
"get-frequent": [["word", "$(results.word.path)"]], "save": []}'
3232
sidecar.istio.io/inject: "false"
33+
tekton.dev/template: ''
3334
pipelines.kubeflow.org/big_data_passing_format: $(workspaces.$TASK_NAME.path)/artifacts/$ORIG_PR_NAME/$TASKRUN_NAME/$TASK_PARAM_NAME
3435
pipelines.kubeflow.org/pipeline_spec: '{"description": "Download and Get Most
3536
Frequent Word and Save to GCS", "inputs": [{"default": "gs://ml-pipeline-playground/shakespeare1.txt",
3637
"name": "url", "optional": true, "type": "String"}, {"default": "/tmp/output.txt",
3738
"name": "outputpath", "optional": true, "type": "String"}], "name": "download-and-save-most-frequent"}'
39+
labels:
40+
pipelines.kubeflow.org/pipelinename: ''
41+
pipelines.kubeflow.org/generation: ''
3842
spec:
3943
params:
4044
- name: outputpath

0 commit comments

Comments
 (0)