From b274866b6a6b948435a0cbae05ae16889c17dba3 Mon Sep 17 00:00:00 2001 From: Dharmit Dalvi Date: Thu, 25 Jul 2024 17:03:54 +0530 Subject: [PATCH] test: Migrate KFP SDK Execution Tests to GHA (#10975) Signed-off-by: ddalvi --- .github/workflows/sdk-execution.yml | 63 +++++++++++++++++++++++++++ test/presubmit-sdk-execution-tests.sh | 30 ------------- 2 files changed, 63 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/sdk-execution.yml delete mode 100755 test/presubmit-sdk-execution-tests.sh diff --git a/.github/workflows/sdk-execution.yml b/.github/workflows/sdk-execution.yml new file mode 100644 index 00000000000..22f605fca9f --- /dev/null +++ b/.github/workflows/sdk-execution.yml @@ -0,0 +1,63 @@ +name: KFP SDK execution tests + +on: + push: + branches: [master] + + pull_request: + paths: + - '.github/workflows/sdk-execution.yml' + - 'sdk/python/**' + - 'api/v2alpha1/**' + +jobs: + sdk-execution-tests: + runs-on: ubuntu-24.04 + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Create KFP cluster + uses: ./.github/actions/kfp-cluster + + - name: Forward API port + run: ./scripts/deploy/github/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + + - name: apt-get update + run: sudo apt-get update + + - name: Install protobuf-compiler + run: sudo apt-get install protobuf-compiler -y + + - name: Install setuptools + run: | + pip3 install setuptools + pip3 freeze + + - name: Install Wheel + run: pip3 install wheel==0.42.0 + + - name: Install protobuf + run: pip3 install protobuf==4.25.3 + + - name: Generate API proto files + working-directory: ./api + run: make clean python + + - name: Install kfp-pipeline-spec from source + run: | + python3 -m pip install api/v2alpha1/python + + - name: Install requirements + run: pip install -r ./test/sdk-execution-tests/requirements.txt + + - name: Run tests + run: | + export KFP_ENDPOINT="http://localhost:8888" + export TIMEOUT_SECONDS=2700 + pytest ./test/sdk-execution-tests/sdk_execution_tests.py --asyncio-task-timeout $TIMEOUT_SECONDS diff --git a/test/presubmit-sdk-execution-tests.sh b/test/presubmit-sdk-execution-tests.sh deleted file mode 100755 index 4a710c17c4c..00000000000 --- a/test/presubmit-sdk-execution-tests.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -ex -# Copyright 2022 Kubeflow Pipelines contributors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -source_root=$(pwd) - -python3 -m pip install --upgrade pip -python3 -m pip install $source_root/sdk/python -apt-get update && apt-get install -y protobuf-compiler -pushd api -make clean python -popd -python3 -m pip install api/v2alpha1/python -python3 -m pip install -r $source_root/test/sdk-execution-tests/requirements.txt - - -export KFP_ENDPOINT="https://$(curl https://raw.githubusercontent.com/kubeflow/testing/master/test-infra/kfp/endpoint)" -export TIMEOUT_SECONDS=2700 -pytest $source_root/test/sdk-execution-tests/sdk_execution_tests.py --asyncio-task-timeout $TIMEOUT_SECONDS