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/02/21 03:04:22 UTC

[GitHub] csantanapr closed pull request #2799: ansible fix for #2788 for docker for mac

csantanapr closed pull request #2799: ansible fix for #2788 for docker for mac 
URL: https://github.com/apache/incubator-openwhisk/pull/2799
 
 
   

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/roles/invoker/tasks/deploy.yml b/ansible/roles/invoker/tasks/deploy.yml
index be2a251346..076b2549fc 100644
--- a/ansible/roles/invoker/tasks/deploy.yml
+++ b/ansible/roles/invoker/tasks/deploy.yml
@@ -71,7 +71,7 @@
 - name: define options when deploying invoker on Ubuntu
   set_fact:
     linuxOptions: "-v /usr/lib/x86_64-linux-gnu/libapparmor.so.1:/usr/lib/x86_64-linux-gnu/libapparmor.so.1"
-  when: ansible_distribution == "Ubuntu"
+  when: (ansible_distribution == "Ubuntu") and (whisk_version_name != "local")
 
 - name: get running invoker information
   uri: url="http://{{ ansible_host }}:{{ docker.port }}/containers/json?filters={{ '{"name":[ "invoker" ],"ancestor":[ "invoker" ]}' | urlencode }}" return_content=yes
@@ -129,6 +129,23 @@
   set_fact:
     invoker_args: "{{ invoker.arguments }} {{ invoker.jmxremote.jvmArgs }}"
 
+- name: "determine 'runc' binary location"
+  shell: which runc || which docker-runc
+  register: runcBinaryNative
+  when: ansible_distribution != 'MacOSX'
+
+# in local environments where docker host is a VM, we need to get the path from the VM, not the local machine
+# and hence we use docker run to find out the paths on the VM
+- name: "determine 'runc' binary location (on docker host)"
+  shell: docker run --privileged --pid=host --userns=host debian nsenter -t 1 -m -u -n -i sh -c "which runc || which docker-runc"
+  register: runcBinaryOnVM
+  when: ansible_distribution == 'MacOSX'
+
+# this step is needed b/c Ansible messes the variable when a task is skipped https://github.com/ansible/ansible/issues/4297
+- name: "determine the final runc binary location"
+  set_fact:
+    runcBinary: "{{ runcBinaryNative if ansible_distribution != 'MacOSX' else runcBinaryOnVM }}"
+
 - name: start invoker using docker cli
   shell: >
         docker run -d
@@ -193,6 +210,7 @@
         -e CONFIG_whisk_memory_std='{{ limit_action_memory_std | default() }}'
         -e CONFIG_whisk_activation_payload_max='{{ limit_activation_payload | default() }}'
         -v /sys/fs/cgroup:/sys/fs/cgroup
+        -v {{ runcBinary.stdout }}:/usr/bin/docker-runc
         -v /run/runc:/run/runc
         -v {{ whisk_logs_dir }}/invoker{{ groups['invokers'].index(inventory_hostname) }}:/logs
         -v {{ invoker.confdir }}/invoker{{ groups['invokers'].index(inventory_hostname) }}:/conf


 

----------------------------------------------------------------
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