You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/06/01 17:44:12 UTC

[GitHub] csantanapr closed pull request #3689: Enable extending environment variables of Controller and Invoker

csantanapr closed pull request #3689: Enable extending environment variables of Controller and Invoker
URL: https://github.com/apache/incubator-openwhisk/pull/3689
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/ansible/group_vars/all b/ansible/group_vars/all
index 25312d26ee..1acdfbbc12 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 a86f0ee1e2..29dcc1b96a 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 1d50e84bc2..ee4a79aaf3 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"


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services