csantanapr commented on a change in pull request #2383: docker pull invoker 
images runtimes from manifest
URL: 
https://github.com/apache/incubator-openwhisk/pull/2383#discussion_r123137595
 
 

 ##########
 File path: ansible/roles/invoker/tasks/deploy.yml
 ##########
 @@ -3,16 +3,40 @@
 
 - include: docker_login.yml
 
-- name: "pull action images with tag {{docker_image_tag}}"
+- name: "pull invoker images with tag {{docker_image_tag}}"
   shell: "docker pull {{docker_registry}}{{item}}:{{docker_image_tag}}"
   with_items:
     - '{{ docker_image_prefix }}/invoker'
-    - '{{ docker_image_prefix }}/dockerskeleton'
-    - '{{ docker_image_prefix }}/nodejs6action'
-    - '{{ docker_image_prefix }}/python2action'
-    - '{{ docker_image_prefix }}/python3action'
-    - '{{ docker_image_prefix }}/swift3action'
-    - '{{ docker_image_prefix }}/java8action'
+  when: docker_registry != ""
+
+- name: "pull nodejs action images with tag {{docker_image_tag}}"
+  shell: "docker pull 
{{docker_registry}}{{docker_image_prefix}}/{{item.image.name}}:{{docker_image_tag}}"
+  with_items:
+    - "{{ runtimesManifest.runtimes.nodejs }}"
+  when: (docker_registry != "") and ("deprecated" not in item)
+
+- name: "pull python action images with tag {{docker_image_tag}}"
+  shell: "docker pull 
{{docker_registry}}{{docker_image_prefix}}/{{item.image.name}}:{{docker_image_tag}}"
+  with_items:
+    - "{{ runtimesManifest.runtimes.python }}"
+  when: (docker_registry != "") and ("deprecated" not in item)
+
+- name: "pull swift action images with tag {{docker_image_tag}}"
+  shell: "docker pull 
{{docker_registry}}{{docker_image_prefix}}/{{item.image.name}}:{{docker_image_tag}}"
+  with_items:
+    - "{{ runtimesManifest.runtimes.swift }}"
+  when: (docker_registry != "") and ("deprecated" not in item)
+
+- name: "pull java action images with tag {{docker_image_tag}}"
+  shell: "docker pull 
{{docker_registry}}{{docker_image_prefix}}/{{item.image.name}}:{{docker_image_tag}}"
+  with_items:
+    - "{{ runtimesManifest.runtimes.java }}"
+  when: (docker_registry != "") and ("deprecated" not in item)
 
 Review comment:
   @markusthoemmes 
   I was able to dedupe using `unique`
   ```
   with_items: "{{ runtimesManifest.runtimes.values() | sum(start=[]) | 
map(attribute='image.name') | list | unique }}"
   ```
   But I still have a problem with deprecated, I need to reject only if 
deprecated is present and true.
   I try the filters `reject` and `rejectattr` and was note able to get it to 
work like
   ```
   with_items: "{{ runtimesManifest.runtimes.values() | sum(start=[]) | 
rejectattr('deprecated')  | map(attribute='image.name') | list | unique }}"
   ```
   But I have problems 
   ```
   "'dict object' has no attribute 'deprecated'"}
   ```
 
----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to