"docs/vscode:/vscode.git/clone" did not exist on "4bae76e4539c30f68fa4e39c4e492a2155cf81d0"
task_pytorch_tutorial_test.sh 697 Bytes
Newer Older
Minjie Wang's avatar
Minjie Wang committed
1
2
3
#!/bin/bash
# The working directory for this script will be "tests/scripts"

VoVAllen's avatar
VoVAllen committed
4
5
. /opt/conda/etc/profile.d/conda.sh
conda activate pytorch-ci
Minjie Wang's avatar
Minjie Wang committed
6
TUTORIAL_ROOT="./tutorials"
7

Minjie Wang's avatar
Minjie Wang committed
8
9
10
11
12
function fail {
    echo FAIL: $@
    exit -1
}

Minjie Wang's avatar
Minjie Wang committed
13
14
15
16
export MPLBACKEND=Agg
export DGLBACKEND=pytorch
export DGL_LIBRARY_PATH=${PWD}/build
export PYTHONPATH=${PWD}/python:$PYTHONPATH
17
export DGL_DOWNLOAD_DIR=${PWD}/_download
Minjie Wang's avatar
Minjie Wang committed
18

19
20
pushd ${TUTORIAL_ROOT} > /dev/null
# Install requirements
VoVAllen's avatar
VoVAllen committed
21
pip install -r requirements.txt || fail "installing requirements"
Minjie Wang's avatar
Minjie Wang committed
22

23
# Test
24
for f in $(find . -path ./dist -prune -false -o -name "*.py" ! -name "*_mx.py")
Minjie Wang's avatar
Minjie Wang committed
25
26
27
28
do
    echo "Running tutorial ${f} ..."
    python3 $f || fail "run ${f}"
done
29

30
popd > /dev/null