Skip to content

Commit 10222b1

Browse files
authored
Merge pull request #997 from stackhpc/merge-zed-antelope
Merge Zed into Antelope
2 parents c591acd + 35d6091 commit 10222b1

33 files changed

+312
-99
lines changed

.github/workflows/overcloud-host-image-build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
id: openstack_release
3939
run: |
4040
BRANCH=$(awk -F'=' '/defaultbranch/ {print $2}' src/kayobe-config/.gitreview)
41-
echo "openstack_release=${BRANCH}" | sed "s|stable/||" >> $GITHUB_OUTPUT
41+
echo "openstack_release=${BRANCH}" | sed -E "s,(stable|unmaintained)/,," >> $GITHUB_OUTPUT
4242
4343
# Generate a tag to apply to all built overcloud host images.
4444
- name: Generate overcloud host image tag

.github/workflows/overcloud-host-image-promote.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
id: openstack_release
3232
run: |
3333
BRANCH=$(awk -F'=' '/defaultbranch/ {print $2}' .gitreview)
34-
echo "openstack_release=${BRANCH}" | sed "s|stable/||" >> $GITHUB_OUTPUT
34+
echo "openstack_release=${BRANCH}" | sed -E "s,(stable|unmaintained)/,," >> $GITHUB_OUTPUT
3535
working-directory: src/kayobe-config
3636

3737
- name: Clone StackHPC Kayobe repository

.github/workflows/overcloud-host-image-upload.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
id: openstack_release
4848
run: |
4949
BRANCH=$(awk -F'=' '/defaultbranch/ {print $2}' src/kayobe-config/.gitreview)
50-
echo "openstack_release=${BRANCH}" | sed "s|stable/||" >> $GITHUB_OUTPUT
50+
echo "openstack_release=${BRANCH}" | sed -E "s,(stable|unmaintained)/,," >> $GITHUB_OUTPUT
5151
5252
- name: Clone StackHPC Kayobe repository
5353
uses: actions/checkout@v4

.github/workflows/stackhpc-ci-cleanup.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
id: openstack_release
3131
run: |
3232
BRANCH=$(awk -F'=' '/defaultbranch/ {print $2}' src/kayobe-config/.gitreview)
33-
echo "openstack_release=${BRANCH}" | sed "s|stable/||" >> $GITHUB_OUTPUT
33+
echo "openstack_release=${BRANCH}" | sed -E "s,(stable|unmaintained)/,," >> $GITHUB_OUTPUT
3434
3535
- name: Install OpenStack client
3636
run: |

.github/workflows/stackhpc-container-image-build.yml

+112-31
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ on:
3333
type: boolean
3434
required: false
3535
default: true
36+
push-dirty:
37+
description: Push scanned images that have vulnerabilities?
38+
type: boolean
39+
required: false
40+
# NOTE(Alex-Welsh): This default should be flipped once we resolve existing failures
41+
default: true
3642

3743
env:
3844
ANSIBLE_FORCE_COLOR: True
@@ -54,7 +60,7 @@ jobs:
5460
id: openstack_release
5561
run: |
5662
BRANCH=$(awk -F'=' '/defaultbranch/ {print $2}' .gitreview)
57-
echo "openstack_release=${BRANCH}" | sed "s|stable/||" >> $GITHUB_OUTPUT
63+
echo "openstack_release=${BRANCH}" | sed -E "s,(stable|unmaintained)/,," >> $GITHUB_OUTPUT
5864
5965
# Generate a tag to apply to all built container images.
6066
# Without this, each kayobe * container image build command would use a different tag.
@@ -100,7 +106,15 @@ jobs:
100106
- name: Install package dependencies
101107
run: |
102108
sudo apt update
103-
sudo apt install -y build-essential git unzip nodejs python3-wheel python3-pip python3-venv
109+
sudo apt install -y build-essential git unzip nodejs python3-wheel python3-pip python3-venv curl jq wget
110+
111+
- name: Install gh
112+
run: |
113+
sudo mkdir -p -m 755 /etc/apt/keyrings && wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null
114+
sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
115+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
116+
sudo apt update
117+
sudo apt install gh -y
104118
105119
- name: Checkout
106120
uses: actions/checkout@v4
@@ -118,6 +132,10 @@ jobs:
118132
run: |
119133
docker ps
120134
135+
- name: Install Trivy
136+
run: |
137+
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b /usr/local/bin v0.49.0
138+
121139
- name: Install Kayobe
122140
run: |
123141
mkdir -p venvs &&
@@ -132,6 +150,10 @@ jobs:
132150
- name: Install Docker Python SDK
133151
run: |
134152
sudo pip install docker
153+
154+
- name: Get Kolla tag
155+
id: write-kolla-tag
156+
run: echo "kolla-tag=${{ needs.generate-tag.outputs.openstack_release }}-${{ matrix.distro }}-${{ matrix.distro == 'rocky' && '9' || 'jammy' }}-${{ needs.generate-tag.outputs.datetime_tag }}" >> $GITHUB_OUTPUT
135157

