From 7e88f5a5b31472ff3654c788a7dd5ce7097691c7 Mon Sep 17 00:00:00 2001 From: Steve Brasier Date: Tue, 30 Sep 2025 19:18:24 +0000 Subject: [PATCH 1/3] move image download/conversion to runner's /mnt [no ci] --- .github/workflows/s3-image-sync.yml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/s3-image-sync.yml b/.github/workflows/s3-image-sync.yml index 43adf5072..f73885cea 100644 --- a/.github/workflows/s3-image-sync.yml +++ b/.github/workflows/s3-image-sync.yml @@ -93,33 +93,24 @@ jobs: echo "TARGET_IMAGE=${TARGET_IMAGE}" >> "$GITHUB_ENV" shell: bash - - name: Clear up some space on runner - run: | - df -h - sudo rm -rf /usr/share/dotnet - sudo rm -rf /opt/ghc - sudo rm -rf "/usr/local/share/boost" - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - sudo apt-get clean - df -h - - name: Download image to runner run: | . venv/bin/activate - openstack image save --file "${{ env.TARGET_IMAGE }}.raw" "${{ env.TARGET_IMAGE }}" + df -h + openstack image save --file "/mnt/${{ env.TARGET_IMAGE }}.raw" "${{ env.TARGET_IMAGE }}" df -h shell: bash - name: Convert image to QCOW2 run: | . venv/bin/activate - qemu-img convert -f raw -O qcow2 -c "${{ env.TARGET_IMAGE }}.raw" "${{ env.TARGET_IMAGE }}" + qemu-img convert -f raw -O qcow2 -c "/mnt/${{ env.TARGET_IMAGE }}.raw" "${{ env.TARGET_IMAGE }}" shell: bash - name: Upload Image to S3 run: | echo "Uploading Image: ${{ env.TARGET_IMAGE }} to S3..." - s3cmd --multipart-chunk-size-mb=150 put ${{ env.TARGET_IMAGE }} s3://${{ env.S3_BUCKET }} + s3cmd --multipart-chunk-size-mb=150 put "/mnt/${{ env.TARGET_IMAGE }}" s3://${{ env.S3_BUCKET }} shell: bash image_sync: From 4c36537ff3775429ece8c791f5c3be8c03296ff6 Mon Sep 17 00:00:00 2001 From: Steve Brasier Date: Tue, 30 Sep 2025 20:10:40 +0000 Subject: [PATCH 2/3] make image dir --- .github/workflows/s3-image-sync.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/s3-image-sync.yml b/.github/workflows/s3-image-sync.yml index f73885cea..b8629ebd3 100644 --- a/.github/workflows/s3-image-sync.yml +++ b/.github/workflows/s3-image-sync.yml @@ -9,6 +9,7 @@ on: env: S3_BUCKET: openhpc-images-prerelease IMAGE_PATH: environments/.stackhpc/tofu/cluster_image.auto.tfvars.json + RUNNER_IMAGE_DIR: /mnt/images permissions: contents: read @@ -97,20 +98,22 @@ jobs: run: | . venv/bin/activate df -h - openstack image save --file "/mnt/${{ env.TARGET_IMAGE }}.raw" "${{ env.TARGET_IMAGE }}" + sudo mkdir ${{ env.RUNNER_IMAGE_DIR }} + sudo chmod ugo=rwX ${{ env.RUNNER_IMAGE_DIR }} + openstack image save --file "${{ env.RUNNER_IMAGE_DIR }}/${{ env.TARGET_IMAGE }}.raw" "${{ env.TARGET_IMAGE }}" df -h shell: bash - name: Convert image to QCOW2 run: | . venv/bin/activate - qemu-img convert -f raw -O qcow2 -c "/mnt/${{ env.TARGET_IMAGE }}.raw" "${{ env.TARGET_IMAGE }}" + qemu-img convert -f raw -O qcow2 -c "${{ env.RUNNER_IMAGE_DIR }}/${{ env.TARGET_IMAGE }}.raw" "${{ env.TARGET_IMAGE }}" shell: bash - name: Upload Image to S3 run: | echo "Uploading Image: ${{ env.TARGET_IMAGE }} to S3..." - s3cmd --multipart-chunk-size-mb=150 put "/mnt/${{ env.TARGET_IMAGE }}" s3://${{ env.S3_BUCKET }} + s3cmd --multipart-chunk-size-mb=150 put "${{ env.RUNNER_IMAGE_DIR }}/${{ env.TARGET_IMAGE }}" s3://${{ env.S3_BUCKET }} shell: bash image_sync: From 63d918b7b0bc5c0ae0f534dd08c80199c24b15bf Mon Sep 17 00:00:00 2001 From: Steve Brasier Date: Wed, 1 Oct 2025 08:23:39 +0000 Subject: [PATCH 3/3] fix image upload --- .github/workflows/s3-image-sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/s3-image-sync.yml b/.github/workflows/s3-image-sync.yml index b8629ebd3..3489dc62e 100644 --- a/.github/workflows/s3-image-sync.yml +++ b/.github/workflows/s3-image-sync.yml @@ -107,7 +107,7 @@ jobs: - name: Convert image to QCOW2 run: | . venv/bin/activate - qemu-img convert -f raw -O qcow2 -c "${{ env.RUNNER_IMAGE_DIR }}/${{ env.TARGET_IMAGE }}.raw" "${{ env.TARGET_IMAGE }}" + qemu-img convert -f raw -O qcow2 -c "${{ env.RUNNER_IMAGE_DIR }}/${{ env.TARGET_IMAGE }}.raw" "${{ env.RUNNER_IMAGE_DIR }}/${{ env.TARGET_IMAGE }}" shell: bash - name: Upload Image to S3