Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ workflow를 관리합니다.

## 파일

### `node-image-prefetch-plan.yml`

문제 저장소의 수동 main caller에서 호출하는 읽기 전용 reusable workflow입니다.
현재 문제와 성공한 bundle 전체를 대조해 아키텍처별 이미지 목록, 이전 목록과의
변경분과 Actions Summary를 보관합니다. 누락·조회·입력 실패는 전체 취합 실패로
처리하며 노드 다운로드, release 활성화나 이미지 삭제는 수행하지 않습니다.
[연동 기준과 caller 예시](../../docs/node-image-prefetch.md)를 확인합니다.

### `published-runtime-smoke.yml`

성공한 main 발행본을 선택하는 별도 수동 caller용 reusable workflow입니다.
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/challenge-supply-chain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,15 @@ jobs:
--artifact-output dist/artifact-v2.json \
--registry-output dist/registry-publish.json

- name: 노드 이미지 사전 다운로드 목록 생성
if: >-
github.ref == 'refs/heads/main' &&
(github.event_name == 'push' || github.event_name == 'workflow_dispatch')
run: |
python3 .msgctf-ci/scripts/generate_node_image_plan.py \
--artifact dist/artifact-v2.json \
--output-dir dist/node-prefetch

- name: GHCR digest 발행 결과 요약
id: summary
env:
Expand Down
83 changes: 83 additions & 0 deletions .github/workflows/node-image-prefetch-plan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: 일반 문제 이미지 사전 다운로드 목록 취합

on:
workflow_call:
inputs:
devsecops_ref:
description: 리뷰한 공급망 도구 commit SHA
type: string
required: true
previous_artifact_id:
description: 이전 완료 취합 artifact ID, 최초 취합은 생략
type: string
required: false
default: ""

permissions:
contents: read
actions: read

jobs:
plan:
name: 노드 변경 없는 전체 목록·변경분 생성
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: 공식 저장소의 수동 main 요청 확인
env:
DEVSECOPS_REF: ${{ inputs.devsecops_ref }}
PREVIOUS_ARTIFACT_ID: ${{ inputs.previous_artifact_id }}
run: |
set -euo pipefail
test "$GITHUB_REPOSITORY" = MSG-CTF/2026_MSG_CTF || { echo "공식 문제 저장소에서 호출하세요" >&2; exit 1; }
test "$GITHUB_EVENT_NAME" = workflow_dispatch || { echo "수동 실행만 허용합니다" >&2; exit 1; }
test "$GITHUB_REF" = refs/heads/main || { echo "main 실행만 허용합니다" >&2; exit 1; }
[[ "$DEVSECOPS_REF" =~ ^[0-9a-f]{40}$ ]] || { echo "검토한 도구 SHA가 필요합니다" >&2; exit 1; }
if [ -n "$PREVIOUS_ARTIFACT_ID" ]; then
[[ "$PREVIOUS_ARTIFACT_ID" =~ ^[1-9][0-9]{0,18}$ ]] || { echo "이전 artifact ID 형식을 확인하세요" >&2; exit 1; }
fi

- name: 검토한 공급망 도구 가져오기
uses: actions/checkout@v4
with:
repository: MSG-CTF/msgctf-devsecops
ref: ${{ inputs.devsecops_ref }}
persist-credentials: false

- name: Python 설정
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: 검증 의존성 설치
run: python3 -m pip install -r ci/requirements.txt

- name: 전체 성공 발행본 취합과 변경분 계산
env:
GH_TOKEN: ${{ github.token }}
PREVIOUS_ARTIFACT_ID: ${{ inputs.previous_artifact_id }}
run: |
set -euo pipefail
args=()
if [ -n "$PREVIOUS_ARTIFACT_ID" ]; then
args+=(--previous-artifact-id "$PREVIOUS_ARTIFACT_ID")
fi
python3 -B -m scripts.collect_node_image_plans \
--expected-source-sha "$GITHUB_SHA" \
--output-dir dist/node-prefetch "${args[@]}"

- name: 취합 결과 보관
if: always() && hashFiles('dist/node-prefetch/summary.md') != ''
uses: actions/upload-artifact@v4
with:
name: node-image-prefetch-${{ github.run_id }}-${{ github.run_attempt }}
path: dist/node-prefetch/
retention-days: 90
if-no-files-found: error

- name: 취합·실패 결과 요약
if: always()
run: |
if [ -f dist/node-prefetch/summary.md ]; then
cat dist/node-prefetch/summary.md >> "$GITHUB_STEP_SUMMARY"
fi
2 changes: 2 additions & 0 deletions .github/workflows/pipeline-self-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- ".github/workflows/published-runtime-smoke.yml"
- ".github/workflows/pipeline-self-test.yml"
- ".github/workflows/ghcr-cleanup-dry-run.yml"
- ".github/workflows/node-image-prefetch-plan.yml"
- "ci/**"
- "scripts/**"
- "tests/**"
Expand All @@ -20,6 +21,7 @@ on:
- ".github/workflows/published-runtime-smoke.yml"
- ".github/workflows/pipeline-self-test.yml"
- ".github/workflows/ghcr-cleanup-dry-run.yml"
- ".github/workflows/node-image-prefetch-plan.yml"
- "ci/**"
- "scripts/**"
- "tests/**"
Expand Down
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Challenge Repo
Platform 실행 흐름은 다음과 같습니다.

