Skip to content

Commit a4c5b1a

Browse files
committedFeb 28, 2025·
Rebase on KFP commit 7d8e921
2 parents 40e6e1b + 7d8e921 commit a4c5b1a

File tree

15 files changed

+74
-21
lines changed

15 files changed

+74
-21
lines changed
 

‎.github/workflows/kfp-kubernetes-execution-tests.yml

+3
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ jobs:
7474

7575
- name: Run tests
7676
id: test
77+
env:
78+
PULL_NUMBER: ${{ github.event.pull_request.number }}
79+
REPO_NAME: ${{ github.repository }}
7780
run: |
7881
export KFP_ENDPOINT="http://localhost:8888"
7982
export TIMEOUT_SECONDS=2700

‎.github/workflows/kfp-samples.yml

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
id: tests
4949
env:
5050
PULL_NUMBER: ${{ github.event.pull_request.number }}
51+
REPO_NAME: ${{ github.repository }}
5152
run: |
5253
./backend/src/v2/test/sample-test.sh
5354
continue-on-error: true

‎.github/workflows/kfp-sdk-runtime-tests.yml

+1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ jobs:
2828
- name: Run KFP Runtime Code Tests
2929
run: |
3030
export PULL_NUMBER="${{ github.event.inputs.pull_number || github.event.pull_request.number }}"
31+
export REPO_NAME="${{ github.repository }}"
3132
./test/presubmit-test-kfp-runtime-code.sh

‎.github/workflows/sdk-execution.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,13 @@ jobs:
6666

6767
- name: Run tests
6868
id: tests
69+
env:
70+
PULL_NUMBER: ${{ github.event.pull_request.number }}
71+
REPO_NAME: ${{ github.repository }}
6972
run: |
7073
export KFP_ENDPOINT="http://localhost:8888"
7174
export TIMEOUT_SECONDS=2700
72-
pytest ./test/sdk-execution-tests/sdk_execution_tests.py --asyncio-task-timeout $TIMEOUT_SECONDS
75+
pytest -v -n 5 ./test/sdk-execution-tests/sdk_execution_tests.py
7376
continue-on-error: true
7477

7578
- name: Collect failed logs

‎OWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ reviewers:
1616
- VaniHaripriya
1717
- mprahl
1818
emeritus_approvers:
19-
- harshad16
19+
- harshad16

‎backend/src/v2/test/sample-test.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ python3 -m pip install -r ./requirements-sample-test.txt
2323

2424
popd
2525

26+
REPO_NAME="${REPO_NAME:-kubeflow/pipelines}"
27+
2628
if [[ -n "${PULL_NUMBER}" ]]; then
27-
export KFP_PACKAGE_PATH="git+https://github.com/opendatahub-io/data-science-pipelines@refs/pull/${PULL_NUMBER}/merge#egg=kfp&subdirectory=sdk/python"
29+
export KFP_PACKAGE_PATH="git+https://github.com/${REPO_NAME}@refs/pull/${PULL_NUMBER}/merge#egg=kfp&subdirectory=sdk/python"
2830
else
29-
export KFP_PACKAGE_PATH='git+https://github.com/opendatahub-io/data-science-pipelines#egg=kfp&subdirectory=sdk/python'
31+
export KFP_PACKAGE_PATH="git+https://github.com/${REPO_NAME}#egg=kfp&subdirectory=sdk/python"
3032
fi
3133

3234
python3 -m pip install $KFP_PACKAGE_PATH

‎backend/src/v2/test/scripts/ci-env.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ GCS_ROOT="gs://${PROJECT}/${COMMIT_SHA}/v2-sample-test"
1818
GCR_ROOT="gcr.io/${PROJECT}/${COMMIT_SHA}/v2-sample-test"
1919
# This is kfp-ci endpoint.
2020
HOST=${HOST:-"https://$(curl https://raw.githubusercontent.com/kubeflow/testing/master/test-infra/kfp/endpoint)"}
21+
REPO_NAME="${REPO_NAME:-kubeflow/pipelines}"
2122

