51 lines
3.6 KiB
Markdown
51 lines
3.6 KiB
Markdown
---
|
|
id: "req-0002"
|
|
status: approved
|
|
discovery: "dcy-0002"
|
|
criteria:
|
|
create:
|
|
- "ac-0004"
|
|
- "ac-0005"
|
|
- "ac-0006"
|
|
- "ac-0007"
|
|
- "ac-0008"
|
|
update: []
|
|
retire: []
|
|
satisfy: []
|
|
---
|
|
|
|
# trex-core 검증 컨테이너 이미지의 GHCR 게시
|
|
|
|
## Objective
|
|
|
|
정확한 `trex-core` source commit으로부터 만든 컨테이너가 repository 검증과 built-container 검사를 모두 통과한 경우에만 `ghcr.io/fourblocks2020/trex-core`에 게시되도록 하여, 운영자가 source commit·stable SHA tag·immutable digest를 역추적하고 같은 digest로 배포하거나 이전 digest로 롤백할 수 있게 한다.
|
|
|
|
## Scope
|
|
|
|
- repository-root `Dockerfile`과 제한된 build context로 Python 3.12 기반 이미지를 만들고 `trex-core-daemon`, `trex-core`, `trex-core-reset` console entrypoint를 설치한다.
|
|
- GitHub Actions는 `main` 및 `v*` tag push의 정확한 commit을 checkout하고 repository가 정의한 검증 gate, image build와 built-container smoke를 순서대로 수행한다.
|
|
- verify job에서 검사를 마친 이미지 archive와 그 SHA-256을 artifact로 전달하고, 별도 publish job은 checksum이 일치하는 artifact를 load하여 재빌드 없이 GHCR에 게시한다.
|
|
- 모든 성공 게시에는 전체 source commit에서 결정적으로 파생된 stable SHA tag와 OCI revision을 부여하고 registry가 반환한 immutable digest를 배포·rollback의 정본으로 기록한다. `v*` tag event는 같은 loaded image에 해당 release tag를 추가하며 `latest`는 만들지 않는다.
|
|
- workflow output 또는 summary에 게시 image reference, digest와 전체 source commit을 남긴다.
|
|
- Docker build와 built-container 검사는 운영 TOML, `.env`, credential, token, 실제 connection string 또는 운영 서비스를 사용하지 않는다.
|
|
- runtime 문서는 per-instance config·secret 외부 주입, SHA tag 탐색과 digest pin, 이전 digest rollback을 설명하되 파괴적인 reset을 자동 rollback으로 안내하지 않는다.
|
|
|
|
## Constraints
|
|
|
|
- repository 검증, image build, built-container smoke, tested-image artifact 생성·전달·checksum·load 검증 중 하나라도 실패하면 registry login/push 전에 중단한다.
|
|
- registry push 이후에만 얻을 수 있는 digest가 누락되거나 형식이 잘못되면 job을 nonzero로 종료하고 성공 output·summary를 남기지 않는다. 이미 발생한 registry write를 발생하지 않은 것으로 주장하지 않는다.
|
|
- publish job은 검증된 artifact를 다시 빌드할 수 없으며 `packages: write` 권한은 GHCR 게시가 필요한 최소 job 범위로 제한한다.
|
|
- runtime image와 검증은 `pyproject.toml`의 Python `>=3.12` 및 현재 console entrypoint 계약을 보존한다.
|
|
- built-container smoke는 package import와 무부작용 entrypoint probe로 한정하고 실제 주문, migration, daemon setup, 실제 KIS 계좌, 운영 credential 또는 production service에 연결하지 않는다.
|
|
- `--config`가 필수인 daemon 계약을 보존하고 운영 config를 image layer에 고정하지 않는다.
|
|
- GitHub `main` 반영과 최초 GHCR package write는 구현 검증과 분리된 외부 쓰기이며 별도 승인을 요구한다.
|
|
|
|
## Non-Goals
|
|
|
|
- 운영 서버·production Compose의 image 교체, 재시작 또는 배포 완료
|
|
- release version 선택, release tag 생성, production 검증 또는 release 완료 주장
|
|
- DB migration, `trex-core-reset`, 운영 데이터 rollback 자동화
|
|
- 다른 TREX 저장소나 `trex-sim` 격리 stack 변경
|
|
- 새로운 HTTP health endpoint, multi-architecture image, image signing, SBOM 또는 provenance attestation
|
|
- GHCR package visibility나 조직 보안정책 변경
|