ci(main): links·vulnerabilities를 변수가 정한 가벼운 runner로 보낸다 #57
@@ -9,6 +9,12 @@
|
||||
# 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`).
|
||||
#
|
||||
# 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;
|
||||
# `verifyStrictLaneStages` fails a pull request that changes that line, its condition, or adds a
|
||||
@@ -82,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: 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
|
||||
@@ -116,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: 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
|
||||
|
||||
@@ -205,6 +205,12 @@ 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: ${{ 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로 돌아간다.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -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"}
|
||||
|
||||
@@ -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`에서 `${{ 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: push run의 같은 자리에 변수 값이 보이고, job 로그 머리의 runner 이름이 두 번째 runner다. nightly run의 두 job은 `ubuntu-latest`다.
|
||||
@@ -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 <PID>`를 쓴다. `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 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절이다. 아래는 스크립트가 하는 일이고, 스크립트를 쓸 수 없을 때(다른 기준 커밋, 단계 밖의 명령 하나) 손으로 한다.
|
||||
|
||||
@@ -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: ${{ 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에는 쓰지 않는다.
|
||||
|
||||
Reference in New Issue
Block a user