@@ -37,10 +37,11 @@ source $(dirname $0)/sqlflow/docker/dev/find_fastest_resources.sh
3737set +e
3838
3939# Execute cmd until given output is present
40+ # or exit when timeout (50*3s)
4041# "$1" is user message
4142# "$2" is cmd
4243# "$3" is expected output
43- function wait_until () {
44+ function wait_or_exit () {
4445 echo -n " Waiting for $1 "
4546 for i in {1..50}; do
4647 $2 | grep -o -q " $3 "
7576 fi
7677fi
7778
78- wait_until " minikube" " minikube status" " apiserver: Running"
79+ wait_or_exit " minikube" " minikube status" " apiserver: Running"
7980
8081# Test if a Kubernetes pod is ready
8182# "$1" shoulde be namespace id e.g. argo
@@ -101,7 +102,7 @@ if [[ "$argo_server_alive" == "yes" ]]; then
101102else
102103 $( dirname $0 ) /sqlflow/scripts/travis/start_argo.sh
103104fi
104- wait_until " argo" " is_pod_ready argo app=argo-server" " yes"
105+ wait_or_exit " argo" " is_pod_ready argo app=argo-server" " yes"
105106
106107echo " Strat Kubernetes Dashboard ..."
107108dashboard_alive=$( is_pod_ready " kubernetes-dashboard" " k8s-app=kubernetes-dashboard" )
@@ -110,7 +111,7 @@ if [[ "$dashboard_alive" == "yes" ]]; then
110111else
111112 nohup minikube dashboard > /dev/null 2>&1 &
112113fi
113- wait_until " Kubernetes Dashboard" " is_pod_ready kubernetes-dashboard k8s-app=kubernetes-dashboard" " yes"
114+ wait_or_exit " Kubernetes Dashboard" " is_pod_ready kubernetes-dashboard k8s-app=kubernetes-dashboard" " yes"
114115
115116echo " Strat SQLFlow ..."
116117sqlflow_alive=$( is_pod_ready " default" " app=sqlflow-server" )
@@ -119,7 +120,7 @@ if [[ "$sqlflow_alive" == "yes" ]]; then
119120else
120121 kubectl apply -f sqlflow/doc/run/k8s/install-sqlflow.yaml
121122fi
122- # wait_until "SQLFlow" "is_pod_ready default app=sqlflow-server" "yes"
123+ wait_or_exit " SQLFlow" " is_pod_ready default app=sqlflow-server" " yes"
123124
124125# Kill port exposing if it already exist
125126function stop_expose() {
0 commit comments