Skip to content

Commit 7d00fbc

Browse files
authored
Merge pull request #909 from stackhpc/sync/zed-into-2023.1
Sync zed into 2023.1
2 parents a8dc63f + 7b5f902 commit 7d00fbc

File tree

12 files changed

+672
-52
lines changed

12 files changed

+672
-52
lines changed

.github/workflows/stackhpc-all-in-one.yml

Lines changed: 88 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ on:
5555
description: Whether to run the workflow (workaround for required status checks issue)
5656
type: boolean
5757
default: true
58+
upgrade:
59+
description: Whether to perform an upgrade
60+
type: boolean
61+
default: false
5862
secrets:
5963
KAYOBE_VAULT_PASSWORD:
6064
required: true
@@ -76,10 +80,27 @@ jobs:
7680
KAYOBE_ENVIRONMENT: ci-aio
7781
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
7882
KAYOBE_IMAGE: ${{ inputs.kayobe_image }}
83+
# NOTE(upgrade): Reference the PREVIOUS release here.
84+
PREVIOUS_KAYOBE_IMAGE: ghcr.io/stackhpc/stackhpc-kayobe-config:stackhpc-zed
85+
# NOTE(upgrade): Reference the PREVIOUS release branch here.
86+
PREVIOUS_BRANCH: stackhpc/zed
7987
steps:
80-
- uses: actions/checkout@v3
88+
# If testing upgrade, checkout previous release, otherwise checkout current branch
89+
- name: Checkout ${{ inputs.upgrade && 'previous release' || 'current' }} config
90+
uses: actions/checkout@v4
8191
with:
82-
submodules: true
92+
ref: ${{ inputs.upgrade && env.PREVIOUS_BRANCH || github.ref }}
93+
submodules: true
94+
95+
- name: Output Kayobe image
96+
id: kayobe_image
97+
run: |
98+
if ${{ inputs.upgrade }}; then
99+
kayobe_image=$PREVIOUS_KAYOBE_IMAGE
100+
else
101+
kayobe_image=$KAYOBE_IMAGE
102+
fi
103+
echo kayobe_image=$kayobe_image >> $GITHUB_OUTPUT
83104
84105
- name: Output image tag
85106
id: image_tag
@@ -125,6 +146,7 @@ jobs:
125146
aio_vm_flavor = "${{ env.VM_FLAVOR }}"
126147
aio_vm_network = "${{ env.VM_NETWORK }}"
127148
aio_vm_subnet = "${{ env.VM_SUBNET }}"
149+
aio_vm_volume_size = "${{ env.VM_VOLUME_SIZE }}"
128150
EOF
129151
working-directory: ${{ github.workspace }}/terraform/aio
130152
env:
@@ -135,6 +157,7 @@ jobs:
135157
VM_NETWORK: ${{ inputs.vm_network }}
136158
VM_SUBNET: ${{ inputs.vm_subnet }}
137159
VM_INTERFACE: ${{ inputs.vm_interface }}
160+
VM_VOLUME_SIZE: ${{ inputs.upgrade && '45' || '35' }}
138161

