Skip to content

Commit 4852f13

Browse files
committed
modify wait function's name
1 parent 0329790 commit 4852f13

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

start.bash

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ source $(dirname $0)/sqlflow/docker/dev/find_fastest_resources.sh
3737
set +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"
@@ -75,7 +76,7 @@ else
7576
fi
7677
fi
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
101102
else
102103
$(dirname $0)/sqlflow/scripts/travis/start_argo.sh
103104
fi
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

106107
echo "Strat Kubernetes Dashboard ..."
107108
dashboard_alive=$(is_pod_ready "kubernetes-dashboard" "k8s-app=kubernetes-dashboard")
@@ -110,7 +111,7 @@ if [[ "$dashboard_alive" == "yes" ]]; then
110111
else
111112
nohup minikube dashboard >/dev/null 2>&1 &
112113
fi
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

115116
echo "Strat SQLFlow ..."
116117
sqlflow_alive=$(is_pod_ready "default" "app=sqlflow-server")
@@ -119,7 +120,7 @@ if [[ "$sqlflow_alive" == "yes" ]]; then
119120
else
120121
kubectl apply -f sqlflow/doc/run/k8s/install-sqlflow.yaml
121122
fi
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
125126
function stop_expose() {

0 commit comments

Comments
 (0)