From ba3c964a92d93cc0dec378ff156e0468206a71b4 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 18:57:05 +0900 Subject: [PATCH] =?UTF-8?q?ci(main):=20Redis=20=EA=B5=AC=EC=84=B1=20lane?= =?UTF-8?q?=2011=ED=96=89=EC=9D=84=20job=20=ED=95=98=EB=82=98=EC=9D=98=20s?= =?UTF-8?q?tep=EC=9C=BC=EB=A1=9C=20=EB=8F=88=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: nightly의 redis-topology가 행렬 job 11개였다. 행마다 job을 새로 시작해 컨테이너·checkout·JDK·Gradle 시작과 구성을 다시 치렀다. 수동 실행 run 100에서 이 11개가 runner 135분 가운데 26분이었고, 그중 약 3분의 1이 시작 비용이었다. 고른 방법: job 하나에 행마다 step 하나를 둔다. 각 step은 지금과 같은 `bash scripts/ci/redis-topology.sh ` 한 줄이다. - `if: always()`로 한 행이 실패해도 나머지가 돈다. job이 빨갛게 되고, 실패한 step 이름이 행을 말한다. - 스크립트가 끝날 때 자기 topology를 내리므로 행끼리 서버를 나누지 않는다. - 같은 job 안에서 Gradle daemon과 구성 결과를 다시 쓴다. - timeout은 행 11개를 합친 시간에 맞춰 90분으로 둔다. 문서: 행렬이라고 적던 곳(gates.md, template-vs-consumer.md, redis-sdk compose README, 스크립트 머리 주석)을 step으로 고친다. 버린 대안: 버전마다 job 하나(3개). 시작 비용을 셋 더 치른다. 한 step에서 셸 반복문으로 돌기: 어느 행이 실패했는지 로그를 뒤져야 하고, 단계 job 규칙과 같은 이유로 셸 문법을 늘리지 않는다. 위험·한계: UI에서 행마다 따로 보이던 초록·빨강이 step 단위가 된다. job 하나가 시간 제한에 걸리면 남은 행이 함께 멈춘다. 검증: YAML을 읽어 step 13개(checkout, setup, 행 11)를 확인했다. runner nightly 측정은 PR 본문에 적는다. --- .gitea/workflows/main.yml | 59 +++++++++++++------ docs/ci-cd/template-vs-consumer.md | 2 +- docs/work/reference/gates.md | 4 +- scripts/ci/redis-topology.sh | 5 +- .../outbound/redis-sdk/compose/README.md | 2 +- 5 files changed, 48 insertions(+), 24 deletions(-) diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index fbd1638b..1b1926f9 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -157,31 +157,54 @@ jobs: - run: ./gradlew :adapter:outbound:httpclient:httpClientStableContractTest -Phttpclient.contract.transports=${{ matrix.transport }} # Sentinel promotion, Cluster redirects and TLS against real servers, every supported version. - # docs/redis/support-matrix.md says which lane produced which evidence; the job log carries the + # docs/redis/support-matrix.md says which lane produced which evidence; each step's log carries the # commit, the server version and the image digest. + # + # One job, a step per topology and version. As eleven matrix jobs each row paid the job start + # again (container, checkout, JDK, Gradle start and configuration: 26 of the 135 runner minutes + # of manual run 100 went to these rows, about a third of it start). `always()` runs every row + # after one fails, and the job's red names the failed step. The script stops its topology on + # exit, so the rows do not share a server. redis-topology: if: ${{ github.event_name != 'push' }} runs-on: ubuntu-latest - timeout-minutes: 30 - strategy: - fail-fast: false - matrix: - include: - - { topology: standalone, redis: "7.2" } - - { topology: standalone, redis: "7.4" } - - { topology: standalone, redis: "8.2" } - - { topology: sentinel, redis: "7.2" } - - { topology: sentinel, redis: "7.4" } - - { topology: sentinel, redis: "8.2" } - - { topology: cluster, redis: "7.2" } - - { topology: cluster, redis: "7.4" } - - { topology: cluster, redis: "8.2" } - - { topology: tls, redis: "7.4" } - - { topology: tls, redis: "8.2" } + timeout-minutes: 90 steps: - uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2 - uses: ./.gitea/actions/setup-java-gradle - - run: bash scripts/ci/redis-topology.sh ${{ matrix.topology }} ${{ matrix.redis }} + - name: standalone on Redis 7.2 + if: ${{ always() }} + run: bash scripts/ci/redis-topology.sh standalone 7.2 + - name: standalone on Redis 7.4 + if: ${{ always() }} + run: bash scripts/ci/redis-topology.sh standalone 7.4 + - name: standalone on Redis 8.2 + if: ${{ always() }} + run: bash scripts/ci/redis-topology.sh standalone 8.2 + - name: sentinel on Redis 7.2 + if: ${{ always() }} + run: bash scripts/ci/redis-topology.sh sentinel 7.2 + - name: sentinel on Redis 7.4 + if: ${{ always() }} + run: bash scripts/ci/redis-topology.sh sentinel 7.4 + - name: sentinel on Redis 8.2 + if: ${{ always() }} + run: bash scripts/ci/redis-topology.sh sentinel 8.2 + - name: cluster on Redis 7.2 + if: ${{ always() }} + run: bash scripts/ci/redis-topology.sh cluster 7.2 + - name: cluster on Redis 7.4 + if: ${{ always() }} + run: bash scripts/ci/redis-topology.sh cluster 7.4 + - name: cluster on Redis 8.2 + if: ${{ always() }} + run: bash scripts/ci/redis-topology.sh cluster 8.2 + - name: tls on Redis 7.4 + if: ${{ always() }} + run: bash scripts/ci/redis-topology.sh tls 7.4 + - name: tls on Redis 8.2 + if: ${{ always() }} + run: bash scripts/ci/redis-topology.sh tls 8.2 # The one fileserver environment a pull request cannot provide: a real NFSv4 server. fileserver-nfs-ambiguity: diff --git a/docs/ci-cd/template-vs-consumer.md b/docs/ci-cd/template-vs-consumer.md index 3cb6295a..4541e926 100644 --- a/docs/ci-cd/template-vs-consumer.md +++ b/docs/ci-cd/template-vs-consumer.md @@ -17,7 +17,7 @@ | 대상 | 무엇을 지키는가 | | --- | --- | | `docs/design/**`, `docs/history/**` | 이 템플릿을 만든 과정의 설계서·계획서·납품 패키지·증거·학습 기록 | -| `main.yml`의 nightly 행렬 job(`jpa-postgresql`, `httpclient-transport`, `redis-topology`, `fileserver-nfs-ambiguity`, `notification-chaos`, `jpa-next`, `object-storage-aws`)과 `release.yml`의 영역별 release lane | 템플릿이 광고하는 지원 매트릭스의 근거. 서비스가 그 capability를 쓰면 남기고, 지운 capability의 job은 같이 지운다 | +| `main.yml`의 nightly job(`jpa-postgresql`, `httpclient-transport`, `redis-topology`, `fileserver-nfs-ambiguity`, `notification-chaos`, `jpa-next`, `object-storage-aws`)과 `release.yml`의 영역별 release lane | 템플릿이 광고하는 지원 매트릭스의 근거. 서비스가 그 capability를 쓰면 남기고, 지운 capability의 job은 같이 지운다 | ## Consumer 필수 (파생 프로젝트가 유지해야 한다) diff --git a/docs/work/reference/gates.md b/docs/work/reference/gates.md index 1e76a01a..d494e4bf 100644 --- a/docs/work/reference/gates.md +++ b/docs/work/reference/gates.md @@ -23,7 +23,7 @@ Gradle 명령과 `scripts/verify.sh`는 모두 저장소 루트(Gradle 루트) | `app` | `scripts/bootstrap-local.sh`(앱을 띄워 health와 기본 endpoint 확인) | — | | `round` | `pr` → `main` → `nightly` → `release`, 첫 실패에서 멈춘다 | — | -workflow에만 있는 job: `pr.yml` `done`의 마지막 step과 `main.yml`의 `vulnerabilities`(trivy, `scripts/ci/trivy-scan.sh`), `main.yml`의 `links`(lychee), nightly 행렬(`jpa-postgresql`·`httpclient-transport`·`redis-topology`·`fileserver-nfs-ambiguity`·`notification-chaos`·`jpa-next`), `release.yml`의 release lane과 이미지 job. `main.yml`의 `done`은 게이트가 아니다: nightly에 main에서 `:prCheck`를 한 번 더 돌려 빌드 캐시를 채우고, 같은 이름의 PR job이 그 캐시를 읽는다(setup-gradle이 job 이름으로 캐시를 찾는다). 도구를 내려받거나 runner 환경이 필요해 `verify.sh`에 넣지 않았다. 손으로 돌리는 법은 3절 (다)다. +workflow에만 있는 job: `pr.yml` `done`의 마지막 step과 `main.yml`의 `vulnerabilities`(trivy, `scripts/ci/trivy-scan.sh`), `main.yml`의 `links`(lychee), nightly job(`jpa-postgresql`·`httpclient-transport`·`redis-topology`·`fileserver-nfs-ambiguity`·`notification-chaos`·`jpa-next`), `release.yml`의 release lane과 이미지 job. `main.yml`의 `done`은 게이트가 아니다: nightly에 main에서 `:prCheck`를 한 번 더 돌려 빌드 캐시를 채우고, 같은 이름의 PR job이 그 캐시를 읽는다(setup-gradle이 job 이름으로 캐시를 찾는다). 도구를 내려받거나 runner 환경이 필요해 `verify.sh`에 넣지 않았다. 손으로 돌리는 법은 3절 (다)다. 게이트 하나씩: @@ -112,7 +112,7 @@ workflow에만 있는 job: `pr.yml` `done`의 마지막 step과 `main.yml`의 `v 1. 바뀐 파일 목록을 만든다: `git diff --name-only <기준 커밋> <합친 커밋>`. 2. 바뀐 영역의 job을 고른다: PostgreSQL major(`jpa-postgresql`, persistence-jpa), HTTP transport(`httpclient-transport`, httpclient), Redis topology(`redis-topology`, redis leaf 셋), NFS(`fileserver-nfs-ambiguity`, fileserver), 알림 chaos(`notification-chaos`), 릴리스 lane(`release.yml`의 같은 영역 job). -3. 그 job의 `run` 줄을 저장소 루트에서 그대로 돌린다. 행렬은 값마다 한 번이다. 스크립트 job(`scripts/ci/redis-topology.sh `)은 desktop에서도 같은 줄로 돈다. +3. 그 job의 `run` 줄을 저장소 루트에서 그대로 돌린다. 행렬은 값마다 한 번이다. `redis-topology`는 행렬이 아니라 행마다 step 하나이고, 그 `scripts/ci/redis-topology.sh ` 줄은 desktop에서도 같은 줄로 돈다. 4. 고르지 않은 job은 이름과 "바뀐 영역 아님"을 결과 표에 적는다. 5. 처음 켠 job이 이번 변경과 무관한 이전부터의 실패를 드러내면(예: 진입 문서만 바꿨는데 그 영역 job을 돌림), 기준 커밋에서 같은 실패인지 보고 「이전부터」로 적는다. 그 영역의 남은 문제로 넘기고 이번 변경 몫으로 세지 않는다. diff --git a/scripts/ci/redis-topology.sh b/scripts/ci/redis-topology.sh index 94aa747b..1aee77fe 100755 --- a/scripts/ci/redis-topology.sh +++ b/scripts/ci/redis-topology.sh @@ -1,8 +1,9 @@ #!/usr/bin/env bash # One Redis topology lane against a real server: start the Compose topology, run the leaves' # `redisTopologyTest` for it, print the evidence manifest, stop the topology. Called by the -# `redis-topology` nightly job of .gitea/workflows/main.yml (one call per matrix row); a person can -# run the same line on a machine with Docker. +# `redis-topology` nightly job of .gitea/workflows/main.yml (one step per row; the script stops its +# topology on exit, so the rows do not share a server); a person can run the same line on a machine +# with Docker. # # bash scripts/ci/redis-topology.sh # diff --git a/src/adapter/outbound/redis-sdk/compose/README.md b/src/adapter/outbound/redis-sdk/compose/README.md index 793c28e5..2592f65f 100644 --- a/src/adapter/outbound/redis-sdk/compose/README.md +++ b/src/adapter/outbound/redis-sdk/compose/README.md @@ -6,7 +6,7 @@ 넷 모두 Redis 7.4에서 돌았고 증거는 `docs/redis/support-matrix.md`에 적혀 있다. `.gitea/workflows/main.yml`의 nightly `redis-topology` job이 매일 밤(그리고 손으로 실행할 때) 지원 버전 × topology 표 -전체를 행마다 `scripts/ci/redis-topology.sh `으로 돌린다. 같은 줄을 Docker가 있는 머신에서 +전체를 job 하나 안에서 행마다 step 하나(`scripts/ci/redis-topology.sh `)로 돌린다. 같은 줄을 Docker가 있는 머신에서 손으로 돌릴 수 있다. pull request마다 돌던 standalone lane은 2026-11-08에 nightly로 옮겼다(어댑터 컨테이너 lane은 main 단계, 소유자 결정 2026-11-07).