Skip to content

Commit 61860db

Browse files
committed
add k8s platform sdk tests to support inputparams
Signed-off-by: Humair Khan <[email protected]>
1 parent 7b640d5 commit 61860db

28 files changed

+1913
-96
lines changed

kubernetes_platform/python/kfp/kubernetes/config_map.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 The Kubeflow Authors
1+
# Copyright 2025 The Kubeflow Authors
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

kubernetes_platform/python/kfp/kubernetes/image.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 The Kubeflow Authors
1+
# Copyright 2025 The Kubeflow Authors
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -36,7 +36,6 @@ def set_image_pull_secrets(
3636

3737
msg = common.get_existing_kubernetes_config_as_message(task)
3838

39-
# Assuming secret_names is a list of strings
4039
if is_list_of_strings(secret_names) or is_list_of_parameter_channel(secret_names):
4140
image_pull_secret = []
4241
for secret_name in secret_names:
@@ -76,8 +75,10 @@ def set_image_pull_policy(task: PipelineTask, policy: str) -> PipelineTask:
7675

7776
return task
7877

78+
7979
def is_list_of_strings(items: list) -> bool:
8080
return all(isinstance(item, str) for item in items)
8181

82+
8283
def is_list_of_parameter_channel(items: list) -> bool:
8384
return all(isinstance(item, pipeline_channel.PipelineParameterChannel) for item in items)

kubernetes_platform/python/kfp/kubernetes/node_selector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 The Kubeflow Authors
1+
# Copyright 2025 The Kubeflow Authors
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

kubernetes_platform/python/kfp/kubernetes/secret.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 The Kubeflow Authors
1+
# Copyright 2025 The Kubeflow Authors
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

kubernetes_platform/python/kfp/kubernetes/toleration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 The Kubeflow Authors
1+
# Copyright 2025 The Kubeflow Authors
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

kubernetes_platform/python/kfp/kubernetes/volume.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 The Kubeflow Authors
1+
# Copyright 2025 The Kubeflow Authors
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

kubernetes_platform/python/test/snapshot/data/config_map_as_env.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ deploymentSpec:
1717
- -c
1818
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
1919
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
20-
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.4.0'\
20+
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.11.0'\
2121
\ '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"3.9\"' && \"\
2222
$0\" \"$@\"\n"
2323
- sh
@@ -46,15 +46,18 @@ root:
4646
taskInfo:
4747
name: comp
4848
schemaVersion: 2.1.0
49-
sdkVersion: kfp-2.4.0
49+
sdkVersion: kfp-2.11.0
5050
---
5151
platforms:
5252
kubernetes:
5353
deploymentSpec:
5454
executors:
5555
exec-comp:
5656
configMapAsEnv:
57-
- keyToEnv:
58-
- envVar: CONFIG_MAP_VAR
59-
configMapKey: foo
60-
configMapName: my-cm
57+
- configMapName: my-cm
58+
configNameParameter:
59+
runtimeValue:
60+
constant: my-cm
61+
keyToEnv:
62+
- configMapKey: foo
63+
envVar: CONFIG_MAP_VAR

kubernetes_platform/python/test/snapshot/data/config_map_as_vol.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ deploymentSpec:
1717
- -c
1818
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
1919
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
20-
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.4.0'\
20+
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.11.0'\
2121
\ '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"3.9\"' && \"\
2222
$0\" \"$@\"\n"
2323
- sh
@@ -46,14 +46,17 @@ root:
4646
taskInfo:
4747
name: comp
4848
schemaVersion: 2.1.0
49-
sdkVersion: kfp-2.4.0
49+
sdkVersion: kfp-2.11.0
5050
---
5151
platforms:
5252
kubernetes:
5353
deploymentSpec:
5454
executors:
5555
exec-comp:
5656
configMapAsVolume:
57-
- mountPath: /mnt/my_vol
58-
configMapName: my-cm
59-
optional: False
57+
- configMapName: my-cm
58+
configNameParameter:
59+
runtimeValue:
60+
constant: my-cm
61+
mountPath: /mnt/my_vol
62+
optional: false

kubernetes_platform/python/test/snapshot/data/create_mount_delete_dynamic_pvc.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ deploymentSpec:
9696
- -c
9797
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
9898
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
99-
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.4.0'\
99+
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.11.0'\
100100
\ '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"3.9\"' && \"\
101101
$0\" \"$@\"\n"
102102
- sh
@@ -132,7 +132,7 @@ deploymentSpec:
132132
- -c
133133
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
134134
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
135-
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.4.0'\
135+
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.11.0'\
136136
\ '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"3.9\"' && \"\
137137
$0\" \"$@\"\n"
138138
- sh
@@ -214,7 +214,7 @@ root:
214214
taskInfo:
215215
name: producer
216216
schemaVersion: 2.1.0
217-
sdkVersion: kfp-2.4.0
217+
sdkVersion: kfp-2.11.0
218218
---
219219
platforms:
220220
kubernetes:
@@ -223,12 +223,20 @@ platforms:
223223
exec-consumer:
224224
pvcMount:
225225
- mountPath: /data
226+
pvcNameParameter:
227+
taskOutputParameter:
228+
outputParameterKey: name
229+
producerTask: createpvc
226230
taskOutputParameter:
227231
outputParameterKey: name
228232
producerTask: createpvc
229233
exec-producer:
230234
pvcMount:
231235
- mountPath: /data
236+
pvcNameParameter:
237+
taskOutputParameter:
238+
outputParameterKey: name
239+
producerTask: createpvc
232240
taskOutputParameter:
233241
outputParameterKey: name
234242
producerTask: createpvc

kubernetes_platform/python/test/snapshot/data/create_mount_delete_existing_pvc.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ deploymentSpec:
8686
- -c
8787
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
8888
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
89-
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.4.0'\
89+
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.11.0'\
9090
\ '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"3.9\"' && \"\
9191
$0\" \"$@\"\n"
9292
- sh
@@ -161,7 +161,7 @@ root:
161161
taskInfo:
162162
name: deletepvc
163163
schemaVersion: 2.1.0
164-
sdkVersion: kfp-2.4.0
164+
sdkVersion: kfp-2.11.0
165165
---
166166
platforms:
167167
kubernetes:
@@ -170,6 +170,10 @@ platforms:
170170
exec-comp:
171171
pvcMount:
172172
- mountPath: /data
173+
pvcNameParameter:
174+
taskOutputParameter:
175+
outputParameterKey: name
176+
producerTask: createpvc
173177
taskOutputParameter:
174178
outputParameterKey: name
175179
producerTask: createpvc

0 commit comments

Comments
 (0)