Skip to content

0.0.10

0.0.10 #49

Workflow file for this run

name: Model Training
on:
pull_request:
branches: [ 'main' ]
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
jobs:
build:
runs-on: self-hosted
container:
image: docker://ghcr.io/iterative/cml:0-dvc2-base1-gpu
volumes:
# This mounts and persists the venv between runs
- /home/runner/work/frdc-ml/_github_home:/root
# This mounts the resources folder
# - /home/runner/work/frdc-ml/_github_home/rsc:/__w/FRDC-ML/FRDC-ML/rsc
env:
# This is where setup-python will install and cache the venv
AGENT_TOOLSDIRECTORY: "/root/venv"
# This uses the host's exposed services
LABEL_STUDIO_HOST: "host.docker.internal"
LABEL_STUDIO_API_KEY: "${{ secrets.LABEL_STUDIO_API_KEY }}"
options: --gpus all
steps:
- uses: actions/checkout@v3
- name: Force change owner
run: |
chown -R root: ~
- name: Check if Label Studio Server is up
run: |
curl --fail --silent --head http://host.docker.internal:8080 || exit 1
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install via exported requirements.txt
run: |
python3 -m pip install --upgrade pip
python3 -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
- name: Add directories to PYTHONPATH
run: >
echo "PYTHONPATH=${{ github.workspace }}/src:\
${{ github.workspace }}/tests" >> $GITHUB_ENV
# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: Run Model Training
working-directory: ${{ github.workspace }}/tests
run: |
git config --global --add safe.directory /__w/FRDC-ML/FRDC-ML
python3 -m 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