You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by cs...@apache.org on 2017/09/14 12:53:03 UTC

[incubator-openwhisk-deploy-kube] branch master updated: Simplify travis (#54)

This is an automated email from the ASF dual-hosted git repository.

csantanapr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-deploy-kube.git


The following commit(s) were added to refs/heads/master by this push:
     new 041e1a9  Simplify travis (#54)
041e1a9 is described below

commit 041e1a931388e9ae64e6a9b27c8894c664d11382
Author: Dan Lavine <dl...@us.ibm.com>
AuthorDate: Thu Sep 14 12:53:00 2017 +0000

    Simplify travis (#54)
---
 .travis.yml                    |   7 +-
 .travis/build.sh               | 200 -----------------------------------------
 .travis/setup.sh               |  66 --------------
 docs/setting_up_kube/README.md |   4 +-
 tools/travis/build.sh          |   2 +-
 5 files changed, 5 insertions(+), 274 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index e794123..a33e13b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,9 +3,6 @@ sudo: required
 env:
   matrix:
     - env:
-      - TRAVIS_KUBE_VERSION=v1.5.6
-      - TRAVIS_ETCD_VERSION=v3.0.14
-    - env:
       - TRAVIS_KUBE_VERSION=v1.6.2
       - TRAVIS_ETCD_VERSION=v3.0.17
 
@@ -14,8 +11,8 @@ services:
 
 before_install:
   - ./tools/travis/setupscan.sh
-  - .travis/setup.sh
+  - ./tools/travis/setup.sh
 
 script:
   - ./tools/travis/scancode.sh
-  - .travis/build.sh
+  - ./tools/travis/build.sh
diff --git a/.travis/build.sh b/.travis/build.sh
deleted file mode 100755
index 6eca786..0000000
--- a/.travis/build.sh
+++ /dev/null
@@ -1,200 +0,0 @@
-#!/bin/bash
-
-set -x
-
-SCRIPTDIR=$(cd $(dirname "$0") && pwd)
-ROOTDIR="$SCRIPTDIR/../"
-
-cd $ROOTDIR
-
-kubectl apply -f configure/openwhisk_kube_namespace.yml
-
-couchdbHealthCheck () {
-  # wait for the pod to be created before getting the job name
-  sleep 5
-  POD_NAME=$(kubectl -n openwhisk get pods -o wide --show-all | grep "couchdb" | awk '{print $1}')
-
-  PASSED=false
-  TIMEOUT=0
-  until [ $TIMEOUT -eq 25 ]; do
-    if [ -n "$(kubectl -n openwhisk logs $POD_NAME | grep "Apache CouchDB has started on http://0.0.0.0:5984")" ]; then
-      break
-    fi
-
-    let TIMEOUT=TIMEOUT+1
-    sleep 30
-  done
-
-  if [ $TIMEOUT -eq 25 ]; then
-    echo "Failed to finish deploying CouchDB"
-
-    kubectl -n openwhisk logs $POD_NAME
-    exit 1
-  fi
-
-  echo "CouchDB is up and running"
-}
-
-deploymentHealthCheck () {
-  if [ -z "$1" ]; then
-    echo "Error, component health check called without a component parameter"
-    exit 1
-  fi
-
-  PASSED=false
-  TIMEOUT=0
-  until $PASSED || [ $TIMEOUT -eq 25 ]; do
-    KUBE_DEPLOY_STATUS=$(kubectl -n openwhisk get pods -o wide | grep "$1" | awk '{print $3}')
-    if [ "$KUBE_DEPLOY_STATUS" == "Running" ]; then
-      PASSED=true
-      break
-    fi
-
-    kubectl get pods --all-namespaces -o wide --show-all
-
-    let TIMEOUT=TIMEOUT+1
-    sleep 30
-  done
-
-  if [ "$PASSED" = false ]; then
-    echo "Failed to finish deploying $1"
-
-    kubectl -n openwhisk logs $(kubectl -n openwhisk get pods -o wide | grep "$1" | awk '{print $1}')
-    exit 1
-  fi
-
-  echo "$1 is up and running"
-}
-
-statefulsetHealthCheck () {
-  if [ -z "$1" ]; then
-    echo "Error, StatefulSet health check called without a parameter"
-    exit 1
-  fi
-
-  PASSED=false
-  TIMEOUT=0
-  until $PASSED || [ $TIMEOUT -eq 25 ]; do
-    KUBE_DEPLOY_STATUS=$(kubectl -n openwhisk get pods -o wide | grep "$1"-0 | awk '{print $3}')
-    if [ "$KUBE_DEPLOY_STATUS" == "Running" ]; then
-      PASSED=true
-      break
-    fi
-
-    kubectl get pods --all-namespaces -o wide --show-all
-
-    let TIMEOUT=TIMEOUT+1
-    sleep 30
-  done
-
-  if [ "$PASSED" = false ]; then
-    echo "Failed to finish deploying $1"
-
-    kubectl -n openwhisk logs $(kubectl -n openwhisk get pods -o wide | grep "$1"-0 | awk '{print $1}')
-    exit 1
-  fi
-
-  echo "$1-0 is up and running"
-
-}
-
-# setup couchdb
-pushd kubernetes/couchdb
-  kubectl apply -f couchdb.yml
-
-  couchdbHealthCheck
-popd
-
-# setup zookeeper
-pushd kubernetes/zookeeper
-  kubectl apply -f zookeeper.yml
-
-  deploymentHealthCheck "zookeeper"
-popd
-
-# setup kafka
-pushd kubernetes/kafka
-  kubectl apply -f kafka.yml
-
-  deploymentHealthCheck "kafka"
-popd
-
-# setup the controller
-pushd kubernetes/controller
-  kubectl apply -f controller.yml
-
-  statefulsetHealthCheck "controller"
-popd
-
-# setup the invoker
-pushd kubernetes/invoker
-  kubectl apply -f invoker.yml
-
-  # wait until the invoker is ready
-  statefulsetHealthCheck "invoker"
-popd
-
-# setup nginx
-pushd kubernetes/nginx
-  ./certs.sh localhost
-  kubectl -n openwhisk create configmap nginx --from-file=nginx.conf
-  kubectl -n openwhisk create secret tls nginx --cert=certs/cert.pem --key=certs/key.pem
-  kubectl apply -f nginx.yml
-
-  # wait until nginx is ready
-  deploymentHealthCheck "nginx"
-popd
-
-AUTH_WSK_SECRET=789c46b1-71f6-4ed5-8c54-816aa4f8c502:abczO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP
-AUTH_GUEST=23bc46b1-71f6-4ed5-8c54-816aa4f8c502:123zO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP
-WSK_PORT=$(kubectl -n openwhisk describe service nginx | grep https-api | grep NodePort| awk '{print $3}' | cut -d'/' -f1)
-
-# download and setup the wsk cli from nginx
-wget --no-check-certificate https://localhost:$WSK_PORT/cli/go/download/linux/amd64/wsk
-chmod +x wsk
-sudo cp wsk /usr/local/bin/wsk
-
-./wsk property set --auth $AUTH_GUEST --apihost https://localhost:$WSK_PORT
-
-
-# setup the catalog
-pushd /tmp
-  git clone https://github.com/apache/incubator-openwhisk
-  export OPENWHISK_HOME=$PWD/incubator-openwhisk
-
-  git clone https://github.com/apache/incubator-openwhisk-catalog
-
-  pushd incubator-openwhisk-catalog/packages
-    export WHISK_CLI_PATH=/usr/local/bin/wsk
-
-    # This script currently has an issue where the cli path is the 4th argument
-    ./installCatalog.sh $AUTH_WSK_SECRET https://localhost:$WSK_PORT $WHISK_CLI_PATH
-  popd
-popd
-
-# create wsk action
-cat > hello.js << EOL
-function main() {
-  return {payload: 'Hello world'};
-}
-EOL
-
-./wsk -i action create hello hello.js
-
-sleep 5
-
-# run the new hello world action
-RESULT=$(./wsk -i action invoke --blocking hello | grep "\"status\": \"success\"")
-
-if [ -z "$RESULT" ]; then
-  echo "FAILED! Could not invoked custom action"
-
-  echo " ----------------------------- controller logs ---------------------------"
-  kubectl -n openwhisk logs controller-0
-
-  echo " ----------------------------- invoker logs ---------------------------"
-  kubectl -n openwhisk logs invoker-0
-  exit 1
-fi
-
-echo "PASSED! Deployed openwhisk and invoked custom action"
diff --git a/.travis/setup.sh b/.travis/setup.sh
deleted file mode 100755
index 6fdbc42..0000000
--- a/.travis/setup.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-# This script assumes Docker is already installed
-#!/bin/bash
-
-set -x
-
-# set docker0 to promiscuous mode
-sudo ip link set docker0 promisc on
-
-# install etcd
-wget https://github.com/coreos/etcd/releases/download/$TRAVIS_ETCD_VERSION/etcd-$TRAVIS_ETCD_VERSION-linux-amd64.tar.gz
-tar xzf etcd-$TRAVIS_ETCD_VERSION-linux-amd64.tar.gz
-sudo mv etcd-$TRAVIS_ETCD_VERSION-linux-amd64/etcd /usr/local/bin/etcd
-rm etcd-$TRAVIS_ETCD_VERSION-linux-amd64.tar.gz
-rm -rf etcd-$TRAVIS_ETCD_VERSION-linux-amd64
-
-# download kubectl
-wget https://storage.googleapis.com/kubernetes-release/release/$TRAVIS_KUBE_VERSION/bin/linux/amd64/kubectl
-chmod +x kubectl
-sudo mv kubectl /usr/local/bin/kubectl
-
-# download kubernetes
-git clone https://github.com/kubernetes/kubernetes $HOME/kubernetes
-
-# install cfssl
-go get -u github.com/cloudflare/cfssl/cmd/...
-
-pushd $HOME/kubernetes
-  git checkout $TRAVIS_KUBE_VERSION
-  kubectl config set-credentials myself --username=admin --password=admin
-  kubectl config set-context local --cluster=local --user=myself
-  kubectl config set-cluster local --server=http://localhost:8080
-  kubectl config use-context local
-
-  # start kubernetes in the background
-  sudo PATH=$PATH:/home/travis/.gimme/versions/go1.7.linux.amd64/bin/go \
-       KUBE_ENABLE_CLUSTER_DNS=true \
-       hack/local-up-cluster.sh &
-popd
-
-# Wait until kube is up and running
-TIMEOUT=0
-TIMEOUT_COUNT=40
-until $( curl --output /dev/null --silent http://localhost:8080 ) || [ $TIMEOUT -eq $TIMEOUT_COUNT ]; do
-  echo "Kube is not up yet"
-  let TIMEOUT=TIMEOUT+1
-  sleep 20
-done
-
-if [ $TIMEOUT -eq $TIMEOUT_COUNT ]; then
-  echo "Kubernetes is not up and running"
-  exit 1
-fi
-
-echo "Kubernetes is deployed and reachable"
-
-# Try and sleep before issuing chown. Currently, Kubernetes is started by
-# a command that is run in the background. Technically Kubernetes could be
-# up and running, but those files might not exist yet as the previous command
-# could create them after Kube starts successfully.
-sleep 5
-
-sudo chown -R $USER:$USER $HOME/.kube
-
-# Have seen issues where chown does not instantly change file permissions.
-# When this happens the build.sh cript can have failures.
-sleep 30
diff --git a/docs/setting_up_kube/README.md b/docs/setting_up_kube/README.md
index 3df5936..6345264 100644
--- a/docs/setting_up_kube/README.md
+++ b/docs/setting_up_kube/README.md
@@ -55,8 +55,8 @@ Luckily you should be able to run the travis setup script and have everything
 be configured for you.
 
 ```
-cd $THIS_REPO_LOCATION/.travis
-TRAVIS_KUBE_VERSION=v1.5.6 TRAVIS_ETCD_VERSION=v3.0.14 ./setup
+cd $THIS_REPO_LOCATION/tools/travis
+TRAVIS_KUBE_VERSION=v1.6.2 TRAVIS_ETCD_VERSION=v3.0.17 ./setup
 ```
 
 This script should download and install a correct version of `etcd`, `kubectl`, and the
diff --git a/tools/travis/build.sh b/tools/travis/build.sh
index 6eca786..48fe982 100755
--- a/tools/travis/build.sh
+++ b/tools/travis/build.sh
@@ -3,7 +3,7 @@
 set -x
 
 SCRIPTDIR=$(cd $(dirname "$0") && pwd)
-ROOTDIR="$SCRIPTDIR/../"
+ROOTDIR="$SCRIPTDIR/../../"
 
 cd $ROOTDIR
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <co...@openwhisk.apache.org>'].