136158
- name: Configure localhost as a seed
137159
run: |
@@ -153,67 +175,124 @@ jobs:
153175
env:
154176
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
155177

156-
- name: Build and push kolla overcloud images
178+
- name: Create build logs output directory
179+
run: mkdir image-build-logs
180+
181+
- name: Build kolla overcloud images
182+
id: build_overcloud_images
183+
continue-on-error: true
157184
run: |
158-
args="${{ github.event.inputs.regexes }}"
185+
args="${{ inputs.regexes }}"
159186
args="$args -e kolla_base_distro=${{ matrix.distro }}"
160-
args="$args -e kolla_tag=$KOLLA_TAG"
187+
args="$args -e kolla_tag=${{ steps.write-kolla-tag.outputs.kolla-tag }}"
161188
args="$args -e stackhpc_repo_mirror_auth_proxy_enabled=true"
162-
if ${{ inputs.push }} == 'true'; then
163-
args="$args --push"
164-
fi
165189
source venvs/kayobe/bin/activate &&
166190
source src/kayobe-config/kayobe-env --environment ci-builder &&
167191
kayobe overcloud container image build $args
168192
env:
169193
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
170-
KOLLA_TAG: "${{ needs.generate-tag.outputs.openstack_release }}-${{ matrix.distro }}-${{ matrix.distro == 'rocky' && '9' || 'jammy' }}-${{ needs.generate-tag.outputs.datetime_tag }}"
171-
if: github.event.inputs.overcloud == 'true'
194+
if: inputs.overcloud
195+
196+
- name: Copy overcloud container image build logs to output directory
197+
run: sudo mv /var/log/kolla-build.log image-build-logs/kolla-build-overcloud.log
198+
if: inputs.overcloud
172199

173-
- name: Build and push kolla seed images
200+
- name: Build kolla seed images
201+
id: build_seed_images
202+
continue-on-error: true
174203
run: |
175204
args="-e kolla_base_distro=${{ matrix.distro }}"
176-
args="$args -e kolla_tag=$KOLLA_TAG"
205+
args="$args -e kolla_tag=${{ steps.write-kolla-tag.outputs.kolla-tag }}"
177206
args="$args -e stackhpc_repo_mirror_auth_proxy_enabled=true"
178-
if ${{ inputs.push }} == 'true'; then
179-
args="$args --push"
180-
fi
181207
source venvs/kayobe/bin/activate &&
182208
source src/kayobe-config/kayobe-env --environment ci-builder &&
183209
kayobe seed container image build $args
184210
env:
185211
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
186-
KOLLA_TAG: "${{ needs.generate-tag.outputs.openstack_release }}-${{ matrix.distro }}-${{ matrix.distro == 'rocky' && '9' || 'jammy' }}-${{ needs.generate-tag.outputs.datetime_tag }}"
187-
if: github.event.inputs.seed == 'true'
212+
if: inputs.seed
213+
214+
- name: Copy seed container image build logs to output directory
215+
run: sudo mv /var/log/kolla-build.log image-build-logs/kolla-build-seed.log
216+
if: inputs.seed
188217

