Skip to content

Commit 4c36537

Browse files
committed
make image dir
1 parent 7e88f5a commit 4c36537

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/s3-image-sync.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
env:
1010
S3_BUCKET: openhpc-images-prerelease
1111
IMAGE_PATH: environments/.stackhpc/tofu/cluster_image.auto.tfvars.json
12+
RUNNER_IMAGE_DIR: /mnt/images
1213

1314
permissions:
1415
contents: read
@@ -97,20 +98,22 @@ jobs:
9798
run: |
9899
. venv/bin/activate
99100
df -h
100-
openstack image save --file "/mnt/${{ env.TARGET_IMAGE }}.raw" "${{ env.TARGET_IMAGE }}"
101+
sudo mkdir ${{ env.RUNNER_IMAGE_DIR }}
102+
sudo chmod ugo=rwX ${{ env.RUNNER_IMAGE_DIR }}
103+
openstack image save --file "${{ env.RUNNER_IMAGE_DIR }}/${{ env.TARGET_IMAGE }}.raw" "${{ env.TARGET_IMAGE }}"
101104
df -h
102105
shell: bash
103106

104107
- name: Convert image to QCOW2
105108
run: |
106109
. venv/bin/activate
107-
qemu-img convert -f raw -O qcow2 -c "/mnt/${{ env.TARGET_IMAGE }}.raw" "${{ env.TARGET_IMAGE }}"
110+
qemu-img convert -f raw -O qcow2 -c "${{ env.RUNNER_IMAGE_DIR }}/${{ env.TARGET_IMAGE }}.raw" "${{ env.TARGET_IMAGE }}"
108111
shell: bash
109112

110113
- name: Upload Image to S3
111114
run: |
112115
echo "Uploading Image: ${{ env.TARGET_IMAGE }} to S3..."
113-
s3cmd --multipart-chunk-size-mb=150 put "/mnt/${{ env.TARGET_IMAGE }}" s3://${{ env.S3_BUCKET }}
116+
s3cmd --multipart-chunk-size-mb=150 put "${{ env.RUNNER_IMAGE_DIR }}/${{ env.TARGET_IMAGE }}" s3://${{ env.S3_BUCKET }}
114117
shell: bash
115118

116119
image_sync:

0 commit comments

Comments
 (0)