Skip to content

Commit

Permalink
fix jupyter test script args
Browse files Browse the repository at this point in the history
  • Loading branch information
hsachdevah committed Mar 14, 2024
1 parent b673dc7 commit b6cbdec
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
17 changes: 9 additions & 8 deletions cloudbuild-ap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@ steps:
set -e
cd /workspace/modules/jupyter/tests
python3 change_jupyter_config.py autopilot
python3 change_jupyter_config.py $_AUTOPILOT_CLUSTER
cd /workspace/applications/jupyter
terraform apply \
-var-file=workloads-without-iap.example.tfvars \
-var=project_id=$PROJECT_ID \
-var=cluster_name=ml-$SHORT_SHA-$_PR_NUMBER-$_SUFFIX-cluster \
-var=namespace=ml-$SHORT_SHA-$_SUFFIX \
-var=kubernetes_namespace=ml-$SHORT_SHA-$_SUFFIX \
-var=workload_identity_service_account=jupyter-sa-$SHORT_SHA-$_SUFFIX \
-var=gcs_bucket=gke-aieco-jupyter-$SHORT_SHA-$_SUFFIX \
-auto-approve -no-color -lock=false
Expand All @@ -155,7 +155,7 @@ steps:
echo "HOST URL is " $(cat /workspace/jupyterhub_host_url.txt)
cd /workspace/modules/jupyter/tests
python3 test_hub.py $(cat /workspace/jupyterhub_host_url.txt) autopilot
python3 test_hub.py $(cat /workspace/jupyterhub_host_url.txt) $_AUTOPILOT_CLUSTER
echo "pass" > /workspace/jupyterhub_test_result.txt
allowFailure: true

Expand All @@ -172,10 +172,10 @@ steps:
-var-file=workloads-without-iap.example.tfvars \
-var=project_id=$PROJECT_ID \
-var=cluster_name=ml-$SHORT_SHA-$_PR_NUMBER-$_SUFFIX-cluster \
-var=namespace=ml-$SHORT_SHA-$_SUFFIX \
-var=kubernetes_namespace=ml-$SHORT_SHA-$_SUFFIX \
-var=workload_identity_service_account=jupyter-sa-$SHORT_SHA-$_SUFFIX \
-var=gcs_bucket=gke-aieco-jupyter-$SHORT_SHA-$_SUFFIX \
-auto-approve -no-color
-auto-approve -no-color -lock=false
allowFailure: true
waitFor: ['test jupyterhub']
Expand All @@ -195,7 +195,7 @@ steps:
--project $PROJECT_ID
cd /workspace/modules/jupyter/tests
python3 change_jupyter_config.py autopilot
python3 change_jupyter_config.py $_AUTOPILOT_CLUSTER
cd /workspace/applications/rag/
terraform apply \
Expand Down Expand Up @@ -231,7 +231,7 @@ steps:
# Validate Jupyterhub: Test Hub
cd /workspace/modules/jupyter/tests
python3 test_hub.py $(cat /workspace/rag_jupyterhub_host_url.txt) autopilot
python3 test_hub.py $(cat /workspace/rag_jupyterhub_host_url.txt) $_AUTOPILOT_CLUSTER
echo "pass" > /workspace/rag_jupyterhub_test_result.txt
# Validate RAG: Test rag frontend
Expand Down Expand Up @@ -280,6 +280,7 @@ steps:
cd /workspace/infrastructure
terraform destroy -var-file=tfvars_tests/standard-gke-public.platform.tfvars -var=project_id=$PROJECT_ID \
-var=cluster_name=ml-$SHORT_SHA-$_PR_NUMBER-$_SUFFIX-cluster \
-var=autopilot_cluster=$_AUTOPILOT_CLUSTER \
-var=cluster_location=$_REGION -auto-approve -no-color
allowFailure: true
Expand Down Expand Up @@ -331,7 +332,7 @@ steps:
exit 1
fi
waitFor: ['cleanup rag']
waitFor: ['cleanup gke cluster']

substitutions:
_REGION: us-central1
Expand Down
2 changes: 1 addition & 1 deletion modules/jupyter/tests/change_jupyter_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

config_file = "../jupyter_config/config-selfauth.yaml"
if len(sys.argv) == 2:
autopilot = (sys.argv[1] == "autopilot")
autopilot = (sys.argv[1] == "true")
if autopilot:
config_file = "../jupyter_config/config-selfauth-autopilot.yaml"

Expand Down
2 changes: 1 addition & 1 deletion modules/jupyter/tests/test_hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

config_file = "../jupyter_config/config-selfauth.yaml"
if len(sys.argv) == 3:
autopilot = (sys.argv[2] == "autopilot")
autopilot = (sys.argv[2] == "true")
if autopilot:
config_file = "../jupyter_config/config-selfauth-autopilot.yaml"

Expand Down

0 comments on commit b6cbdec

Please sign in to comment.