Skip to content

GPU Test

GPU Test #23

Workflow file for this run

# Tests Tensorflow and Pytorch by SSHing into dsmlp-login and booting up a container using the launch script.
# The test currently uses the rmankini user but will soon be swapped to a test account.
# The tests currently live in the TEST_NBGRADER public directory under tests_gpu, and are run by pytest.
# (For those who don't know pytest, it parses all files and functions that have "test" in the name).
# The tests typically run functions that engage the GPU. After the tests are run, the stdout of the entire SSH session is captured in a bash variable.
# The output is parsed to make sure none of the pytests failed. The job will then fail if any failure are detected.
name: GPU Test
on:
workflow_dispatch:
inputs:
originalTag:
description: "Tag to be tested."
default: "2099.3-somehash"
required: true
dryRun:
type: boolean
description: 'dry-run: retrieve original image names ONLY'
default: false
required: false
workflow_call:
inputs:
originalTag:
description: "Tag to be tested."
default: "2099.3-somehash"
required: true
type: string
dryRun:
type: boolean
description: 'dry-run: retrieve original image names ONLY'
default: false
required: true
jobs:
docker-pipeline:
runs-on: ubuntu-latest
if: >
!contains(github.event.head_commit.message , 'skip ci') &&
!contains(github.event.pull_request.title, 'skip ci')
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: SSH to login
if: ${{ github.event.inputs.dryRun == 'false'}}
run: |
echo "Going into dsmlp-login and running pytest."
echo "Using hash ${{ github.event.inputs.originalTag }}."
sudo apt-get install sshpass
mkdir ~/.ssh
touch ~/.ssh/config
echo "UserKnownHostsFile=/dev/null" >> ~/.ssh/config
echo "StrictHostKeyChecking=no" >> ~/.ssh/config
echo "About to SSH."
output=$(sshpass -p ${{ secrets.DSMLP_LOGIN_PASSWORD }} ssh [email protected] 'launch.sh -i ghcr.io/ucsd-ets/scipy-ml-notebook:${{ github.event.inputs.originalTag }} -P Always -g 1 -c 4 -m 32 -f pytest /opt/workflow_tests')
echo "$output"
if [[ "$output" == *"FAILURES"* ]]; then
echo "Failure detected."
exit 1
fi