Compare commits

..
2 Commits
Author SHA1 Message Date
druppy 31264c17c9 Separate runner dir from persistent build dir; guard against self-sync
Build RPi image / build (push) Failing after 4m34s
2026-10-24 18:35:05 +02:00
druppy 4a645bab2d Target dedicated host runner (yocto label); YOCTO_HOME overridable via runner env 2026-10-24 18:18:01 +02:00
2 changed files with 35 additions and 23 deletions

No files matched your search

+30 -23
View File
@@ -2,16 +2,15 @@ name: Build RPi image
# Yocto (kas) build of rpilinux-image for raspberrypi4-64. # Yocto (kas) build of rpilinux-image for raspberrypi4-64.
# #
# Runner requirements (see chat/notes): # Runs on the dedicated host runner (label "yocto:host", Ryzen 9 box "ada").
# - matches the instance runner's "ubuntu-latest" label (bare label = job # Everything persists in $YOCTO_HOME: extern/ (layer clones) + build/ (sstate)
# runs on the runner's machine, i.e. a host job). Yocto needs ~250GB # survive between runs -> incremental builds after the first.
# persistent disk, so the runner must actually be a machine (or a # $YOCTO_HOME comes from the runner config (runner.envs.YOCTO_HOME =
# container with a big persistent volume), not a throwaway sandbox. # /home/bl/yocto-build, on the 1.8T disk); falls back to $HOME/yocto-build.
# - ~250GB free in $HOME, plus the poky host dependencies + node
# - runner.timeout >= 8h for the first build (runner default is 3h)
# #
# Upgrade path: register a dedicated runner with label "yocto:host" and # First build takes hours (poky fetch + full image) -> runner.timeout >= 8h.
# change runs-on below to "yocto". #
# First build takes hours (poky fetch + full image) -> runner.timeout >= 8h.
on: on:
push: push:
@@ -28,7 +27,7 @@ permissions:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: yocto
timeout-minutes: 600 timeout-minutes: 600
steps: steps:
- uses: builtin:checkout - uses: builtin:checkout
@@ -38,7 +37,7 @@ jobs:
echo "=== runner environment ===" echo "=== runner environment ==="
uname -a uname -a
[ -r /etc/os-release ] && . /etc/os-release && echo "$PRETTY_NAME" [ -r /etc/os-release ] && . /etc/os-release && echo "$PRETTY_NAME"
echo "HOME=$HOME nproc=$(nproc)" echo "HOME=$HOME workspace=$GITEA_WORKSPACE nproc=$(nproc)"
df -h "$HOME" | tail -1 df -h "$HOME" | tail -1
free -h 2>/dev/null | sed -n 2p || true free -h 2>/dev/null | sed -n 2p || true
command -v docker >/dev/null && docker info --format 'docker: {{.ServerVersion}}' 2>/dev/null || echo "no docker daemon" command -v docker >/dev/null && docker info --format 'docker: {{.ServerVersion}}' 2>/dev/null || echo "no docker daemon"
@@ -52,7 +51,7 @@ jobs:
echo "::error::Missing host tools:$missing" echo "::error::Missing host tools:$missing"
echo "Install on the runner host, e.g.:" echo "Install on the runner host, e.g.:"
echo ' sudo apt-get install -y --no-install-recommends build-essential \ echo ' sudo apt-get install -y --no-install-recommends build-essential \
bison chrpath curl diffstat file gawk git libpython3-dev libssl-dev \ bison flex chrpath curl diffstat file gawk git libpython3-dev libssl-dev \
make python3 python3-venv python3-pip python3-dev rsync swig unzip \ make python3 python3-venv python3-pip python3-dev rsync swig unzip \
wget xz-utils zstd bzip2 nodejs npm' wget xz-utils zstd bzip2 nodejs npm'
exit 1 exit 1
@@ -61,29 +60,37 @@ jobs:
- name: Set up kas (persistent venv) - name: Set up kas (persistent venv)
run: | run: |
set -e set -e
export YOCTO_HOME="$HOME/yocto-ci" export YOCTO_HOME="${YOCTO_HOME:-$HOME/yocto-build}"
mkdir -p "$YOCTO_HOME" mkdir -p "$YOCTO_HOME"
[ -d "$YOCTO_HOME/venv" ] || python3 -m venv "$YOCTO_HOME/venv" [ -d "$YOCTO_HOME/venv" ] || python3 -m venv "$YOCTO_HOME/venv"
"$YOCTO_HOME/venv/bin/pip" -q install -U kas "$YOCTO_HOME/venv/bin/pip" -q install -U kas
"$YOCTO_HOME/venv/bin/kas" --version "$YOCTO_HOME/venv/bin/kas" --version
- name: Sync to persistent project dir and build - name: Sync to persistent build dir and build
run: | run: |
set -euo pipefail set -euo pipefail
export YOCTO_HOME="$HOME/yocto-ci" export YOCTO_HOME="${YOCTO_HOME:-$HOME/yocto-build}"
# Persistent project dir: keeps extern/ (layer clones) and build/ SRC="$(pwd)"
# (sstate + tmp) between runs -> incremental builds after the first. DST="$YOCTO_HOME/yocto_rpi"
rsync -a --delete \ # Safety: builtin:checkout cleans ignored files (build/, extern/),
--exclude .git --exclude extern --exclude build \ # so the build tree must NOT be the ephemeral workspace.
./ "$YOCTO_HOME/yocto_rpi/" if [ "$SRC" = "$DST" ]; then
cd "$YOCTO_HOME/yocto_rpi" echo "::error::workspace == persistent dir ($SRC); keep the runner WorkingDirectory outside YOCTO_HOME"
git config --global --add safe.directory "$YOCTO_HOME/yocto_rpi" || true exit 1
fi
echo "syncing $SRC -> $DST"
mkdir -p "$DST"
# .git is copied (kas expects a git repo); extern/ and build/ exist
# only in DST and are excluded, so --delete cannot touch them.
rsync -a --delete --exclude /build/ --exclude /extern/ ./ "$DST/"
cd "$DST"
git config --global --add safe.directory "$DST" || true
"$YOCTO_HOME/venv/bin/kas" build "$YOCTO_HOME/venv/bin/kas" build
- name: Collect images - name: Collect images
run: | run: |
set -euo pipefail set -euo pipefail
export YOCTO_HOME="$HOME/yocto-ci" export YOCTO_HOME="${YOCTO_HOME:-$HOME/yocto-build}"
cd "$YOCTO_HOME/yocto_rpi" cd "$YOCTO_HOME/yocto_rpi"
IMG_DIR="build/*/tmp/deploy/images/raspberrypi4-64" IMG_DIR="build/*/tmp/deploy/images/raspberrypi4-64"
ls -lh $IMG_DIR ls -lh $IMG_DIR
+5
View File
@@ -0,0 +1,5 @@
// Folder-specific settings
//
// For a full list of overridable settings, and general information on folder-specific settings,
// see the documentation: https://zed.dev/docs/configuring-zed#settings-files
{}