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 2021/02/22 08:42:17 UTC

[GitHub] [incubator-yunikorn-k8shim] wilfred-s commented on a change in pull request #233: [YUNIKORN-511] Support to run e2e tests on local macbook

wilfred-s commented on a change in pull request #233:
URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/233#discussion_r580057000



##########
File path: scripts/run-e2e-tests.sh
##########
@@ -75,18 +75,35 @@ function install_cluster() {
 
   # install kubectl
   echo "step 3/6: installing kubectl"
-  stable_release=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)
-  exit_on_error "unable to retrieve latest stable version of kubectl"
-  curl -LO https://storage.googleapis.com/kubernetes-release/release/${stable_release}/bin/linux/amd64/kubectl \
-    && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
-  exit_on_error "install kubectl failed"
+
+  if [[ "$OSTYPE" == "linux-gnu"* ]]; then
+    echo "Installing Kubectl for Linux.."
+          stable_release=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)
+          exit_on_error "unable to retrieve latest stable version of kubectl"
+          curl -LO https://storage.googleapis.com/kubernetes-release/release/${stable_release}/bin/linux/amd64/kubectl \
+          && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
+          exit_on_error "install kubectl failed"
+  elif [[ "$OSTYPE" == "darwin"* ]]; then
+    echo "Installing Kubectl for Mac.."
+              curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/amd64/kubectl" \
+              && chmod +x kubectl && sudo mv kubectl /usr/local/bin

Review comment:
       We need to pull the version from the same location. We should not mix `dl.k8s.io` and `googleapis.com`
   The full procedure is the same for both installs except for a small part of the URL. Instead of having two copied procedures we should have one and just replace `darwin` and `linux` when building the URL.

##########
File path: scripts/run-e2e-tests.sh
##########
@@ -65,7 +65,7 @@ function install_cluster() {
   # build docker images from latest code, so that we can install yunikorn with these latest images
   echo "step 1/6: building docker images from latest code"
   make image REGISTRY=local VERSION=latest
-  exit_on_error "build docker images failed"
+  exit_on_error "buildslac docker images failed"

Review comment:
       I do not understand this comment. What does `buildslac` mean?

##########
File path: scripts/run-e2e-tests.sh
##########
@@ -75,18 +75,35 @@ function install_cluster() {
 
   # install kubectl
   echo "step 3/6: installing kubectl"
-  stable_release=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)
-  exit_on_error "unable to retrieve latest stable version of kubectl"
-  curl -LO https://storage.googleapis.com/kubernetes-release/release/${stable_release}/bin/linux/amd64/kubectl \
-    && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
-  exit_on_error "install kubectl failed"
+
+  if [[ "$OSTYPE" == "linux-gnu"* ]]; then
+    echo "Installing Kubectl for Linux.."
+          stable_release=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)
+          exit_on_error "unable to retrieve latest stable version of kubectl"
+          curl -LO https://storage.googleapis.com/kubernetes-release/release/${stable_release}/bin/linux/amd64/kubectl \
+          && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
+          exit_on_error "install kubectl failed"
+  elif [[ "$OSTYPE" == "darwin"* ]]; then
+    echo "Installing Kubectl for Mac.."
+              curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/amd64/kubectl" \
+              && chmod +x kubectl && sudo mv kubectl /usr/local/bin
+  fi
+
 
   # install KIND
   echo "step 4/6: installing kind"
-  curl -Lo ./kind "https://kind.sigs.k8s.io/dl/v0.8.0/kind-linux-amd64" \
-    && chmod +x ./kind && mv ./kind $(go env GOPATH)/bin
-  exit_on_error "install KIND failed"
-  check_cmd "kind"
+
+  if [[ "$OSTYPE" == "linux-gnu"* ]]; then
+    echo "Installing KIND for Linux.."
+         curl -Lo ./kind "https://kind.sigs.k8s.io/dl/v0.8.0/kind-linux-amd64" \
+            && chmod +x ./kind && mv ./kind $(go env GOPATH)/bin
+         exit_on_error "install KIND failed"
+         check_cmd "kind"
+  elif [[ "$OSTYPE" == "darwin"* ]]; then
+    echo "Installing KIND for Mac.."
+       curl -Lo ./kind "https://kind.sigs.k8s.io/dl/v0.10.0/kind-darwin-amd64" \

Review comment:
       We need to use the same version of kind on all platforms.
   Same comments as above for the URL.




----------------------------------------------------------------
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