Skip to content

Commit 6b800fd

Browse files
Create raw image from fat image build for speed (#650)
* Test if upload as raw from volume is quicker * test raw fatimage on top of raw fat image * bump raw volume-backed images * convert image to qcow2 during sync workflow * test large runner * try qemu compression * free up space on runner * test raw 9.5 base image * Update rocky 8 to raw --------- Co-authored-by: bertiethorpe <[email protected]>
1 parent c902fe1 commit 6b800fd

File tree

4 files changed

+27
-8
lines changed

4 files changed

+27
-8
lines changed

.github/workflows/extra.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
- name: Make image usable for further builds
122122
run: |
123123
. venv/bin/activate
124-
openstack image unset --property signature_verified "${{ steps.manifest.outputs.image-id }}"
124+
openstack image unset --property signature_verified "${{ steps.manifest.outputs.image-id }}" || true
125125
126126
- name: Delete image for automatically-run workflows
127127
run: |

.github/workflows/fatimage.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
matrix: # build RL8, RL9
2424
build:
2525
- image_name: openhpc-RL8
26-
source_image_name: Rocky-8-GenericCloud-Base-8.10-20240528.0.x86_64.qcow2
26+
source_image_name: Rocky-8-GenericCloud-Base-8.10-20240528.0.x86_64.raw
2727
inventory_groups: control,compute,login,update
2828
- image_name: openhpc-RL9
29-
source_image_name: Rocky-9-GenericCloud-Base-9.5-20241118.0.x86_64.qcow2
29+
source_image_name: Rocky-9-GenericCloud-Base-9.5-20241118.0.x86_64.raw
3030
inventory_groups: control,compute,login,update
3131
env:
3232
ANSIBLE_FORCE_COLOR: True
@@ -102,7 +102,7 @@ jobs:
102102
- name: Make image usable for further builds
103103
run: |
104104
. venv/bin/activate
105-
openstack image unset --property signature_verified "${{ steps.manifest.outputs.image-id }}"
105+
openstack image unset --property signature_verified "${{ steps.manifest.outputs.image-id }}" || true
106106
107107
- name: Upload manifest artifact
108108
uses: actions/upload-artifact@v4

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

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626

2727
- name: Install s3cmd
2828
run: |
29+
sudo apt-get update
2930
sudo apt-get --yes install s3cmd
3031
3132
- name: Cleanup S3 bucket
@@ -75,20 +76,38 @@ jobs:
7576
echo "${{ secrets['ARCUS_S3_CFG'] }}" > ~/.s3cfg
7677
shell: bash
7778

78-
- name: Install s3cmd
79+
- name: Install s3cmd and qemu-utils
7980
run: |
80-
sudo apt-get --yes install s3cmd
81+
sudo apt-get update
82+
sudo apt-get --yes install s3cmd qemu-utils
8183
8284
- name: Retrieve image name
8385
run: |
8486
TARGET_IMAGE=$(jq --arg version "${{ matrix.build }}" -r '.cluster_image[$version]' "${{ env.IMAGE_PATH }}")
8587
echo "TARGET_IMAGE=${TARGET_IMAGE}" >> "$GITHUB_ENV"
8688
shell: bash
8789

90+
- name: Clear up some space on runner
91+
run: |
92+
df -h
93+
sudo rm -rf /usr/share/dotnet
94+
sudo rm -rf /opt/ghc
95+
sudo rm -rf "/usr/local/share/boost"
96+
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
97+
sudo apt-get clean
98+
df -h
99+
88100
- name: Download image to runner
89101
run: |
90102
. venv/bin/activate
91-
openstack image save --file ${{ env.TARGET_IMAGE }} ${{ env.TARGET_IMAGE }}
103+
openstack image save --file "${{ env.TARGET_IMAGE }}.raw" "${{ env.TARGET_IMAGE }}"
104+
df -h
105+
shell: bash
106+
107+
- name: Convert image to QCOW2
108+
run: |
109+
. venv/bin/activate
110+
qemu-img convert -f raw -O qcow2 -c "${{ env.TARGET_IMAGE }}.raw" "${{ env.TARGET_IMAGE }}"
92111
shell: bash
93112

94113
- name: Upload Image to S3

packer/openstack.pkr.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ source "openstack" "openhpc" {
178178
ssh_bastion_private_key_file = var.ssh_bastion_private_key_file
179179

180180
# Output image:
181-
image_disk_format = "qcow2"
181+
image_disk_format = "raw"
182182
image_visibility = var.image_visibility
183183

184184
}

0 commit comments

Comments
 (0)