Skip to content
Snippets Groups Projects
Commit 1a538cce authored by Zuul's avatar Zuul Committed by Gerrit Code Review
Browse files

Merge "Add ability to retry image pulling"

parents 8f6ab211 cbb567cb
No related branches found
No related tags found
No related merge requests found
---
# Kolla image pulling settings: the amount of retries and the delay (in seconds)
# between them. These are useful if your registry is not 100% reliable (usually
# due to load). They modify the Ansible image pulling task params ``retries``
# and ``delay``, respectively.
service_images_pull_retries: 3
service_images_pull_delay: 5
...@@ -7,6 +7,10 @@ ...@@ -7,6 +7,10 @@
action: "pull_image" action: "pull_image"
common_options: "{{ docker_common_options }}" common_options: "{{ docker_common_options }}"
image: "{{ service.image }}" image: "{{ service.image }}"
retries: "{{ service_images_pull_retries }}"
delay: "{{ service_images_pull_delay }}"
register: result
until: result is success
with_dict: "{{ lookup('vars', (kolla_role_name | default(project_name)) + '_services') | select_services_enabled_and_mapped_to_host }}" with_dict: "{{ lookup('vars', (kolla_role_name | default(project_name)) + '_services') | select_services_enabled_and_mapped_to_host }}"
loop_control: loop_control:
label: "{{ item.key }}" label: "{{ item.key }}"
...@@ -93,3 +93,9 @@ swift_ks_users: ...@@ -93,3 +93,9 @@ swift_ks_users:
user: "{{ swift_keystone_user }}" user: "{{ swift_keystone_user }}"
password: "{{ swift_keystone_password }}" password: "{{ swift_keystone_password }}"
role: "admin" role: "admin"
# FIXME(yoctozepto): These are copied from service-images-pull role.
# Remove when the Swift role is finally migrated to new style.
service_images_pull_retries: 3
service_images_pull_delay: 5
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
action: "pull_image" action: "pull_image"
common_options: "{{ docker_common_options }}" common_options: "{{ docker_common_options }}"
image: "{{ swift_rsyncd_image_full }}" image: "{{ swift_rsyncd_image_full }}"
retries: "{{ service_images_pull_retries }}"
delay: "{{ service_images_pull_delay }}"
register: result
until: result is success
when: inventory_hostname in groups['swift-account-server'] or when: inventory_hostname in groups['swift-account-server'] or
inventory_hostname in groups['swift-container-server'] or inventory_hostname in groups['swift-container-server'] or
inventory_hostname in groups['swift-object-server'] inventory_hostname in groups['swift-object-server']
...@@ -15,6 +19,10 @@ ...@@ -15,6 +19,10 @@
action: "pull_image" action: "pull_image"
common_options: "{{ docker_common_options }}" common_options: "{{ docker_common_options }}"
image: "{{ swift_proxy_server_image_full }}" image: "{{ swift_proxy_server_image_full }}"
retries: "{{ service_images_pull_retries }}"
delay: "{{ service_images_pull_delay }}"
register: result
until: result is success
when: inventory_hostname in groups['swift-proxy-server'] when: inventory_hostname in groups['swift-proxy-server']
- name: Pulling swift-account image - name: Pulling swift-account image
...@@ -23,6 +31,10 @@ ...@@ -23,6 +31,10 @@
action: "pull_image" action: "pull_image"
common_options: "{{ docker_common_options }}" common_options: "{{ docker_common_options }}"
image: "{{ swift_account_image_full }}" image: "{{ swift_account_image_full }}"
retries: "{{ service_images_pull_retries }}"
delay: "{{ service_images_pull_delay }}"
register: result
until: result is success
when: inventory_hostname in groups['swift-account-server'] when: inventory_hostname in groups['swift-account-server']
- name: Pulling swift-container image - name: Pulling swift-container image
...@@ -31,6 +43,10 @@ ...@@ -31,6 +43,10 @@
action: "pull_image" action: "pull_image"
common_options: "{{ docker_common_options }}" common_options: "{{ docker_common_options }}"
image: "{{ swift_container_image_full }}" image: "{{ swift_container_image_full }}"
retries: "{{ service_images_pull_retries }}"
delay: "{{ service_images_pull_delay }}"
register: result
until: result is success
when: inventory_hostname in groups['swift-container-server'] when: inventory_hostname in groups['swift-container-server']
- name: Pulling swift-object image - name: Pulling swift-object image
...@@ -39,6 +55,10 @@ ...@@ -39,6 +55,10 @@
action: "pull_image" action: "pull_image"
common_options: "{{ docker_common_options }}" common_options: "{{ docker_common_options }}"
image: "{{ swift_object_image_full }}" image: "{{ swift_object_image_full }}"
retries: "{{ service_images_pull_retries }}"
delay: "{{ service_images_pull_delay }}"
register: result
until: result is success
when: inventory_hostname in groups['swift-object-server'] when: inventory_hostname in groups['swift-object-server']
- name: Pulling swift-object-expirer image - name: Pulling swift-object-expirer image
...@@ -47,4 +67,8 @@ ...@@ -47,4 +67,8 @@
action: "pull_image" action: "pull_image"
common_options: "{{ docker_common_options }}" common_options: "{{ docker_common_options }}"
image: "{{ swift_object_expirer_image_full }}" image: "{{ swift_object_expirer_image_full }}"
retries: "{{ service_images_pull_retries }}"
delay: "{{ service_images_pull_delay }}"
register: result
until: result is success
when: inventory_hostname in groups['swift-object-server'] when: inventory_hostname in groups['swift-object-server']
---
features:
- |
Adds two new variables ``service_images_pull_retries`` and
``service_images_pull_delay`` which control the behaviour of image
pulling tasks. These are useful if your registry is not 100%
reliable (usually due to load). The defaults have been set to
3 retries and 5 seconds delay to ensure a better default experience
(these are actually Ansible defaults when task retries are enabled).
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment