Skip to content

Commit 4199bf0

Browse files
committed
ensure qemu
Signed-off-by: Jeffrey Sica <me@jeefy.dev>
1 parent 1586998 commit 4199bf0

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

.github/workflows/change-file-build-new-actions-vm.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,21 @@ on:
1111
jobs:
1212
build:
1313
name: Build new Actions VM
14-
runs-on: ubuntu-latest
14+
runs-on: ubuntu-latest-8-cores
1515

1616
steps:
1717
- uses: actions/checkout@v4
1818
- name: Setup Go
1919
uses: actions/setup-go@v5
2020
with:
2121
go-version: '1.24.x'
22+
- name: Set up QEMU
23+
run : |
24+
sudo apt install qemu-system-x86 xorriso
25+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
26+
sudo udevadm control --reload-rules
27+
sudo udevadm trigger --name-match=kvm
28+
2229
- name: Install dependencies
2330
run: cd ci/gha-runner-vm && go get .
2431
- name: Install Packer
@@ -54,4 +61,4 @@ jobs:
5461
OCI_CLI_KEY_CONTENT: ${{ secrets.OCI_CLI_KEY_CONTENT }}
5562
OCI_CLI_REGION: ${{ secrets.OCI_CLI_REGION }}
5663
OCI_INSTANCE_ID: ${{ secrets.OCI_INSTANCE_ID }}
57-
run: export PATH=$PATH:$HOME/bin && cd ci/gha-runner-vm && go run main.go
64+
run: export PATH=$PATH:$HOME/bin && cd ci/gha-runner-vm && PACKER_LOG=1 go run main.go

.github/workflows/periodic-build-new-actions-vm.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,20 @@ on:
66

77
jobs:
88
build:
9-
runs-on: ubuntu-latest
9+
runs-on: ubuntu-latest-8-cores
1010

1111
steps:
1212
- uses: actions/checkout@v4
1313
- name: Setup Go
1414
uses: actions/setup-go@v5
1515
with:
1616
go-version: '1.24.x'
17+
- name: Set up QEMU
18+
run : |
19+
sudo apt install qemu-system-x86 xorriso
20+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
21+
sudo udevadm control --reload-rules
22+
sudo udevadm trigger --name-match=kvm
1723
- name: Install dependencies
1824
run: cd ci/gha-runner-vm && go get .
1925
- name: Install Packer
@@ -50,4 +56,4 @@ jobs:
5056
OCI_CLI_KEY_CONTENT: ${{ secrets.OCI_CLI_KEY_CONTENT }}
5157
OCI_CLI_REGION: ${{ secrets.OCI_CLI_REGION }}
5258
OCI_INSTANCE_ID: ${{ secrets.OCI_INSTANCE_ID }}
53-
run: export PATH=$PATH:$HOME/bin && cd ci/gha-runner-vm && go run main.go
59+
run: export PATH=$PATH:$HOME/bin && cd ci/gha-runner-vm && PACKER_LOG=1 go run main.go

ci/gha-runner-vm/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func main() {
5252
func run(cmd *cobra.Command, argv []string) error {
5353
filepath := "images/ubuntu/templates/"
5454
sourceFile := fmt.Sprintf("%s%s-%s.pkr.hcl", filepath, args.os, args.osVersion)
55-
imageFile := fmt.Sprintf("build/%s-%s/image.raw", args.os, args.osVersion)
55+
imageFile := fmt.Sprintf("build/image.raw")
5656
filename := ""
5757
imageName := fmt.Sprintf("%s-%s-%s-gha-image", args.os, args.osVersion, args.arch)
5858

@@ -346,7 +346,7 @@ source "qemu" "img" {
346346
iso_url = "%s"
347347
iso_checksum = "%s"
348348
memory = 12000
349-
cpus = 3
349+
cpus = 6
350350
output_directory = "build/"
351351
accelerator = "kvm"
352352
disk_size = "80G"
@@ -358,6 +358,7 @@ source "qemu" "img" {
358358
ssh_username = "ubuntu"
359359
ssh_password = "ubuntu"
360360
ssh_timeout = "60m"
361+
headless = true
361362
}`, args.isoURL, args.isoChecksum)
362363

363364
replacements[`sources = ["source.azure-arm.build_image"]`] = `sources = ["source.azure-arm.build_image", "source.qemu.img"]

0 commit comments

Comments
 (0)