Skip to content

Commit 206a920

Browse files
authored
Merge pull request #10 from stackhpc/minor-upgrade
Add minor upgrade option
2 parents f7d259b + 25a0bc8 commit 206a920

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

.github/workflows/multinode.yml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ on:
5151
type: string
5252
default: main
5353
upgrade:
54+
# Supported values: 'none', 'minor', 'major'
5455
description: Whether to perform an upgrade
55-
type: boolean
56-
default: false
56+
default: none
57+
type: string
5758
break_on:
5859
# Supported values: 'always', 'never', 'failure', 'success'
5960
description: When to break execution for manual interaction
@@ -98,7 +99,7 @@ jobs:
9899
run: |
99100
echo "StackHPC Kayobe Configuration previous version must be defined for upgrades"
100101
exit 1
101-
if: ${{ inputs.upgrade && inputs.stackhpc_kayobe_config_previous_version == '' }}
102+
if: ${{ (inputs.upgrade != 'none') && inputs.stackhpc_kayobe_config_previous_version == '' }}
102103

103104
- name: Fail if no SSH key is provided for break_on
104105
run: |
@@ -112,11 +113,11 @@ jobs:
112113
apt: git unzip nodejs python3-pip python3-venv rsync openssh-client
113114

114115
# If testing upgrade, checkout previous release, otherwise checkout current branch
115-
- name: Checkout ${{ inputs.upgrade && 'previous release' || 'current' }} config
116+
- name: Checkout ${{ (inputs.upgrade != 'none') && 'previous release' || 'current' }} config
116117
uses: actions/checkout@v4
117118
with:
118119
repository: stackhpc/stackhpc-kayobe-config
119-
ref: ${{ inputs.upgrade && inputs.stackhpc_kayobe_config_previous_version || inputs.stackhpc_kayobe_config_version }}
120+
ref: ${{ (inputs.upgrade != 'none') && inputs.stackhpc_kayobe_config_previous_version || inputs.stackhpc_kayobe_config_version }}
120121

121122
- name: Checkout terraform-kayobe-multinode
122123
uses: actions/checkout@v4
@@ -263,7 +264,7 @@ jobs:
263264
echo '${{ env.KAYOBE_VAULT_PASSWORD }}' > vault-pw
264265
265266
cat << EOF >> ansible/vars/defaults.yml
266-
kayobe_config_version: ${{ inputs.upgrade && inputs.stackhpc_kayobe_config_previous_version || inputs.stackhpc_kayobe_config_version }}
267+
kayobe_config_version: ${{ (inputs.upgrade != 'none') && inputs.stackhpc_kayobe_config_previous_version || inputs.stackhpc_kayobe_config_version }}
267268
ssh_key_path: ${{ github.workspace }}/terraform-kayobe-multinode/id_rsa
268269
vxlan_vni: ${{ steps.vxlan_vni.outputs.vxlan_vni }}
269270
vault_password_path: ${{ github.workspace }}/terraform-kayobe-multinode/vault-pw
@@ -332,28 +333,35 @@ jobs:
332333
source venv/bin/activate &&
333334
ansible-playbook -v -i ansible/inventory.yml ansible/deploy-openstack.yml -e multinode_command=upgrade_prerequisites
334335
working-directory: ${{ github.workspace }}/terraform-kayobe-multinode
335-
if: inputs.upgrade
336+
if: inputs.upgrade == 'major'
336337

337338
- name: Upgrade Ansible control host
338339
run: |
339340
source venv/bin/activate &&
340341
ansible-playbook -v -i ansible/inventory.yml ansible/deploy-openstack-config.yml -e upgrade=true -e kayobe_config_version=${{ inputs.stackhpc_kayobe_config_version }}
341342
working-directory: ${{ github.workspace }}/terraform-kayobe-multinode
342-
if: inputs.upgrade
343+
if: inputs.upgrade != 'none'
343344

344-
- name: Upgrade OpenStack
345+
- name: Run major OpenStack upgrade
345346
run: |
346347
source venv/bin/activate &&
347348
ansible-playbook -v -i ansible/inventory.yml ansible/deploy-openstack.yml -e multinode_command=upgrade_overcloud
348349
working-directory: ${{ github.workspace }}/terraform-kayobe-multinode
349-
if: inputs.upgrade
350+
if: inputs.upgrade == 'major'
351+
352+
- name: Run minor OpenStack upgrade
353+
run: |
354+
source venv/bin/activate &&
355+
ansible-playbook -v -i ansible/inventory.yml ansible/deploy-openstack.yml -e multinode_command=minor_upgrade
356+
working-directory: ${{ github.workspace }}/terraform-kayobe-multinode
357+
if: inputs.upgrade == 'minor'
350358

351359
- name: Run Tempest tests
352360
run: |
353361
source venv/bin/activate &&
354362
ansible-playbook -v -i ansible/inventory.yml ansible/deploy-openstack.yml -e multinode_command=run_tempest
355363
working-directory: ${{ github.workspace }}/terraform-kayobe-multinode
356-
if: inputs.upgrade
364+
if: inputs.upgrade != 'none'
357365

358366
- name: Download deployment logs
359367
run: |
@@ -366,7 +374,7 @@ jobs:
366374
- name: Print final lines of tmux log
367375
run: |
368376
tail -n 250 ${{ github.workspace }}/logs/tmux.kayobe:0.log
369-
if: ${{ failure() && steps.config_ach.outcome == 'success' }}
377+
if: ${{ always() && steps.config_ach.outcome == 'success' }}
370378

371379
# GitHub Actions does not accept filenames with certain characters, and
372380
# fails the upload-artifact action if any exist. The tmux log file
@@ -382,7 +390,7 @@ jobs:
382390
id: upload-results
383391
uses: actions/upload-artifact@v4
384392
with:
385-
name: test-results-multinode-${{ inputs.os_distribution }}-${{ inputs.os_release }}-${{ inputs.neutron_plugin }}${{ inputs.upgrade && '-upgrade' || '' }}
393+
name: test-results-multinode-${{ inputs.os_distribution }}-${{ inputs.os_release }}-${{ inputs.neutron_plugin }}${{ (inputs.upgrade != 'none') && '-upgrade' || '' }}
386394
path: |
387395
${{ github.workspace }}/logs/
388396
if: ${{ always() && steps.config_ach.outcome == 'success' }}

0 commit comments

Comments
 (0)