From ebfb8f4166a47e48b81718dac7fabf1f37ac4f89 Mon Sep 17 00:00:00 2001 From: hbelmiro Date: Thu, 20 Jun 2024 16:31:00 -0300 Subject: [PATCH] Migrated kubeflow-pipeline-upgrade-test to GitHub Actions Signed-off-by: hbelmiro --- .github/actions/kfp-cluster/action.yml | 21 +++++++++++++ .github/workflows/backend.yml | 13 ++------ .github/workflows/e2e-test.yaml | 15 ++------- .github/workflows/upgrade-test.yml | 29 ++++++++++++++++++ test/e2e_test_gke_v2.yaml | 42 -------------------------- test/upgrade-tests.sh | 4 +-- 6 files changed, 56 insertions(+), 68 deletions(-) create mode 100644 .github/actions/kfp-cluster/action.yml create mode 100644 .github/workflows/upgrade-test.yml diff --git a/.github/actions/kfp-cluster/action.yml b/.github/actions/kfp-cluster/action.yml new file mode 100644 index 000000000000..4abf265b4041 --- /dev/null +++ b/.github/actions/kfp-cluster/action.yml @@ -0,0 +1,21 @@ +name: "Set up KFP on KinD" +description: "Step to start and configure KFP on KinD" + +runs: + using: "composite" + steps: + - name: Create k8s Kind Cluster + uses: container-tools/kind-action@v2 + with: + cluster_name: kfp + kubectl_version: v1.29.2 + version: v0.22.0 + node_image: kindest/node:v1.29.2 + + - name: Build images + shell: bash + run: ./scripts/deploy/github/build-images.sh + + - name: Deploy KFP + shell: bash + run: ./scripts/deploy/github/deploy-kfp.sh diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 73743c4db2eb..2db94a684b6c 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -33,21 +33,12 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - - name: Create k8s Kind Cluster - uses: container-tools/kind-action@v2 - with: - cluster_name: kfp-tekton - kubectl_version: v1.29.2 - version: v0.22.0 - node_image: kindest/node:v1.29.2 - - name: build images - run: ./scripts/deploy/github/build-images.sh + - name: Create KFP cluster + uses: ./.github/actions/kfp-cluster - name: Set up Python 3.10 uses: actions/setup-python@v4 with: python-version: '3.10' - - name: "deploy kfp-tekton" - run: ./scripts/deploy/github/deploy-kfp.sh - name: Install sdk run: | python3 -m venv .venv diff --git a/.github/workflows/e2e-test.yaml b/.github/workflows/e2e-test.yaml index 2a92b572a195..6535d164bdc6 100644 --- a/.github/workflows/e2e-test.yaml +++ b/.github/workflows/e2e-test.yaml @@ -23,19 +23,8 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Create k8s Kind Cluster - uses: container-tools/kind-action@v2 - with: - cluster_name: kfp - kubectl_version: v1.29.2 - version: v0.22.0 - node_image: kindest/node:v1.29.2 - - - name: Build images - run: ./scripts/deploy/github/build-images.sh - - - name: Deploy KFP - run: ./scripts/deploy/github/deploy-kfp.sh + - 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 diff --git a/.github/workflows/upgrade-test.yml b/.github/workflows/upgrade-test.yml new file mode 100644 index 000000000000..b8eb84eecbc0 --- /dev/null +++ b/.github/workflows/upgrade-test.yml @@ -0,0 +1,29 @@ +name: KFP upgrade tests + +on: + push: + branches: [master] + + pull_request: + paths: + - '.github/workflows/upgrade-test.yml' + - 'backend/**' + - 'manifests/kustomize/**' + +jobs: + upgrade-test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Create KFP cluster + uses: ./.github/actions/kfp-cluster + + - name: Prepare upgrade tests + working-directory: backend/test/integration + run: go test -v ./... -namespace ${NAMESPACE} -args -runUpgradeTests=true -testify.m=Prepare + + - name: Prepare verification tests + working-directory: backend/test/integration + run: go test -v ./... -namespace ${NAMESPACE} -args -runUpgradeTests=true -testify.m=Verify diff --git a/test/e2e_test_gke_v2.yaml b/test/e2e_test_gke_v2.yaml index f107ed10f4ed..9777e43d49a0 100644 --- a/test/e2e_test_gke_v2.yaml +++ b/test/e2e_test_gke_v2.yaml @@ -37,48 +37,6 @@ spec: - name: namespace value: kubeflow templates: - - name: upgrade-test-preparation - inputs: - parameters: - - name: target-image-prefix - - name: test-results-gcs-dir - - name: api-integration-test-image-suffix - steps: - - - name: build-api-integration-test-image - template: build-image - arguments: - parameters: - - name: docker-path - value: . - - name: docker-file - value: test/api-integration-test/Dockerfile - - name: image-name - value: "{{inputs.parameters.target-image-prefix}}{{inputs.parameters.api-integration-test-image-suffix}}" - - - name: run-upgrade-tests-preparation - template: run-upgrade-tests-preparation - arguments: - parameters: - - name: test-results-gcs-dir - value: "{{inputs.parameters.test-results-gcs-dir}}" - - name: api-integration-test-image - value: "{{inputs.parameters.target-image-prefix}}{{inputs.parameters.api-integration-test-image-suffix}}" - - - name: upgrade-test-verification - inputs: - parameters: - - name: target-image-prefix - - name: test-results-gcs-dir - - name: api-integration-test-image-suffix - steps: - - - name: run-upgrade-tests-verification - template: run-upgrade-tests-verification - arguments: - parameters: - - name: test-results-gcs-dir - value: "{{inputs.parameters.test-results-gcs-dir}}" - - name: api-integration-test-image - value: "{{inputs.parameters.target-image-prefix}}{{inputs.parameters.api-integration-test-image-suffix}}" - - name: upgrade-test-preparation-v2 inputs: parameters: diff --git a/test/upgrade-tests.sh b/test/upgrade-tests.sh index fe646f61e1b7..3d8a5d77020e 100755 --- a/test/upgrade-tests.sh +++ b/test/upgrade-tests.sh @@ -104,8 +104,8 @@ if [ -n "$TEST_V2_API" ]; then TEST_PREPARATION_ENTRYPOINT=upgrade-test-preparation-v2 TEST_VERIFICATION_ENTRYPOINT=upgrade-test-verification-v2 else - TEST_PREPARATION_ENTRYPOINT=upgrade-test-preparation - TEST_VERIFICATION_ENTRYPOINT=upgrade-test-verification + >&2 echo "Error: Upgrade test for v1 is no longer supported. This is currently handled by GitHub Actions." + exit 1 fi