Skip to content

Commit fa16e2d

Browse files
committed
swap to structured matrix vars
1 parent a9be849 commit fa16e2d

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

.github/workflows/nightlybuild.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,38 @@ jobs:
1717
openstack:
1818
name: openstack-imagebuild
1919
concurrency:
20-
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os_version }}-${{ matrix.build }} # to branch/PR + OS + build
20+
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.source_image.name }}-${{ matrix.inventory_groups.label }} # to branch/PR + OS + build
2121
cancel-in-progress: true
2222
runs-on: ubuntu-22.04
2323
strategy:
2424
fail-fast: false # allow other matrix jobs to continue even if one fails
2525
matrix:
26-
source_image_name:
27-
- Rocky-8-GenericCloud-Base-8.9-20231119.0.x86_64.qcow2
28-
- Rocky-9-GenericCloud-Base-9.4-20240523.0.x86_64.qcow2
26+
source_image:
27+
- label: RL8
28+
name: Rocky-8-GenericCloud-Base-8.9-20231119.0.x86_64.qcow2
29+
- label: RL9
30+
name: Rocky-9-GenericCloud-Base-9.4-20240523.0.x86_64.qcow2
2931
inventory_groups:
30-
- ["update", "ofed"]
31-
- ["update", "ofed", "cuda"]
32+
- label: ofed
33+
list: 'update,ofed'
34+
- label: cuda
35+
list: 'update,ofed,cuda'
3236
exclude:
33-
- source_image_name: Rocky-8-GenericCloud-Base-8.9-20231119.0.x86_64.qcow2
34-
inventory_groups: 'update,ofed,cuda'
37+
- source_image: {label: RL8}
38+
inventory_groups: {label: cuda}
3539
env:
3640
ANSIBLE_FORCE_COLOR: True
3741
OS_CLOUD: openstack
3842
CI_CLOUD: ${{ github.event.inputs.ci_cloud || vars.CI_CLOUD }}
3943
# set the image suffix to -latest for cron jobs or a branch name if manually-triggered
4044
IMAGE_NAME_SUFFIX: ${{ github.event_name == 'schedule' && 'latest' || github.ref_name }}
41-
4245

4346
steps:
4447
- uses: actions/checkout@v2
4548

4649
- name: Record settings for CI cloud
4750
run: |
4851
echo CI_CLOUD: ${{ env.CI_CLOUD }}
49-
echo IMAGE_NAME_SUFFIX: ${{ env.IMAGE_NAME_SUFFIX }}
5052
5153
- name: Setup ssh
5254
run: |
@@ -86,10 +88,10 @@ jobs:
8688
packer build \
8789
-on-error=${{ vars.PACKER_ON_ERROR }} \
8890
-var-file=$PKR_VAR_environment_root/${{ env.CI_CLOUD }}.pkrvars.hcl \
89-
-var source_image_name=${{ matrix.source_image_name }} \
90-
-var image_name_prefix=rocky-${{ matrix.os_version }} \
91+
-var source_image_name=${{ matrix.source_image.name }} \
92+
-var image_name=rocky-${{ matrix.source_image.label }}-${{ matrix.inventory_groups.label }} \
9193
-var image_name_suffix=${{ env.IMAGE_NAME_SUFFIX }} \
92-
-var inventory_groups=${{ matrix.inventory_groups }} \
94+
-var inventory_groups=${{ matrix.inventory_groups.list }} \
9395
openstack.pkr.hcl
9496
env:
9597
PACKER_LOG: '1'

packer/openstack.pkr.hcl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,9 @@ variable "inventory_groups" {
155155
# }
156156
# }
157157

158-
variable "image_name_prefix" {
158+
variable "image_name" {
159159
type = string
160-
description = "Prefix for built image names"
161-
# TODO: maybe we can just make this default to the first two parts of the source image name?
160+
description = "Built image name"
162161
default = "openhpc"
163162
}
164163

@@ -203,7 +202,7 @@ build {
203202

204203
source "source.openstack.openhpc" {
205204
name = "rocky-latest"
206-
image_name = "${var.image_name_prefix}-${local.image_name_suffix}"
205+
image_name = "${var.image_name}-${local.image_name_suffix}"
207206
}
208207

209208
provisioner "ansible" {

0 commit comments

Comments
 (0)