189218
- name: Get built container images
190-
run: |
191-
docker image ls --filter "reference=ark.stackhpc.com/stackhpc-dev/*:*${{ matrix.distro }}*${{ needs.generate-tag.outputs.datetime_tag }}" > ${{ matrix.distro }}-container-images
219+
run: docker image ls --filter "reference=ark.stackhpc.com/stackhpc-dev/*:${{ steps.write-kolla-tag.outputs.kolla-tag }}" > ${{ matrix.distro }}-container-images
192220

193221
- name: Fail if no images have been built
194222
run: if [ $(wc -l < ${{ matrix.distro }}-container-images) -le 1 ]; then exit 1; fi
195223

196-
- name: Upload container images artifact
224+
- name: Scan built container images
225+
run: src/kayobe-config/tools/scan-images.sh ${{ matrix.distro }} ${{ steps.write-kolla-tag.outputs.kolla-tag }}
226+
227+
- name: Move image scan logs to output artifact
228+
run: mv image-scan-output image-build-logs/image-scan-output
229+
230+
- name: Fail if no images have passed scanning
231+
run: if [ $(wc -l < image-build-logs/image-scan-output/clean-images.txt) -le 0 ]; then exit 1; fi
232+
if: ${{ !inputs.push-dirty }}
233+
234+
- name: Copy clean images to push-attempt-images list
235+
run: cp image-build-logs/image-scan-output/clean-images.txt image-build-logs/push-attempt-images.txt
236+
if: inputs.push
237+
238+
- name: Append dirty images to push list
239+
run: |
240+
cat image-build-logs/image-scan-output/dirty-images.txt >> image-build-logs/push-attempt-images.txt
241+
if: ${{ inputs.push && inputs.push-dirty }}
242+
243+
- name: Push images
244+
run: |
245+
touch image-build-logs/push-failed-images.txt
246+
source venvs/kayobe/bin/activate &&
247+
source src/kayobe-config/kayobe-env --environment ci-builder &&
248+
kayobe playbook run ${KAYOBE_CONFIG_PATH}/ansible/docker-registry-login.yml &&
249+
250+
while read -r image; do
251+
# Retries!
252+
for i in {1..5}; do
253+
if docker push $image; then
254+
echo "Pushed $image"
255+
break
256+
elif $i == 5; then
257+
echo "Failed to push $image"
258+
echo $image >> image-build-logs/push-failed-images.txt
259+
else
260+
echo "Failed on retry $i"
261+
sleep 5
262+
fi;
263+
done
264+
done < image-build-logs/push-attempt-images.txt
265+
shell: bash
266+
env:
267+
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
268+
if: inputs.push
269+
270+
- name: Upload output artifact
197271
uses: actions/upload-artifact@v4
198272
with:
199-
name: ${{ matrix.distro }} container images
200-
path: ${{ matrix.distro }}-container-images
273+
name: ${{ matrix.distro }}-logs
274+
path: image-build-logs
201275
retention-days: 7
276+
if: ${{ !cancelled() }}
277+
278+
- name: Fail when images failed to build
279+
run: echo "An image build failed. Check the workflow artifact for build logs" && exit 1
280+
if: ${{ steps.build_overcloud_images.outcome == 'failure' || steps.build_seed_images.outcome == 'failure' }}
281+
282+
- name: Fail when images failed to push
283+
run: if [ $(wc -l < image-build-logs/push-failed-images.txt) -gt 0 ]; then cat image-build-logs/push-failed-images.txt && exit 1; fi
284+
if: ${{ !cancelled() }}
285+
286+
- name: Fail when images failed scanning
287+
run: if [ $(wc -l < image-build-logs/dirty-images.txt) -gt 0 ]; then cat image-build-logs/dirty-images.txt && exit 1; fi
288+
if: ${{ !inputs.push-dirty && !cancelled() }}
202289

