-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest.sh
executable file
·47 lines (41 loc) · 1.58 KB
/
test.sh
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
#! /bin/sh
set -e
distro="$1"
arch="x86_64"
case $distro in
ubuntu) distro_ver="${distro}16.04" ;;
centos) distro_ver="${distro}7.6" ;;
alpine) distro_ver="${distro}3.8" ;;
*)
echo "Unknown distro value: ${distro}"
exit 1
esac
user="$(id -u):$(id -g)"
echo ">> Running unit tests for ${distro} ${arch}"
docker run --rm -it -u ${user} -v $(pwd):/root \
lablup/hook-dev:${distro} \
/root/test-hook.${distro_ver}.${arch}.bin
echo ""
echo ">> Running integration tests for ${distro} ${arch}"
docker run --rm -it -u ${user} -v $(pwd):/root \
--cpuset-cpus=0-1,4-5 \
--memory=1g \
-e LD_PRELOAD=/root/libbaihook.${distro_ver}.${arch}.so \
lablup/hook-dev:${distro} \
/root/test-hooked.${distro_ver}.${arch}.bin
if [ "$distro" = "ubuntu" ]; then
echo ""
echo ">> Running integration tests for lablup/python-ff:19.06-py36"
docker run --rm -it -u ${user} -v $(pwd):/root -w /root/test \
--cpuset-cpus=0-1,4-5 \
--memory=1g \
-e LD_PRELOAD=/root/libbaihook.ubuntu16.04.x86_64.so \
lablup/python-ff:19.06-py36-cuda9 \
python /root/test/test-numpy.py
docker run --rm -it -u ${user} -v $(pwd):/root -w /root/test \
--cpuset-cpus=0-1,4-5 \
--memory=1g \
-e LD_PRELOAD=/root/libbaihook.ubuntu16.04.x86_64.so \
lablup/python-ff:19.06-py36-cuda9 \
sh -c 'mkdir -p /tmp/output; jupyter nbconvert --to notebook --execute assets/src.ipynb --output assets/result.ipynb; ls -l /tmp && ls -l assets'
fi