Commit Graph
29 Commits
Author SHA1 Message Date
nanxunandClaude Opus 4.8 1b3512042c ci: pass registry auth directly to buildx via --auth flag
The docker-container driver's buildkit session mechanism does not reliably
forward host Docker credentials to the buildkit container, causing every
docker buildx build --push to fail with 401 Unauthorized on the manifest
HEAD request.

Fix: remove the standalone Login Registry stage and embed withCredentials
directly into each build stage, passing credentials to buildkit via the
docker buildx build --auth flag:
  --auth 'reg.nxsir.cn=:'

This sends auth directly to buildkit rather than relying on the implicit
docker login -> config.json -> session forwarding chain.

Each stage also does a docker login for the host CLI (needed for
buildx inspect --bootstrap to pull images from the registry, and for
cache-from/cache-to operations).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:57:44 +08:00
nanxunandClaude Opus 4.8 fbf6b52a08 ci: drop NO_PROXY from buildkit driver-opt to avoid comma parsing in docker CLI
Docker buildx create --driver-opt splits values on commas as list
separators, causing 'env.NO_PROXY=127.0.0.1,localhost,...' to be parsed
as separate key=value entries and failing with:
  invalid value "localhost", expecting k=v

The NO_PROXY hosts for build containers are already passed via build-arg
in the build stage; the buildkit container itself doesn't need them.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:38:50 +08:00
nanxunandClaude Opus 4.8 293aa31f60 ci: login before Prepare Buildx to fix 401 Unauthorized push
Move Login Registry stage before Prepare Buildx so Docker credentials are
in /root/.docker/config.json BEFORE the buildx docker-container builder
is created and bootstrapped. Previously the builder started without auth,
causing buildx --push to fail with '401 Unauthorized' on the manifest
HEAD request (blob layers pushed but manifest rejected).

Also expand the NO_PROXY driver-opt from just 'reg.nxsir.cn' to the full
NO_PROXY_HOSTS list (Tsighua, MCR, daocloud) so the buildkit container
itself also bypasses the proxy for these direct-reachable registries.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:35:23 +08:00
nanxunandClaude Opus 4.8 1cb05292c0 ci: exclude direct-reachable mirrors from HTTP proxy to fix apt 502
The 7890 proxy intermittently returns '502 Bad Gateway' when tunneling to
mirrors.tuna.tsinghua.edu.cn (observed on libglapi-mesa during
apt-get install in the runtime layer). The Tsinghua mirror, MCR, and
daocloud are all directly reachable from this builder, so the proxy adds
no value and only introduces failure modes.

Add the following hosts to NO_PROXY_HOSTS so apt/curl inside the build
containers hit them directly:
  - mirrors.tuna.tsinghua.edu.cn, .tsinghua.edu.cn
  - mcr.microsoft.com
  - docker.m.daocloud.io

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 18:55:45 +08:00
nanxunandClaude Opus 4.8 fd1121bde0 ci: cap buildkit max-parallelism at 1 to avoid OOM on 4GB builder
Multi-platform buildx (linux/amd64 + linux/arm64) races both platforms in
parallel by default. On the 4GB build agent, QEMU-emulated 'dotnet restore'
for arm64 alone spikes to 2-3GB and racing amd64 apt-installs push us into
the OOM Killer ("cannot allocate memory" at build 4/5).

Fix: write a small buildkitd.toml with max-parallelism = 1 and pass it to
'docker buildx create --config'. buildkit now runs stages sequentially so
the two platforms don't step on each other's RSS.

Recreate the builder every run so the config always takes effect.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 18:49:39 +08:00
nanxunandClaude Opus 4.8 8a709bc217 ci: bypass Docker Hub for tonistiigi/binfmt in Prepare Buildx
The build agent cannot reach auth.docker.io from behind the local network,
causing 'docker run tonistiigi/binfmt --install arm64' to fail with a token
fetch timeout.

Fix: three-tier fallback for ARM64 binfmt registration:
  1. Skip if /proc/sys/fs/binfmt_misc/qemu-aarch64 already exists.
  2. Pull tonistiigi/binfmt via docker.m.daocloud.io mirror.
  3. Fall back to qemu-user-static via apt.

Add a post-registration sanity check (arm64 alpine + uname -m) so
misconfigured builders fail fast rather than at buildx invocation time.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 18:39:06 +08:00
nanxun f7fa02d13c fix: avoid jenkinsfile label mojibake 2026-05-31 19:53:01 +08:00
nanxun fd5be2cc8e ci: stabilize buildx heartbeat and cache 2026-05-31 16:48:35 +08:00
nanxun 9c2767f78c ci: restore polling heartbeat for buildx logs 2026-05-15 16:18:59 +08:00
nanxun d69c7d015e ci: stream buildx logs with tail heartbeat 2026-05-10 12:53:24 +08:00
nanxun 9e09c76a84 更新 Jenkinsfile 2026-05-08 20:33:03 +08:00
nanxun 96cfbf464f fix: surface buildx errors in jenkins heartbeat 2026-05-08 20:25:05 +08:00
nanxun 723bd3945e ci: move buildx heartbeat logs to tmp 2026-04-30 09:45:03 +08:00
nanxun 4ea250ae23 ci: keep buildx logs alive for jenkins 2026-04-30 02:40:03 +08:00
nanxun 2c05771c48 ci: reuse buildx builder cache 2026-04-25 00:25:44 +08:00
nanxun 6a96835e95 ci: use mirror images for web build 2026-04-24 19:54:14 +08:00
nanxun 2bf3c001c9 ci: use host network for buildx builder 2026-04-24 19:38:26 +08:00
nanxun c5c49d62bf ci: simplify buildx no-proxy config 2026-04-24 19:21:51 +08:00
nanxun 5279448fc7 ci: inline docker proxy settings 2026-04-24 19:18:40 +08:00
nanxun 8ae59a3b7a ci: inline docker proxy settings 2026-04-24 19:14:55 +08:00
nanxun fd6fed2474 ci: quote buildx driver opts 2026-04-24 19:11:26 +08:00
nanxun 35a31fdd79 ci: escape buildx no-proxy values 2026-04-24 19:08:24 +08:00
nanxun 8b605a32ca ci: configure docker build proxy 2026-04-24 19:02:44 +08:00
nanxun 1e48572321 更新 Jenkinsfile 2026-04-24 16:07:54 +08:00
nanxun 9b92834f81 更新 Jenkinsfile 2026-04-24 16:04:34 +08:00
nanxun 010ef6b068 更新 Jenkinsfile 2026-04-24 16:03:38 +08:00
nanxun b67ee45b48 更新 Jenkinsfile 2026-04-24 16:01:54 +08:00
nanxun 70f8fbf9bf 更新 Jenkinsfile 2026-04-24 16:00:20 +08:00
nanxun 6c651b6582 ci: add multi-arch docker pipeline 2026-04-23 23:43:20 +08:00