You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2020/10/26 21:19:55 UTC

[GitHub] [incubator-yunikorn-k8shim] yangwwei commented on a change in pull request #201: [YUNIKORN-448] Create a docker image to simulate app that requires gang scheduling

yangwwei commented on a change in pull request #201:
URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/201#discussion_r512266110



##########
File path: Makefile
##########
@@ -153,6 +156,32 @@ adm_image: admission
 	docker build ./deployments/image/admission -t ${REGISTRY}/yunikorn:admission-${VERSION}
 	@rm -f ./deployments/image/admission/${POD_ADMISSION_CONTROLLER_BINARY}
 
+# Build gang web server and client binary in a production ready version
+.PHONY: gang
+gang:

Review comment:
       rename this target to `simulation`

##########
File path: pkg/gang/gangclient/gangclient.go
##########
@@ -0,0 +1,84 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package main
+
+import (
+	"encoding/json"
+	"fmt"
+	"io/ioutil"
+	"net/http"
+	"os"
+	"strconv"
+	"strings"
+	"time"
+)
+
+func main() {
+	jobName := os.Getenv("jobName")
+	serviceName := os.Getenv("serviceName")
+	memberAmount, err := strconv.Atoi(os.Getenv("memberAmount"))
+	if err != nil {
+		memberAmount = 10
+	}
+	runtimeMin, err := strconv.Atoi(os.Getenv("runtimeMin"))
+	if err != nil {
+		runtimeMin = 1
+	}
+	serviceName = strings.ToUpper(serviceName) + "_SERVICE_HOST"
+	serviceIP := os.Getenv(serviceName)
+	addRequest(serviceIP, jobName)
+	// Check if we satisfy gang minMember or not every 2 second
+	for {
+		number := checkRequest(serviceIP, jobName)
+		if number >= memberAmount {
+			fmt.Println("satisfy gang minMember.")
+			fmt.Println("start to run job.")

Review comment:
       Not the job, this should be logged as "start to run the task".
   Also, we need some log to say "the task will run for XX minutes"

##########
File path: pkg/gang/gangclient/gangclient.go
##########
@@ -0,0 +1,84 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package main
+
+import (
+	"encoding/json"
+	"fmt"
+	"io/ioutil"
+	"net/http"
+	"os"
+	"strconv"
+	"strings"
+	"time"
+)
+
+func main() {
+	jobName := os.Getenv("jobName")
+	serviceName := os.Getenv("serviceName")
+	memberAmount, err := strconv.Atoi(os.Getenv("memberAmount"))
+	if err != nil {
+		memberAmount = 10
+	}
+	runtimeMin, err := strconv.Atoi(os.Getenv("runtimeMin"))
+	if err != nil {
+		runtimeMin = 1
+	}
+	serviceName = strings.ToUpper(serviceName) + "_SERVICE_HOST"
+	serviceIP := os.Getenv(serviceName)

Review comment:
       These ENV vars are required, I think we should do some check to make sure they present.
   Otherwise, the cmd should fail directly and give users some explicit error.
   Another thing is, all ENV vars should be using capital letters, e.g JOB_ID

##########
File path: Makefile
##########
@@ -30,6 +30,9 @@ OUTPUT=_output
 RELEASE_BIN_DIR=${OUTPUT}/bin
 ADMISSION_CONTROLLER_BIN_DIR=${OUTPUT}/admission-controllers/
 POD_ADMISSION_CONTROLLER_BINARY=scheduler-admission-controller
+GANG_BIN_DIR=${OUTPUT}/gang
+GANG_CLIENT_BINARY=gangclient
+GANG_SERVER_BINARY=gangweb

Review comment:
       instead of `gangweb`, let's rename it to  `simulation-gang-coordinator`

##########
File path: pkg/gang/gangclient/gangclient.go
##########
@@ -0,0 +1,84 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package main
+
+import (
+	"encoding/json"
+	"fmt"
+	"io/ioutil"
+	"net/http"
+	"os"
+	"strconv"
+	"strings"
+	"time"
+)
+
+func main() {
+	jobName := os.Getenv("jobName")
+	serviceName := os.Getenv("serviceName")
+	memberAmount, err := strconv.Atoi(os.Getenv("memberAmount"))
+	if err != nil {
+		memberAmount = 10
+	}
+	runtimeMin, err := strconv.Atoi(os.Getenv("runtimeMin"))
+	if err != nil {
+		runtimeMin = 1

Review comment:
       do not set a default value when the error is not nil, this can cover some issues up.
   directly log this error and fail the execution

##########
File path: pkg/gang/gangclient/gangclient.go
##########
@@ -0,0 +1,84 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package main
+
+import (
+	"encoding/json"
+	"fmt"
+	"io/ioutil"
+	"net/http"
+	"os"
+	"strconv"
+	"strings"
+	"time"
+)
+
+func main() {
+	jobName := os.Getenv("jobName")
+	serviceName := os.Getenv("serviceName")
+	memberAmount, err := strconv.Atoi(os.Getenv("memberAmount"))
+	if err != nil {
+		memberAmount = 10
+	}
+	runtimeMin, err := strconv.Atoi(os.Getenv("runtimeMin"))
+	if err != nil {
+		runtimeMin = 1
+	}
+	serviceName = strings.ToUpper(serviceName) + "_SERVICE_HOST"
+	serviceIP := os.Getenv(serviceName)
+	addRequest(serviceIP, jobName)
+	// Check if we satisfy gang minMember or not every 2 second
+	for {
+		number := checkRequest(serviceIP, jobName)
+		if number >= memberAmount {
+			fmt.Println("satisfy gang minMember.")
+			fmt.Println("start to run job.")
+			time.Sleep(time.Duration(runtimeMin) * time.Minute) // means the application start running job
+			break
+		}
+		time.Sleep(2 * time.Second)
+	}
+}
+
+func addRequest(ip string, jobName string) {
+	resp, err := http.Get("http://" + ip + ":8863" + "/ws/v1/add/" + jobName)
+	if err != nil {
+		fmt.Println(err)
+	}
+	defer resp.Body.Close()
+	body, err := ioutil.ReadAll(resp.Body)
+	if err != nil {
+		fmt.Println("Get request body fail.")
+	}
+	fmt.Println(string(body))
+}
+
+func checkRequest(ip string, jobName string) int {
+	resp, err := http.Get("http://" + ip + ":8863" + "/ws/v1/check/" + jobName)
+	var value int
+	if err != nil {
+		fmt.Println("Check jobMember fail.")

Review comment:
       return the error

##########
File path: pkg/gang/gangclient/gangclient.go
##########
@@ -0,0 +1,84 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package main
+
+import (
+	"encoding/json"
+	"fmt"
+	"io/ioutil"
+	"net/http"
+	"os"
+	"strconv"
+	"strings"
+	"time"
+)
+
+func main() {
+	jobName := os.Getenv("jobName")
+	serviceName := os.Getenv("serviceName")
+	memberAmount, err := strconv.Atoi(os.Getenv("memberAmount"))
+	if err != nil {
+		memberAmount = 10
+	}
+	runtimeMin, err := strconv.Atoi(os.Getenv("runtimeMin"))
+	if err != nil {
+		runtimeMin = 1
+	}
+	serviceName = strings.ToUpper(serviceName) + "_SERVICE_HOST"
+	serviceIP := os.Getenv(serviceName)
+	addRequest(serviceIP, jobName)
+	// Check if we satisfy gang minMember or not every 2 second
+	for {
+		number := checkRequest(serviceIP, jobName)
+		if number >= memberAmount {
+			fmt.Println("satisfy gang minMember.")
+			fmt.Println("start to run job.")
+			time.Sleep(time.Duration(runtimeMin) * time.Minute) // means the application start running job
+			break
+		}
+		time.Sleep(2 * time.Second)
+	}
+}
+
+func addRequest(ip string, jobName string) {
+	resp, err := http.Get("http://" + ip + ":8863" + "/ws/v1/add/" + jobName)
+	if err != nil {
+		fmt.Println(err)
+	}
+	defer resp.Body.Close()
+	body, err := ioutil.ReadAll(resp.Body)
+	if err != nil {
+		fmt.Println("Get request body fail.")
+	}
+	fmt.Println(string(body))
+}
+
+func checkRequest(ip string, jobName string) int {
+	resp, err := http.Get("http://" + ip + ":8863" + "/ws/v1/check/" + jobName)
+	var value int
+	if err != nil {
+		fmt.Println("Check jobMember fail.")
+	}
+	defer resp.Body.Close()
+	err = json.NewDecoder(resp.Body).Decode(&value)
+	if err != nil {
+		fmt.Println("Decode fail.")

Review comment:
       return the error

##########
File path: Makefile
##########
@@ -30,6 +30,9 @@ OUTPUT=_output
 RELEASE_BIN_DIR=${OUTPUT}/bin
 ADMISSION_CONTROLLER_BIN_DIR=${OUTPUT}/admission-controllers/
 POD_ADMISSION_CONTROLLER_BINARY=scheduler-admission-controller
+GANG_BIN_DIR=${OUTPUT}/gang
+GANG_CLIENT_BINARY=gangclient

Review comment:
       rename `gangclient` to `simulation-gang-worker`

##########
File path: pkg/gang/gangclient/gangclient.go
##########
@@ -0,0 +1,84 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package main
+
+import (
+	"encoding/json"
+	"fmt"
+	"io/ioutil"
+	"net/http"
+	"os"
+	"strconv"
+	"strings"
+	"time"
+)
+
+func main() {
+	jobName := os.Getenv("jobName")
+	serviceName := os.Getenv("serviceName")
+	memberAmount, err := strconv.Atoi(os.Getenv("memberAmount"))
+	if err != nil {
+		memberAmount = 10
+	}
+	runtimeMin, err := strconv.Atoi(os.Getenv("runtimeMin"))
+	if err != nil {
+		runtimeMin = 1

Review comment:
       `rumtimeMin` --->  `taskExecutionSeconds`
   We'd prefer to use seconds, that is more flexible to configure

##########
File path: pkg/gang/gangclient/gangclient.go
##########
@@ -0,0 +1,84 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package main
+
+import (
+	"encoding/json"
+	"fmt"
+	"io/ioutil"
+	"net/http"
+	"os"
+	"strconv"
+	"strings"
+	"time"
+)
+
+func main() {
+	jobName := os.Getenv("jobName")
+	serviceName := os.Getenv("serviceName")
+	memberAmount, err := strconv.Atoi(os.Getenv("memberAmount"))
+	if err != nil {
+		memberAmount = 10
+	}
+	runtimeMin, err := strconv.Atoi(os.Getenv("runtimeMin"))
+	if err != nil {
+		runtimeMin = 1
+	}
+	serviceName = strings.ToUpper(serviceName) + "_SERVICE_HOST"
+	serviceIP := os.Getenv(serviceName)
+	addRequest(serviceIP, jobName)
+	// Check if we satisfy gang minMember or not every 2 second
+	for {
+		number := checkRequest(serviceIP, jobName)
+		if number >= memberAmount {
+			fmt.Println("satisfy gang minMember.")
+			fmt.Println("start to run job.")
+			time.Sleep(time.Duration(runtimeMin) * time.Minute) // means the application start running job
+			break
+		}
+		time.Sleep(2 * time.Second)
+	}
+}
+
+func addRequest(ip string, jobName string) {
+	resp, err := http.Get("http://" + ip + ":8863" + "/ws/v1/add/" + jobName)
+	if err != nil {
+		fmt.Println(err)
+	}
+	defer resp.Body.Close()
+	body, err := ioutil.ReadAll(resp.Body)
+	if err != nil {
+		fmt.Println("Get request body fail.")

Review comment:
       return an error, instead of just printing the log

##########
File path: pkg/gang/webserver/handlers.go
##########
@@ -0,0 +1,56 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package main
+
+import (
+	"encoding/json"
+	"log"
+	"net/http"
+
+	"github.com/gorilla/mux"
+)
+
+func writeHeader(w http.ResponseWriter) {
+	w.Header().Set("Content-Type", "application/json; charset=UTF-8")
+	w.Header().Set("Access-Control-Allow-Origin", "*")
+	w.Header().Set("Access-Control-Allow-Credentials", "true")
+	w.Header().Set("Access-Control-Allow-Methods", "GET,POST,HEAD,OPTIONS")
+	w.Header().Set("Access-Control-Allow-Headers", "X-Requested-With,Content-Type,Accept,Origin")
+}
+
+func setTaskReady(w http.ResponseWriter, r *http.Request) {
+	writeHeader(w)
+	lock.Lock()
+	defer lock.Unlock()
+	vars := mux.Vars(r)
+	jobName := vars["jobName"]
+	jobMember[jobName]++
+	if err := json.NewEncoder(w).Encode(jobMember); err != nil {
+		log.Printf("Add task %s fail.", jobName)

Review comment:
       this should return the client an error, not just a server-side log
   you can refer to, e.g https://github.com/apache/incubator-yunikorn-core/blob/e9ab51a96afc6a9ce9a320db800f514cf5e7ab50/pkg/webservice/handlers.go#L56

##########
File path: pkg/gang/gangclient/gangclient.go
##########
@@ -0,0 +1,84 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package main
+
+import (
+	"encoding/json"
+	"fmt"
+	"io/ioutil"
+	"net/http"
+	"os"
+	"strconv"
+	"strings"
+	"time"
+)
+
+func main() {
+	jobName := os.Getenv("jobName")
+	serviceName := os.Getenv("serviceName")
+	memberAmount, err := strconv.Atoi(os.Getenv("memberAmount"))
+	if err != nil {
+		memberAmount = 10
+	}
+	runtimeMin, err := strconv.Atoi(os.Getenv("runtimeMin"))
+	if err != nil {
+		runtimeMin = 1
+	}
+	serviceName = strings.ToUpper(serviceName) + "_SERVICE_HOST"
+	serviceIP := os.Getenv(serviceName)
+	addRequest(serviceIP, jobName)
+	// Check if we satisfy gang minMember or not every 2 second
+	for {
+		number := checkRequest(serviceIP, jobName)
+		if number >= memberAmount {
+			fmt.Println("satisfy gang minMember.")
+			fmt.Println("start to run job.")
+			time.Sleep(time.Duration(runtimeMin) * time.Minute) // means the application start running job
+			break
+		}
+		time.Sleep(2 * time.Second)

Review comment:
       if the condition is not met, we need to print some logs as well.
   E.g how many members are running out there, and what is the minMember, can you add that log as well?

##########
File path: Makefile
##########
@@ -153,6 +156,32 @@ adm_image: admission
 	docker build ./deployments/image/admission -t ${REGISTRY}/yunikorn:admission-${VERSION}
 	@rm -f ./deployments/image/admission/${POD_ADMISSION_CONTROLLER_BINARY}
 
+# Build gang web server and client binary in a production ready version
+.PHONY: gang
+gang:
+	@echo "building gang web client binary"
+	CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
+	go build -a -o=${GANG_BIN_DIR}/${GANG_CLIENT_BINARY} -ldflags \
+	'-extldflags "-static" -X main.version=${VERSION} -X main.date=${DATE}' \
+	-tags netgo -installsuffix netgo \
+	./pkg/gang/gangclient
+	@echo "building gang web server binary"
+	go build -a -o=${GANG_BIN_DIR}/${GANG_SERVER_BINARY} -ldflags \
+	'-extldflags "-static" -X main.version=${VERSION} -X main.date=${DATE}' \
+	-tags netgo -installsuffix netgo \
+	./pkg/gang/webserver
+
+# Build gang test images based on the production ready version
+.PHONY: gang_image

Review comment:
       rename this to `simulation_image`

##########
File path: pkg/gang/webserver/handlers.go
##########
@@ -0,0 +1,56 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package main
+
+import (
+	"encoding/json"
+	"log"
+	"net/http"
+
+	"github.com/gorilla/mux"
+)
+
+func writeHeader(w http.ResponseWriter) {
+	w.Header().Set("Content-Type", "application/json; charset=UTF-8")
+	w.Header().Set("Access-Control-Allow-Origin", "*")
+	w.Header().Set("Access-Control-Allow-Credentials", "true")
+	w.Header().Set("Access-Control-Allow-Methods", "GET,POST,HEAD,OPTIONS")
+	w.Header().Set("Access-Control-Allow-Headers", "X-Requested-With,Content-Type,Accept,Origin")
+}
+
+func setTaskReady(w http.ResponseWriter, r *http.Request) {
+	writeHeader(w)
+	lock.Lock()
+	defer lock.Unlock()
+	vars := mux.Vars(r)
+	jobName := vars["jobName"]
+	jobMember[jobName]++
+	if err := json.NewEncoder(w).Encode(jobMember); err != nil {
+		log.Printf("Add task %s fail.", jobName)
+	}
+}
+
+func checkJobReady(w http.ResponseWriter, r *http.Request) {
+	writeHeader(w)
+	vars := mux.Vars(r)
+	jobName := vars["jobName"]
+	if err := json.NewEncoder(w).Encode(jobMember[jobName]); err != nil {
+		log.Printf("Check job %s Member fail", jobName)

Review comment:
       return an error, see comment above

##########
File path: pkg/gang/gangclient/gangclient.go
##########
@@ -0,0 +1,84 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package main
+
+import (
+	"encoding/json"
+	"fmt"
+	"io/ioutil"
+	"net/http"
+	"os"
+	"strconv"
+	"strings"
+	"time"
+)
+
+func main() {
+	jobName := os.Getenv("jobName")

Review comment:
       instead of calling it `jobName`, let's be consistent to use `jobID`

##########
File path: pkg/gang/gangclient/gangclient.go
##########
@@ -0,0 +1,84 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package main
+
+import (
+	"encoding/json"
+	"fmt"
+	"io/ioutil"
+	"net/http"
+	"os"
+	"strconv"
+	"strings"
+	"time"
+)
+
+func main() {
+	jobName := os.Getenv("jobName")
+	serviceName := os.Getenv("serviceName")
+	memberAmount, err := strconv.Atoi(os.Getenv("memberAmount"))
+	if err != nil {
+		memberAmount = 10

Review comment:
       do not set a default value when the error is not nil, this can cover some issues up.
   directly log this error and fail the execution




----------------------------------------------------------------
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:
users@infra.apache.org