@@ -37,10 +37,11 @@ source $(dirname $0)/sqlflow/docker/dev/find_fastest_resources.sh
37
37
set +e
38
38
39
39
# Execute cmd until given output is present
40
+ # or exit when timeout (50*3s)
40
41
# "$1" is user message
41
42
# "$2" is cmd
42
43
# "$3" is expected output
43
- function wait_until () {
44
+ function wait_or_exit () {
44
45
echo -n " Waiting for $1 "
45
46
for i in {1..50}; do
46
47
$2 | grep -o -q " $3 "
75
76
fi
76
77
fi
77
78
78
- wait_until " minikube" " minikube status" " apiserver: Running"
79
+ wait_or_exit " minikube" " minikube status" " apiserver: Running"
79
80
80
81
# Test if a Kubernetes pod is ready
81
82
# "$1" shoulde be namespace id e.g. argo
@@ -101,7 +102,7 @@ if [[ "$argo_server_alive" == "yes" ]]; then
101
102
else
102
103
$( dirname $0 ) /sqlflow/scripts/travis/start_argo.sh
103
104
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"
105
106
106
107
echo " Strat Kubernetes Dashboard ..."
107
108
dashboard_alive=$( is_pod_ready " kubernetes-dashboard" " k8s-app=kubernetes-dashboard" )
@@ -110,7 +111,7 @@ if [[ "$dashboard_alive" == "yes" ]]; then
110
111
else
111
112
nohup minikube dashboard > /dev/null 2>&1 &
112
113
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"
114
115
115
116
echo " Strat SQLFlow ..."
116
117
sqlflow_alive=$( is_pod_ready " default" " app=sqlflow-server" )
@@ -119,7 +120,7 @@ if [[ "$sqlflow_alive" == "yes" ]]; then
119
120
else
120
121
kubectl apply -f sqlflow/doc/run/k8s/install-sqlflow.yaml
121
122
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"
123
124
124
125
# Kill port exposing if it already exist
125
126
function stop_expose() {
0 commit comments