Skip to content

ci: BE 패턴 기반 FastAPI CI/CD 정비#138

Merged
selnem merged 1 commit into
developfrom
refactor/deploy-oidc
Jun 18, 2026
Merged

ci: BE 패턴 기반 FastAPI CI/CD 정비#138
selnem merged 1 commit into
developfrom
refactor/deploy-oidc

Conversation

@selnem

@selnem selnem commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

develop 중심 CI와 OIDC EB 배포(스모크·롤백) 도입

✨ 작업 개요

FastAPI AI 서버의 CI/CD를 BE 패턴에 맞게 재구성했습니다.

CI (ci.yml)

  • 트리거: develop push/PR, main 대상 PR, workflow_dispatch
  • Postgres(pgvector) + Redis 서비스 컨테이너 기반 통합 CI
  • compileallci_infra_smoke.py(PG/Redis/S3) → unittest → uvicorn /health 200 검증
  • CI_ENV secret + workflow에서 CI용 DB/Redis override

CD (dev/prod)

  • deploy.yml / prod_deploy.yml → reusable workflow(_reusable-eb-deploy.yml)로 공통화
  • static AWS access key 제거, OIDC (vars.AWS_ROLE_ARN) 기반 인증
  • EB 배포 후 외부 health URL 스모크 테스트(3회 재시도)
  • 배포/스모크 실패 시 이전 EB 버전 자동 롤백 + 롤백 후 health 재검증
  • 배포 zip에서 tests, rag/raw, docs 제외 및 zip 내용 검증

기타

  • docs/cicd-oidc-setup.md: OIDC·GitHub Variables/Secrets 설정 가이드
  • runtime.txt: python-3.14 명시

🧐 집중 리뷰 요청

  1. _reusable-eb-deploy.yml 롤백 조건
    deploy 실패 또는 smoke_test 실패 시 PREVIOUS_VERSION으로 롤백하는 분기가 의도대로인지 봐주세요.

  2. 브랜치/트리거 전략

    • CI: develop 중심 (main push는 CI 미실행)
    • Dev 배포: main merge 시
    • Prod 배포: prod merge 시
      운영 플로우와 맞는지 확인 부탁드립니다.
  3. Python 3.14
    CI(setup-python), runtime.txt, EB 플랫폼 버전 정합성 — EB가 3.14 미지원이면 배포 실패 가능성이 있습니다.

  4. ci_infra_smoke.py S3 smoke
    CI에서 실 버킷에 put/get/delete 합니다. CI 전용 IAM 권한·버킷 정책이 적절한지 검토해주세요.

  5. 보안
    OIDC Trust policy scope(repo:...:*)와 output-credentials: true + beanstalk-deploy 조합 — org 정책상 허용 범위인지 의견 부탁드립니다.

develop 중심 CI와 OIDC EB 배포(스모크·롤백)를 도입.
@selnem selnem self-assigned this Jun 18, 2026
@selnem selnem added the 🚀 deploy 배포 label Jun 18, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a deployment issue template, a CI/CD OIDC setup guide, a Python runtime configuration, and an infrastructure smoke test script for PostgreSQL, Redis, and S3. The reviewer provided several critical recommendations: updating the Python runtime in runtime.txt and the documentation from the unsupported python-3.14 to python-3.12; modifying the PostgreSQL smoke test to correctly use the loaded environment variables from the .env file; and updating the S3 smoke test to support OIDC-based authentication by allowing boto3 to fall back to default credentials when static AWS keys are not provided.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread runtime.txt
Comment thread scripts/ci_infra_smoke.py
Comment thread scripts/ci_infra_smoke.py
Comment thread scripts/ci_infra_smoke.py
Comment thread docs/cicd-oidc-setup.md

## EB Python 플랫폼

`runtime.txt`에 `python-3.14`를 명시했습니다. dev/prod EB 환경이 Python 3.14 플랫폼을 지원하는지 확인하고, 미지원 시 플랫폼 업그레이드를 선행하세요.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

runtime.txt에 명시된 Python 버전을 python-3.12로 변경함에 따라 가이드 문서의 설명도 이에 맞게 수정합니다.

Suggested change
`runtime.txt``python-3.14`를 명시했습니다. dev/prod EB 환경이 Python 3.14 플랫폼을 지원하는지 확인하고, 미지원 시 플랫폼 업그레이드를 선행하세요.
`runtime.txt``python-3.12`를 명시했습니다. dev/prod EB 환경이 Python 3.12 플랫폼을 지원하는지 확인하고, 미지원 시 플랫폼 업그레이드를 선행하세요.

@selnem selnem merged commit 6ee8437 into develop Jun 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant