pipelines/test
capri-xiyue ea205cfa32
test: remove pin for cluster version (#6692)
* remove pin for cluster version

* pin image type to cos
2021-10-06 16:41:19 -07:00
..
api-integration-test test: fix apt update "changed its 'Suite' value from 'stable' to 'oldstable'" (#6351) 2021-08-16 02:18:06 -07:00
cloudbuild
frontend-integration-test test: prepare samples to be emissary executor compatible. Part of #5718 (#6109) 2021-07-22 18:00:01 +08:00
imagebuilder Assigned copyright to the project authors (#5587) 2021-05-05 13:53:22 +08:00
images
initialization-test test: fix apt update "changed its 'Suite' value from 'stable' to 'oldstable'" (#6351) 2021-08-16 02:18:06 -07:00
kfp-functional-test Assigned copyright to the project authors (#5587) 2021-05-05 13:53:22 +08:00
manifests
release revert: feat: change release tags to vX.Y.Z. Part of #5954 (#6034) 2021-07-14 14:43:56 +08:00
sample-test feat: upgrade MLMD to 1.2.0. Fix #6436 (#6437) 2021-08-28 16:59:22 -07:00
scripts
tools/project-cleaner test: Remove upgrade command in project_cleaner (#6227) 2021-08-04 02:30:41 -07:00
.gitignore
OWNERS chore(test): add chensun to test/OWNERS, remove numerology (#5357) 2021-03-22 15:28:43 -07:00
README.md fix(test): Update reference link in test README.md (#5354) 2021-03-22 17:52:50 -07:00
build-images.sh Assigned copyright to the project authors (#5587) 2021-05-05 13:53:22 +08:00
build_image.yaml test: prepare samples to be emissary executor compatible. Part of #5718 (#6109) 2021-07-22 18:00:01 +08:00
check-argo-status.sh Assigned copyright to the project authors (#5587) 2021-05-05 13:53:22 +08:00
check-build-image-status.sh Assigned copyright to the project authors (#5587) 2021-05-05 13:53:22 +08:00
component_test.yaml test: Revert "fix: Add workaround init container to fix test infra" (#6652) 2021-09-30 12:28:31 -07:00
deploy-cluster.sh test: remove pin for cluster version (#6692) 2021-10-06 16:41:19 -07:00
deploy-pipeline-lite.sh test: temporarily skip verify workload identity binding 2021-07-15 05:14:07 +00:00
deploy-pipeline-mkp-cli.sh Assigned copyright to the project authors (#5587) 2021-05-05 13:53:22 +08:00
e2e_test_gke_v2.yaml test: Revert "fix: Add workaround init container to fix test infra" (#6652) 2021-09-30 12:28:31 -07:00
install-argo-cli.sh feat: upgrade argo to v3.1.6-patch (#6376) 2021-08-18 03:17:38 -07:00
install-argo.sh test: temporarily skip verify workload identity binding 2021-07-15 05:14:07 +00:00
postsubmit-tests-with-pipeline-deployment.sh Assigned copyright to the project authors (#5587) 2021-05-05 13:53:22 +08:00
presubmit-backend-test.sh Assigned copyright to the project authors (#5587) 2021-05-05 13:53:22 +08:00
presubmit-backend-visualization.sh feat: upgrade TFX to 1.2.0 (#6375) 2021-08-18 01:50:37 -07:00
presubmit-component-yaml.sh
presubmit-components-gcp.sh
presubmit-tests-mkp.sh Assigned copyright to the project authors (#5587) 2021-05-05 13:53:22 +08:00
presubmit-tests-sdk.sh feat(sdk.v2): Add Google AIPlatformClient (#5677) 2021-05-18 13:33:34 -07:00
presubmit-tests-tfx.sh test: restore penguin_pipeline_kubeflow_test (#6131) 2021-07-25 00:55:41 -07:00
presubmit-tests-with-pipeline-deployment.sh Assigned copyright to the project authors (#5587) 2021-05-05 13:53:22 +08:00
sample_test.yaml test: Revert "fix: Add workaround init container to fix test infra" (#6652) 2021-09-30 12:28:31 -07:00
tag_for_hosted.sh feat: upgrade MLMD to 1.2.0. Fix #6436 (#6437) 2021-08-28 16:59:22 -07:00
test-prep.sh Assigned copyright to the project authors (#5587) 2021-05-05 13:53:22 +08:00
upgrade-tests.sh Assigned copyright to the project authors (#5587) 2021-05-05 13:53:22 +08:00
upgrade_test_setup.yaml test: prepare samples to be emissary executor compatible. Part of #5718 (#6109) 2021-07-22 18:00:01 +08:00

README.md

ML pipeline test infrastructure

This folder contains the integration/e2e tests for ML pipeline. We use Argo workflow to run the tests.

At a high level, a typical test workflow will

  • build docker images for all components
  • create a dedicate test namespace in the cluster
  • deploy ml pipeline using the newly built components
  • run the test
  • delete the namespace
  • delete the images

All these steps will be taking place in the same Kubernetes cluster. You can use GKE to test against the code in a Github Branch. The image will be temporarily stored in the GCR repository in the same project.

Tests are run automatically on each commit in a Kubernetes cluster using Prow. Tests can also be run manually, see the next section.

Run tests using GKE

You could run the tests against a specific commit.

Setup

Here are the one-time steps to prepare for your GKE testing cluster:

  • Follow the deployment guide to create a GKE cluster.
  • Install Argo in the cluster.
  • Create cluster role binding.
    kubectl create clusterrolebinding default-as-admin --clusterrole=cluster-admin --serviceaccount=default:default
    
  • Follow the guideline to create a ssh deploy key, and store as Kubernetes secret in your cluster, so the job can later access the code. Note it requires admin permission to add a deploy key to github repo. This step is not needed when the project is public.
    kubectl create secret generic ssh-key-secret
    --from-file=id_rsa=/path/to/your/id_rsa
    --from-file=id_rsa.pub=/path/to/your/id_rsa.pub
    

Run tests

Simply submit the test workflow to the GKE cluster, with a parameter specifying the commit you want to test (master HEAD by default):

argo submit integration_test_gke.yaml -p commit-sha=<commit>

You can check the result by doing:

argo list

The workflow will create a temporary namespace with the same name as the Argo workflow. All the images will be stored in gcr.io/project_id/workflow_name/branch_name/*. By default when the test is *finished, the namespace and images will be deleted. However you can keep them by providing additional parameter.

argo submit integration_test_gke.yaml -p branch="my-branch" -p cleanup="false"

Run presubmit-tests-with-pipeline-deployment.sh locally

Run the following commands from root of kubeflow/pipelines repo.

# $WORKSPACE are env variables set by Prow
export WORKSPACE=$(pwd) # root of kubeflow/pipelines git repo
export SA_KEY_FILE=PATH/TO/YOUR/GCP/PROJECT/SERVICE/ACCOUNT/KEY
# (optional) uncomment the following to keep reusing the same cluster
# export TEST_CLUSTER=YOUR_PRECONFIGURED_CLUSTER_NAME
# (optional) uncomment the following to disable built image caching
# export DISABLE_IMAGE_CACHING=true

./test/presubmit-tests-with-pipeline-deployment.sh \
  --workflow_file e2e_test_gke_v2.yaml \ # You can specify other workflows you want to test too.
  --test_result_folder ${FOLDER_NAME_TO_HOLD_TEST_RESULT} \
  --test_result_bucket ${YOUR_GCS_TEST_RESULT_BUCKET} \
  --project ${YOUR_GCS_PROJECT}

Troubleshooting

Q: Why is my test taking so long on GKE?

The cluster downloads a bunch of images during the first time the test runs. It will be faster the second time since the images are cached. The image building steps are running in parallel and usually takes 2~3 minutes in total. If you are experiencing high latency, it might due to the resource constrains on your GKE cluster. In that case you need to deploy a larger cluster.