You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by gi...@git.apache.org on 2017/06/28 22:21:39 UTC

[GitHub] csantanapr commented on a change in pull request #2440: Use docker API via unix-socket in /var/run/docker.sock

csantanapr commented on a change in pull request #2440: Use docker API via unix-socket in /var/run/docker.sock
URL: https://github.com/apache/incubator-openwhisk/pull/2440#discussion_r124671595
 
 

 ##########
 File path: ansible/roles/invoker/tasks/deploy.yml
 ##########
 @@ -23,9 +23,23 @@
   when: docker_registry != ""
   retries: 3
 
-- name: determine docker root dir
+- name: "determine docker root dir on docker-machine"
   uri:  url="http://{{ inventory_hostname }}:{{ docker.port }}/info" return_content=yes
-  register: dockerInfo
+  register: dockerInfo_output
+  when: "'environments/docker-machine' in inventory_dir"
+
+- set_fact:
+    dockerInfo: "{{ dockerInfo_output['json'] }}"
+  when: "'environments/docker-machine' in inventory_dir"
+
+- name: "determine docker root dir"
+  shell: curl --unix-socket /var/run/docker.sock http:/v1.24/info
+  register: dockerInfo_output
+  when: "'environments/docker-machine' not in inventory_dir"
+
+- set_fact:
+    dockerInfo: "{{ dockerInfo_output.stdout|from_json }}"
+  when: "'environments/docker-machine' not in inventory_dir"
 
 Review comment:
   @markusthoemmes 
   I could remove docker-machine environment completely :-)
   I thought this was the plan any way, so this will leave for a short while.
    
   I was looking for a way to make this the default, but notice that this `curl --unix-socket` would run  on docker-machine, so I was looking for a way to skip it.
   
   I don't think I have have a docker_host variable that I can use in place in the commands as the output is different and the command is different using shell: curl vs. uri or get_url.
   I was not able to find a setting to make uri or get_url use a socker fd
   Unless I missed what you said.
   
   What about if I set a variable in group_vars per environment.
   docker_native_api: true | false
   I will set it to true in local, mac
   I will set it to false for docker-machine.
   
   then I can use when:docker_native_api == true or docker_native_api == false
   
   Im also open if you wan to send a commit to my branch to help out.
 
----------------------------------------------------------------
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