Add GPU CI/CD #32
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: "GPU CI/CD" | |
on: | |
pull_request: | |
branches: | |
- 'main' | |
- '[rv][0-9].[0-9].[0-9]' | |
- '[rv][0-9].[0-9].[0-9]rc[0-9]' | |
types: [ labeled ] | |
jobs: | |
build-container: | |
if: ${{ github.event.label.name == 'gpuci' }} | |
uses: ./.github/workflows/_build_container.yml | |
run-gpu-tests: | |
needs: build-container | |
runs-on: self-hosted | |
if: ${{ github.event.label.name == 'gpuci' }} | |
steps: | |
- name: Remove existing container if it exists | |
run: | | |
if [ "$(docker ps -aq -f name=nemo-curator-container)" ]; then | |
docker rm -f nemo-curator-container | |
fi | |
- name: Run Docker container | |
run: | | |
docker run --gpus all --runtime=nvidia --name nemo-curator-container -d nemoci.azurecr.io/nemo_curator_container:${{ github.run_id }} bash -c "sleep infinity" | |
- name: Check GPUs | |
run: | | |
whoami | |
docker exec nemo-curator-container nvidia-smi | |
- name: Verify installations | |
run: | | |
docker exec nemo-curator-container /bin/bash -c "source activate rapids && pip list" | |
- name: Run PyTests with GPU mark | |
run: | | |
docker exec nemo-curator-container /bin/bash -c "source activate rapids && pytest -m gpu --rootdir /opt/NeMo-Curator /opt/NeMo-Curator/tests" | |
- name: Cleanup | |
run: | | |
docker stop nemo-curator-container && docker rm nemo-curator-container |