ci(gates): browser job 컨테이너의 /dev/shm을 2 GB로 연다
frontend-quality-gates / merge / static checks (pull_request) Successful in 1m45s
frontend-quality-gates / merge / browser tests (pull_request) Successful in 7m53s
frontend-quality-gates / FE-GATE-017 / diagram-review (pull_request) Skipped
frontend-quality-gates / main / self-tests and removal drills (pull_request) Skipped
frontend-quality-gates / FE-GATE-014 / config-compatibility (pull_request) Skipped
frontend-quality-gates / FE-GATE-028 / manual-accessibility-review (pull_request) Skipped
frontend-quality-gates / FE-GATE-026 / lab-performance (pull_request) Skipped
frontend-quality-gates / FE-GATE-015 / immutable-release-candidate (pull_request) Skipped
frontend-quality-gates / external-vulnerability-provider (pull_request) Skipped
frontend-quality-gates / external-provenance-provider (pull_request) Skipped
frontend-quality-gates / promote-verified-immutable-candidate (pull_request) Skipped
frontend-quality-gates / deploy-promoted-release (pull_request) Skipped
frontend-quality-gates / merge / tests (pull_request) Successful in 15m11s
frontend-quality-gates / FE-GATE-019 / hosting-header (pull_request) Skipped
frontend-quality-gates / FE-GATE-021 / runbook-boot-config (pull_request) Skipped
frontend-quality-gates / FE-GATE-022 / runbook-chunk-mismatch (pull_request) Skipped
frontend-quality-gates / FE-GATE-023 / runbook-api-degradation (pull_request) Skipped
frontend-quality-gates / FE-GATE-024 / runbook-telemetry (pull_request) Skipped
frontend-quality-gates / FE-GATE-025 / runbook-release-rollback (pull_request) Skipped
frontend-quality-gates / FE-GATE-018 / field-web-vitals (pull_request) Skipped

CI job 컨테이너의 /dev/shm은 Docker 기본값 64 MB다. 그래서 앞 커밋의
Firefox RAM 프로필이 CI에서는 켜지지 않는다. 프로필은 runner 디스크에
남고, 이유가 한 줄 찍힌다. main run 266(ee95573f)도 같은 꼴로
빨갛다. FE-GATE-009 [firefox] generated-feature.spec.ts:380에서 첫
화면(로그인 heading) 5초 대기를 넘겼다.

생성기가 Playwright 이미지를 쓰는 job 컨테이너에
`options: "--shm-size=2g"`를 붙인다(BROWSER_JOB_SHARED_MEMORY). 2 GB는
Firefox worker 6개 프로필 합 최대 211 MB와 fixture가 요구하는 worker당
64 MB에 여유를 둔 값이다. job 메모리 상한 10 GB 안에서 쓴다.
ci-quality-gates.md에 한 줄을 적었다.

버린 대안: runner 설정 `container.options`에 같은 값을 두는 안(계획
D-4 (가))은 운영 설정이라 소유자 실행 묶음에 있다. 그것이 적용되면 이
줄은 지워도 된다.

위험·한계: runner는 `privileged: false`다. act_runner가 workflow의 이
옵션을 무시하면 프로필은 그대로 디스크에 남고, FE-GATE-008·009 로그에
「Firefox profiles stay on disk」 줄이 남는다. runner run에서 그 줄이
없는지로 확인한다.

