Skip to content

Commit d16ef50

Browse files
committed
test cuda nightly builds
1 parent 35048ac commit d16ef50

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

.github/workflows/fatimage.yml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ on:
1010
- LEAFCLOUD
1111
- SMS
1212
- ARCUS
13+
schedule:
14+
- cron: '0 0 * * *' # Run at midnight
1315

1416
jobs:
1517
openstack:
@@ -25,16 +27,16 @@ jobs:
2527
- RL8
2628
- RL9
2729
build:
28-
- openstack.openhpc
29-
- openstack.openhpc-cuda
30+
- openstack.rocky-latest
31+
- openstack.rocky-latest-cuda
3032
exclude:
3133
- os_version: RL8
32-
build: openstack.openhpc-cuda
34+
build: openstack.rocky-latest-cuda
3335

3436
env:
3537
ANSIBLE_FORCE_COLOR: True
3638
OS_CLOUD: openstack
37-
CI_CLOUD: ${{ github.event.inputs.ci_cloud }}
39+
CI_CLOUD: ${{ github.event.inputs.ci_cloud || vars.CI_CLOUD }}
3840
steps:
3941
- uses: actions/checkout@v2
4042

@@ -77,18 +79,12 @@ jobs:
7779
cd packer/
7880
packer init .
7981
80-
if [[ "${{ matrix.build }}" == *"cuda"* ]]; then
81-
SOURCE_IMAGE_NAME="rocky-latest-cuda"
82-
else
83-
SOURCE_IMAGE_NAME="rocky-latest"
84-
fi
85-
8682
PACKER_LOG=1 packer build \
8783
-on-error=${{ vars.PACKER_ON_ERROR }} \
8884
-only=${{ matrix.build }} \
89-
-var-file=$PKR_VAR_environment_root/${{ vars.CI_CLOUD }}.pkrvars.hcl \
90-
-var "source_image_name={\"${{ matrix.os_version }}\":\"${SOURCE_IMAGE_NAME}-${{ matrix.os_version }}\"}" \
85+
-var-file=$PKR_VAR_environment_root/${{ env.CI_CLOUD }}.pkrvars.hcl \
9186
openstack.pkr.hcl
87+
9288
env:
9389
PKR_VAR_os_version: ${{ matrix.os_version }}
9490

@@ -104,11 +100,23 @@ jobs:
104100
echo "image-name=${IMAGE_NAME}" >> "$GITHUB_OUTPUT"
105101
echo "image-id=$IMAGE_ID" >> "$GITHUB_OUTPUT"
106102
103+
- name: Delete old latest image
104+
run: |
105+
. venv/bin/activate
106+
IMAGE_COUNT=$(openstack image list --name ${{ steps.manifest.outputs.image-name }} -f value -c ID | wc -l)
107+
if [ "$IMAGE_COUNT" -gt 1 ]; then
108+
OLD_IMAGE_ID=$(openstack image list --sort created_at:asc --name "${{ steps.manifest.outputs.image-name }}" -f value -c ID | head -n 1)
109+
openstack image delete "$OLD_IMAGE_ID"
110+
else
111+
echo "Only one image exists, skipping deletion."
112+
fi
113+
107114
- name: Download image
108115
run: |
109116
. venv/bin/activate
110117
sudo mkdir /mnt/images
111118
sudo chmod 777 /mnt/images
119+
openstack image unset --property signature_verified "${{ steps.manifest.outputs.image-name }}"
112120
openstack image save --file /mnt/images/${{ steps.manifest.outputs.image-name }}.qcow2 ${{ steps.manifest.outputs.image-name }}
113121
114122
- name: Set up QEMU

0 commit comments

Comments
 (0)