From 1c4c55749cc1662f23ee105db5fad07f69f50856 Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Mon, 20 Feb 2023 08:43:41 +0100 Subject: [PATCH 1/2] CI: Configure additional disk when available It seems that on some nodepool providers (rax for sure), we get 40G boot disk and 80G additional disk, while on others we get 80G boot disk only. Change-Id: I179c41032239f5f0ce6055c79295b32c33fe67a5 (cherry picked from commit a0d758019a753596567128a44032165dc8214f05) --- tests/playbooks/pre.yml | 78 +++++++++++++++++++++++++++++++++++++++++ tests/playbooks/run.yml | 3 +- 2 files changed, 80 insertions(+), 1 deletion(-) diff --git a/tests/playbooks/pre.yml b/tests/playbooks/pre.yml index 0fbeec3dfc..cbf220deaa 100644 --- a/tests/playbooks/pre.yml +++ b/tests/playbooks/pre.yml @@ -119,3 +119,81 @@ path: /run/docker.sock mode: 0666 become: true + + # On RAX hosts, we have a small root partition and a large, + # unallocated ephemeral device attached at /dev/xvde + - name: Set ephemeral device if /dev/xvde exists + when: ansible_devices["xvde"] is defined + set_fact: + ephemeral_device: "/dev/xvde" + + # On other providers, we have a device called "ephemeral0". + - name: Set ephemeral device by label + when: ephemeral_device is undefined + block: + - name: Get ephemeral0 device node + command: /sbin/blkid -L ephemeral0 + register: ephemeral0 + # rc !=0 is expected + failed_when: False + changed_when: False + + - name: Set ephemeral device if LABEL exists + when: "ephemeral0.rc == 0" + set_fact: + ephemeral_device: "{{ ephemeral0.stdout }}" + + - name: Configure additional disk (if available) + become: true + when: ephemeral_device is defined + block: + - name: Ensure ephemeral device is unmounted + ansible.posix.mount: + name: "{{ ephemeral_device }}" + state: "{{ item }}" + loop: + - unmounted + - absent + + - name: Get existing partitions + community.general.parted: + device: "{{ ephemeral_device }}" + unit: MiB + state: info + register: ephemeral_partitions + + - name: Remove any existing partitions + community.general.parted: + device: "{{ ephemeral_device }}" + number: "{{ item.num }}" + state: absent + loop: "{{ ephemeral_partitions.partitions }}" + + - name: Create filesystem on additional partition + community.general.filesystem: + fstype: ext4 + dev: "{{ ephemeral_device }}" + opts: "-L kolla" + + - name: Ensure /mnt/kolla mountpoint is created + ansible.builtin.file: + path: "/mnt/kolla" + owner: root + group: root + state: directory + mode: 0755 + + - name: Mount additional filesystem + ansible.posix.mount: + path: "/mnt/kolla" + src: "LABEL=kolla" + fstype: ext4 + state: present + + - name: Ensure /mnt/kolla/work_dir directory is created + ansible.builtin.file: + path: "/mnt/kolla/work_dir" + owner: root + group: root + state: directory + mode: 0777 diff --git a/tests/playbooks/run.yml b/tests/playbooks/run.yml index f95b1da40c..256e4c4dbd 100644 --- a/tests/playbooks/run.yml +++ b/tests/playbooks/run.yml @@ -4,6 +4,7 @@ - ../vars/zuul.yml vars: tag_suffix: "{{ '-aarch64' if ansible_architecture == 'aarch64' else '' }}" + kolla_disk: "{{ true if ephemeral_device is defined else false }}" kolla_build_config: DEFAULT: debug: true @@ -46,4 +47,4 @@ command: "{{ virtualenv_path }}/bin/kolla-build --template-only --work-dir {{ kolla_build_logs_dir }}/work_dir" - name: Run kolla-build - command: "{{ virtualenv_path }}/bin/kolla-build" + command: "{{ virtualenv_path }}/bin/kolla-build {% if kolla_disk %}--work-dir /mnt/kolla/work_dir{% endif %}" From 4b3998d46ed2b0c982ae4ba2cd2eded95eb039c9 Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Thu, 16 Feb 2023 08:23:27 +0100 Subject: [PATCH 2/2] CI: Retry docker push on publish jobs We have a high number of POST_FAILURE jobs failing on at least one container push - let's fix that. Change-Id: I0015dd4d3ffe5b3e1202ebcfde2b2c72c4655b41 (cherry picked from commit 0887d2e789e8fcd41b49c6346034c4774ea919dd) --- tests/playbooks/publish.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/playbooks/publish.yml b/tests/playbooks/publish.yml index 4e27086f22..8b24856768 100644 --- a/tests/playbooks/publish.yml +++ b/tests/playbooks/publish.yml @@ -23,6 +23,9 @@ push: yes source: local loop: "{{ docker_host_info.images }}" + register: push_status + until: push_status.failed is false + retries: 5 when: kolla_registry == 'dockerhub' - block: @@ -39,4 +42,7 @@ repository: "quay.io/{{ item.RepoTags.0 }}" source: local loop: "{{ docker_host_info.images }}" + register: push_status + until: push_status.failed is false + retries: 5 when: kolla_registry == 'quay.io'