검증(desktop): generate:ci-workflow로 workflow와 snapshot 갱신,
ci-browser-image·ci-workflow-generation 시험 449 passed, check:ci-workflow,
check:types:node, eslint, scripts/verify.sh docs, verify:documentation 통과.
This commit is contained in:
DongHyeonka
2026-11-13 19:34:18 +09:00
parent f81dda4913
commit c239bdf4d5
5 changed files with 27 additions and 4 deletions
+1
View File
@@ -175,6 +175,7 @@ jobs:
timeout-minutes: 45
container:
image: "mcr.microsoft.com/playwright:v1.62.0-noble@sha256:baed2032d533817f3dbe6425de795788430ba345e819a1201337009ba17c9d07"
options: "--shm-size=2g"
env:
CI_RUNNER_IMAGE: "mcr.microsoft.com/playwright:v1.62.0-noble@sha256:baed2032d533817f3dbe6425de795788430ba345e819a1201337009ba17c9d07"
steps:
+4 -1
View File
@@ -8,7 +8,10 @@
출력을 거절한다. `corepack pnpm check:ci`는 산출물 schema 검사, 타입이 있는 계약 검사기,
이 workflow drift 검사를 돈다. merge 단계는 job 셋(`merge_static`, `merge_test`,
`merge_browser`)으로 돌고 job마다 설치를 한 번 한다. 게이트마다 ID 이름의 step이 하나씩
있고, 실패한 게이트가 다음 게이트를 건너뛰게 하지 않는다.
있고, 실패한 게이트가 다음 게이트를 건너뛰게 하지 않는다. `merge_browser` 컨테이너는 `/dev/shm`을
2 GB로 연다(`--shm-size=2g`). Firefox 시험 프로필을 RAM에 두기 위해서다
(`tests/support/browser/browser-test.ts`). Docker 기본값 64 MB면 프로필이 runner 디스크에 남아
Firefox의 첫 localStorage 접근이 수 초씩 기다렸다.
merge job 셋만 의존성 캐시를 쓴다(권하는 안으로 정함 2026-11-13, 총괄). setup-node 앞에서
Node toolcache, corepack이 받은 pnpm, pnpm store와 메타데이터 캐시를 `.nvmrc`와
+17 -1
View File
@@ -210,7 +210,13 @@ function renderJob(
` timeout-minutes: ${job.timeoutMinutes}`,
);
const image = jobImage(job);
if (image) lines.push(" container:", ` image: ${yamlScalar(image)}`);
if (image) {
lines.push(
" container:",
` image: ${yamlScalar(image)}`,
` options: ${yamlScalar(`--shm-size=${BROWSER_JOB_SHARED_MEMORY}`)}`,
);
}
if (job.kind === "immutable") {
const archive = job.steps.find((step) => step.kind === "archive-candidate");
if (!archive || archive.kind !== "archive-candidate") throw new TypeError("immutable job lacks archive step");
@@ -291,6 +297,16 @@ function gateHostPrefix(gate: Readonly<{ hostEnvironment?: "system-container" |
return gate?.hostEnvironment === "system-container" ? "scripts/run-in-system-container.sh " : "";
}
/**
* /dev/shm of a browser job's container. Firefox's test profiles go there when
* it has room for every worker (tests/support/browser/browser-test.ts): with a
* profile on the runner's shared disk, Firefox's first localStorage access in
* a context waited up to 8.2 s and failed first-screen waits (FE-GATE-008 and
* FE-GATE-009, runs 127 and 266). Docker's default of 64 MB holds none; six
* Firefox workers' profiles peaked at 211 MB together (2026-11-13).
*/
export const BROWSER_JOB_SHARED_MEMORY = "2g";
/** The Playwright image a browser job runs in (`browser-install.image`), if any. */
function jobImage(job: CiWorkflowJob): string | undefined {
for (const step of job.steps) {
@@ -178,6 +178,7 @@ jobs:
timeout-minutes: 45
container:
image: "mcr.microsoft.com/playwright:v1.62.0-noble@sha256:baed2032d533817f3dbe6425de795788430ba345e819a1201337009ba17c9d07"
options: "--shm-size=2g"
env:
CI_RUNNER_IMAGE: "mcr.microsoft.com/playwright:v1.62.0-noble@sha256:baed2032d533817f3dbe6425de795788430ba345e819a1201337009ba17c9d07"
steps:
+4 -2
View File
@@ -3,7 +3,7 @@ import { readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
import { loadCiGateContract, PLAYWRIGHT_JOB_IMAGE_PATTERN } from "../../scripts/contracts/ci-gates.ts";
import { renderCiWorkflow } from "../../scripts/generate-ci-workflow.ts";
import { BROWSER_JOB_SHARED_MEMORY, renderCiWorkflow } from "../../scripts/generate-ci-workflow.ts";
/**
* merge_browser runs in Playwright's own image so it does not download the
@@ -36,7 +36,9 @@ describe("browser job image", () => {
const job = workflow.slice(workflow.indexOf(" merge_browser:\n"), workflow.indexOf(" release_gate:\n"));
expect(image?.kind === "browser-install" && image.image).toBeTruthy();
const ref = image?.kind === "browser-install" ? image.image! : "";
expect(job).toContain(` container:\n image: "${ref}"\n`);
expect(job).toContain(
` container:\n image: "${ref}"\n options: "--shm-size=${BROWSER_JOB_SHARED_MEMORY}"\n`,
);
expect(job).toContain(` env:\n CI_RUNNER_IMAGE: "${ref}"\n`);
expect(job).not.toContain("playwright install");
});