-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (58 loc) · 2.43 KB
/
test_gpu.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# 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] '/opt/launch-sh/bin/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