139162
- name: Terraform Plan
140163
run: terraform plan
@@ -206,8 +229,14 @@ jobs:
206229
cat terraform/aio/id_rsa >> $GITHUB_OUTPUT
207230
echo "EOF" >> $GITHUB_OUTPUT
208231
232+
# The same tag may be reused (e.g. stackhpc/yoga), so ensure we have the latest image.
233+
- name: Pull previous Kayobe image
234+
run: |
235+
sudo docker image pull ${{ steps.kayobe_image.outputs.kayobe_image }}
236+
if: inputs.upgrade
237+
209238
# The same tag may be reused (e.g. pr-123), so ensure we have the latest image.
210-
- name: Pull latest Kayobe image
239+
- name: Pull current Kayobe image
211240
run: |
212241
sudo docker image pull $KAYOBE_IMAGE
213242
@@ -216,7 +245,7 @@ jobs:
216245
sudo -E docker run -t --rm \
217246
-v $(pwd):/stack/kayobe-automation-env/src/kayobe-config \
218247
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY \
219-
$KAYOBE_IMAGE \
248+
${{ steps.kayobe_image.outputs.kayobe_image }} \
220249
/stack/kayobe-automation-env/src/kayobe-config/.automation/pipeline/playbook-run.sh '$KAYOBE_CONFIG_PATH/ansible/growroot.yml'
221250
env:
222251
KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: ${{ steps.ssh_key.outputs.ssh_key }}
@@ -226,7 +255,7 @@ jobs:
226255
sudo -E docker run -t --rm \
227256
-v $(pwd):/stack/kayobe-automation-env/src/kayobe-config \
228257
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY \
229-
$KAYOBE_IMAGE \
258+
${{ steps.kayobe_image.outputs.kayobe_image }} \
230259
/stack/kayobe-automation-env/src/kayobe-config/.automation/pipeline/overcloud-host-configure.sh
231260
env:
232261
KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: ${{ steps.ssh_key.outputs.ssh_key }}
@@ -236,7 +265,7 @@ jobs:
236265
sudo -E docker run -t --rm \
237266
-v $(pwd):/stack/kayobe-automation-env/src/kayobe-config \
238267
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY \
239-
$KAYOBE_IMAGE \
268+
${{ steps.kayobe_image.outputs.kayobe_image }} \
240269
/stack/kayobe-automation-env/src/kayobe-config/.automation/pipeline/overcloud-service-deploy.sh
241270
env:
242271
KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: ${{ steps.ssh_key.outputs.ssh_key }}
@@ -246,11 +275,62 @@ jobs:
246275
sudo -E docker run -t --rm \
247276
-v $(pwd):/stack/kayobe-automation-env/src/kayobe-config \
248277
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY \
249-
$KAYOBE_IMAGE \
278+
${{ steps.kayobe_image.outputs.kayobe_image }} \
250279
/stack/kayobe-automation-env/src/kayobe-config/.automation/pipeline/playbook-run.sh etc/kayobe/ansible/configure-aio-resources.yml
251280
env:
252281
KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: ${{ steps.ssh_key.outputs.ssh_key }}
253282

