From f19774562cff6b7656ae814525fe5ded8d881dab Mon Sep 17 00:00:00 2001 From: Tommy Li Date: Wed, 1 Feb 2023 10:18:30 -0800 Subject: [PATCH] update e2e tests with new api commands --- scripts/deploy/iks/test-cache.sh | 17 +++++++++-------- scripts/deploy/iks/test-condition-depend.sh | 11 ++++++----- scripts/deploy/iks/test-flip-coin.sh | 11 ++++++----- scripts/deploy/iks/test-many-edges.sh | 9 +++++---- scripts/deploy/iks/test-trusted-ai.sh | 11 ++++++----- 5 files changed, 32 insertions(+), 27 deletions(-) diff --git a/scripts/deploy/iks/test-cache.sh b/scripts/deploy/iks/test-cache.sh index afe38fd856..baa048e260 100755 --- a/scripts/deploy/iks/test-cache.sh +++ b/scripts/deploy/iks/test-cache.sh @@ -22,19 +22,20 @@ run_cache() { local PIPELINE_ID local RUN_ID local PIPELINE_NAME="cache" + local KFP_COMMAND="kfp-tekton" echo " ===== cache pipeline =====" python3 sdk/python/tests/compiler/testdata/cache.py - retry 3 3 kfp --endpoint http://localhost:8888 pipeline upload -p "$PIPELINE_NAME" sdk/python/tests/compiler/testdata/cache.yaml || : - PIPELINE_ID=$(kfp --endpoint http://localhost:8888 pipeline list | grep "$PIPELINE_NAME" | awk '{print $2}') + retry 3 3 $KFP_COMMAND --endpoint http://localhost:8888 pipeline upload -p "$PIPELINE_NAME" sdk/python/tests/compiler/testdata/cache.yaml || : + PIPELINE_ID=$($KFP_COMMAND --endpoint http://localhost:8888 pipeline list | grep "$PIPELINE_NAME" | awk '{print $2}') if [[ -z "$PIPELINE_ID" ]]; then echo "Failed to upload pipeline" return "$REV" fi local RUN_NAME="${PIPELINE_NAME}-run-$((RANDOM%10000+1))" - retry 3 3 kfp --endpoint http://localhost:8888 run submit -e "exp-cache" -r "$RUN_NAME" -p "$PIPELINE_ID" || : - RUN_ID=$(kfp --endpoint http://localhost:8888 run list | grep "$RUN_NAME" | awk '{print $2}') + retry 3 3 $KFP_COMMAND --endpoint http://localhost:8888 run submit -e "exp-cache" -r "$RUN_NAME" -p "$PIPELINE_ID" || : + RUN_ID=$($KFP_COMMAND --endpoint http://localhost:8888 run list | grep "$RUN_NAME" | awk '{print $2}') if [[ -z "$RUN_ID" ]]; then echo "Failed to submit a run for cache pipeline" return "$REV" @@ -43,7 +44,7 @@ run_cache() { local RUN_STATUS ENDTIME=$(date -ud "$DURATION minute" +%s) while [[ "$(date -u +%s)" -le "$ENDTIME" ]]; do - RUN_STATUS=$(kfp --endpoint http://localhost:8888 run list | grep "$RUN_NAME" | awk '{print $6}') + RUN_STATUS=$($KFP_COMMAND --endpoint http://localhost:8888 run list | grep "$RUN_NAME" | awk '{print $6}') if [[ "$RUN_STATUS" == "Succeeded" || "$RUN_STATUS" == "Completed" ]]; then REV=0 break; @@ -59,8 +60,8 @@ run_cache() { # need to run the pipeline twice to verify caching RUN_NAME="${PIPELINE_NAME}-run-$((RANDOM%10000+1))" - retry 3 3 kfp --endpoint http://localhost:8888 run submit -e "exp-cache" -r "$RUN_NAME" -p "$PIPELINE_ID" || : - RUN_ID=$(kfp --endpoint http://localhost:8888 run list | grep "$RUN_NAME" | awk '{print $2}') + retry 3 3 $KFP_COMMAND --endpoint http://localhost:8888 run submit -e "exp-cache" -r "$RUN_NAME" -p "$PIPELINE_ID" || : + RUN_ID=$($KFP_COMMAND --endpoint http://localhost:8888 run list | grep "$RUN_NAME" | awk '{print $2}') if [[ -z "$RUN_ID" ]]; then echo "Failed to submit a run for cache pipeline" return "$REV" @@ -68,7 +69,7 @@ run_cache() { ENDTIME=$(date -ud "$DURATION minute" +%s) while [[ "$(date -u +%s)" -le "$ENDTIME" ]]; do - RUN_STATUS=$(kfp --endpoint http://localhost:8888 run list | grep "$RUN_NAME" | awk '{print $6}') + RUN_STATUS=$($KFP_COMMAND --endpoint http://localhost:8888 run list | grep "$RUN_NAME" | awk '{print $6}') if [[ "$RUN_STATUS" == "Succeeded" || "$RUN_STATUS" == "Completed" ]]; then REV=0 break; diff --git a/scripts/deploy/iks/test-condition-depend.sh b/scripts/deploy/iks/test-condition-depend.sh index f69cfb0643..ec3bc7331e 100755 --- a/scripts/deploy/iks/test-condition-depend.sh +++ b/scripts/deploy/iks/test-condition-depend.sh @@ -22,19 +22,20 @@ run_cond_dep() { local PIPELINE_ID local RUN_ID local PIPELINE_NAME="cond-dep" + local KFP_COMMAND="kfp-tekton" echo " ===== condition depend pipeline =====" python3 sdk/python/tests/compiler/testdata/condition_depend.py - retry 3 3 kfp --endpoint http://localhost:8888 pipeline upload -p "$PIPELINE_NAME" sdk/python/tests/compiler/testdata/condition_depend.yaml || : - PIPELINE_ID=$(kfp --endpoint http://localhost:8888 pipeline list | grep "$PIPELINE_NAME" | awk '{print $2}') + retry 3 3 $KFP_COMMAND --endpoint http://localhost:8888 pipeline upload -p "$PIPELINE_NAME" sdk/python/tests/compiler/testdata/condition_depend.yaml || : + PIPELINE_ID=$($KFP_COMMAND --endpoint http://localhost:8888 pipeline list | grep "$PIPELINE_NAME" | awk '{print $2}') if [[ -z "$PIPELINE_ID" ]]; then echo "Failed to upload pipeline" return "$REV" fi local RUN_NAME="${PIPELINE_NAME}-run-$((RANDOM%10000+1))" - retry 3 3 kfp --endpoint http://localhost:8888 run submit -e "exp-cond-dep" -r "$RUN_NAME" -p "$PIPELINE_ID" || : - RUN_ID=$(kfp --endpoint http://localhost:8888 run list | grep "$RUN_NAME" | awk '{print $2}') + retry 3 3 $KFP_COMMAND --endpoint http://localhost:8888 run submit -e "exp-cond-dep" -r "$RUN_NAME" -p "$PIPELINE_ID" || : + RUN_ID=$($KFP_COMMAND --endpoint http://localhost:8888 run list | grep "$RUN_NAME" | awk '{print $2}') if [[ -z "$RUN_ID" ]]; then echo "Failed to submit a run for condition-depend pipeline" return "$REV" @@ -43,7 +44,7 @@ run_cond_dep() { local RUN_STATUS ENDTIME=$(date -ud "$DURATION minute" +%s) while [[ "$(date -u +%s)" -le "$ENDTIME" ]]; do - RUN_STATUS=$(kfp --endpoint http://localhost:8888 run list | grep "$RUN_NAME" | awk '{print $6}') + RUN_STATUS=$($KFP_COMMAND --endpoint http://localhost:8888 run list | grep "$RUN_NAME" | awk '{print $6}') if [[ "$RUN_STATUS" == "Completed" ]]; then REV=0 break; diff --git a/scripts/deploy/iks/test-flip-coin.sh b/scripts/deploy/iks/test-flip-coin.sh index d36479d738..24c6b4f278 100755 --- a/scripts/deploy/iks/test-flip-coin.sh +++ b/scripts/deploy/iks/test-flip-coin.sh @@ -21,19 +21,20 @@ run_flip_coin_example() { shift local PIPELINE_ID local RUN_ID + local KFP_COMMAND="kfp-tekton" echo " ===== flip coin sample =====" python3 samples/flip-coin/condition.py - retry 3 3 kfp --endpoint http://localhost:8888 pipeline upload -p e2e-flip-coin samples/flip-coin/condition.yaml || : - PIPELINE_ID=$(kfp --endpoint http://localhost:8888 pipeline list | grep 'e2e-flip-coin' | awk '{print $2}') + retry 3 3 $KFP_COMMAND --endpoint http://localhost:8888 pipeline upload -p e2e-flip-coin samples/flip-coin/condition.yaml || : + PIPELINE_ID=$($KFP_COMMAND --endpoint http://localhost:8888 pipeline list | grep 'e2e-flip-coin' | awk '{print $2}') if [[ -z "$PIPELINE_ID" ]]; then echo "Failed to upload pipeline" return "$REV" fi local RUN_NAME="e2e-flip-coin-run-$((RANDOM%10000+1))" - retry 3 3 kfp --endpoint http://localhost:8888 run submit -e exp-e2e-flip-coin -r "$RUN_NAME" -p "$PIPELINE_ID" || : - RUN_ID=$(kfp --endpoint http://localhost:8888 run list | grep "$RUN_NAME" | awk '{print $2}') + retry 3 3 $KFP_COMMAND --endpoint http://localhost:8888 run submit -e exp-e2e-flip-coin -r "$RUN_NAME" -p "$PIPELINE_ID" || : + RUN_ID=$($KFP_COMMAND --endpoint http://localhost:8888 run list | grep "$RUN_NAME" | awk '{print $2}') if [[ -z "$RUN_ID" ]]; then echo "Failed to submit a run for flip coin pipeline" return "$REV" @@ -42,7 +43,7 @@ run_flip_coin_example() { local RUN_STATUS ENDTIME=$(date -ud "$DURATION minute" +%s) while [[ "$(date -u +%s)" -le "$ENDTIME" ]]; do - RUN_STATUS=$(kfp --endpoint http://localhost:8888 run list | grep "$RUN_NAME" | awk '{print $6}') + RUN_STATUS=$($KFP_COMMAND --endpoint http://localhost:8888 run list | grep "$RUN_NAME" | awk '{print $6}') if [[ "$RUN_STATUS" == "Completed" ]]; then REV=0 break; diff --git a/scripts/deploy/iks/test-many-edges.sh b/scripts/deploy/iks/test-many-edges.sh index f78c55b7c0..a08724705c 100755 --- a/scripts/deploy/iks/test-many-edges.sh +++ b/scripts/deploy/iks/test-many-edges.sh @@ -21,11 +21,12 @@ run_many_edges() { shift local PIPELINE_ID local RUN_ID + local KFP_COMMAND="kfp-tekton" echo " ===== many edges =====" python3 scripts/deploy/iks/test/many-edges.py - retry 3 3 kfp --endpoint http://localhost:8888 pipeline upload -p many-edges scripts/deploy/iks/test/many-edges.yaml || : - PIPELINE_ID=$(kfp --endpoint http://localhost:8888 pipeline list | grep 'many-edges' | awk '{print $2}') + retry 3 3 $KFP_COMMAND --endpoint http://localhost:8888 pipeline upload -p many-edges scripts/deploy/iks/test/many-edges.yaml || : + PIPELINE_ID=$($KFP_COMMAND --endpoint http://localhost:8888 pipeline list | grep 'many-edges' | awk '{print $2}') if [[ -z "$PIPELINE_ID" ]]; then echo "Failed to upload pipeline" return "$REV" @@ -35,8 +36,8 @@ run_many_edges() { local ENDTIME ENDTIME=$(date -ud "5 second" +%s) - retry 3 3 kfp --endpoint http://localhost:8888 run submit -e exp-many-edges -r "$RUN_NAME" -p "$PIPELINE_ID" || : - RUN_ID=$(kfp --endpoint http://localhost:8888 run list | grep "$RUN_NAME" | awk '{print $2}') + retry 3 3 $KFP_COMMAND --endpoint http://localhost:8888 run submit -e exp-many-edges -r "$RUN_NAME" -p "$PIPELINE_ID" || : + RUN_ID=$($KFP_COMMAND --endpoint http://localhost:8888 run list | grep "$RUN_NAME" | awk '{print $2}') if [[ -z "$RUN_ID" ]]; then echo "Failed to submit a run for many edges pipeline" return "$REV" diff --git a/scripts/deploy/iks/test-trusted-ai.sh b/scripts/deploy/iks/test-trusted-ai.sh index dc175eea6c..ea805c8338 100755 --- a/scripts/deploy/iks/test-trusted-ai.sh +++ b/scripts/deploy/iks/test-trusted-ai.sh @@ -21,6 +21,7 @@ run_trusted_ai_example() { shift local PIPELINE_ID local RUN_ID + local KFP_COMMAND="kfp-tekton" kubectl create clusterrolebinding pipeline-runner-extend --clusterrole \ cluster-admin --serviceaccount=kubeflow:pipeline-runner || true @@ -29,16 +30,16 @@ run_trusted_ai_example() { python3 samples/trusted-ai/trusted-ai.py # use kubeflow namespace yq eval --inplace '(.spec.params[] | select(.name=="namespace")) |=.value="kubeflow"' samples/trusted-ai/trusted-ai.yaml - retry 3 3 kfp --endpoint http://localhost:8888 pipeline upload -p e2e-trusted-ai samples/trusted-ai/trusted-ai.yaml || : - PIPELINE_ID=$(kfp --endpoint http://localhost:8888 pipeline list | grep 'e2e-trusted-ai' | awk '{print $2}') + retry 3 3 $KFP_COMMAND --endpoint http://localhost:8888 pipeline upload -p e2e-trusted-ai samples/trusted-ai/trusted-ai.yaml || : + PIPELINE_ID=$($KFP_COMMAND --endpoint http://localhost:8888 pipeline list | grep 'e2e-trusted-ai' | awk '{print $2}') if [[ -z "$PIPELINE_ID" ]]; then echo "Failed to upload pipeline" return "$REV" fi local RUN_NAME="e2e-trusted-ai-run-$((RANDOM%10000+1))" - retry 3 3 kfp --endpoint http://localhost:8888 run submit -e exp-e2e-trusted-ai -r "$RUN_NAME" -p "$PIPELINE_ID" || : - RUN_ID=$(kfp --endpoint http://localhost:8888 run list | grep "$RUN_NAME" | awk '{print $2}') + retry 3 3 $KFP_COMMAND --endpoint http://localhost:8888 run submit -e exp-e2e-trusted-ai -r "$RUN_NAME" -p "$PIPELINE_ID" || : + RUN_ID=$($KFP_COMMAND --endpoint http://localhost:8888 run list | grep "$RUN_NAME" | awk '{print $2}') if [[ -z "$RUN_ID" ]]; then echo "Failed to submit a run for trusted-ai pipeline" return "$REV" @@ -47,7 +48,7 @@ run_trusted_ai_example() { local RUN_STATUS ENDTIME=$(date -ud "$DURATION minute" +%s) while [[ "$(date -u +%s)" -le "$ENDTIME" ]]; do - RUN_STATUS=$(kfp --endpoint http://localhost:8888 run list | grep "$RUN_NAME" | awk '{print $6}') + RUN_STATUS=$($KFP_COMMAND --endpoint http://localhost:8888 run list | grep "$RUN_NAME" | awk '{print $6}') if [[ "$RUN_STATUS" == "Succeeded" ]]; then REV=0 break;