203-
sync-container-repositories:
204-
name: Trigger container image repository sync
205-
needs:
206-
- container-image-build
207-
if: github.repository == 'stackhpc/stackhpc-kayobe-config' && inputs.push
208-
runs-on: ubuntu-latest
209-
permissions: {}
210-
steps:
211290
# NOTE(mgoddard): Trigger another CI workflow in the
212291
# stackhpc-release-train repository.
213292
- name: Trigger container image repository sync
214293
run: |
215294
filter='${{ inputs.regexes }}'
216-
if [[ -n $filter ]] && [[ ${{ github.event.inputs.seed }} == 'true' ]]; then
295+
if [[ -n $filter ]] && [[ ${{ inputs.seed }} == 'true' ]]; then
217296
filter="$filter bifrost"
218297
fi
219298
gh workflow run \
@@ -224,7 +303,9 @@ jobs:
224303
-f sync-old-images=false
225304
env:
226305
GITHUB_TOKEN: ${{ secrets.STACKHPC_RELEASE_TRAIN_TOKEN }}
306+
if: ${{ github.repository == 'stackhpc/stackhpc-kayobe-config' && inputs.push && !cancelled() }}
227307

228308
- name: Display link to container image repository sync workflows
229309
run: |
230310
echo "::notice Container image repository sync workflows: https://github.com/stackhpc/stackhpc-release-train/actions/workflows/container-sync.yml"
311+
if: ${{ github.repository == 'stackhpc/stackhpc-kayobe-config' && inputs.push && !cancelled() }}

doc/source/configuration/vault.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,9 @@ Configure Barbican
296296
[vault_plugin]
297297
vault_url = https://{{ kolla_internal_vip_address }}:8200
298298
use_ssl = True
299-
ssl_ca_crt_file = {% raw %}{{ openstack_cacert }}{% endraw %}
299+
{% raw %}
300+
ssl_ca_crt_file = {{ openstack_cacert }}
301+
{% endraw %}
300302
approle_role_id = {{ secrets_barbican_approle_role_id }}
301303
approle_secret_id = {{ secrets_barbican_approle_secret_id }}
302304
kv_mountpoint = barbican

doc/source/contributor/environments/aufn-ceph.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This environment creates a Universe-from-nothing_-style deployment of Kayobe con
1414
Prerequisites
1515
=============
1616

17-
* a baremetal node with at least 64GB of RAM running CentOS Stream 8 (or Ubuntu)
17+
* a baremetal node with at least 64GB of RAM running Rocky Linux 9 or Ubuntu Jammy.
1818

1919
* access to the test pulp server on SMS lab
2020

doc/source/contributor/environments/ci-builder.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Access the host via SSH.
2525

2626
Install package dependencies.
2727

28-
On CentOS:
28+
On Rocky Linux:
2929

3030
.. parsed-literal::
3131

doc/source/operations/tempest.rst

+7-4
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ To install Docker on Ubuntu:
6565
sudo apt-get update
6666
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
6767
68-
Installing Docker on CentOS/Rocky:
68+
Installing Docker on Rocky:
6969

7070
.. code-block:: bash
7171
@@ -99,9 +99,9 @@ Build a Kayobe automation image:
9999
100100
git submodule init
101101
git submodule update
102-
# If running on Ubuntu, the fact cache can confuse Kayobe in the CentOS-based container
102+
# If running on Ubuntu, the fact cache can confuse Kayobe in the Rocky-based container
103103
mv etc/kayobe/facts{,-old}
104-
sudo DOCKER_BUILDKIT=1 docker build --file .automation/docker/kayobe/Dockerfile --tag kayobe:latest .
104+
sudo DOCKER_BUILDKIT=1 docker build --build-arg BASE_IMAGE=rockylinux:9 --file .automation/docker/kayobe/Dockerfile --tag kayobe:latest .
105105
106106
Configuration
107107
=============
@@ -277,7 +277,10 @@ command from the base of the ``kayobe-config`` directory:
277277

