ci / lint the workflow and the shell (push) Successful in 10s
ci / the operator page in a real browser (push) Successful in 2m36s
ci / the same smoke on an image with no base (push) Successful in 4m4s
ci / build the image and smoke it (push) Successful in 4m4s
ci / build, test, smoke (push) Successful in 2m19s
Run 2503 turned a good artifact red: the publish layer was cached, the report layer was cached with it, the build log carried no report lines, and the gate that greps that log found nothing to match. The report is now a script (scripts/aot-link-report.sh) that the build stage copies in and runs, and that CI runs again with `docker run --entrypoint sh … /report.sh` — a container start is never cached, so the gate asks the binary. It exits non-zero when the link names an interpreter or needs a shared object, which is the one claim a scratch layer depends on. Verified here: the script prints `binary bytes: 56820992`, `static-pie linked`, `program headers naming an interpreter: 0`, `NEEDED shared objects: 0`, `static: no interpreter, no NEEDED shared object`, exit 0 — both as a build step and as a `docker run`. .dockerignore keeps `scripts/` out of the context and now makes one named exception for it.
93 lines
4.7 KiB
YAML
93 lines
4.7 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
|
|
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
|