From b89c835e3235f2628b37de15713c311d1b5a4bad Mon Sep 17 00:00:00 2001 From: Devan Goodwin Date: Thu, 11 Aug 2016 11:30:19 -0300 Subject: Improvements for Docker 1.10+ upgrade image nuking. In a parallel step prior to real upgrade tasks, clear out all unused Docker images on all hosts. This should be relatively safe to interrupt as no real upgrade steps have taken place. Once into actual upgrade, we again clear all images only this time with force, and after stopping and removing all containers. Both rmi commands use a new and hopefully less error prone command to do the removal, this should avoid missed orphans as we were hitting before. Added some logging around the current image count before and after this step, most of them are only printed if we're crossing the 1.10 boundary but one does not, just for additional information in your ansible log. --- playbooks/common/openshift-cluster/upgrades/pre.yml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'playbooks/common/openshift-cluster/upgrades/pre.yml') diff --git a/playbooks/common/openshift-cluster/upgrades/pre.yml b/playbooks/common/openshift-cluster/upgrades/pre.yml index b5fbc4af6..42a24eaf8 100644 --- a/playbooks/common/openshift-cluster/upgrades/pre.yml +++ b/playbooks/common/openshift-cluster/upgrades/pre.yml @@ -185,10 +185,12 @@ - name: Verify docker upgrade targets hosts: oo_masters_to_config:oo_nodes_to_config:oo_etcd_to_config tasks: - - name: Determine available Docker - script: ../files/rpm_versions.sh docker - register: g_docker_version_result - when: not openshift.common.is_atomic | bool + # Only check if docker upgrade is required if docker_upgrade is not + # already set to False. + - include: docker/upgrade_check.yml + when: docker_upgrade is not defined or docker_upgrade | bool and not openshift.common.is_atomic | bool + + # Additional checks for Atomic hosts: - name: Determine available Docker shell: "rpm -q --queryformat '---\ncurr_version: %{VERSION}\navail_version: \n' docker" @@ -196,18 +198,12 @@ when: openshift.common.is_atomic | bool - set_fact: - g_docker_version: "{{ g_docker_version_result.stdout | from_yaml }}" - when: not openshift.common.is_atomic | bool - - - set_fact: - g_docker_version: "{{ g_atomic_docker_version_result.stdout | from_yaml }}" + l_docker_version: "{{ g_atomic_docker_version_result.stdout | from_yaml }}" when: openshift.common.is_atomic | bool - fail: msg: This playbook requires access to Docker 1.10 or later - when: g_docker_version.avail_version | default(g_docker_version.curr_version, true) | version_compare('1.10','<') - - # TODO: add check to upgrade ostree to get latest Docker + when: openshift.common.is_atomic | bool and l_docker_version.avail_version | default(l_docker_version.curr_version, true) | version_compare('1.10','<') - set_fact: pre_upgrade_complete: True -- cgit v1.2.3