Skip to content

Batch 프로그램 및 Spotify-backfill 작업 - #194

Merged
TrossYou merged 8 commits into
mainfrom
feat/batch
Oct 31, 2025
Merged

TrossYou merged 8 commits into
mainfrom
feat/batch

Conversation

@TrossYou

Copy link
Copy Markdown
Collaborator

✨ 개요

TS 배치 스크립트를 푸시하면 자동으로 이미지 빌드 -> GHCR 푸시 -> K8s Job 실행 까지 이어지는 파이프라인 추가.
기본값은 DRY_RUN=true라서 안전하게 시뮬레이션 후 false로 전환해 실제 반영할 수 있음.

🌀 흐름

1. TS 스크립트 작성

  • 위치: scripts/ (예: scripts/spotify-backfill.ts)
    2. push -> "Build Batch Image" 워크플로우 실행
  • 파일: .github/workflows/BuildBatchImage.yml
  • 동작:
    1. Dockerfile에 따라 TS를 dist/ 하위 JS로 번들(tsup)
      • docker/batch/Dockerfile
    2. 번들 결과를 바탕으로 배치 이미지 생성
      • 태그: sha-
    3. GHCR 푸시: ghcr.io/formalbridge/project_alpha/batch:
      3. 빌드 완료 -> 자동으로 "Deploy And Run Batch Job" 워크플로우 실행
  • 파일: .github/workflows/DeployAndRunBatchJob.yml
  • 동작:
    1. 방금 푸시된 sha- 태그 이미지로 Job 실행
      • 공통 템플릿: K8s/jobs/batch-job-template.yml
      • 새 스크립트 작성 시, JOB_NAME은 파일 경로로 자동 설정
    2. 완료 대기 & 로그 출력

🔆 새 스크립트 사용 방법

  • 스크립트만 올리면 Actoins에서 자동으로 Job까지 실행됨

@TrossYou TrossYou self-assigned this Oct 28, 2025

@dongcheolpark dongcheolpark 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.

제대로 읽지는 못했는데 일단 동작하는 것 같으니까 머지하고 이상하면 리버트합시다

@TrossYou
TrossYou merged commit d07c732 into main Oct 31, 2025
3 checks passed
@TrossYou
TrossYou deleted the feat/batch branch October 31, 2025 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants