From 19c7b0c300a1e13513e33cc86a453237b6d63d93 Mon Sep 17 00:00:00 2001 From: Adam Jensen Date: Sun, 12 Nov 2023 20:46:48 -0500 Subject: [PATCH] WIP: Replace vbox with qemu --- .github/workflows/build.yml | 36 ++++++++++++++++++++++-------------- Vagrantfile | 35 +++++++++++++++++++++++++++-------- 2 files changed, 49 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 967f883..7794d96 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,36 +1,44 @@ name: ci on: push: - tags: + # tags: schedule: - cron: "0 0 * * 1" workflow_dispatch: jobs: package-box: name: Package Vagrant Boxes - runs-on: macos-12 + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: box: - - fbsd_13_2 - - fbsd_12_4 + # - fbsd_12 + - fbsd_13 + # - fbsd_14 steps: - - name: Install Vagrant - run: brew install vagrant - - name: Cache Vagrant boxes - uses: actions/cache@v3 - with: - path: ~/.vagrant.d - key: ${{ matrix.box }}-vagrant-20231102-${{ hashFiles('Vagrantfile') }} - restore-keys: | - ${{ matrix.box }}-vagrant-20231102- + - name: Install Vagrant and QEMU + run: | + sudo apt-get install -qq -o=Dpkg::Use-Pty=0 moreutils + sudo chronic apt-get install -qq -o=Dpkg::Use-Pty=0 vagrant qemu-system virtualbox + # - name: Cache Vagrant boxes + # uses: actions/cache@v3 + # with: + # path: ~/.vagrant.d + # key: ${{ matrix.box }}-vagrant-20231102-${{ hashFiles('Vagrantfile') }} + # restore-keys: | + # ${{ matrix.box }}-vagrant-20231102- - uses: actions/checkout@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - name: Set up VM run: | + rm -rf ~/.vagrant + rm -rf ~/.vagrant.d vagrant plugin install vagrant-disksize + vagrant plugin install vagrant-qemu vagrant status - vagrant up ${{ matrix.box }} + vagrant up --provider libvirt ${{ matrix.box }} - name: Package box run: | vagrant package ${{ matrix.box }} --output ${{ matrix.box }}.box diff --git a/Vagrantfile b/Vagrantfile index 085c3c2..05f3776 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,13 +1,17 @@ Vagrant.configure("2") do |config| config.disksize.size = "16GB" - config.vm.define "fbsd_13_2" do |c| - c.vm.box = "freebsd/FreeBSD-13.2-STABLE" + config.vm.define "fbsd_12" do |c| + c.vm.box = "roboxes/freebsd12" end - config.vm.define "fbsd_12_4" do |c| - c.vm.box = "freebsd/FreeBSD-12.4-STABLE" - end + # config.vm.define "fbsd_13" do |c| + # c.vm.box = "roboxes/freebsd13" + # end + + # config.vm.define "fbsd_14" do |c| + # c.vm.box = "roboxes/freebsd14" + # end config.vm.synced_folder ".", "/vagrant", disabled: true @@ -65,9 +69,24 @@ Vagrant.configure("2") do |config| du -ah / | sort -r -h | head -25 SHELL - config.vm.provider "virtualbox" do |v| - v.memory = 8192 - v.cpus = 3 + config.vm.provider "libvirt" do |qe| + # v.memory = 8192 + # v.smp = 3 + # v.qemu_dir = "/usr/share/qemu" + # v.arch = "x86_64" + # v.machine = "q35" + # v.cpu = "qemu64" + # v.net_device = "virtio-net-pci" + + # qe.arch = "x86_64" + # qe.machine = "q35" + # qe.cpu = "max" + # qe.smp = "cpus=2,sockets=1,cores=2,threads=1" + # qe.net_device = "virtio-net-pci" + # qe.extra_qemu_args = %w(-accel tcg,thread=multi,tb-size=512) + # #qe.qemu_dir = "/usr/share/qemu" + # qe.qemu_dir = "/opt/homebrew/opt/qemu/share/qemu" + # qe.no_daemonize = true end config.vm.boot_timeout = 600