openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From csantan...@apache.org
Subject [incubator-openwhisk] branch master updated: Enable extending environment variables of Controller and Invoker (#3689)
Date Fri, 01 Jun 2018 17:44:14 GMT
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.git


The following commit(s) were added to refs/heads/master by this push:
     new 8b6681a  Enable extending environment variables of Controller and Invoker (#3689)
8b6681a is described below

commit 8b6681ae83eecf15d5baf16a2bc45ea3267d54ce
Author: Chetan Mehrotra <chetanm@apache.org>
AuthorDate: Fri Jun 1 23:14:10 2018 +0530

    Enable extending environment variables of Controller and Invoker (#3689)
---
 ansible/group_vars/all                    |  3 +++
 ansible/roles/controller/tasks/deploy.yml |  4 ++++
 ansible/roles/invoker/tasks/deploy.yml    | 12 ++++++++----
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/ansible/group_vars/all b/ansible/group_vars/all
index 25312d2..1acdfbb 100644
--- a/ansible/group_vars/all
+++ b/ansible/group_vars/all
@@ -83,6 +83,8 @@ controller:
     truststore:
       password: "{{ controllerKeystorePassword }}"
       path: "/conf/{{ controllerKeystoreName }}"
+  extraEnv: "{{ controller_extraEnv | default({}) }}"
+
 # move controller protocol outside to not evaluate controller variables during execution
of setup.yml
 controllerProtocolForSetup: "{{ controller_protocol | default('https') }}"
 controllerKeystoreName: "{{ controllerKeyPrefix }}openwhisk-keystore.p12"
@@ -169,6 +171,7 @@ invoker:
     jvmArgs: "{% if inventory_hostname in groups['invokers'] %}
     {{ jmx.jvmCommonArgs }} -Djava.rmi.server.hostname={{ invokerHostname }} -Dcom.sun.management.jmxremote.rmi.port={{
jmx.rmiBasePortInvoker + groups['invokers'].index(inventory_hostname) }} -Dcom.sun.management.jmxremote.port={{
jmx.basePortInvoker + groups['invokers'].index(inventory_hostname) }}
     {% endif %}"
+  extraEnv: "{{ invoker_extraEnv | default({}) }}"
 
 userLogs:
   spi: "{{ userLogs_spi | default('whisk.core.containerpool.logging.DockerToActivationLogStoreProvider')
}}"
diff --git a/ansible/roles/controller/tasks/deploy.yml b/ansible/roles/controller/tasks/deploy.yml
index a86f0ee..29dcc1b 100644
--- a/ansible/roles/controller/tasks/deploy.yml
+++ b/ansible/roles/controller/tasks/deploy.yml
@@ -236,6 +236,10 @@
 
       "CONFIG_whisk_transactions_header": "{{ transactions.header }}"
 
+- name: merge extra env variables
+  set_fact:
+    controller_env: "{{ controller_env | combine(controller.extraEnv) }}"
+
 - name: include plugins
   include_tasks: "{{ item }}.yml"
   with_items: "{{ controller_plugins | default([]) }}"
diff --git a/ansible/roles/invoker/tasks/deploy.yml b/ansible/roles/invoker/tasks/deploy.yml
index 1d50e84..ee4a79a 100644
--- a/ansible/roles/invoker/tasks/deploy.yml
+++ b/ansible/roles/invoker/tasks/deploy.yml
@@ -143,7 +143,7 @@
 
 - name: prepare invoker env
   set_fact:
-    env:
+    invoker_env:
       "JAVA_OPTS": "-Xmx{{ invoker.heap }} -XX:+CrashOnOutOfMemoryError -XX:+UseGCOverheadLimit
-XX:ErrorFile=/logs/java_error.log"
       "INVOKER_OPTS": "{{ invoker_args | default(invoker.arguments) }}"
       "JMX_REMOTE": "{{ jmx.enabled }}"
@@ -210,11 +210,15 @@
       "CONFIG_whisk_activation_payload_max": "{{ limit_activation_payload | default() }}"
       "CONFIG_whisk_transactions_header": "{{ transactions.header }}"
 
-- name: extend invoker env
+- name: extend invoker dns env
   set_fact:
-    env: "{{ env|default({}) | combine( {'CONFIG_whisk_containerFactory_containerArgs_dnsServers_'
~ item.0: item.1} ) }}"
+    invoker_env: "{{ invoker_env | default({}) | combine( {'CONFIG_whisk_containerFactory_containerArgs_dnsServers_'
~ item.0: item.1} ) }}"
   with_indexed_items: "{{ (invoker_container_network_dns_servers | default()).split(' ')}}"
 
+- name: merge extra env variables
+  set_fact:
+    invoker_env: "{{ invoker_env | combine(invoker.extraEnv) }}"
+
 - name: set invoker volumes
   set_fact:
     volumes: "/sys/fs/cgroup:/sys/fs/cgroup,/run/runc:/run/runc,\
@@ -239,7 +243,7 @@
     image: "{{ docker_registry }}{{ docker.image.prefix }}/invoker:{{ docker.image.tag }}"
     state: started
     recreate: true
-    env: "{{ env }}"
+    env: "{{ invoker_env }}"
     volumes: "{{ volumes }}"
     ports: "{{ ports_to_expose }}"
     command: /bin/sh -c "exec /init.sh {{ groups['invokers'].index(inventory_hostname) }}
>> /logs/invoker{{ groups['invokers'].index(inventory_hostname) }}_logs.log 2>&1"

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

Mime
View raw message