HuangTing-Yao commented on a change in pull request #229:
URL: 
https://github.com/apache/incubator-yunikorn-k8shim/pull/229#discussion_r569999601



##########
File path: deployments/examples/gang/cmd/gangDeploy.sh
##########
@@ -26,46 +26,22 @@ set -o pipefail
 JOBAMOUNT=$1
 GANGMEMBER=$2
 RUNTIMESEC=$3
+TIMEOUT=0
+
+# create service and job counter web server
+WORKDIR=$(cd "$(dirname "$0")"; pwd)
+kubectl apply -f $WORKDIR/../gang-coordinator.yaml
 
-# create service
-kubectl create -f <(cat << EOF
-apiVersion: v1
-kind: Service
-metadata:
-  name: gangservice
-  labels:
-    app: gang
-spec:
-  selector:
-    app: gang
-  type: ClusterIP
-  ports:
-  - protocol: TCP
-    port: 8863
-    targetPort: 8863
-EOF) 
-# create job counter web server
-kubectl create -f <(cat << EOF
-apiVersion: v1
-kind: Pod
-metadata:
-  name: gangweb
-  labels:
-    app: gang
-    queue: root.sandbox
-spec:
-  schedulerName: yunikorn
-  containers:
-    - name: gangweb
-      image: apache/yunikorn:simulation-gang-coordinator-latest
-      imagePullPolicy: Never
-      ports:
-        - containerPort: 8863
-EOF)
 # wait for web server to be running
-until grep 'Running' <(kubectl get pod gangweb -o=jsonpath='{.status.phase}'); 
do
+until grep -q 'Running' <(kubectl get pod gangweb 
-o=jsonpath='{.status.phase}'); do
   sleep 1
+  TIMEOUT=$(($TIMEOUT+1))
+  if [ $TIMEOUT -ge 20 ]; then
+    echo "Timeout for waiting web server"

Review comment:
       sure, done.

##########
File path: deployments/examples/gang/cmd/gangDeploy.sh
##########
@@ -26,46 +26,22 @@ set -o pipefail
 JOBAMOUNT=$1
 GANGMEMBER=$2
 RUNTIMESEC=$3
+TIMEOUT=0
+
+# create service and job counter web server
+WORKDIR=$(cd "$(dirname "$0")"; pwd)
+kubectl apply -f $WORKDIR/../gang-coordinator.yaml

Review comment:
       I had check several times, it can work in my local, do I miss something?

##########
File path: deployments/examples/gang/cmd/gangDeploy.sh
##########
@@ -96,5 +73,6 @@ spec:
           value: "$RUNTIMESEC"
       restartPolicy: Never
       schedulerName: yunikorn
-EOF)
+EOF
+)
 done

Review comment:
       before the `done`, right?

##########
File path: deployments/examples/gang/cmd/gangDeploy.sh
##########
@@ -26,46 +26,23 @@ set -o pipefail
 JOBAMOUNT=$1
 GANGMEMBER=$2
 RUNTIMESEC=$3

Review comment:
       Sure, done.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to