Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tests): update e2e tests with new api commands #1140

Merged
merged 1 commit into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions scripts/deploy/iks/test-cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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;
Expand All @@ -59,16 +60,16 @@ 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"
fi

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;
Expand Down
11 changes: 6 additions & 5 deletions scripts/deploy/iks/test-condition-depend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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;
Expand Down
11 changes: 6 additions & 5 deletions scripts/deploy/iks/test-flip-coin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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;
Expand Down
9 changes: 5 additions & 4 deletions scripts/deploy/iks/test-many-edges.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
11 changes: 6 additions & 5 deletions scripts/deploy/iks/test-trusted-ai.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -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;
Expand Down