2223
if [[ -z "${PULL_NUMBER}" ]]; then
23-
KFP_PACKAGE_PATH='git+https://github.com/kubeflow/pipelines\#egg=kfp&subdirectory=sdk/python'
24+
KFP_PACKAGE_PATH="git+https://github.com/${REPO_NAME}#egg=kfp&subdirectory=sdk/python"
2425
else
25-
KFP_PACKAGE_PATH='git+https://github.com/kubeflow/pipelines@refs/pull/${PULL_NUMBER}/merge\#egg=kfp&subdirectory=sdk/python'
26+
KFP_PACKAGE_PATH="git+https://github.com/${REPO_NAME}@refs/pull/${PULL_NUMBER}/merge#egg=kfp&subdirectory=sdk/python"
2627
fi
2728

2829
cat <<EOF >kfp-ci.env

‎docs/versions.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
[
22
{
3-
"version": "https://kubeflow-pipelines.readthedocs.io/en/sdk-2.11.0/",
4-
"title": "2.11.0",
3+
"version": "https://kubeflow-pipelines.readthedocs.io/en/sdk-2.12.0/",
4+
"title": "2.12.0",
55
"aliases": [
66
"stable",
77
"latest"
88
]
99
},
10+
{
11+
"version": "https://kubeflow-pipelines.readthedocs.io/en/sdk-2.11.0/",
12+
"title": "2.11.0",
13+
"aliases": []
14+
},
1015
{
1116
"version": "https://kubeflow-pipelines.readthedocs.io/en/sdk-2.10.1/",
1217
"title": "2.10.1",

‎kubernetes_platform/python/README.md

+18
Original file line numberDiff line numberDiff line change
@@ -289,3 +289,21 @@ def pipeline():
289289
task = simple_task()
290290
kubernetes.set_image_pull_policy(task, "Always")
291291
```
292+
293+
### ImagePullSecrets: Set secrets to authenticate image pulls
294+
```python
295+
from kfp import dsl
296+
from kfp import kubernetes
297+
298+
@dsl.container_component
299+
def hello():
300+
return dsl.ContainerSpec(
301+
image='some-private-image:tag',
302+
command=['echo', 'hello']
303+
)
304+
305+
@dsl.pipeline
306+
def pipeline():
307+
task = hello()
308+
kubernetes.set_image_pull_secrets(task, ['secret-name'])
309+
```

‎sdk/RELEASE.md

+20
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,26 @@
1010

1111
## Documentation updates
1212

13+
# 2.12.0
14+
15+
## Features
16+
17+
* Add support for placeholders in resource limits [\#11501](https://github.com/kubeflow/pipelines/pull/11501)
18+
* Introduce cache_key to sdk [\#11466](https://github.com/kubeflow/pipelines/pull/11466)
19+
* Add support for importing models stored in the Modelcar format (sidecar) [\#11606](https://github.com/kubeflow/pipelines/pull/11606)
20+
21+
## Breaking changes
22+
23+
## Deprecations
24+
25+
## Bug fixes and other changes
26+
27+
* dsl.component docstring typo [\#11547](https://github.com/kubeflow/pipelines/pull/11547)
28+
* Update broken api-connect link [\#11521](https://github.com/kubeflow/pipelines/pull/11521)
29+
* Fix kfp-sdk-test for different python versions [\#11559](https://github.com/kubeflow/pipelines/pull/11559)
30+
31+
## Documentation updates
32+
1333
# 2.11.0
1434

1535
## Features

‎sdk/python/kfp/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# https://packaging.python.org/guides/packaging-namespace-packages/#pkgutil-style-namespace-packages
1717
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
1818

19-
__version__ = '2.11.0'
19+
__version__ = '2.12.0'
2020

2121
import sys
2222
import warnings

‎test/kfp-kubernetes-execution-tests/sdk_execution_tests.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,11 @@ def run(test_case: TestCase) -> Tuple[str, client.client.RunPipelineResult]:
110110

111111

112112
def get_kfp_package_path() -> str:
113+
repo_name = os.environ.get('REPO_NAME', 'kubeflow/pipelines')
113114
if os.environ.get('PULL_NUMBER') is not None:
114-
path = f'git+https://github.com/kubeflow/pipelines.git@refs/pull/{os.environ.get("PULL_NUMBER")}/merge#subdirectory=sdk/python'
115+
path = f'git+https://github.com/{repo_name}.git@refs/pull/{os.environ["PULL_NUMBER"]}/merge#subdirectory=sdk/python'
115116
else:
116-
path = 'git+https://github.com/kubeflow/pipelines.git@master#subdirectory=sdk/python'
117+
path = f'git+https://github.com/{repo_name}.git@master#subdirectory=sdk/python'
117118
print(f'Using the following KFP package path for tests: {path}')
118119
return path
119120

‎test/presubmit-tests-sdk.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ pytest sdk/python/kfp --cov=kfp
3636
set +x
3737
# export COVERALLS_REPO_TOKEN=$(gsutil cat gs://ml-pipeline-test-keys/coveralls_repo_token)
3838
set -x
39-
REPO_BASE="https://github.com/kubeflow/pipelines"
39+
REPO_NAME="${REPO_NAME:-kubeflow/pipelines}"
40+
REPO_BASE="https://github.com/${REPO_NAME}"
4041
export COVERALLS_SERVICE_NAME="prow"
4142
export COVERALLS_SERVICE_JOB_ID=$PROW_JOB_ID
4243
export CI_PULL_REQUEST="$REPO_BASE/pull/$PULL_NUMBER"
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
sdk/python
22
pytest==8.3.2
3-
pytest-asyncio-cooperative==0.37.0
3+
pytest-xdist==2.5.0

‎test/sdk-execution-tests/sdk_execution_tests.py

+5-8
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
import asyncio
1514
import dataclasses
1615
import functools
1716
import os
@@ -100,10 +99,11 @@ def run(test_case: TestCase) -> Tuple[str, client.client.RunPipelineResult]:
10099

101100

102101
def get_kfp_package_path() -> str:
102+
repo_name = os.environ.get('REPO_NAME', 'kubeflow/pipelines')
103103
if os.environ.get('PULL_NUMBER') is not None:
104-
path = f'git+https://github.com/kubeflow/pipelines.git@refs/pull/{os.environ.get("PULL_NUMBER")}/merge#subdirectory=sdk/python'
104+
path = f'git+https://github.com/{repo_name}.git@refs/pull/{os.environ["PULL_NUMBER"]}/merge#subdirectory=sdk/python'
105105
else:
106-
path = 'git+https://github.com/kubeflow/pipelines.git@master#subdirectory=sdk/python'
106+
path = f'git+https://github.com/{repo_name}.git@master#subdirectory=sdk/python'
107107
print(f'Using the following KFP package path for tests: {path}')
108108
return path
109109

@@ -112,18 +112,15 @@ def get_kfp_package_path() -> str:
112112
dsl.component, kfp_package_path=get_kfp_package_path())
113113

114114

115-
@pytest.mark.asyncio_cooperative
116115
@pytest.mark.parametrize('test_case', create_test_case_parameters())
117-
async def test(test_case: TestCase) -> None:
118-
"""Asynchronously runs all samples and test that they succeed."""
119-
event_loop = asyncio.get_running_loop()
116+
def test(test_case: TestCase) -> None:
120117
try:
121118
run_url, run_result = run(test_case)
122119
except Exception as e:
123120
raise RuntimeError(
124121
f'Error triggering pipeline {test_case.name}.') from e
125122

126-
api_run = await event_loop.run_in_executor(None, wait, run_result)
123+
api_run = wait(run_result)
127124
assert api_run.state == test_case.expected_state, f'Pipeline {test_case.name} ended with incorrect status: {api_run.state}. More info: {run_url}'
128125

129126

0 commit comments

Comments
 (0)
Please sign in to comment.