문제: FE-GATE-013의 test:system은 provider sandbox를 실제로 띄운다. systemd user manager(systemd-run --user --scope)와 cgroup v2 위임, bubblewrap(--unshare-net 등)이 필요하다. runner의 job 컨테이너는 entrypoint가 sleep이라 systemd가 없고 bwrap도 없어 사전 점검에서 실패한다 (run 56·80·81). desktop 호스트는 다 있지만 Ubuntu 24.04의 apparmor_restrict_unprivileged_userns=1이 비특권 bwrap을 막는다. 그래서 이 게이트는 runner와 desktop 어디서도 초록인 적이 없다. 고른 방법(소유자 결정 2026-11-11 5절 e: 조건이 되는 실행 환경을 찾는다): - config/ci/system-container.Dockerfile: Ubuntu 24.04(digest 고정) + systemd PID 1 + root linger + bubblewrap 등 hostRequirements의 도구. - scripts/run-in-system-container.sh: 이미지(Dockerfile 해시 태그)가 없으면 만들고, privileged·자체 cgroup namespace로 띄워 systemd와 root user manager를 기다린 뒤, 작업 트리·git 이력·호출한 쪽의 node와 corepack을 복사해 명령을 root로 돌리고 artifacts/를 되가져온 다음 지운다. root는 호스트의 userns 제한을 받지 않는다. - gates.json 게이트 필드 hostEnvironment: "system-container"(FE-GATE-013). 생성기는 그 게이트의 run 줄에 래퍼를 붙이고, 실행 검사 (workflowGateExecutionFailures)는 계약이 정한 접두어로 돈 줄만 센다. scripts/verify.sh gate·parts·stage도 같은 래퍼로 돌린다. - CI에서는 runner의 Docker proxy로 안쪽 dind daemon을 쓴다(platform-core gitea-runner README가 「남은 위험」으로 적은 길: proxy가 privileged 컨테이너를 막지 않는다). - 버린 대안: 전용 VM runner(문서 조건을 그대로 만족하지만 platform-core 변경과 VM 자원·runner 등록이 필요), 호스트 AppArmor profile(호스트 userns 제한을 푸는 보안 설정 변경, 소유자 sudo). 위험·한계: - root로 돌아 「비특권 runner에서 bwrap userns」 조건 자체는 증명하지 않는다. release 단계 provider job 둘은 아직 job 컨테이너에서 돈다(범위 밖, 같은 래퍼나 VM runner가 필요). - runner가 rootless dind로 바뀌면 privileged 컨테이너를 못 띄워 깨진다. - 래퍼 준비(이미지 확인·기동·복사)에 desktop에서 50~60초가 든다. 검증(desktop): 래퍼로 check-system-test-prerequisites → PASS(root), tests/system/ci-runner/provider-process-group.test.ts 1개 통과. python3 -m unittest scripts.tests.test_verify 통과, check:ci PASS(게이트 28), ci-workflow-generation 시험 통과. 게이트 전체(test:system 116개 포함)는 이 브랜치 끝의 merge 단계에서 돈다.
17 lines
851 B
Docker
17 lines
851 B
Docker
# The host FE-GATE-013 runs on (scripts/run-in-system-container.sh): systemd as
|
|
# PID 1 with a lingering root user manager, cgroup v2 delegation, bubblewrap and
|
|
# the tools the provider sandbox calls (config/ci/gates.json hostRequirements).
|
|
# Node and pnpm are not installed here: the script copies in the caller's own,
|
|
# so the gate runs with the same versions as the job that called it.
|
|
FROM docker.io/library/ubuntu:24.04@sha256:fe81560990fae86dc4743202b2cb4d3df98d0bcf949173cecef15ce1127ef852
|
|
|
|
RUN apt-get update \
|
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
|
bubblewrap ca-certificates dbus dbus-user-session git systemd systemd-sysv tar util-linux \
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
&& mkdir -p /var/lib/systemd/linger \
|
|
&& touch /var/lib/systemd/linger/root
|
|
|
|
STOPSIGNAL SIGRTMIN+3
|
|
CMD ["/sbin/init"]
|