From 4a4240a7260d15837549acf992400e567edef25a Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Wed, 15 Feb 2023 10:50:49 +0100 Subject: [PATCH] Pin zun jobs to Docker 20 Add support for pinning docker package in baremetal role has been incorporated in this change since ansible-collection-kolla first branch is stable/yoga Related-Bug: #2007142 Change-Id: I9ce2a9ce5413e77625201f3986967e31a679ad9c (cherry picked from commit 94a74f58c7891e41ca637c4e2a6450ca88cbfb56) (cherry picked from commit 6fab166fde5ab07daa7e00f520c9a90020970b90) --- ansible/roles/baremetal/defaults/main.yml | 4 +++- ansible/roles/baremetal/tasks/install.yml | 19 +++++++++++++++++++ doc/source/reference/compute/zun-guide.rst | 10 ++++++++++ tests/templates/globals-default.j2 | 3 +++ zuul.d/base.yaml | 1 + 5 files changed, 36 insertions(+), 1 deletion(-) diff --git a/ansible/roles/baremetal/defaults/main.yml b/ansible/roles/baremetal/defaults/main.yml index f8db2920a4..fd617758cd 100644 --- a/ansible/roles/baremetal/defaults/main.yml +++ b/ansible/roles/baremetal/defaults/main.yml @@ -8,13 +8,15 @@ docker_apt_repo: "deb {{ docker_apt_url }} {{ ansible_facts.distribution_release docker_apt_key_file: "gpg" docker_apt_key_id: "0EBFCD88" docker_apt_package: "docker-ce" +docker_apt_package_pin: "" # Docker Yum repository configuration. docker_yum_url: "https://download.docker.com/linux/centos" docker_yum_baseurl: "{{ docker_yum_url }}/$releasever/$basearch/stable" docker_yum_gpgkey: "{{ docker_yum_url }}/gpg" docker_yum_gpgcheck: true -docker_yum_package: "docker-ce" +docker_yum_package: "{% if ansible_facts.distribution == 'openEuler' %}docker{{ '-' + docker_yum_package_pin if (docker_yum_package_pin | length > 0) else '' }}{% else %}docker-ce{{ '-' + docker_yum_package_pin if (docker_yum_package_pin | length > 0) else '' }}{% endif %}" +docker_yum_package_pin: "" ceph_version: "pacific" epel_version: "8" diff --git a/ansible/roles/baremetal/tasks/install.yml b/ansible/roles/baremetal/tasks/install.yml index c16231eadd..33bf0c6530 100644 --- a/ansible/roles/baremetal/tasks/install.yml +++ b/ansible/roles/baremetal/tasks/install.yml @@ -68,6 +68,25 @@ - ansible_facts.os_family == 'Debian' - not docker_unit_file.stat.exists +- name: Ensure /etc/apt/preferences.d exists + file: + path: /etc/apt/preferences.d + state: directory + mode: 0755 + when: ansible_facts.os_family == 'Debian' + +- name: Install docker apt pin + copy: + dest: "/etc/apt/preferences.d/docker" + content: | + Package: {{ docker_apt_package }} + Pin: version {{ docker_apt_package_pin }} + Pin-Priority: 1000 + become: True + when: + - docker_apt_package_pin | length > 0 + - ansible_facts.os_family == 'Debian' + - name: Install apt packages package: name: "{{ (debian_pkg_install | join(' ')).split() }}" diff --git a/doc/source/reference/compute/zun-guide.rst b/doc/source/reference/compute/zun-guide.rst index 9959dede1a..a2dee978d6 100644 --- a/doc/source/reference/compute/zun-guide.rst +++ b/doc/source/reference/compute/zun-guide.rst @@ -23,6 +23,16 @@ following variables: docker_configure_for_zun: "yes" containerd_configure_for_zun: "yes" +Currently Kuryr does not support Docker 23 and later due to +dropped --cluster-store option (bug +`bug `__).You need +to cap docker by setting the following variables in globals.yml. + +.. code-block:: yaml + + docker_apt_package_pin: "5:20.*" + docker_yum_package_pin: "20.*" + Docker reconfiguration requires rebootstrapping before deploy. Make sure you understand the consequences of restarting Docker. Please see :ref:`rebootstrapping` for details. diff --git a/tests/templates/globals-default.j2 b/tests/templates/globals-default.j2 index 72d74067fa..4040f958fa 100644 --- a/tests/templates/globals-default.j2 +++ b/tests/templates/globals-default.j2 @@ -84,6 +84,9 @@ enable_cinder: "yes" # lvm backup driver for cinder-backup does not exist enable_cinder_backup: "no" enable_cinder_backend_lvm: "yes" +# pin Docker to 20 - https://bugs.launchpad.net/zun/+bug/2007142 +docker_apt_package_pin: "5:20.*" +docker_yum_package_pin: "20.*" {% endif %} {% if scenario == "swift" %} diff --git a/zuul.d/base.yaml b/zuul.d/base.yaml index 62eb16f96e..d9a985dae9 100644 --- a/zuul.d/base.yaml +++ b/zuul.d/base.yaml @@ -101,6 +101,7 @@ - ^tests/test-core-openstack.sh - ^tests/test-zun.sh - ^tests/test-dashboard.sh + - ^tests/templates/globals-default\.j2$ vars: scenario: zun