From b932d49b7ba7509f588aa3a968e47615510aaa0d Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Fri, 20 Nov 2026 07:29:20 +0900 Subject: [PATCH 1/4] =?UTF-8?q?ci(main):=20links=C2=B7vulnerabilities?= =?UTF-8?q?=EB=A5=BC=20=EB=B3=80=EC=88=98=EA=B0=80=20=EC=A0=95=ED=95=9C=20?= =?UTF-8?q?=EA=B0=80=EB=B2=BC=EC=9A=B4=20runner=EB=A1=9C=20=EB=B3=B4?= =?UTF-8?q?=EB=82=B8=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit runner가 desktop 하나라 두 템플릿 repo의 job이 한 줄로 선다. main push run에서 links(7~10초)와 vulnerabilities(17~41초)는 push 뒤 20~53분을 기다렸다가 몇 초 만에 끝난다(2026-11-19 run 6개). 두 job의 runs-on을 ${{ vars.LIGHT_RUNNER_LABEL || 'ubuntu-latest' }}로 바꾼다. 변수가 없으면 ubuntu-latest라 전과 같고, runner가 하나인 파생 프로젝트는 할 일이 없다. 변수가 있으면 그 라벨을 가진 두 번째 runner가 두 job을 맡는다. 두 job은 Gradle·Docker·브라우저를 쓰지 않는다. 라벨 고정은 파생 프로젝트에서 job이 영원히 기다려 버렸고, runs-on 목록은 Gitea가 모든 라벨을 가진 runner를 찾아(OR가 아님) 버렸다. 위험: 변수가 있는데 그 runner가 멈췄거나 꺼져 있으면 두 job은 기다리고 공유 runner로 넘어가지 않는다. 오래 끌 때는 변수를 지운다. schedule run에서 Gitea가 vars를 푸는지는 아직 못 봤다(못 풀면 ubuntu-latest로 돈다). 검증: 버린 probe 브랜치의 push run에서 Gitea 1.27이 vars를 풀어 job 라벨이 laptop-light, 없는 변수는 ubuntu-latest였다. 같은 두 job이 노트북 runner에서 초록이었다. scripts/verify.sh docs rc=0. --- .gitea/workflows/main.yml | 9 +++++++-- docs/build.md | 5 +++++ docs/upgrade/2026-11-light-runner.md | 21 +++++++++++++++++++++ docs/work/operate.md | 2 +- docs/work/reference/gates.md | 1 + 5 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 docs/upgrade/2026-11-light-runner.md diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index c4b17cd1..da9f9dd5 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -9,6 +9,11 @@ # using: the runner takes one job at a time, and the performance job is the last one in this file # (owner decision 2026-11-07; the job says why not `needs`). # +# Two jobs, `links` and `vulnerabilities`, run on the runner the Actions variable LIGHT_RUNNER_LABEL +# names, and on `ubuntu-latest` like every other job when the variable is not set (a repository with +# one runner sets nothing and nothing changes). Only jobs without Gradle, Docker or a browser go there: +# a second, smaller runner that takes them leaves the shared one to the heavy jobs. +# # Which lanes a stage means is decided by its Gradle task (build.gradle). The stage jobs (`main` # for the main and integration stages, `performance`) run them as one line; # `verifyStrictLaneStages` fails a pull request that changes that line, its condition, or adds a @@ -82,7 +87,7 @@ jobs: # Every committed Markdown link, external URLs included. A documentation check, so the main stage # (owner decision 2026-09-16); scripts/check-docs.py checks the relative links on every pull request. links: - runs-on: ubuntu-latest + runs-on: ${{ vars.LIGHT_RUNNER_LABEL || 'ubuntu-latest' }} timeout-minutes: 15 steps: - uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2 @@ -116,7 +121,7 @@ jobs: # The dependency tree against today's vulnerability database: new advisories appear without a # commit, so main and nightly scan again what the pull request scanned. vulnerabilities: - runs-on: ubuntu-latest + runs-on: ${{ vars.LIGHT_RUNNER_LABEL || 'ubuntu-latest' }} timeout-minutes: 20 steps: - uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2 diff --git a/docs/build.md b/docs/build.md index e83d983e..b897a014 100644 --- a/docs/build.md +++ b/docs/build.md @@ -205,6 +205,11 @@ drift하기 시작하면 그때 자동화한다. 진짜 항목을 상대로, 진 `main.yml`이 main 단계(`mainCheck`·`integrationCheck`·build-logic 시험·configuration cache·링크)와 nightly(행렬 job, compose smoke, 마지막에 `performanceCheck`)를, `release.yml`이 태그 단계를 돌린다. 무엇을 돌릴지는 Gradle 단계 태스크가 정하고, `verifyStrictLaneStages`가 단계 job의 모양을 지킨다. +- **runner.** job은 `runs-on: ubuntu-latest`로 공유 runner에서 돈다. `main.yml`의 `links`·`vulnerabilities` 둘만 + `runs-on: ${{ vars.LIGHT_RUNNER_LABEL || 'ubuntu-latest' }}`다. Actions 변수 `LIGHT_RUNNER_LABEL`이 없으면 전과 같다. + runner가 하나인 파생 프로젝트는 할 일이 없다. 변수가 있으면 그 라벨을 가진 두 번째 runner가 두 job을 맡고, 공유 + runner는 무거운 job만 받는다. 두 job은 Gradle·Docker·브라우저를 쓰지 않는다. 그 라벨의 runner가 없거나 멈춰 있으면 + 두 job은 기다린다. 공유 runner로 넘어가지 않는다. 변수를 지우면 다음 run부터 공유 runner로 돌아간다. --- diff --git a/docs/upgrade/2026-11-light-runner.md b/docs/upgrade/2026-11-light-runner.md new file mode 100644 index 00000000..6821322a --- /dev/null +++ b/docs/upgrade/2026-11-light-runner.md @@ -0,0 +1,21 @@ +# 업그레이드 안내 — 2026-11 가벼운 job용 runner 라벨 + +- 범위: `.gitea/workflows/main.yml`의 `links`·`vulnerabilities` job이 도는 runner. 코드·빌드·게이트의 내용은 그대로다. +- 근거: 소유자 결정(2026-11-20, 가벼운 job은 두 번째 runner로), `docs/build.md` 「CI 게이트 배선」의 runner 항목 + +## 1. 누가 읽나 + +이 템플릿을 `upstream` remote로 두고 merge해 받는 파생 서비스가 읽는다. runner가 하나인 서비스는 할 일이 없다. + +## 2. 바뀐 것과 할 일 + +| # | 바뀐 것 | 서비스가 할 일 | +| --- | --- | --- | +| 1 | `links`·`vulnerabilities`의 `runs-on`이 `ubuntu-latest`에서 `${{ vars.LIGHT_RUNNER_LABEL \|\| 'ubuntu-latest' }}`가 됐다. 변수가 없으면 전과 같다 | 없다. 두 번째 runner로 두 job을 보내려면 그 runner에 고유 라벨 하나를 주고, repo(또는 org) Actions 변수 `LIGHT_RUNNER_LABEL`에 그 라벨을 넣는다 | +| 2 | 변수가 있는데 그 라벨의 runner가 없거나 멈춰 있으면 두 job은 기다린다. 공유 runner로 넘어가지 않는다 | 그 runner를 오래 끌 때는 변수를 지운다. 다음 run부터 `ubuntu-latest`로 돈다 | +| 3 | 서비스가 `main.yml`의 두 job을 고쳤다면 merge에서 충돌이 난다 | 서비스의 고친 줄을 두고 `runs-on` 줄만 받는다 | + +## 3. 확인 + +- 변수가 없는 repo: main push run의 `links`·`vulnerabilities` job 라벨이 `ubuntu-latest`다(Gitea run 화면이나 `GET /repos/{owner}/{repo}/actions/runs/{run}/jobs`의 `labels`). +- 변수가 있는 repo: 같은 자리에 변수 값이 보이고, job 로그 머리의 runner 이름이 두 번째 runner다. diff --git a/docs/work/operate.md b/docs/work/operate.md index 51d370e8..055e3055 100644 --- a/docs/work/operate.md +++ b/docs/work/operate.md @@ -34,7 +34,7 @@ - desktop의 기존 checkout `~/workspace/clean-architecture-backend-template`은 여러 세션이 함께 쓴다. 그 `stash@{0}`는 소유자의 보관분이다. 건드리지 않는다. `git stash pop`·`drop`·`clear`와 이름 없는 `git stash`를 쓰지 않는다. - design-docs repo는 노트북 `~/workspace/desktop-server-git/design-docs`에 있다. - desktop 기본 셸은 zsh다. 파이프의 rc는 `bash -o pipefail -c '<명령> | tee <로그>'; echo "rc=$?"`로 받는다(zsh에는 `PIPESTATUS`가 없다). 자기 실행을 멈출 때는 시작할 때 남긴 PID로 `kill `를 쓴다. `pkill -f <경로>`는 그 경로가 든 ssh 명령줄 자신과도 맞아 세션을 끊는다. -- CI runner(2026-11-07): Gitea Actions가 켜졌고, desktop에 `desktop-runner` 하나(`gitea/runner` dind, `capacity: 1`, label `ubuntu-latest`)가 돈다. desktop은 12코어·31GB다. CI job은 공유 잠금을 쓰지 않으므로, 손으로 돌린 게이트가 느리면 `docker ps`로 runner job이 함께 도는지 본다. +- CI runner(2026-11-07): Gitea Actions가 켜졌고, desktop에 `desktop-runner` 하나(`gitea/runner` dind, `capacity: 1`, label `ubuntu-latest`)가 돈다. desktop은 12코어·31GB다. CI job은 공유 잠금을 쓰지 않으므로, 손으로 돌린 게이트가 느리면 `docker ps`로 runner job이 함께 도는지 본다. 노트북에는 가벼운 job용 `laptop-runner`(label `laptop-light`, capacity 1)가 있고, repo 변수 `LIGHT_RUNNER_LABEL=laptop-light`가 `main.yml`의 `links`·`vulnerabilities`를 그리로 보낸다(2026-11-20). 노트북이 뜨겁거나 바쁘거나 배터리로 돌면 감시가 새 job을 막고 화면에 알린다. 그동안 두 job은 기다린다. 상한·멈춤·끄기는 노트북의 `~/laptop-runner/README.md`이고, 변수를 지우면 두 job은 desktop으로 돌아간다. - runner의 job 컨테이너 안의 `localhost`는 dind 데몬이 띄운 서비스가 아니다. Testcontainers는 이것을 스스로 처리한다. compose로 띄운 서비스에 `localhost`로 붙는 job은 `scripts/ci/redis-topology.sh`처럼 포트를 넘겨야 한다. **`scripts/verify.sh`가 아래 절차를 한다.** `scripts/verify.sh <단계>`는 지금 작업 트리(커밋하지 않은 변경 포함)를 패치로 만들어 desktop에 보내고, 기준 커밋에서 새 worktree를 만들어 얹고, 트리 해시가 같은지 본 뒤 잠금 아래에서 단계를 돌리고, 로그를 `~/<브랜치 이름>-logs/<단계>.log`에 남기고, worktree를 지운다. push하지 않는다. 단계와 돌리는 명령은 [reference/gates.md](reference/gates.md) 1절이다. 아래는 스크립트가 하는 일이고, 스크립트를 쓸 수 없을 때(다른 기준 커밋, 단계 밖의 명령 하나) 손으로 한다. diff --git a/docs/work/reference/gates.md b/docs/work/reference/gates.md index 71cd899a..46224845 100644 --- a/docs/work/reference/gates.md +++ b/docs/work/reference/gates.md @@ -211,3 +211,4 @@ for k in tests skipped failures errors; do cat $(find "$x" -name 'TEST-*.xml') | 7. 실행 환경(Gitea)에서 돌지 않는 action·권한(`id-token`, ghcr, GitHub 의존성 그래프, `upload-artifact@v4` 이상)을 쓰지 않는다. 써야 하면 `github.server_url` 조건을 단다. 8. Gradle 밖 검사 스크립트는 `scripts/`(workflow만 부르면 `scripts/ci/`)에 두고, 머리 주석에 누가 부르는지(workflow·Gradle·사람·훅)를 적는다. 부르는 곳이 없는 검사 스크립트는 만들지 않는다. 같은 일을 하는 빌드 태스크가 있으면 거기에 넣는다. 스크립트의 시험은 `scripts/tests/`에 unittest로 둔다. `prCheck`의 `testDocumentChecks`가 PR마다 `python3 -m unittest discover -s scripts/tests`로 돌린다. 9. 같은 장치에서 결함이 두 라운드 연속 나오면 고치기 전에 그 장치가 필요한지 다시 본다([improve.md](../improve.md) 7절). +10. 새 job은 `runs-on: ubuntu-latest`다. `runs-on: ${{ vars.LIGHT_RUNNER_LABEL || 'ubuntu-latest' }}`(가벼운 job용 두 번째 runner)는 Gradle·Docker·Testcontainers·privileged 컨테이너·브라우저를 쓰지 않고 공유 runner에서 2분 안에 끝나는 job에만 쓴다. 지금은 `main.yml`의 `links`(7~10초)와 `vulnerabilities`(17~41초)다(2026-11-19 main push run 6개). 변수가 없으면 `ubuntu-latest`라 runner가 하나인 곳은 전과 같다. 그 job은 라벨의 runner가 멈추면 기다리므로, 결과가 급한 job에는 쓰지 않는다. -- 2.54.0 From 1b9fbeb8a8d4697bc52d60db1f96a0013e3f1f75 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Fri, 20 Nov 2026 07:37:52 +0900 Subject: [PATCH 2/4] =?UTF-8?q?chore(ledger):=20laptop-runner=20=EC=9E=91?= =?UTF-8?q?=EC=97=85=EC=9D=98=20=EC=98=88=EC=B8=A1=20=EC=A4=84=EC=9D=84=20?= =?UTF-8?q?=EB=8D=94=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/ledger/estimates.jsonl | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/ledger/estimates.jsonl b/docs/ledger/estimates.jsonl index fcc0be15..2c8a143b 100644 --- a/docs/ledger/estimates.jsonl +++ b/docs/ledger/estimates.jsonl @@ -19,3 +19,4 @@ {"schema": 1, "kind": "estimate", "task": "r9-group-a", "transcript": "70449164-6ab3-49a9-9bcd-a4281e2a0759", "started_at": "2026-11-13T07:00+09:00", "base": "d3a90479", "task_kind": "improve", "size": "large", "minutes": {"p30": 160, "p50": 240, "p80": 370}, "calls": {"p30": 250, "p50": 380, "p80": 570}, "output_tokens": {"p30": 200000, "p50": 320000, "p80": 490000}, "basis": "발견 31건·PR 3개, 손 판단 결정 약 8(전송별 인가 전달, graphql 하위 좌표, test profile 기동 거부, broadcaster 목적지, metrics registry 맞추기 등), desktop 검증 약 8회(leaf·pr 단계); 원값 300/450/700분·400/600/900호출·350k/550k/850k에 보정 0.53·0.63·0.58을 곱함", "recorded_at": "2026-11-13T06:52+09:00"} {"schema": 1, "kind": "actual", "task": "r9-group-a", "transcript": "70449164-6ab3-49a9-9bcd-a4281e2a0759", "minutes": 383, "active_minutes": 215, "calls": 2295, "output_tokens": 1973586, "within": "p50", "result": "done", "commits": ["0fded57c", "2f0aefad", "01caee3c", "75df7615", "a7f44d8a", "354b7fc9"], "why": "시간은 p50 안이고 호출·출력은 p80을 넘었다. 새 눈 리뷰 4라운드(발견 약 90건 모두 고침), main 두 번 이동(rebase·재검증), desktop 잠금 대기 중 실행 교체가 호출을 늘렸다", "recorded_at": "2026-11-13T19:15+09:00"} {"schema": 1, "kind": "estimate", "task": "be-ci-next", "transcript": "7f6aac72-543c-4f2a-a47c-550e4c727f99", "started_at": "2026-11-19T17:44+09:00", "base": "59349a2b", "task_kind": "operate+improve", "size": "medium", "minutes": {"p30": 106, "p50": 159, "p80": 254}, "calls": {"p30": 220, "p50": 315, "p80": 470}, "output_tokens": {"p30": 145000, "p50": 232000, "p80": 348000}, "basis": "PR 셋(links 인자, API surface 거절 RED/GREEN·verify.sh main, BE-1 측정·고침과 BE-4). 결정 셋, runner PR run 3개 이상·nightly 로그 대기. 선례 w2-be-ci-perf 실측 555분(p50의 3.9배). 손 예측 200/300/480분·350/500/750호출·250k/400k/600k에 보정 0.53·0.63·0.58을 곱함", "recorded_at": "2026-11-19T17:51+09:00"} +{"schema": 1, "kind": "estimate", "task": "laptop-runner", "transcript": "27674009-98d8-4e0c-8946-fb1e590c4128", "started_at": "2026-11-20T07:00:00+09:00", "base": "a68ff147be881f6ede908a286c0fbc1f963f2307", "task_kind": "operate", "size": "large", "minutes": {"p30": 66, "p50": 99, "p80": 165}, "calls": {"p30": 165, "p50": 230, "p80": 330}, "output_tokens": {"p30": 145000, "p50": 203000, "p80": 290000}, "basis": "large 선례 7건 실측 중앙값에서 출발, 손 결정 6개·검증 run 3~4개와 대기, 보정 시간 0.55·호출 0.66·출력 0.58 곱함", "recorded_at": "2026-11-20T07:30+09:00"} -- 2.54.0 From 162c37c9fe8d048b724faaed399d03e981a2542f Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Fri, 20 Nov 2026 07:52:44 +0900 Subject: [PATCH 3/4] =?UTF-8?q?ci(main):=20nightly=C2=B7=EC=88=98=EB=8F=99?= =?UTF-8?q?=20run=EC=9D=98=20=EA=B0=80=EB=B2=BC=EC=9A=B4=20job=EC=9D=80=20?= =?UTF-8?q?=EA=B3=B5=EC=9C=A0=20runner=EC=97=90=20=EB=91=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nightly는 04:00에 사람이 없을 때도 돈다. 그때 두 번째 runner(노트북)가 꺼져 있거나 멈춰 있으면 links·vulnerabilities가 아침까지 기다리고 nightly run이 끝나지 않는다. 그 시각의 공유 runner는 비어 있어 옮길 이득도 없다. runs-on 식에 github.event_name == 'push' 조건을 더해 push run만 변수의 라벨로 보내고, 다른 이벤트는 변수와 상관없이 ubuntu-latest로 둔다. 변수가 없으면 전과 같다. schedule run에서 vars가 풀리는지 모르던 점도 이 식으로는 상관없어진다. 문서도 맞춘다: 공유 runner가 「무거운 job만 받는다」는 말이 사실보다 넓어 지웠고(release.yml의 가벼운 job도 공유 runner에 있다), 가벼운 runner로 보낼 job에 자기 container: 옵션이 없어야 한다는 조건과 로그아웃이 돌던 job을 5초 만에 끊는다는 운영 주의를 더했다. 검증: probe 브랜치(b8757324)에서 같은 식이 push run에서 laptop-light로 풀려 노트북 runner에서 초록이었고, workflow_dispatch run에서는 ubuntu-latest로 풀렸다. scripts/verify.sh docs rc=0. --- .gitea/workflows/main.yml | 13 +++++++------ docs/build.md | 9 +++++---- docs/upgrade/2026-11-light-runner.md | 6 +++--- docs/work/operate.md | 2 +- docs/work/reference/gates.md | 2 +- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index da9f9dd5..c4c2a271 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -9,10 +9,11 @@ # using: the runner takes one job at a time, and the performance job is the last one in this file # (owner decision 2026-11-07; the job says why not `needs`). # -# Two jobs, `links` and `vulnerabilities`, run on the runner the Actions variable LIGHT_RUNNER_LABEL -# names, and on `ubuntu-latest` like every other job when the variable is not set (a repository with -# one runner sets nothing and nothing changes). Only jobs without Gradle, Docker or a browser go there: -# a second, smaller runner that takes them leaves the shared one to the heavy jobs. +# On a push, two jobs, `links` and `vulnerabilities`, run on the runner the Actions variable +# LIGHT_RUNNER_LABEL names. Nightly and manual runs, and every run when the variable is not set, keep +# them on `ubuntu-latest` like every other job: a repository with one runner sets nothing and nothing +# changes, and a nightly starts when nobody may be at that second runner while the shared one is free. +# Only jobs without Gradle, Docker or a browser go there (docs/work/reference/gates.md 7). # # Which lanes a stage means is decided by its Gradle task (build.gradle). The stage jobs (`main` # for the main and integration stages, `performance`) run them as one line; @@ -87,7 +88,7 @@ jobs: # Every committed Markdown link, external URLs included. A documentation check, so the main stage # (owner decision 2026-09-16); scripts/check-docs.py checks the relative links on every pull request. links: - runs-on: ${{ vars.LIGHT_RUNNER_LABEL || 'ubuntu-latest' }} + runs-on: ${{ github.event_name == 'push' && vars.LIGHT_RUNNER_LABEL || 'ubuntu-latest' }} timeout-minutes: 15 steps: - uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2 @@ -121,7 +122,7 @@ jobs: # The dependency tree against today's vulnerability database: new advisories appear without a # commit, so main and nightly scan again what the pull request scanned. vulnerabilities: - runs-on: ${{ vars.LIGHT_RUNNER_LABEL || 'ubuntu-latest' }} + runs-on: ${{ github.event_name == 'push' && vars.LIGHT_RUNNER_LABEL || 'ubuntu-latest' }} timeout-minutes: 20 steps: - uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2 diff --git a/docs/build.md b/docs/build.md index b897a014..47c36b10 100644 --- a/docs/build.md +++ b/docs/build.md @@ -206,10 +206,11 @@ drift하기 시작하면 그때 자동화한다. 진짜 항목을 상대로, 진 nightly(행렬 job, compose smoke, 마지막에 `performanceCheck`)를, `release.yml`이 태그 단계를 돌린다. 무엇을 돌릴지는 Gradle 단계 태스크가 정하고, `verifyStrictLaneStages`가 단계 job의 모양을 지킨다. - **runner.** job은 `runs-on: ubuntu-latest`로 공유 runner에서 돈다. `main.yml`의 `links`·`vulnerabilities` 둘만 - `runs-on: ${{ vars.LIGHT_RUNNER_LABEL || 'ubuntu-latest' }}`다. Actions 변수 `LIGHT_RUNNER_LABEL`이 없으면 전과 같다. - runner가 하나인 파생 프로젝트는 할 일이 없다. 변수가 있으면 그 라벨을 가진 두 번째 runner가 두 job을 맡고, 공유 - runner는 무거운 job만 받는다. 두 job은 Gradle·Docker·브라우저를 쓰지 않는다. 그 라벨의 runner가 없거나 멈춰 있으면 - 두 job은 기다린다. 공유 runner로 넘어가지 않는다. 변수를 지우면 다음 run부터 공유 runner로 돌아간다. + `runs-on: ${{ github.event_name == 'push' && vars.LIGHT_RUNNER_LABEL || 'ubuntu-latest' }}`다. Actions 변수 + `LIGHT_RUNNER_LABEL`이 없으면 전과 같다. runner가 하나인 파생 프로젝트는 할 일이 없다. 변수가 있으면 push run의 두 job을 + 그 라벨을 가진 두 번째 runner가 맡는다. nightly·수동 run의 두 job은 변수와 상관없이 공유 runner에서 돈다. 두 job은 + Gradle·Docker·브라우저를 쓰지 않는다. push run에서 그 라벨의 runner가 없거나 멈춰 있으면 두 job은 기다린다. 공유 + runner로 넘어가지 않는다. 변수를 지우면 다음 run부터 공유 runner로 돌아간다. --- diff --git a/docs/upgrade/2026-11-light-runner.md b/docs/upgrade/2026-11-light-runner.md index 6821322a..dccbe7a3 100644 --- a/docs/upgrade/2026-11-light-runner.md +++ b/docs/upgrade/2026-11-light-runner.md @@ -11,11 +11,11 @@ | # | 바뀐 것 | 서비스가 할 일 | | --- | --- | --- | -| 1 | `links`·`vulnerabilities`의 `runs-on`이 `ubuntu-latest`에서 `${{ vars.LIGHT_RUNNER_LABEL \|\| 'ubuntu-latest' }}`가 됐다. 변수가 없으면 전과 같다 | 없다. 두 번째 runner로 두 job을 보내려면 그 runner에 고유 라벨 하나를 주고, repo(또는 org) Actions 변수 `LIGHT_RUNNER_LABEL`에 그 라벨을 넣는다 | -| 2 | 변수가 있는데 그 라벨의 runner가 없거나 멈춰 있으면 두 job은 기다린다. 공유 runner로 넘어가지 않는다 | 그 runner를 오래 끌 때는 변수를 지운다. 다음 run부터 `ubuntu-latest`로 돈다 | +| 1 | `links`·`vulnerabilities`의 `runs-on`이 `ubuntu-latest`에서 `${{ github.event_name == 'push' && vars.LIGHT_RUNNER_LABEL \|\| 'ubuntu-latest' }}`가 됐다. 변수가 없으면 전과 같다. nightly·수동 run은 변수가 있어도 `ubuntu-latest`다 | 없다. push run의 두 job을 두 번째 runner로 보내려면 그 runner에 고유 라벨 하나를 주고, repo(또는 org) Actions 변수 `LIGHT_RUNNER_LABEL`에 그 라벨을 넣는다 | +| 2 | 변수가 있는데 그 라벨의 runner가 없거나 멈춰 있으면 push run의 두 job은 기다린다. 공유 runner로 넘어가지 않는다 | 그 runner를 오래 끌 때는 변수를 지운다. 다음 run부터 `ubuntu-latest`로 돈다 | | 3 | 서비스가 `main.yml`의 두 job을 고쳤다면 merge에서 충돌이 난다 | 서비스의 고친 줄을 두고 `runs-on` 줄만 받는다 | ## 3. 확인 - 변수가 없는 repo: main push run의 `links`·`vulnerabilities` job 라벨이 `ubuntu-latest`다(Gitea run 화면이나 `GET /repos/{owner}/{repo}/actions/runs/{run}/jobs`의 `labels`). -- 변수가 있는 repo: 같은 자리에 변수 값이 보이고, job 로그 머리의 runner 이름이 두 번째 runner다. +- 변수가 있는 repo: push run의 같은 자리에 변수 값이 보이고, job 로그 머리의 runner 이름이 두 번째 runner다. nightly run의 두 job은 `ubuntu-latest`다. diff --git a/docs/work/operate.md b/docs/work/operate.md index 055e3055..9146d62c 100644 --- a/docs/work/operate.md +++ b/docs/work/operate.md @@ -34,7 +34,7 @@ - desktop의 기존 checkout `~/workspace/clean-architecture-backend-template`은 여러 세션이 함께 쓴다. 그 `stash@{0}`는 소유자의 보관분이다. 건드리지 않는다. `git stash pop`·`drop`·`clear`와 이름 없는 `git stash`를 쓰지 않는다. - design-docs repo는 노트북 `~/workspace/desktop-server-git/design-docs`에 있다. - desktop 기본 셸은 zsh다. 파이프의 rc는 `bash -o pipefail -c '<명령> | tee <로그>'; echo "rc=$?"`로 받는다(zsh에는 `PIPESTATUS`가 없다). 자기 실행을 멈출 때는 시작할 때 남긴 PID로 `kill `를 쓴다. `pkill -f <경로>`는 그 경로가 든 ssh 명령줄 자신과도 맞아 세션을 끊는다. -- CI runner(2026-11-07): Gitea Actions가 켜졌고, desktop에 `desktop-runner` 하나(`gitea/runner` dind, `capacity: 1`, label `ubuntu-latest`)가 돈다. desktop은 12코어·31GB다. CI job은 공유 잠금을 쓰지 않으므로, 손으로 돌린 게이트가 느리면 `docker ps`로 runner job이 함께 도는지 본다. 노트북에는 가벼운 job용 `laptop-runner`(label `laptop-light`, capacity 1)가 있고, repo 변수 `LIGHT_RUNNER_LABEL=laptop-light`가 `main.yml`의 `links`·`vulnerabilities`를 그리로 보낸다(2026-11-20). 노트북이 뜨겁거나 바쁘거나 배터리로 돌면 감시가 새 job을 막고 화면에 알린다. 그동안 두 job은 기다린다. 상한·멈춤·끄기는 노트북의 `~/laptop-runner/README.md`이고, 변수를 지우면 두 job은 desktop으로 돌아간다. +- CI runner(2026-11-07): Gitea Actions가 켜졌고, desktop에 `desktop-runner` 하나(`gitea/runner` dind, `capacity: 1`, label `ubuntu-latest`)가 돈다. desktop은 12코어·31GB다. CI job은 공유 잠금을 쓰지 않으므로, 손으로 돌린 게이트가 느리면 `docker ps`로 runner job이 함께 도는지 본다. 노트북에는 가벼운 job용 `laptop-runner`(label `laptop-light`, capacity 1)가 있고, repo 변수 `LIGHT_RUNNER_LABEL=laptop-light`가 main push run의 `links`·`vulnerabilities`를 그리로 보낸다(2026-11-20, nightly·수동 run은 desktop). 노트북이 뜨겁거나 바쁘거나 배터리로 돌면 감시가 새 job을 막고 화면에 알린다. 그동안 두 job은 기다린다. 로그아웃·재부팅은 돌던 job을 5초 만에 끊으므로 먼저 `~/laptop-runner/PAUSE`를 만들고 job이 끝나길 기다린다. 상한·멈춤·끄기는 노트북의 `~/laptop-runner/README.md`이고, 변수를 지우면 두 job은 desktop으로 돌아간다. - runner의 job 컨테이너 안의 `localhost`는 dind 데몬이 띄운 서비스가 아니다. Testcontainers는 이것을 스스로 처리한다. compose로 띄운 서비스에 `localhost`로 붙는 job은 `scripts/ci/redis-topology.sh`처럼 포트를 넘겨야 한다. **`scripts/verify.sh`가 아래 절차를 한다.** `scripts/verify.sh <단계>`는 지금 작업 트리(커밋하지 않은 변경 포함)를 패치로 만들어 desktop에 보내고, 기준 커밋에서 새 worktree를 만들어 얹고, 트리 해시가 같은지 본 뒤 잠금 아래에서 단계를 돌리고, 로그를 `~/<브랜치 이름>-logs/<단계>.log`에 남기고, worktree를 지운다. push하지 않는다. 단계와 돌리는 명령은 [reference/gates.md](reference/gates.md) 1절이다. 아래는 스크립트가 하는 일이고, 스크립트를 쓸 수 없을 때(다른 기준 커밋, 단계 밖의 명령 하나) 손으로 한다. diff --git a/docs/work/reference/gates.md b/docs/work/reference/gates.md index 46224845..77ae8e51 100644 --- a/docs/work/reference/gates.md +++ b/docs/work/reference/gates.md @@ -211,4 +211,4 @@ for k in tests skipped failures errors; do cat $(find "$x" -name 'TEST-*.xml') | 7. 실행 환경(Gitea)에서 돌지 않는 action·권한(`id-token`, ghcr, GitHub 의존성 그래프, `upload-artifact@v4` 이상)을 쓰지 않는다. 써야 하면 `github.server_url` 조건을 단다. 8. Gradle 밖 검사 스크립트는 `scripts/`(workflow만 부르면 `scripts/ci/`)에 두고, 머리 주석에 누가 부르는지(workflow·Gradle·사람·훅)를 적는다. 부르는 곳이 없는 검사 스크립트는 만들지 않는다. 같은 일을 하는 빌드 태스크가 있으면 거기에 넣는다. 스크립트의 시험은 `scripts/tests/`에 unittest로 둔다. `prCheck`의 `testDocumentChecks`가 PR마다 `python3 -m unittest discover -s scripts/tests`로 돌린다. 9. 같은 장치에서 결함이 두 라운드 연속 나오면 고치기 전에 그 장치가 필요한지 다시 본다([improve.md](../improve.md) 7절). -10. 새 job은 `runs-on: ubuntu-latest`다. `runs-on: ${{ vars.LIGHT_RUNNER_LABEL || 'ubuntu-latest' }}`(가벼운 job용 두 번째 runner)는 Gradle·Docker·Testcontainers·privileged 컨테이너·브라우저를 쓰지 않고 공유 runner에서 2분 안에 끝나는 job에만 쓴다. 지금은 `main.yml`의 `links`(7~10초)와 `vulnerabilities`(17~41초)다(2026-11-19 main push run 6개). 변수가 없으면 `ubuntu-latest`라 runner가 하나인 곳은 전과 같다. 그 job은 라벨의 runner가 멈추면 기다리므로, 결과가 급한 job에는 쓰지 않는다. +10. 새 job은 `runs-on: ubuntu-latest`다. `runs-on: ${{ github.event_name == 'push' && vars.LIGHT_RUNNER_LABEL || 'ubuntu-latest' }}`(push run만 가벼운 job용 두 번째 runner로)는 Gradle·Docker·Testcontainers·privileged 컨테이너·브라우저·자기 `container:`를 쓰지 않고 공유 runner에서 2분 안에 끝나는 job에만 쓴다. 지금은 `main.yml`의 `links`(7~10초)와 `vulnerabilities`(17~41초)다(2026-11-19 main push run 6개). 변수가 없으면 `ubuntu-latest`라 runner가 하나인 곳은 전과 같다. nightly·수동 run은 사람이 없을 때도 돌기 때문에 공유 runner에 둔다. push run의 그 job은 라벨의 runner가 멈추면 기다리므로, 결과가 급한 job에는 쓰지 않는다. -- 2.54.0 From a1b6edccd08a6e1afdb7f3dd40a92d3882473081 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Fri, 20 Nov 2026 08:06:40 +0900 Subject: [PATCH 4/4] =?UTF-8?q?docs(operate):=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=95=84=EC=9B=83=20=EC=A0=84=20=EB=A9=88=EC=B6=A4=EC=9D=B4=20?= =?UTF-8?q?runner=EC=97=90=20=EB=8B=BF=EA=B8=B0=EA=B9=8C=EC=A7=80=2030?= =?UTF-8?q?=EC=B4=88=EB=A5=BC=20=EB=8D=94=20=EA=B8=B0=EB=8B=A4=EB=A6=B0?= =?UTF-8?q?=EB=8B=A4=EA=B3=A0=20=EC=A0=81=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit runner는 health check 결과를 30초까지 다시 쓰고 감시는 30초마다 판단한다. PAUSE를 만든 직후에는 아직 새 job을 받을 수 있어, 상태가 paused가 된 뒤 30초를 더 기다리라고 적는다. 검증: scripts/verify.sh docs rc=0. --- docs/work/operate.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/work/operate.md b/docs/work/operate.md index 9146d62c..749f35ef 100644 --- a/docs/work/operate.md +++ b/docs/work/operate.md @@ -34,7 +34,7 @@ - desktop의 기존 checkout `~/workspace/clean-architecture-backend-template`은 여러 세션이 함께 쓴다. 그 `stash@{0}`는 소유자의 보관분이다. 건드리지 않는다. `git stash pop`·`drop`·`clear`와 이름 없는 `git stash`를 쓰지 않는다. - design-docs repo는 노트북 `~/workspace/desktop-server-git/design-docs`에 있다. - desktop 기본 셸은 zsh다. 파이프의 rc는 `bash -o pipefail -c '<명령> | tee <로그>'; echo "rc=$?"`로 받는다(zsh에는 `PIPESTATUS`가 없다). 자기 실행을 멈출 때는 시작할 때 남긴 PID로 `kill `를 쓴다. `pkill -f <경로>`는 그 경로가 든 ssh 명령줄 자신과도 맞아 세션을 끊는다. -- CI runner(2026-11-07): Gitea Actions가 켜졌고, desktop에 `desktop-runner` 하나(`gitea/runner` dind, `capacity: 1`, label `ubuntu-latest`)가 돈다. desktop은 12코어·31GB다. CI job은 공유 잠금을 쓰지 않으므로, 손으로 돌린 게이트가 느리면 `docker ps`로 runner job이 함께 도는지 본다. 노트북에는 가벼운 job용 `laptop-runner`(label `laptop-light`, capacity 1)가 있고, repo 변수 `LIGHT_RUNNER_LABEL=laptop-light`가 main push run의 `links`·`vulnerabilities`를 그리로 보낸다(2026-11-20, nightly·수동 run은 desktop). 노트북이 뜨겁거나 바쁘거나 배터리로 돌면 감시가 새 job을 막고 화면에 알린다. 그동안 두 job은 기다린다. 로그아웃·재부팅은 돌던 job을 5초 만에 끊으므로 먼저 `~/laptop-runner/PAUSE`를 만들고 job이 끝나길 기다린다. 상한·멈춤·끄기는 노트북의 `~/laptop-runner/README.md`이고, 변수를 지우면 두 job은 desktop으로 돌아간다. +- CI runner(2026-11-07): Gitea Actions가 켜졌고, desktop에 `desktop-runner` 하나(`gitea/runner` dind, `capacity: 1`, label `ubuntu-latest`)가 돈다. desktop은 12코어·31GB다. CI job은 공유 잠금을 쓰지 않으므로, 손으로 돌린 게이트가 느리면 `docker ps`로 runner job이 함께 도는지 본다. 노트북에는 가벼운 job용 `laptop-runner`(label `laptop-light`, capacity 1)가 있고, repo 변수 `LIGHT_RUNNER_LABEL=laptop-light`가 main push run의 `links`·`vulnerabilities`를 그리로 보낸다(2026-11-20, nightly·수동 run은 desktop). 노트북이 뜨겁거나 바쁘거나 배터리로 돌면 감시가 새 job을 막고 화면에 알린다. 그동안 두 job은 기다린다. 로그아웃·재부팅은 돌던 job을 5초 만에 끊으므로 먼저 `~/laptop-runner/PAUSE`를 만들고, 상태가 paused가 된 뒤 30초를 더 기다리고(runner가 검사 결과를 30초까지 다시 쓴다), 돌던 job이 끝나길 기다린다. 상한·멈춤·끄기는 노트북의 `~/laptop-runner/README.md`이고, 변수를 지우면 두 job은 desktop으로 돌아간다. - runner의 job 컨테이너 안의 `localhost`는 dind 데몬이 띄운 서비스가 아니다. Testcontainers는 이것을 스스로 처리한다. compose로 띄운 서비스에 `localhost`로 붙는 job은 `scripts/ci/redis-topology.sh`처럼 포트를 넘겨야 한다. **`scripts/verify.sh`가 아래 절차를 한다.** `scripts/verify.sh <단계>`는 지금 작업 트리(커밋하지 않은 변경 포함)를 패치로 만들어 desktop에 보내고, 기준 커밋에서 새 worktree를 만들어 얹고, 트리 해시가 같은지 본 뒤 잠금 아래에서 단계를 돌리고, 로그를 `~/<브랜치 이름>-logs/<단계>.log`에 남기고, worktree를 지운다. push하지 않는다. 단계와 돌리는 명령은 [reference/gates.md](reference/gates.md) 1절이다. 아래는 스크립트가 하는 일이고, 스크립트를 쓸 수 없을 때(다른 기준 커밋, 단계 밖의 명령 하나) 손으로 한다. -- 2.54.0