You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by da...@apache.org on 2018/09/20 01:17:58 UTC

[incubator-openwhisk-deploy-kube] branch master updated: travisCI improvements (#301)

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

daisyguo 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 5f14b2c  travisCI improvements (#301)
5f14b2c is described below

commit 5f14b2c51537277f071b3fd78d8e2f9a413dccf0
Author: David Grove <dg...@users.noreply.github.com>
AuthorDate: Wed Sep 19 21:17:53 2018 -0400

    travisCI improvements (#301)
    
    1. On minikube the default storageClass is called `standard`,
    so we need to provide this value for those charts that require
    PVs to deploy successfully.
    
    2. Add a readiness check for a healthy invoker and gate the
    catalog/routemgmt install jobs on that test.  This should cause
    them to wait long enough to avoid whatever race condition is causing
    them to often error out with 500 error code from couchdb.
---
 helm/openwhisk/templates/_readiness.tpl           | 11 +++++++++++
 helm/openwhisk/templates/installCatalogJob.yaml   |  2 +-
 helm/openwhisk/templates/installRouteMgmtJob.yaml |  2 +-
 tools/travis/build-helm.sh                        |  4 ++--
 4 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/helm/openwhisk/templates/_readiness.tpl b/helm/openwhisk/templates/_readiness.tpl
index f95752b..ac1c27b 100644
--- a/helm/openwhisk/templates/_readiness.tpl
+++ b/helm/openwhisk/templates/_readiness.tpl
@@ -43,3 +43,14 @@
     value: http://{{ include "controller_host" . }}:{{ .Values.controller.port }}/ping
   command: ["sh", "-c", "result=1; until [ $result -eq 0 ]; do echo 'Checking controller readiness'; wget -T 5 --spider $READINESS_URL; result=$?; sleep 1; done; echo 'Success: controller is ready'"]
 {{- end -}}
+
+{{/* Init container that waits for at least 1 healthy invoker */}}
+{{- define "readiness.waitForHealthyInvoker" -}}
+- name: "wait-for-healthy-invoker"
+  image: "busybox"
+  imagePullPolicy: "IfNotPresent"
+  env:
+  - name: "READINESS_URL"
+    value: "http://{{ include "controller_host" . }}:{{ .Values.controller.port }}/invokers/healthy/count"
+  command: ["sh", "-c", "echo 0 > /tmp/count.txt; while true; do echo 'waiting for healthy invoker'; wget -T 5 -qO /tmp/count.txt --no-check-certificate \"$READINESS_URL\"; NUM_HEALTHY_INVOKERS=$(cat /tmp/count.txt); if [ $NUM_HEALTHY_INVOKERS -gt 0 ]; then echo \"Success: there are $NUM_HEALTHY_INVOKERS healthy invokers\"; break; fi; echo '...not ready yet; sleeping 3 seconds before retry'; sleep 3; done;"]
+{{- end -}}
diff --git a/helm/openwhisk/templates/installCatalogJob.yaml b/helm/openwhisk/templates/installCatalogJob.yaml
index 6db70db..f893ce3 100644
--- a/helm/openwhisk/templates/installCatalogJob.yaml
+++ b/helm/openwhisk/templates/installCatalogJob.yaml
@@ -19,7 +19,7 @@ spec:
           name: install-catalog
       initContainers:
       # Wait for a controller to be up so we can perfom our CRUD actions with the CLI
-{{ include "readiness.waitForController" . | indent 6 }}
+{{ include "readiness.waitForHealthyInvoker" . | indent 6 }}
       containers:
       - name: catalog
         image: {{ .Values.utility.scriptRunnerImage | quote }}
diff --git a/helm/openwhisk/templates/installRouteMgmtJob.yaml b/helm/openwhisk/templates/installRouteMgmtJob.yaml
index 3bb36e8..3126b6b 100644
--- a/helm/openwhisk/templates/installRouteMgmtJob.yaml
+++ b/helm/openwhisk/templates/installRouteMgmtJob.yaml
@@ -19,7 +19,7 @@ spec:
           name: install-routemgmt
       initContainers:
       # Wait for a controller to be up so we can perfom our CRUD actions with the CLI
-{{ include "readiness.waitForController" . | indent 6 }}
+{{ include "readiness.waitForHealthyInvoker" . | indent 6 }}
       containers:
       - name: routemgmt
         image: {{ .Values.utility.scriptRunnerImage | quote }}
diff --git a/tools/travis/build-helm.sh b/tools/travis/build-helm.sh
index e4092f5..79cb2af 100755
--- a/tools/travis/build-helm.sh
+++ b/tools/travis/build-helm.sh
@@ -282,7 +282,7 @@ echo "PASSED! Deployed Kafka provider and package"
 ####
 # now test the installation of Alarm provider
 ####
-helm install helm/openwhisk-providers/charts/ow-alarm --namespace=openwhisk --name alarmp4travis
+helm install helm/openwhisk-providers/charts/ow-alarm --namespace=openwhisk --name alarmp4travis --set alarmprovider.persistence.storageClass=standard
 
 jobHealthCheck "install-package-alarm"
 
@@ -300,7 +300,7 @@ echo "PASSED! Deployed Alarms provider and package"
 ####
 # now test the installation of Cloudant provider
 ####
-helm install helm/openwhisk-providers/charts/ow-cloudant --namespace=openwhisk --name cloudantp4travis
+helm install helm/openwhisk-providers/charts/ow-cloudant --namespace=openwhisk --name cloudantp4travis --set cloudantprovider.persistence.storageClass=standard
 
 jobHealthCheck "install-package-cloudant"