Skip to content

Commit 3f4ed03

Browse files
authored
Merge pull request #805 from stackhpc/fix/image-upload
Fix image sync workflow for new larger fat images
2 parents 4bcc614 + 63d918b commit 3f4ed03

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

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

Lines changed: 7 additions & 13 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
@@ -93,33 +94,26 @@ jobs:
9394
echo "TARGET_IMAGE=${TARGET_IMAGE}" >> "$GITHUB_ENV"
9495
shell: bash
9596

96-
- name: Clear up some space on runner
97-
run: |
98-
df -h
99-
sudo rm -rf /usr/share/dotnet
100-
sudo rm -rf /opt/ghc
101-
sudo rm -rf "/usr/local/share/boost"
102-
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
103-
sudo apt-get clean
104-
df -h
105-
10697
- name: Download image to runner
10798
run: |
10899
. venv/bin/activate
109-
openstack image save --file "${{ env.TARGET_IMAGE }}.raw" "${{ env.TARGET_IMAGE }}"
100+
df -h
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 }}"
110104
df -h
111105
shell: bash
112106

113107
- name: Convert image to QCOW2
114108
run: |
115109
. venv/bin/activate
116-
qemu-img convert -f raw -O qcow2 -c "${{ 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.RUNNER_IMAGE_DIR }}/${{ env.TARGET_IMAGE }}"
117111
shell: bash
118112

119113
- name: Upload Image to S3
120114
run: |
121115
echo "Uploading Image: ${{ env.TARGET_IMAGE }} to S3..."
122-
s3cmd --multipart-chunk-size-mb=150 put ${{ 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 }}
123117
shell: bash
124118

125119
image_sync:

0 commit comments

Comments
 (0)