From 1a398a5a61929ba148f743dad485613f68e376d4 Mon Sep 17 00:00:00 2001 From: Yoann Lecuyer Date: Mon, 16 Mar 2026 23:02:12 +0100 Subject: [PATCH 1/4] Ci: Add smoler tests --- .github/workflows/main.yml | 55 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 355b4f4..4cf06e7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,6 +8,7 @@ on: - '**.md' - 'www/**' - 'app/**' + pull_request: workflow_dispatch: inputs: img: @@ -33,6 +34,7 @@ on: jobs: build_img: + if: github.event_name != 'pull_request' runs-on: ubuntu-latest container: image: debian:latest @@ -77,3 +79,56 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + smoler_registry_test: + runs-on: ubuntu-latest + services: + registry: + image: registry:2 + ports: + - 5000:5000 + env: + REGISTRY_STORAGE: inmemory + options: >- + --health-cmd "wget --quiet --spider http://127.0.0.1:5000/v2/ || exit 1" + --health-interval 5s + --health-timeout 3s + --health-retries 20 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install build dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + bmake \ + curl \ + gdisk \ + jq \ + libarchive-tools \ + qemu-system-x86 \ + rsync \ + socat + + - name: Build Dockerfiles with smoler + run: | + for dockerfile in dockerfiles/Dockerfile.*; do + echo "Building ${dockerfile}" + ./smoler.sh build -y "${dockerfile}" + done + + - name: Push and pull image through in-memory registry + env: + SMOLREPO: localhost:5000/smolbsd + ORAS_PLAIN_HTTP: "true" + run: | + image="images/basic-amd64:latest.img" + test -f "${image}" + + ./smoler.sh push "${image}" + + rm -f "${image}" + ./smoler.sh pull basic-amd64:latest + + test -f "${image}" + From 34c4e5bd4d700fb57d222b6d3b55567227d53d08 Mon Sep 17 00:00:00 2001 From: Yoann Lecuyer Date: Mon, 16 Mar 2026 22:36:43 +0100 Subject: [PATCH 2/4] Fix: no tag for the builder image on linux. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8885018..c703efd 100644 --- a/Makefile +++ b/Makefile @@ -161,7 +161,7 @@ base: buildimg: $Qecho "${ARROW} building the builder image" $Qrm -f tmp/* - $Q${MAKE} SERVICE=build base + $Q${MAKE} SERVICE=build IMGTAG= base fetchimg: $Qecho "${ARROW} fetching builder image" From 8f019c6a124acfeae8032a93c349d9cf01e2522d Mon Sep 17 00:00:00 2001 From: Yoann Lecuyer Date: Mon, 16 Mar 2026 23:08:24 +0100 Subject: [PATCH 3/4] no kvm in qemu :( --- .github/workflows/main.yml | 2 ++ startnb.sh | 22 ++++++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4cf06e7..654f48b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -81,6 +81,8 @@ jobs: smoler_registry_test: runs-on: ubuntu-latest + env: + QEMU_ACCEL: tcg services: registry: image: registry:2 diff --git a/startnb.sh b/startnb.sh index 82449b1..73e0b71 100755 --- a/startnb.sh +++ b/startnb.sh @@ -132,15 +132,29 @@ fi cputype="host" +# allow forcing a specific accelerator (for CI or restricted hosts) +if [ -n "${QEMU_ACCEL}" ]; then + accel="-accel ${QEMU_ACCEL}" + [ "${QEMU_ACCEL}" = "tcg" ] && cputype="qemu64" +fi + case $OS in NetBSD) - accel="-accel nvmm" + [ -z "$accel" ] && accel="-accel nvmm" ;; Linux) - accel="-accel kvm" + if [ -z "$accel" ]; then + if [ -c /dev/kvm ] && [ -r /dev/kvm ] && [ -w /dev/kvm ]; then + accel="-accel kvm" + else + accel="-accel tcg" + cputype="qemu64" + echo "${WARN} KVM unavailable, falling back to TCG" + fi + fi ;; Darwin) - accel="-accel hvf" + [ -z "$accel" ] && accel="-accel hvf" if [ "$arch" = "evbarm-aarch64" ]; then # Mac M1, M2, M3, M4 cputype="cortex-a57" @@ -150,7 +164,7 @@ Darwin) fi ;; OpenBSD|FreeBSD) - accel="-accel tcg" # unaccelerated + [ -z "$accel" ] && accel="-accel tcg" # unaccelerated cputype="qemu64" ;; *) From 090fece5833b7a9f2d4df7a2e760c19fb70441f2 Mon Sep 17 00:00:00 2001 From: Yoann Lecuyer Date: Mon, 16 Mar 2026 23:22:20 +0100 Subject: [PATCH 4/4] Revert "Fix: no tag for the builder image on linux." This reverts commit 34c4e5bd4d700fb57d222b6d3b55567227d53d08. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c703efd..8885018 100644 --- a/Makefile +++ b/Makefile @@ -161,7 +161,7 @@ base: buildimg: $Qecho "${ARROW} building the builder image" $Qrm -f tmp/* - $Q${MAKE} SERVICE=build IMGTAG= base + $Q${MAKE} SERVICE=build base fetchimg: $Qecho "${ARROW} fetching builder image"