trigger_action #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: new data push to training | |
on: | |
repository_dispatch: | |
types: [trigger_action] # Airflow에서 보내는 `trigger_action` 이벤트를 감지 | |
workflow_dispatch: | |
jobs: | |
run_triggered_job: | |
runs-on: [self-hosted, linux, X64] | |
steps: | |
- name: Print message from Airflow | |
run: echo "${{ github.event.client_payload.message }}" | |
- name: Print folder path | |
run: echo "${{ github.event.client_payload.folder_path }}" | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: 디버그 로그 보기 | |
run: | | |
echo "GITHUB_ACTIONS_DEBUG=true" >> $GITHUB_ENV | |
- name: git pull | |
run: | | |
cd /home/ubuntu/flatfix | |
git pull | |
- name: python 설치 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.11.9 | |
- name: 의존성 설치 | |
run: | | |
export PATH="$HOME/.pyenv/bin:$PATH" | |
eval "$(pyenv init --path)" | |
eval "$(pyenv init -)" | |
eval "$(pyenv virtualenv-init -)" | |
pyenv activate modelenv-2 | |
pip install pytest | |
pytest /home/ubuntu/flatfix/test/ | |
- name: 도커 컴포즈 업 | |
run: | | |
cd /home/ubuntu/flatfix | |
docker compose up --build -d | |
- name: 모델 학습 efficientnet | |
run: | | |
docker run --gpus all --network flatfix_mlflow-network flatfix-train-model \ | |
python main.py Train \ | |
--model_type efficientnet --model_version 0 \ | |
--dataset_version ${{ github.event.client_payload.folder_path }} | |
- name: 모델 학습 resnet | |
run: | | |
docker run --gpus all --network flatfix_mlflow-network flatfix-train-model \ | |
python main.py Train \ | |
--model_type resnet --model_version 18 \ | |
--dataset_version ${{ github.event.client_payload.folder_path }} | |
- name: 모델 학습 tinyvgg | |
run: | | |
docker run --gpus all --network flatfix_mlflow-network flatfix-train-model \ | |
python main.py Train \ | |
--model_type tinyvgg \ | |
--dataset_version ${{ github.event.client_payload.folder_path }} | |
- name: stage 모델 선정 Loss 값 기준 | |
run: docker run --network flatfix_mlflow-network --rm flatfix-train-model python main.py Stage Loss | |