278278
.. code-block:: bash
279279
280-
sudo -E docker run --detach -it --rm --network host -v $(pwd):/stack/kayobe-automation-env/src/kayobe-config -v $(pwd)/tempest-artifacts:/stack/tempest-artifacts -e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY kayobe:latest /stack/kayobe-automation-env/src/kayobe-config/.automation/pipeline/tempest.sh -e ansible_user=stack
280+
sudo -E docker run --name kayobe-automation --detach -it --rm --network host \
281+
-v $(pwd):/stack/kayobe-automation-env/src/kayobe-config -v $(pwd)/tempest-artifacts:/stack/tempest-artifacts \
282+
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY kayobe:latest \
283+
/stack/kayobe-automation-env/src/kayobe-config/.automation/pipeline/tempest.sh -e ansible_user=stack
281284
282285
By default, ``no_log`` is set to stop credentials from leaking. This can be
283286
disabled by adding ``-e rally_no_sensitive_log=false`` to the end.

doc/source/operations/upgrading.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,14 @@ Known issues
199199
200200
* Docker log-opts are currently not configured in Antelope. You will see these
201201
being removed when running a host configure in check+diff mode. See bug for
202-
details (fix in progress):
202+
details (fix released):
203203
https://bugs.launchpad.net/ansible-collection-kolla/+bug/2040105
204204

205205
* /etc/hosts are not templated correctly when running a host configure with
206206
``--limit``. To work around this, run your host configures with
207207
``--skip-tags etc-hosts``. If you do need to change ``/etc/hosts``, for
208208
example with any newly-added hosts, run a full host configure afterward with
209-
``--tags etc-hosts``. See bug for details (fix in progress):
209+
``--tags etc-hosts``. See bug for details (fix released):
210210
https://bugs.launchpad.net/kayobe/+bug/2051714
211211

212212
Security baseline
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
- name: Login to docker registry
3+
gather_facts: false
4+
hosts: container-image-builders
5+
tasks:
6+
- name: Login to docker registry
7+
docker_login:
8+
registry_url: "{{ kolla_docker_registry or omit }}"
9+
username: "{{ kolla_docker_registry_username }}"
10+
password: "{{ kolla_docker_registry_password }}"
11+
reauthorize: yes

etc/kayobe/ansible/ovn-fix-chassis-priorities.yml

+17-14
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,25 @@
2121
- name: Find OVN DB DB Leader
2222
hosts: "{{ ovn_nb_db_group | default('controllers') }}"
2323
tasks:
24-
- name: Find the OVN NB DB leader
25-
ansible.builtin.command: docker exec ovn_nb_db ovn-nbctl get-connection
26-
changed_when: false
27-
failed_when: false
28-
register: ovn_check_result
29-
check_mode: false
24+
- name: Find OVN DB Leader
25+
when: kolla_enable_ovn | bool
26+
block:
27+
- name: Find the OVN NB DB leader
28+
ansible.builtin.command: docker exec ovn_nb_db ovn-nbctl get-connection
29+
changed_when: false
30+
failed_when: false
31+
register: ovn_check_result
32+
check_mode: false
3033

31-
- name: Group hosts by leader/follower role
32-
ansible.builtin.group_by:
33-
key: "ovn_nb_{{ 'leader' if ovn_check_result.rc == 0 else 'follower' }}"
34-
changed_when: false
34+
- name: Group hosts by leader/follower role
35+
ansible.builtin.group_by:
36+
key: "ovn_nb_{{ 'leader' if ovn_check_result.rc == 0 else 'follower' }}"
37+
changed_when: false
3538

36-
- name: Assert one leader exists
37-
ansible.builtin.assert:
38-
that:
39-
- groups['ovn_nb_leader'] | default([]) | length == 1
39+
- name: Assert one leader exists
40+
ansible.builtin.assert:
41+
that:
42+
- groups['ovn_nb_leader'] | default([]) | length == 1
4043

4144
- name: Fix OVN chassis priorities
4245
hosts: ovn_nb_leader

etc/kayobe/ansible/ubuntu-upgrade.yml

-4
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,3 @@
104104
that:
105105
- ansible_facts.distribution_major_version == '22'
106106
- ansible_facts.distribution_release == 'jammy'
107-
108-
- name: Run the OVN chassis priority fix playbook
109-
import_playbook: "{{ lookup('ansible.builtin.env', 'KAYOBE_CONFIG_PATH') }}/ansible/ovn-fix-chassis-priorities.yml"
110-
when: kolla_enable_ovn

0 commit comments

Comments
 (0)