-
Notifications
You must be signed in to change notification settings - Fork 2
[AI] [FEAT]: Kaggle 기반 자동 학습 파이프라인 구축 #344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
e16a46c
f7eb760
9cdc10c
1004415
dd95843
9522964
f9a8b7d
ee009ff
702411e
0e7f57f
8d1f1b3
26c8d73
2c9ad4a
bea3a1d
6755d13
fec03d5
6239d19
f7c4c18
8abec31
63dcd60
a8a892c
c4b7473
1e3fa96
eab2ceb
ac3ae3b
2f2f36d
d0ad1fb
58a222d
07fbb68
dac094d
eea4a94
cd13f95
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| name: Weekly Model Training Pipeline | ||
|
|
||
| on: | ||
| # 매주 화요일 새벽 2시 (KST) 자동 실행 | ||
| schedule: | ||
| - cron: '0 17 * * 1' | ||
| # GitHub Actions 탭에서 수동 실행 가능 | ||
| workflow_dispatch: | ||
| inputs: | ||
| skip_extract: | ||
| description: 'DB 추출 스킵 (parquet 이미 있을 때)' | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
| skip_upload: | ||
| description: 'Kaggle 업로드 스킵 (데이터 변경 없을 때)' | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
|
|
||
| jobs: | ||
| train: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 780 # 최대 13시간 | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.10' | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| pip install \ | ||
| kaggle \ | ||
| pandas \ | ||
| pyarrow \ | ||
| psycopg2-binary \ | ||
| paramiko \ | ||
| sshtunnel \ | ||
| scp | ||
|
|
||
| - name: Setup Kaggle credentials | ||
| run: | | ||
| mkdir -p ~/.kaggle | ||
| jq -n \ | ||
| --arg user "${{ secrets.KAGGLE_USERNAME }}" \ | ||
| --arg key "${{ secrets.KAGGLE_KEY }}" \ | ||
| '{"username": $user, "key": $key}' \ | ||
| > ~/.kaggle/kaggle.json | ||
| chmod 600 ~/.kaggle/kaggle.json | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Run weekly training pipeline | ||
| env: | ||
| SSH_HOST: ${{ secrets.SSH_HOST }} | ||
| SSH_USER: ${{ secrets.SSH_USER }} | ||
| SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | ||
| SSH_PORT: ${{ secrets.SSH_PORT }} | ||
| DB_HOST: ${{ secrets.DB_HOST }} | ||
| DB_PORT: ${{ secrets.DB_PORT }} | ||
| DB_USER: ${{ secrets.DB_USER }} | ||
| DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | ||
| DB_NAME: ${{ secrets.DB_NAME }} | ||
| KAGGLE_USERNAME: ${{ secrets.KAGGLE_USERNAME }} | ||
| KAGGLE_KEY: ${{ secrets.KAGGLE_KEY }} | ||
| SERVER_WEIGHTS_PATH: ${{ secrets.SERVER_WEIGHTS_PATH }} | ||
| run: | | ||
| SKIP_EXTRACT="" | ||
| SKIP_UPLOAD="" | ||
| if [ "${{ github.event.inputs.skip_extract }}" == "true" ]; then | ||
| SKIP_EXTRACT="--skip-extract" | ||
| fi | ||
| if [ "${{ github.event.inputs.skip_upload }}" == "true" ]; then | ||
| SKIP_UPLOAD="--skip-upload" | ||
| fi | ||
| python AI/pipelines/weekly_routine.py $SKIP_EXTRACT $SKIP_UPLOAD | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -100,13 +100,14 @@ def resolve_model_artifacts( | |||||||||||||||||||||||||||||||||
| metadata_path=str(resolved_model_dir / "metadata.json"), | ||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| # [수정] PatchTST: 실제 저장 파일명으로 통일 + scaler_path 추가 | ||||||||||||||||||||||||||||||||||
| if normalized_model == "patchtst": | ||||||||||||||||||||||||||||||||||
| resolved_model_dir = _resolve_absolute(model_dir) if model_dir else (root_dir / "patchtst") | ||||||||||||||||||||||||||||||||||
| resolved_model_dir = _resolve_absolute(model_dir) if model_dir else (root_dir / "PatchTST") | ||||||||||||||||||||||||||||||||||
| return ModelArtifactPaths( | ||||||||||||||||||||||||||||||||||
| root_dir=str(root_dir), | ||||||||||||||||||||||||||||||||||
| model_dir=str(resolved_model_dir), | ||||||||||||||||||||||||||||||||||
| model_path=str(resolved_model_dir / "PatchTST_best.pt"), | ||||||||||||||||||||||||||||||||||
| scaler_path=None, | ||||||||||||||||||||||||||||||||||
| model_path=str(resolved_model_dir / "patchtst_model.pt"), # PatchTST_best.pt → patchtst_model.pt | ||||||||||||||||||||||||||||||||||
| scaler_path=str(resolved_model_dir / "patchtst_scaler.pkl"), # 추가 | ||||||||||||||||||||||||||||||||||
|
Comment on lines
104
to
+110
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PatchTST 디렉터리 casing이 기존 저장 경로와 달라집니다.
수정 예시 if normalized_model == "patchtst":
- resolved_model_dir = _resolve_absolute(model_dir) if model_dir else (root_dir / "patchtst")
+ resolved_model_dir = _resolve_absolute(model_dir) if model_dir else (root_dir / "PatchTST")
return ModelArtifactPaths(
root_dir=str(root_dir),
model_dir=str(resolved_model_dir),
model_path=str(resolved_model_dir / "patchtst_model.pt"),📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| metadata_path=None, | ||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.