"...source/git@developer.sourcefind.cn:OpenDAS/fairscale.git" did not exist on "61aac92ab7e06c0bcfbe6140e875b88359bddfa1"
Commit c9e3c658 authored by Minjie Wang's avatar Minjie Wang
Browse files

Merge branch 'cpp' of github.com:zzhang-cn/dgl into cpp

parents 820c6b9e 49ea781c
#!/usr/bin/env groovy
def setup() {
sh 'easy_install nose'
sh 'git submodule init'
sh 'git submodule update'
}
def build_dgl() {
sh 'if [ -d build ]; then rm -rf build; fi; mkdir build'
dir('python') {
sh 'python3 setup.py install'
}
dir ('build') {
sh 'cmake ..'
sh 'make -j$(nproc)'
}
}
def unit_test() {
withEnv(["DGL_LIBRARY_PATH=${env.WORKSPACE}/build"]) {
sh 'nosetests tests -v --with-xunit'
sh 'nosetests tests/pytorch -v --with-xunit'
sh 'nosetests tests/graph_index -v --with-xunit'
}
}
def example_test(dev) {
dir ('tests/scripts') {
withEnv(["DGL_LIBRARY_PATH=${env.WORKSPACE}/build"]) {
sh "./test_examples.sh ${dev}"
}
}
}
pipeline { pipeline {
agent none agent none
stages { stages {
...@@ -7,36 +42,27 @@ pipeline { ...@@ -7,36 +42,27 @@ pipeline {
agent { agent {
docker { docker {
image 'lingfanyu/dgl-cpu' image 'lingfanyu/dgl-cpu'
args '-u root'
} }
} }
stages { stages {
stage('SETUP') { stage('SETUP') {
steps { steps {
sh 'easy_install nose' setup()
sh 'git submodule init'
sh 'git submodule update'
} }
} }
stage('BUILD') { stage('BUILD') {
steps { steps {
sh 'if [ -d build ]; then rm -rf build; fi; mkdir build' build_dgl()
dir('python') { }
sh 'python3 setup.py install' }
} stage('UNIT TEST') {
dir ('build') { steps {
sh 'cmake ..' unit_test()
sh 'make -j$(nproc)'
}
} }
} }
stage('TEST') { stage('EXAMPLE TEST') {
steps { steps {
withEnv(["DGL_LIBRARY_PATH=${env.WORKSPACE}/build"]) { example_test('CPU')
sh 'nosetests tests -v --with-xunit'
sh 'nosetests tests/pytorch -v --with-xunit'
sh 'nosetests tests/graph_index -v --with-xunit'
}
} }
} }
} }
...@@ -50,36 +76,28 @@ pipeline { ...@@ -50,36 +76,28 @@ pipeline {
agent { agent {
docker { docker {
image 'lingfanyu/dgl-gpu' image 'lingfanyu/dgl-gpu'
args '--runtime nvidia -u root' args '--runtime nvidia'
} }
} }
stages { stages {
stage('SETUP') { stage('SETUP') {
steps { steps {
sh 'easy_install nose' setup()
sh 'git submodule init'
sh 'git submodule update'
} }
} }
stage('BUILD') { stage('BUILD') {
steps { steps {
sh 'if [ -d build ]; then rm -rf build; fi; mkdir build' build_dgl()
dir('python') { }
sh 'python3 setup.py install' }
} stage('UNIT TEST') {
dir ('build') { steps {
sh 'cmake ..' unit_test()
sh 'make -j$(nproc)'
}
} }
} }
stage('TEST') { stage('EXAMPLE TEST') {
steps { steps {
withEnv(["DGL_LIBRARY_PATH=${env.WORKSPACE}/build"]) { example_test('GPU')
sh 'nosetests tests -v --with-xunit'
sh 'nosetests tests/pytorch -v --with-xunit'
sh 'nosetests tests/graph_index -v --with-xunit'
}
} }
} }
} }
......
#!/bin/bash
GCN_EXAMPLE_DIR="../../examples/pytorch/gcn"
function fail {
echo FAIL: $@
exit -1
}
function usage {
echo "Usage: $0 [CPU|GPU]"
}
# check arguments
if [ $# -ne 1 ]; then
usage
fail "Error: must specify device"
fi
if [ "$1" == "CPU" ]; then
dev=-1
elif [ "$1" == "GPU" ]; then
export CUDA_VISIBLE_DEVICES=0
dev=0
else
usage
fail "Unknown device $1"
fi
pushd $GCN_EXAMPLE_DIR> /dev/null
# test CPU
python3 gcn.py --dataset cora --gpu $dev || fail "run gcn.py on $1"
python3 gcn_spmv.py --dataset cora --gpu $dev || fail "run gcn_spmv.py on $1"
popd > /dev/null
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment