Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
c9e3c658
Commit
c9e3c658
authored
Oct 18, 2018
by
Minjie Wang
Browse files
Merge branch 'cpp' of github.com:zzhang-cn/dgl into cpp
parents
820c6b9e
49ea781c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
90 additions
and
36 deletions
+90
-36
Jenkinsfile
Jenkinsfile
+54
-36
tests/scripts/test_examples.sh
tests/scripts/test_examples.sh
+36
-0
No files found.
Jenkinsfile
View file @
c9e3c658
#
!
/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
{
agent
none
stages
{
...
...
@@ -7,36 +42,27 @@ pipeline {
agent
{
docker
{
image
'lingfanyu/dgl-cpu'
args
'-u root'
}
}
stages
{
stage
(
'SETUP'
)
{
steps
{
sh
'easy_install nose'
sh
'git submodule init'
sh
'git submodule update'
setup
()
}
}
stage
(
'BUILD'
)
{
steps
{
sh
'if [ -d build ]; then rm -rf build; fi; mkdir build'
dir
(
'python'
)
{
sh
'python3 setup.py install'
build_dgl
()
}
dir
(
'build'
)
{
sh
'cmake ..'
sh
'make -j$(nproc)'
}
stage
(
'UNIT TEST'
)
{
steps
{
unit_test
()
}
}
stage
(
'TEST'
)
{
stage
(
'
EXAMPLE
TEST'
)
{
steps
{
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'
}
example_test
(
'CPU'
)
}
}
}
...
...
@@ -50,36 +76,28 @@ pipeline {
agent
{
docker
{
image
'lingfanyu/dgl-gpu'
args
'--runtime nvidia
-u root
'
args
'--runtime nvidia'
}
}
stages
{
stage
(
'SETUP'
)
{
steps
{
sh
'easy_install nose'
sh
'git submodule init'
sh
'git submodule update'
setup
()
}
}
stage
(
'BUILD'
)
{
steps
{
sh
'if [ -d build ]; then rm -rf build; fi; mkdir build'
dir
(
'python'
)
{
sh
'python3 setup.py install'
build_dgl
()
}
dir
(
'build'
)
{
sh
'cmake ..'
sh
'make -j$(nproc)'
}
stage
(
'UNIT TEST'
)
{
steps
{
unit_test
()
}
}
stage
(
'TEST'
)
{
stage
(
'
EXAMPLE
TEST'
)
{
steps
{
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'
}
example_test
(
'GPU'
)
}
}
}
...
...
tests/scripts/test_examples.sh
0 → 100755
View file @
c9e3c658
#!/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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment