Verified Commit cc6dee0a authored by Sven-Hendrik Haase's avatar Sven-Hendrik Haase
Browse files

Attempt to use tcg instead of kvm as qemu accelerator

In my tests, this slows down the builds from 4m to 10m per build BUT allows use build
on public non-kvm-enabled builders which gives us the ability to run random MRs on CI.
Additionally, we can now run many builds in parallel.
parent 97c2d3eb
...@@ -31,46 +31,22 @@ validate-packer: ...@@ -31,46 +31,22 @@ validate-packer:
build:cloud-qemu: build:cloud-qemu:
stage: build stage: build
tags:
- secure-kvm
before_script: before_script:
- pacman -Syu --needed --noconfirm packer qemu-headless - pacman -Syu --needed --noconfirm packer qemu-headless
script: script:
- packer build -parallel-builds=1 -var 'headless=true' -var 'write_zeroes=yes' -except=sign cloud.json - packer build -parallel-builds=1 -var 'write_zeroes=yes' -except=sign cloud.json
artifacts: artifacts:
name: "cloud-qemu" name: "cloud-qemu"
paths: paths:
- "release/Arch-Linux-x86_64-cloudimg-*.img" - "release/Arch-Linux-x86_64-cloudimg-*.img"
expire_in: 2d expire_in: 2d
resource_group: vm-build
build:vagrant-qemu: build:vagrant-qemu:
stage: build stage: build
tags:
- secure-kvm
before_script: before_script:
- pacman -Syu --needed --noconfirm packer qemu-headless - pacman -Syu --needed --noconfirm packer qemu-headless
script: script:
- packer build -parallel-builds=1 -var 'headless=true' -var 'write_zeroes=yes' -only=qemu local.json - packer build -parallel-builds=1 -var 'write_zeroes=yes' -only=qemu local.json
artifacts:
paths:
- "Arch-Linux-x86_64-libvirt-*.box"
expire_in: 3h
resource_group: vm-build
build:vagrant-virtualbox:
stage: build
tags:
- secure-virtualbox
before_script:
- pacman -Syu --needed --noconfirm packer virtualbox
script:
- packer build -parallel-builds=1 -var 'headless=true' -var 'write_zeroes=yes' -only=virtualbox-iso local.json
artifacts:
paths:
- "Arch-Linux-x86_64-virtualbox-*.box"
expire_in: 3h
resource_group: vm-build
publish: publish:
stage: publish stage: publish
...@@ -80,10 +56,8 @@ publish: ...@@ -80,10 +56,8 @@ publish:
before_script: before_script:
- pacman -Syu --needed --noconfirm qemu-headless virtualbox packer - pacman -Syu --needed --noconfirm qemu-headless virtualbox packer
script: script:
- packer build -force -parallel-builds=1 -var "vagrant_cloud_token=$VAGRANT_API_TOKEN" -var 'headless=true' -var 'write_zeroes=yes' -except=vmware-iso vagrant.json - packer build -parallel-builds=1 -var "vagrant_cloud_token=$VAGRANT_API_TOKEN" -var 'write_zeroes=yes' -except=vmware-iso vagrant.json
only: only:
refs:
- release
variables: variables:
- $SCHEDULED_PUBLISH == "TRUE" - $SCHEDULED_PUBLISH == "TRUE"
resource_group: vm-build resource_group: vm-build
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
"headless": "true", "headless": "true",
"write_zeroes": "", "write_zeroes": "",
"boot_wait": "60s", "boot_wait": "60s",
"accelerator": "",
"mirror": "" "mirror": ""
}, },
"builders": [ "builders": [
...@@ -26,6 +27,7 @@ ...@@ -26,6 +27,7 @@
"ssh_timeout": "10000s", "ssh_timeout": "10000s",
"shutdown_command": "sudo systemctl poweroff", "shutdown_command": "sudo systemctl poweroff",
"headless": "{{user `headless`}}", "headless": "{{user `headless`}}",
"accelerator": "{{user `accelerator`}}",
"qemuargs": [ "qemuargs": [
[ [
"-m", "-m",
......
{ {
"variables": { "variables": {
"iso_url": "https://mirror.pkgbuild.com/iso/latest/archlinux-{{isotime \"2006.01\"}}.01-x86_64.iso", "iso_url": "https://mirror.pkgbuild.com/iso/latest/archlinux-{{isotime \"2006.01\"}}.01-x86_64.iso",
...@@ -8,6 +9,7 @@ ...@@ -8,6 +9,7 @@
"headless": "true", "headless": "true",
"write_zeroes": "", "write_zeroes": "",
"boot_wait": "60s", "boot_wait": "60s",
"accelerator": "",
"mirror": "" "mirror": ""
}, },
"builders": [ "builders": [
...@@ -59,6 +61,7 @@ ...@@ -59,6 +61,7 @@
"ssh_timeout": "10000s", "ssh_timeout": "10000s",
"shutdown_command": "sudo systemctl poweroff", "shutdown_command": "sudo systemctl poweroff",
"headless": "{{user `headless`}}", "headless": "{{user `headless`}}",
"accelerator": "{{user `accelerator`}}",
"qemuargs": [ "qemuargs": [
[ [
"-m", "-m",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment