Files
openwaf/.github/workflows/aot-probe.yml
T
Pavlo Ratushnyi e81f27e931
ci / the same smoke on an image with no base (push) Successful in 3m58s
ci / lint the workflow and the shell (push) Successful in 8s
ci / build, test, smoke (push) Successful in 2m6s
ci / the operator page in a real browser (push) Successful in 2m21s
ci / build the image and smoke it (push) Successful in 4m13s
the AOT probe clears the container a dead run left on the shared daemon
Run 2507: the static-link gate went green on x86-64 — `image size: 94.5MB`,
`binary bytes: 56351320`, `file says: … x86-64 … static-pie linked, stripped`,
`program headers naming an interpreter: 0`, `NEEDED shared objects: 0`,
`static: no interpreter, no NEEDED shared object`. The reporting step then died
at exit 125 on `Conflict. The container name "/aotprobe" is already in use` —
runs 2501 and 2503 aborted before their own teardown and left the container on a
daemon every later run shares. The step now removes the name before starting and
treats its own teardown as best-effort.
2026-10-06 09:42:44 +02:00

99 lines
5.1 KiB
YAML

# The NativeAOT relitigation, run on the architecture that ships it.
#
# Not a merge gate. `ci.yml` gates what ships; this one measures what does not
# ship yet, and it is the only place the x86-64 musl AOT build can be produced —
# the musl AOT ILC crashes under emulation on Apple Silicon, so a local build
# can only ever produce the arm64 half of the story.
#
# What it gates, and only this: that the AOT link is FULLY STATIC — no PT_INTERP,
# no NEEDED shared object — because that is the claim `Dockerfile.aot-probe`
# makes and the claim a scratch image depends on. A build that links against a
# shared libc would still produce a bootable-looking image and a silently
# different artifact.
#
# What it reports without gating: that the binary then refuses to start, because
# SQLitePCLRaw resolves libe_sqlite3 by dynamic loading and NativeAOT says
# "Dynamic loading not supported". Behind that wall sits the next one — EF's
# precompile-queries generator (docs/ARCHITECTURE.md, NativeAOT entry). Both are
# recorded here rather than argued, and both are why the shipped images are the
# chiseled and the self-contained-scratch ones.
name: aot-probe
on:
schedule:
- cron: '17 4 * * 1'
workflow_dispatch:
env:
IMAGE: openwaf-aot-probe:ci
jobs:
aot:
name: the static musl link, on x86-64
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Install Docker CLI + compose plugin
run: |
set -eu
if command -v docker >/dev/null 2>&1; then
echo "docker already present: $(docker --version)"
else
export DEBIAN_FRONTEND=noninteractive
apt-get update -qq
apt-get install -qq -y ca-certificates curl gnupg >/dev/null
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg \
| gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable" \
> /etc/apt/sources.list.d/docker.list
apt-get update -qq
apt-get install -qq -y docker-ce-cli docker-compose-plugin docker-buildx-plugin >/dev/null
fi
[ -S /var/run/docker.sock ] || { echo "no /var/run/docker.sock on this runner"; exit 1; }
# Two builds, one cache. The image build produces the artifact; the
# `--target build` build produces the stage that HOLDS the binary, and a
# `docker run` of the report script against it always executes — which is
# what the gate needs, since a cached build layer prints nothing (run 2503
# failed on exactly that).
- name: Build the AOT image and ask the binary whether it is static
run: |
set -eu
docker build -f Dockerfile.aot-probe -t "$IMAGE" --progress=plain . 2>&1 \
| tail -20
printf 'image size: %s\n' "$(docker image ls --format '{{.Size}}' "$IMAGE")"
docker build -f Dockerfile.aot-probe --target build -t openwaf-aot-build:ci . 2>&1 \
| tail -5
docker run --rm --entrypoint sh openwaf-aot-build:ci /report.sh
# Reported, not gated: what the binary does once it is running. It is
# expected to die, and the log line it dies with is the finding.
- name: Start it and record what it says
run: |
set -uo pipefail
# A run that died before its own teardown leaves the container behind on
# a shared daemon, and the next run then dies on the name rather than
# reporting anything (run 2507, exit 125: Conflict. The container name
# "/aotprobe" is already in use). Clear it first; there is nothing of
# this probe's worth keeping in it.
docker rm -f aotprobe >/dev/null 2>&1 || true
docker run -d --name aotprobe -p 18099:8080 \
-e OPENWAF_ADMIN_TOKEN=ci-only-throwaway \
-e ReverseProxy__Clusters__upstream__Destinations__upstream1__Address=http://127.0.0.1:1/ \
"$IMAGE" >/dev/null
sleep 20
docker inspect --format 'container state: {{.State.Status}} health: {{if .State.Health}}{{.State.Health.Status}}{{else}}no healthcheck{{end}}' aotprobe
# `|| true` on both greps: grep exits 1 when it matches nothing, and a
# zero count is a finding, not a step failure. Measured on run 2501,
# where the reporting step died on exactly that while the static-link
# gate above it had already passed (56,351,320-byte static-pie x86-64
# binary, 0 interpreters, 0 NEEDED, 94.5 MB image).
docker logs aotprobe 2>&1 | { grep -m1 -E 'Hosting failed to start|DllNotFoundException|Dynamic loading not supported' || echo 'no startup failure line found — that would be news worth reading'; }
docker logs aotprobe 2>&1 | { grep -c "Query wasn't precompiled and dynamic code isn't supported with NativeAOT" || true; } \
| sed 's/^/queries refused at run time: /'
docker rm -f aotprobe >/dev/null 2>&1 || true