Skip to content

Commit 4c67cf3

Browse files
committed
CI: Add upgrade tests
Adds two upgrade test jobs: Ubuntu Jammy OVS and Rocky 9 OVN. These jobs reuse the existing aio reusable workflow, which has a new 'upgrade' input parameter. When testing an upgrade, the previous release is first deployed, then the aio is upgraded to the current release before running RefStack tests.
1 parent 85d0798 commit 4c67cf3

File tree

2 files changed

+126
-8
lines changed

2 files changed

+126
-8
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-yoga
85+
# NOTE(upgrade): Reference the PREVIOUS release branch here.
86+
PREVIOUS_BRANCH: stackhpc/yoga
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@v3
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@v3
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

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

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,41 @@ jobs:
143143
if: ${{ needs.check-changes.outputs.aio == 'true' }}
144144
secrets: inherit
145145
if: ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
146+
147+
# Test two upgrade scenarios: Ubuntu Jammy OVS and Rocky 9 OVN.
148+
149+
all-in-one-upgrade-ubuntu-jammy-ovs:
150+
name: aio upgrade (Ubuntu Jammy OVS)
151+
needs:
152+
- check-changes
153+
- build-kayobe-image
154+
uses: ./.github/workflows/stackhpc-all-in-one.yml
155+
with:
156+
kayobe_image: ${{ needs.build-kayobe-image.outputs.kayobe_image }}
157+
os_distribution: ubuntu
158+
os_release: jammy
159+
ssh_username: ubuntu
160+
neutron_plugin: ovs
161+
OS_CLOUD: sms-lab-release
162+
if: ${{ needs.check-changes.outputs.aio == 'true' }}
163+
upgrade: true
164+
secrets: inherit
165+
if: ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
166+
167+
all-in-one-upgrade-rocky-9-ovn:
168+
name: aio upgrade (Rocky 9 OVN)
169+
needs:
170+
- check-changes
171+
- build-kayobe-image
172+
uses: ./.github/workflows/stackhpc-all-in-one.yml
173+
with:
174+
kayobe_image: ${{ needs.build-kayobe-image.outputs.kayobe_image }}
175+
os_distribution: rocky
176+
os_release: "9"
177+
ssh_username: cloud-user
178+
neutron_plugin: ovn
179+
OS_CLOUD: sms-lab-release
180+
if: ${{ needs.check-changes.outputs.aio == 'true' }}
181+
upgrade: true
182+
secrets: inherit
183+
if: ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}

0 commit comments

Comments
 (0)