From 37441afd54ca47f3b9ee9d7e39ed8d8772b14794 Mon Sep 17 00:00:00 2001 From: Diego Lovison Date: Fri, 23 Aug 2024 16:46:00 -0300 Subject: [PATCH] test: Kubeflow Pipelines V2 integration Tests (#11125) Signed-off-by: Diego Lovison --- .../kubeflow-pipelines-integration-v2.yml | 38 +++++++++++++++++++ backend/src/v2/test/Makefile | 14 +------ backend/src/v2/test/requirements.txt | 6 --- .../src/v2/test/scripts/upload_gcs_blob.py | 20 ---------- 4 files changed, 40 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/kubeflow-pipelines-integration-v2.yml delete mode 100644 backend/src/v2/test/scripts/upload_gcs_blob.py diff --git a/.github/workflows/kubeflow-pipelines-integration-v2.yml b/.github/workflows/kubeflow-pipelines-integration-v2.yml new file mode 100644 index 00000000000..5de0b55b937 --- /dev/null +++ b/.github/workflows/kubeflow-pipelines-integration-v2.yml @@ -0,0 +1,38 @@ +name: Kubeflow Pipelines V2 integration Tests + +on: + push: + branches: + - master + pull_request: + paths: + - '.github/workflows/kubeflow-pipelines-integration-v2.yml' + - 'samples' + - 'core' + - 'backend' + +jobs: + integration-tests: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.8] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + + - 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: Run the Integration Tests + run: | + ./backend/src/v2/test/integration-test.sh diff --git a/backend/src/v2/test/Makefile b/backend/src/v2/test/Makefile index caa945b05fc..7a6a7db2498 100644 --- a/backend/src/v2/test/Makefile +++ b/backend/src/v2/test/Makefile @@ -9,19 +9,9 @@ include $(ENV_PATH) SHELL = /bin/bash .PHONY: integration-test -integration-test: upload +integration-test: export KF_PIPELINES_ENDPOINT=$(HOST) \ - && python -u sample_test.py \ - --samples_config samples/test/config-integration.yaml \ - --timeout_mins 60 \ - --context $(GCS_ROOT)/src/context.tar.gz \ - --gcs_root $(GCS_ROOT)/data \ - --gcr_root $(GCR_ROOT) \ - --kfp_package_path "$(KFP_PACKAGE_PATH)" - -.PHONY: upload -upload: context - python -u scripts/upload_gcs_blob.py tmp/context.tar.gz $(GCS_ROOT)/src/context.tar.gz + && python -u ../../../../samples/v2/sample_test.py .PHONY: context context: diff --git a/backend/src/v2/test/requirements.txt b/backend/src/v2/test/requirements.txt index 6eece4be3a9..9e690ab4125 100644 --- a/backend/src/v2/test/requirements.txt +++ b/backend/src/v2/test/requirements.txt @@ -1,9 +1,3 @@ # install kfp sdk from local path -e ../../../../sdk/python -# TODO(chensun): remove the deprecated dependencies once migrated tests. --r ../../../../sdk/python/requirements-deprecated.txt -ml-metadata==1.14.0 -minio==7.0.4 -google-cloud-storage fire --e ../../../../samples/test/utils diff --git a/backend/src/v2/test/scripts/upload_gcs_blob.py b/backend/src/v2/test/scripts/upload_gcs_blob.py deleted file mode 100644 index 1c1f577a656..00000000000 --- a/backend/src/v2/test/scripts/upload_gcs_blob.py +++ /dev/null @@ -1,20 +0,0 @@ -from google.cloud import storage - - -# This function is mainly written for environments without gsutil. -def upload_blob(source: str, destination: str): - """Uploads a file to the bucket.""" - # source = "local/path/to/file" - # destination = "gs://your-bucket-name/storage-object-name" - - storage_client = storage.Client() - blob = storage.Blob.from_string(destination, storage_client) - - blob.upload_from_filename(source) - - print(f"File {source} uploaded to destination {destination}") - - -if __name__ == '__main__': - import fire - fire.Fire(upload_blob)