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 2018/04/19 13:21:50 UTC

[incubator-openwhisk-deploy-kube] branch master updated: helm: get runtimes from runtimes.json (#184)

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 76ed813  helm: get runtimes from runtimes.json (#184)
76ed813 is described below

commit 76ed81361281ce6bf5dbaf72079f6f951667f865
Author: David Grove <dg...@users.noreply.github.com>
AuthorDate: Thu Apr 19 09:21:48 2018 -0400

    helm: get runtimes from runtimes.json (#184)
---
 helm/runtimes-minimal-travis.json         |  28 +++++++++
 helm/runtimes.json                        | 101 ++++++++++++++++++++++++++++++
 helm/templates/_helpers.tpl               |   9 +++
 helm/templates/controller_statefulset.yml |   4 +-
 helm/templates/invoker_deployment.yml     |  17 ++++-
 5 files changed, 154 insertions(+), 5 deletions(-)

diff --git a/helm/runtimes-minimal-travis.json b/helm/runtimes-minimal-travis.json
new file mode 100644
index 0000000..98ec32b
--- /dev/null
+++ b/helm/runtimes-minimal-travis.json
@@ -0,0 +1,28 @@
+{
+    "runtimes": {
+        "nodejs": [
+            {
+                "kind": "nodejs:6",
+                "default": true,
+                "image": {
+                    "name": "nodejs6action"
+                },
+                "deprecated": false
+            }
+        ],
+        "python": [
+            {
+                "kind": "python:3",
+                "image": {
+                    "name": "python3action"
+                },
+                "deprecated": false
+            }
+        ]
+    },
+    "blackboxes": [
+        {
+            "name": "dockerskeleton"
+        }
+    ]
+}
diff --git a/helm/runtimes.json b/helm/runtimes.json
new file mode 100644
index 0000000..5a81001
--- /dev/null
+++ b/helm/runtimes.json
@@ -0,0 +1,101 @@
+{
+    "runtimes": {
+        "nodejs": [
+            {
+                "kind": "nodejs",
+                "image": {
+                    "name": "nodejsaction"
+                },
+                "deprecated": true
+            },
+            {
+                "kind": "nodejs:6",
+                "default": true,
+                "image": {
+                    "name": "nodejs6action"
+                },
+                "deprecated": false
+            },
+            {
+                "kind": "nodejs:8",
+                "default": false,
+                "image": {
+                    "name": "action-nodejs-v8"
+                },
+                "deprecated": false
+            }
+        ],
+        "python": [
+            {
+                "kind": "python",
+                "image": {
+                    "name": "python2action"
+                },
+                "deprecated": false
+            },
+            {
+                "kind": "python:2",
+                "default": true,
+                "image": {
+                    "name": "python2action"
+                },
+                "deprecated": false
+            },
+            {
+                "kind": "python:3",
+                "image": {
+                    "name": "python3action"
+                },
+                "deprecated": false
+            }
+        ],
+        "swift": [
+            {
+                "kind": "swift:3.1.1",
+                "image": {
+                    "name": "action-swift-v3.1.1"
+                },
+                "deprecated": false
+            },
+            {
+                "kind": "swift:4.1",
+                "default": true,
+                "image": {
+                    "name": "action-swift-v4.1"
+                },
+                "deprecated": false
+            }
+        ],
+        "java": [
+            {
+                "kind": "java",
+                "default": true,
+                "image": {
+                    "name": "java8action"
+                },
+                "deprecated": false,
+                "attached": {
+                    "attachmentName": "jarfile",
+                    "attachmentType": "application/java-archive"
+                },
+                "sentinelledLogs": false,
+                "requireMain": true
+            }
+        ],
+        "php": [
+            {
+                "kind": "php:7.1",
+                "default": true,
+                "deprecated": false,
+                "image": {
+                    "name": "action-php-v7.1"
+                }
+            }
+        ]
+    },
+    "blackboxes": [
+        {
+            "name": "dockerskeleton"
+        }
+    ]
+}
diff --git a/helm/templates/_helpers.tpl b/helm/templates/_helpers.tpl
index cfd4446..0a74efa 100644
--- a/helm/templates/_helpers.tpl
+++ b/helm/templates/_helpers.tpl
@@ -82,4 +82,13 @@
 {{/* Generate redis service url */}}
 {{- define "redis_url" -}}
 {{ .Values.global.redisServiceName | default "redis" }}.{{ .Release.Namespace }}
+{{- end -}}
+
+{{/* Runtimes manifest */}}
+{{- define "runtimes_manifest" -}}
+{{- if .Values.global.travis -}}
+{{ .Files.Get "runtimes-minimal-travis.json" | quote }}
+{{- else -}}
+{{ .Files.Get "runtimes.json" | quote }}
+{{- end -}}
 {{- end -}}
\ No newline at end of file
diff --git a/helm/templates/controller_statefulset.yml b/helm/templates/controller_statefulset.yml
index ed47c8e..c0d7898 100644
--- a/helm/templates/controller_statefulset.yml
+++ b/helm/templates/controller_statefulset.yml
@@ -83,9 +83,9 @@ spec:
         - name: "LOADBALANCER_INVOKERBUSYTHRESHOLD"
           value: "16"
 
-        # This needs to stay up to date with the lates runtime in Ansible Groupvars
+        # action runtimes
         - name: "RUNTIMES_MANIFEST"
-          value: '{ "defaultImagePrefix": "openwhisk", "defaultImageTag": "latest", "runtimes": { "nodejs": [ { "kind": "nodejs", "image": { "name": "nodejsaction" }, "deprecated": true }, { "kind": "nodejs:6", "default": true, "image": { "name": "nodejs6action" }, "deprecated": false } ], "python": [ { "kind": "python", "image": { "name": "python2action" }, "deprecated": false }, { "kind": "python:2", "default": true, "image": { "name": "python2action" }, "deprecated": false }, { "kind" [...]
+          value: {{ template "runtimes_manifest" . }}
 
         # this version is the day it is deployed and should be configured every time
         - name:  "WHISK_VERSION_DATE"
diff --git a/helm/templates/invoker_deployment.yml b/helm/templates/invoker_deployment.yml
index 9816bc7..8d62f5f 100644
--- a/helm/templates/invoker_deployment.yml
+++ b/helm/templates/invoker_deployment.yml
@@ -53,7 +53,18 @@ spec:
               topologyKey: "kubernetes.io/hostname"
       {{- end }}
      
-      initContainers: 
+      initContainers:
+      - name: docker-pull-runtimes
+        imagePullPolicy: "IfNotPresent"
+        image: openwhisk/kube-docker-pull
+        volumeMounts:
+        - name: dockersock
+          mountPath: "/var/run/docker.sock"
+        env:
+          # action runtimes
+          - name: "RUNTIMES_MANIFEST"
+            value: {{ template "runtimes_manifest" . }}
+
       - name: "wait-for-kafka"
         image: "busybox"
         imagePullPolicy: "IfNotPresent"
@@ -99,9 +110,9 @@ spec:
           - name: "INVOKER_OPTS"
             value: {{ .Values.invokerOptions | quote }}
 
-          # This property can change since it is generated via Ansible GroupVars
+          # action runtimes
           - name: "RUNTIMES_MANIFEST"
-            value: '{ "defaultImagePrefix": "openwhisk", "defaultImageTag": "latest", "runtimes": { "nodejs": [ { "kind": "nodejs", "image": { "name": "nodejsaction" }, "deprecated": true }, { "kind": "nodejs:6", "default": true, "image": { "name": "nodejs6action" }, "deprecated": false } ], "python": [ { "kind": "python", "image": { "name": "python2action" }, "deprecated": false }, { "kind": "python:2", "default": true, "image": { "name": "python2action" }, "deprecated": false }, { "kin [...]
+            value: {{ template "runtimes_manifest" . }}
 
           # Default to empty logs dir. This is because logs should go to stdout
           - name: "WHISK_LOGS_DIR"

-- 
To stop receiving notification emails like this one, please contact
csantanapr@apache.org.