283+
# If testing upgrade, checkout the current release branch
284+
# Stash changes to tracked files, and set clean=false to avoid removing untracked files.
285+
- name: Stash config changes
286+
run: git stash
287+
if: inputs.upgrade
288+
289+
- name: Checkout current release config
290+
uses: actions/checkout@v4
291+
with:
292+
submodules: true
293+
clean: false
294+
if: inputs.upgrade
295+
296+
- name: Pop stashed config changes
297+
run: git stash pop
298+
if: inputs.upgrade
299+
300+
# Now begin upgrade
301+
- name: Host upgrade
302+
run: |
303+
sudo -E docker run -t --rm \
304+
-v $(pwd):/stack/kayobe-automation-env/src/kayobe-config \
305+
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY \
306+
$KAYOBE_IMAGE \
307+
/stack/kayobe-automation-env/src/kayobe-config/.automation/pipeline/overcloud-host-upgrade.sh
308+
env:
309+
KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: ${{ steps.ssh_key.outputs.ssh_key }}
310+
if: inputs.upgrade
311+
312+
- name: Host configure
313+
run: |
314+
sudo -E docker run -t --rm \
315+
-v $(pwd):/stack/kayobe-automation-env/src/kayobe-config \
316+
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY \
317+
$KAYOBE_IMAGE \
318+
/stack/kayobe-automation-env/src/kayobe-config/.automation/pipeline/overcloud-host-configure.sh
319+
env:
320+
KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: ${{ steps.ssh_key.outputs.ssh_key }}
321+
if: inputs.upgrade
322+
323+
- name: Service upgrade
324+
run: |
325+
sudo -E docker run -t --rm \
326+
-v $(pwd):/stack/kayobe-automation-env/src/kayobe-config \
327+
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY \
328+
$KAYOBE_IMAGE \
329+
/stack/kayobe-automation-env/src/kayobe-config/.automation/pipeline/overcloud-service-upgrade.sh
330+
env:
331+
KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: ${{ steps.ssh_key.outputs.ssh_key }}
332+
if: inputs.upgrade
333+
254334
- name: Tempest tests
255335
run: |
256336
mkdir -p tempest-artifacts
@@ -266,7 +346,7 @@ jobs:
266346
- name: Upload test result artifacts
267347
uses: actions/upload-artifact@v3
268348
with:
269-
name: tempest-results-${{ inputs.os_distribution }}-${{ inputs.os_release }}-${{ inputs.neutron_plugin }}
349+
name: tempest-results-${{ inputs.os_distribution }}-${{ inputs.os_release }}-${{ inputs.neutron_plugin }}${{ inputs.upgrade && '-upgrade' }}
270350
path: tempest-artifacts/*
271351

272352
- name: Fail if any Tempest tests failed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
# This workflow queries the Test Pulp server to check that all image tags
3+
# specified in kolla_image_tags are present.
4+
5+
name: Check container image tags
6+
on:
7+
workflow_call:
8+
inputs:
9+
kayobe_image:
10+
description: Kayobe container image
11+
type: string
12+
required: true
13+
secrets:
14+
KAYOBE_VAULT_PASSWORD:
15+
required: true
16+
17+
env:
18+
ANSIBLE_FORCE_COLOR: True
19+
jobs:
20+
check-tags:
21+
name: Check container image tags
22+
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
23+
runs-on: [self-hosted, stackhpc-kayobe-config-aio]
24+
permissions: {}
25+
env:
26+
KAYOBE_ENVIRONMENT: ci-aio
27+
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
28+
KAYOBE_IMAGE: ${{ inputs.kayobe_image }}
29+
steps:
30+
- uses: actions/checkout@v4
31+
with:
32+
submodules: true
33+
34+
# The same tag may be reused (e.g. pr-123), so ensure we have the latest image.
35+
- name: Pull latest Kayobe image
36+
run: |
37+
sudo docker image pull $KAYOBE_IMAGE
38+
39+
- name: Check container image tags
40+
run: |
41+
sudo -E docker run -t --rm \
42+
-v $(pwd):/stack/kayobe-automation-env/src/kayobe-config \
43+
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY \
44+
$KAYOBE_IMAGE \
45+
/stack/kayobe-automation-env/src/kayobe-config/.automation/pipeline/playbook-run.sh \
46+
'$KAYOBE_CONFIG_PATH/ansible/check-tags.yml'
47+
#env:
48+
#KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: ${{ steps.ssh_key.outputs.ssh_key }}

.github/workflows/stackhpc-promote.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
name: Promote package repositories
2+
name: Promote Pulp repositories
33
on:
44
push:
55
branches:
66
# NOTE(upgrade): Reference only the current release branch here.
77
- stackhpc/2023.1
88
jobs:
99
promote:
10-
name: Trigger package repository promotion
10+
name: Trigger Pulp promotion workflows
1111
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
1212
runs-on: ubuntu-latest
1313
permissions: {}
@@ -27,3 +27,19 @@ jobs:
2727
- name: Display link to package repository promotion workflows
2828
run: |
2929
echo "::notice Package repository promote workflow: https://github.com/stackhpc/stackhpc-release-train/actions/workflows/package-promote.yml"
30+
31+
# NOTE(mgoddard): Trigger another CI workflow in the
32+
# stackhpc-release-train repository.
33+
- name: Trigger container image promotion
34+
run: |
35+
gh workflow run \
36+
container-promote.yml \
37+
--repo stackhpc/stackhpc-release-train \
38+
--ref main \
39+
-f kayobe_config_branch=${{ github.ref_name }}
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.STACKHPC_RELEASE_TRAIN_TOKEN }}
42+
43+
- name: Display link to container image promotion workflows
44+
run: |
45+
echo "::notice Container image promote workflow: https://github.com/stackhpc/stackhpc-release-train/actions/workflows/container-promote.yml"

.github/workflows/stackhpc-pull-request.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,16 @@ jobs:
7676
if: ${{ needs.check-changes.outputs.aio == 'true' }}
7777
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
7878

79+
check-tags:
80+
name: Check container image tags
81+
needs:
82+
- build-kayobe-image
83+
uses: ./.github/workflows/stackhpc-check-tags.yml
84+
with:
85+
kayobe_image: ${{ needs.build-kayobe-image.outputs.kayobe_image }}
86+
secrets: inherit
87+
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
88+
7989
all-in-one-ubuntu-jammy-ovs:
8090
name: aio (Ubuntu Jammy OVS)
8191
needs:
@@ -143,3 +153,41 @@ jobs:
143153
if: ${{ needs.check-changes.outputs.aio == 'true' }}
144154
secrets: inherit
145155
if: ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
156+
157+
# Test two upgrade scenarios: Ubuntu Jammy OVS and Rocky 9 OVN.
158+
159+
all-in-one-upgrade-ubuntu-jammy-ovs:
160+
name: aio upgrade (Ubuntu Jammy OVS)
161+
needs:
162+
- check-changes
163+
- build-kayobe-image
164+
uses: ./.github/workflows/stackhpc-all-in-one.yml
165+
with:
166+
kayobe_image: ${{ needs.build-kayobe-image.outputs.kayobe_image }}
167+
os_distribution: ubuntu
168+
os_release: jammy
169+
ssh_username: ubuntu
170+
neutron_plugin: ovs
171+
OS_CLOUD: sms-lab-release
172+
if: ${{ needs.check-changes.outputs.aio == 'true' }}
173+
upgrade: true
174+
secrets: inherit
175+
if: ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
176+
177+
all-in-one-upgrade-rocky-9-ovn:
178+
name: aio upgrade (Rocky 9 OVN)
179+
needs:
180+
- check-changes
181+
- build-kayobe-image
182+
uses: ./.github/workflows/stackhpc-all-in-one.yml
183+
with:
184+
kayobe_image: ${{ needs.build-kayobe-image.outputs.kayobe_image }}
185+
os_distribution: rocky
186+
os_release: "9"
187+
ssh_username: cloud-user
188+
neutron_plugin: ovn
189+
OS_CLOUD: sms-lab-release
190+
if: ${{ needs.check-changes.outputs.aio == 'true' }}
191+
upgrade: true
192+
secrets: inherit
193+
if: ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}

etc/kayobe/ansible/check-tags.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
# This playbook queries the Pulp server to check that all image tags specified
3+
# in kolla_image_tags are present.
4+
5+
- name: Check whether tags exist in Pulp container registry
6+
hosts: localhost
7+
tasks:
8+
- name: Query images and tags
9+
command:
10+
cmd: >-
11+
{{ kayobe_config_path }}/../../tools/kolla-images.py list-tags
12+
register: kolla_images_result
13+
changed_when: false
14+
15+
- name: Set a fact about images and tags
16+
set_fact:
17+
kolla_images: "{{ kolla_images_result.stdout | from_yaml }}"
18+
19+
- name: Set a fact about the Pulp URL
20+
set_fact:
21+
pulp_url: "{{ stackhpc_repo_mirror_url }}"
22+
23+
# Use state=read and allow_missing=false to check for missing tags in test pulp.
24+
- import_role:
25+
name: stackhpc.pulp.pulp_container_content
26+
vars:
27+
pulp_container_content: >-
28+
{%- set contents = [] -%}
29+
{%- for image, tags in kolla_images.items() -%}
30+
{%- set repository = kolla_docker_namespace ~ "/" ~ image -%}
31+
{%- set content = {
32+
"allow_missing": False,
33+
"repository": repository,
34+
"state": "read",
35+
"tags": tags,
36+
} -%}
37+
{%- set _ = contents.append(content) -%}
38+
{%- endfor -%}
39+
{{ contents }}

etc/kayobe/ansible/requirements.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ collections:
77
- name: pulp.squeezer
88
version: 0.0.13
99
- name: stackhpc.pulp
10-
version: 0.5.2
10+
version: 0.5.4
1111
- name: stackhpc.hashicorp
1212
version: 2.4.0
1313
- name: stackhpc.kayobe_workflows

etc/kayobe/environments/ci-aio/stackhpc-ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,9 @@ stackhpc_docker_registry_password: !vault |
6262
38333133393730633666613965653364316162353337313330346164303631313731646461363461
6363
3963323635373866630a633533376339363734626664333765313665623662613764363038383735
6464
38646138376438643533376161376634653439386230353365316239613430363338
65+
66+
# Override Pulp credentials to allow querying container image tags in the
67+
# check-tags.yml custom playbook.
68+
pulp_url: "{{ stackhpc_repo_mirror_url }}"
69+
pulp_username: "{{ stackhpc_docker_registry_username }}"
70+
pulp_password: "{{ stackhpc_docker_registry_password }}"

0 commit comments

Comments
 (0)