```text
Scheduler가 Challenge Registry의 active revision 조회
Backend가 Challenge Registry의 active release를 조회해 확정 workload를 Scheduler에 전달
→ Resource Broker가 target 선택
→ Runtime API가 digest workload 수신
→ Runtime이 K3s Namespace·Pod·Service·보안 정책 생성
Expand All @@ -52,6 +52,20 @@ Scheduler가 Challenge Registry의 active revision 조회

CI는 Kubernetes manifest, Namespace, Service, NetworkPolicy 또는 cleanup을 소유하지 않습니다. 해당 영역은 Runtime 및 격리보안팀의 책임입니다.

일반 K3s 문제의 main 발행 bundle에는 노드 사전 다운로드용 digest 목록도
포함합니다. 실제 노드 다운로드와 수집·적용 버튼 연결은 아직 구현 전이며,
[노드 이미지 사전 다운로드 연동](docs/node-image-prefetch.md)에 담당별 연결과
기존 참가자 인스턴스를 유지하는 전환 순서를 정리했습니다.

Runtime [B안 계약 초안 #70](https://github.com/MSG-CTF/secure-provisioner/pull/70)은
Backend가 준비를 요청하고 Runtime이 다운로드·관측을 관리하며 Scheduler가
준비된 target을 선호하는 제안입니다. 이번 목록은 실행 요청이나 준비 완료 증거가
아니며, 준비 실패만으로 활성화·생성을 막는 gate를 추가하지 않습니다.

전체 대상 취합과 이전 목록 비교는 `scripts/collect_node_image_plans.py` 및
읽기 전용 `node-image-prefetch-plan.yml`로 준비합니다. 문제 저장소의 수동 caller
예시를 제공하며 실제 노드 연결이나 caller 적용은 이번 변경에서 하지 않습니다.

GHCR 이미지 버전은 [삭제 없는 정리 후보 조회](docs/ghcr-cleanup.md)로 관리합니다.
active release·실행 중 digest와 KOTH의 별도 사용 목록을 확인하기 전에는 실제
이미지를 삭제하지 않습니다.
Expand Down Expand Up @@ -191,6 +205,9 @@ GHCR push, publish bundle 생성과 Runtime smoke는 승인된 `main` 실행에
<challenge_slug>-<artifact_scope>-publish-bundle/
├ artifact-v2.json
├ registry-publish.json
├ node-prefetch/ # 일반 K3s 문제의 main 발행만 해당
│ ├ plan.json
│ └ images.txt
├ input/metadata.json
└ results/<container>/
├ timing.json
Expand Down Expand Up @@ -325,6 +342,12 @@ K3s는 향후 containerd mirror 설정을 통해 내부 OCI mirror를 사용할
사전 pull, mirror 또는 별도 Registry 도입은 MVP 이후 결정하며, 이 경우에도
Runtime에는 digest 고정 reference만 전달합니다.

2026-10-23 추가 요구에 따라 노드 사전 다운로드를 준비하고 있습니다. 위 MVP의
on-demand pull 설명은 기존 동작이며, 이번 보조 목록 발행만으로 노드 자동
다운로드나 기존 인스턴스의 무중단 교체가 활성화되지는 않습니다.
준비 정보가 없거나 만료·조회 실패이면 기존 pull 경로를 유지하는 B안은 아직
검토 중이며, 실제 실행의 인증·이미지 승인·격리·플랫폼·자원 검사는 계속 필수입니다.

신규 아키텍처 기준 공급망은 `info.yaml`, 멀티 컨테이너, digest, SBOM, publish bundle을 지원합니다. Backend poller가 Actions artifact를 수집해 release를 등록하고, Runtime 배포 smoke는 Secure Provisioner API를 경유합니다. OCI mirror와 Terraform/Ansible 인프라는 각 담당 팀의 계약에 맞춰 통합 테스트합니다.

Windows container는 Linux image와 같은 build job에서 처리하지 않습니다.
Expand Down
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# 문서

- [노드 이미지 사전 다운로드 연동](node-image-prefetch.md): 문제별·전체 이미지 목록과 변경분 취합, 읽기 전용 Actions와 수집·다운로드·적용의 책임 경계
- [관리자 대시보드 검증·발행 연동](backend-publication-dispatch.md): 정확한 main SHA 발행 요청, run 추적·상태·산출물 조회, 기존 성공본 수집과 중복·재시도 책임
- [발행본 독립 Runtime 검증](published-runtime-smoke.md): 성공한 main 발행본의 출처 검증과 발행 실행에 영향을 주지 않는 단일 WEB 생성·삭제 시험
- [2026-10-21 Backend 개발 서버 전달 자료](reports/2026-10-21-backend-handoff/README.md): 최신 37개 발행 대조와 문제별 revision·run·artifact, 배포 성공 기록 및 서버 확인 요청
Expand Down
28 changes: 28 additions & 0 deletions docs/node-image-prefetch-caller-example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 문제 저장소의 .github/workflows/node-image-prefetch.yml 예시입니다.
# 0으로 된 두 SHA를 PR 리뷰·병합 후 동일한 실제 병합 SHA로 교체해야 합니다.
# 자동 활성화·노드 호출·이미지 삭제는 하지 않습니다.
name: 일반 문제 이미지 사전 다운로드 목록 준비

on:
workflow_dispatch:
inputs:
previous_artifact_id:
description: 이전 성공 취합 artifact ID, 처음에는 생략
type: string
required: false
default: ""

concurrency:
group: node-image-prefetch-${{ github.repository }}
cancel-in-progress: false

permissions:
contents: read
actions: read

jobs:
plan:
uses: MSG-CTF/msgctf-devsecops/.github/workflows/node-image-prefetch-plan.yml@0000000000000000000000000000000000000000
with:
devsecops_ref: "0000000000000000000000000000000000000000"
previous_artifact_id: ${{ inputs.previous_artifact_id }}
Loading
Loading