Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change FreeBSD CI runner #8437

Closed
sezero opened this issue Oct 25, 2023 · 6 comments
Closed

change FreeBSD CI runner #8437

sezero opened this issue Oct 25, 2023 · 6 comments

Comments

@sezero
Copy link
Contributor

sezero commented Oct 25, 2023

The current vmactions is a bootlooping disaster :
vmactions/freebsd-vm#74
.. and our CI runs timeout-fail most times.

mpv-player project seems to have switched to using
cross-platform-actions for freebsd:
mpv-player/mpv@71a497d
.. and its follow-up commits:
mpv-player/mpv@36403e5
mpv-player/mpv@48ac521

I tried doing this:

diff --git a/.github/workflows/vmactions.yml b/.github/workflows/vmactions.yml
index cdcf340..1581fc1 100644
--- a/.github/workflows/vmactions.yml
+++ b/.github/workflows/vmactions.yml
@@ -14,12 +14,13 @@ jobs:
     steps:
     - uses: actions/checkout@v3
     - name: Build
-      uses: vmactions/freebsd-vm@v0
+      uses: cross-platform-actions/[email protected]
       with:
-        mem: 8192
-        usesh: true
-        prepare: |
-          pkg install -y \
+        operating_system: freebsd
+        version: '13.2'
+        run: |
+          sudo pkg update
+          sudo pkg install -y \
               cmake \
               ninja \
               pkgconf \
@@ -48,8 +49,6 @@ jobs:
               ibus \
               libsamplerate \
               libudev-devd
-
-        run: |
           cmake -S . -B build -GNinja \
             -Wdeprecated -Wdev -Werror \
             -DCMAKE_BUILD_TYPE=Release \

I got a failure at first run attempt:

Setting up VM
  Downloading disk image: https://github.com/cross-platform-actions/freebsd-builder/releases/download/v0.5.0/freebsd-13.2-x86-64.qcow2
  Downloading hypervisor: https://github.com/cross-platform-actions/resources/releases/download/v0.9.1/xhyve-macos.tar
  Downloading resources: https://github.com/cross-platform-actions/resources/releases/download/v0.9.1/resources-macos.tar
  /usr/sbin/mkfile -n 40m /tmp/resourcesA8bsj5/res.raw
  /usr/bin/ssh-keygen -t ed25519 -f /tmp/resourcesA8bsj5/id_ed25519 -q -N 
  /usr/sbin/diskutil partitionDisk /dev/disk2 1 GPT fat32 RES 100%
  Downloaded file: /Users/runner/work/_temp/412d79b3-69eb-45c8-a04c-53c85aeccc8a
  Started partitioning on disk2
  Unmounting disk
  Creating the partition map
  Downloaded file: /Users/runner/work/_temp/1fda2994-5461-4a85-b764-9b35e4d1cea8
  Waiting for partitions to activate
  Formatting disk2s1 as MS-DOS (FAT32) with name RES
  512 bytes per physical sector
  /dev/rdisk2s1: 76594 sectors in 76594 FAT32 clusters (512 bytes/cluster)
  bps=512 spc=1 res=32 nft=2 mid=0xf8 spt=32 hds=16 hid=2048 drv=0x80 bsec=77824 bspf=599 rdcl=2 infs=1 bkbs=6
  Mounting disk
  Finished partitioning on disk2
  /usr/bin/sudo umount /Volumes/RES
  /usr/bin/hdiutil detach /dev/disk2
  hdiutil: couldn't eject "disk2" - Resource busy
  
  /Users/runner/work/_actions/cross-platform-actions/action/v0.19.1/webpack:/cross-platform-action/node_modules/@actions/exec/lib/toolrunner.js:574
                  error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  ^
  Error: The process '/usr/bin/hdiutil' failed with exit code 16
      at ExecState._setResult (/Users/runner/work/_actions/cross-platform-actions/action/v0.19.1/webpack:/cross-platform-action/node_modules/@actions/exec/lib/toolrunner.js:574:1)
      at ExecState.CheckComplete (/Users/runner/work/_actions/cross-platform-actions/action/v0.19.1/webpack:/cross-platform-action/node_modules/@actions/exec/lib/toolrunner.js:557:1)
      at ChildProcess.<anonymous> (/Users/runner/work/_actions/cross-platform-actions/action/v0.19.1/webpack:/cross-platform-action/node_modules/@actions/exec/lib/toolrunner.js:451:1)
      at ChildProcess.emit (node:events:513:28)
      at maybeClose (node:internal/child_process:1100:16)
      at Socket.<anonymous> (node:internal/child_process:458:11)
      at Socket.emit (node:events:513:28)
      at Pipe.<anonymous> (node:net:301:12)

But the second re-run succeeded build:
https://github.com/sezero/SDL/actions/runs/6643692249/job/18051835012
.. but finally failed in Tearing down VM phase with:
Error: The process '/usr/bin/rsync' failed with exit code 255

Lastly, I switched runner machine to ubuntu-latest instead of macos-12:

diff --git a/.github/workflows/vmactions.yml b/.github/workflows/vmactions.yml
index 1581fc1..7a89de8 100644
--- a/.github/workflows/vmactions.yml
+++ b/.github/workflows/vmactions.yml
@@ -10,3 +10,3 @@ jobs:
   freebsd:
-    runs-on: macos-12
+    runs-on: ubuntu-latest
     name: FreeBSD

.. and it built successfully:
https://github.com/sezero/SDL/actions/runs/6644052305/job/18052361726

@libsdl-org/a-team: What do you guys think?

@slouken
Copy link
Collaborator

slouken commented Oct 25, 2023

Yes please! :)

@icculus
Copy link
Collaborator

icculus commented Oct 25, 2023

The FreeBSD VM has been driving me nuts for awhile now, so I'm fine with this, but I'll defer to whatever @madebr thinks about this.

@sezero
Copy link
Contributor Author

sezero commented Oct 25, 2023

My current patch for SDL3:
sezero@7a5685c
Took ~22 minutes to finish.

My current patch for SDL2 / release-2.28.x:
sezero@2388c0e
Took ~30 minutes to finish where it hit the timeout, so I disabled static builds.
Will see how much time it takes now.
EDIT: It took 24 minutes to finish. (Maybe bump timeout from 30 to 35 mins to be safe?)

@madebr
Copy link
Contributor

madebr commented Oct 25, 2023

Your patches look perfect :)

@sezero
Copy link
Contributor Author

sezero commented Oct 25, 2023

Run times are long, but nothing to do about that. Pulling them in now.

@sezero
Copy link
Contributor Author

sezero commented Oct 25, 2023

Patches are in in all active branches. Closing.

@sezero sezero closed this as completed Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants