0.0.7 #6
Workflow file for this run
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: Model Training | |
on: | |
pull_request: | |
branches: ['main'] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: self-hosted | |
container: | |
image: docker://ghcr.io/iterative/cml:0-dvc2-base1-gpu | |
volumes: | |
- /home/runner/work/frdc-ml/_github_home:/root | |
env: | |
# This is where setup-python will install and cache the venv | |
AGENT_TOOLSDIRECTORY: "/root/venv" | |
options: --gpus all | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Force change owner | |
run: | | |
chown -R root: ~ | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Install via exported requirements.txt | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install flake8 pytest poetry | |
poetry export --with dev --without-hashes -o requirements.txt | |
pip3 install -r requirements.txt | |
pip3 install torch torchvision torchaudio | |
- name: Check CUDA is available | |
run: nvidia-smi | |
- name: Auth gcloud | |
id: 'auth' | |
uses: 'google-github-actions/auth@v1' | |
with: | |
credentials_json: '${{ secrets.FRDC_DOWNLOAD_KEY }}' | |
- name: Set up Cloud SDK | |
uses: 'google-github-actions/setup-gcloud@v1' | |
- name: Set up WandB | |
run: | | |
echo "WANDB_API_KEY=${{ secrets.WANDB_API_KEY }}" >> $GITHUB_ENV | |
# Our project has src as a source path, explicitly add that in. | |
- name: Add src as PYTHONPATH | |
run: | | |
echo "PYTHONPATH=src" >> $GITHUB_ENV | |
# Do not do cd as it'll break PYTHONPATH. | |
- name: Run Model Training | |
run: | | |
python3 -m tests.model_tests.chestnut_dec_may.train | |
- name: Comment results via CML | |
run: | | |
cml comment update \ | |
--target=pr \ | |
--token ${{ secrets.GITHUB_TOKEN }} \ | |
tests/model_tests/chestnut_dec_may/report.md |