Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit 9cad8b7

Browse files
committed
add test script for jenkins
1 parent 95e16b7 commit 9cad8b7

File tree

4 files changed

+99
-25
lines changed

4 files changed

+99
-25
lines changed

.jenkins/build.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
source /etc/lsb-release
6+
7+
# condition: if 14.04 and conda, conda install pytorch and build
8+
# condition: if 16.04 and conda, conda install pytorch and build
9+
# condition: if any and non-conda, simply build TC from scratch
10+
11+
if [[ "$DISTRIB_RELEASE" == 14.04 ]]; then
12+
if which conda &> /dev/null; then
13+
echo "Building TC in conda env"
14+
conda install -y -c pytorch pytorch
15+
conda install -y pyyaml
16+
WITH_PYTHON_C2=OFF CLANG_PREFIX=/usr/local/clang+llvm-tapir5.0 BUILD_TYPE=Release ./build.sh --all
17+
else
18+
echo "Building TC in non-conda env"
19+
WITH_PYTHON_C2=OFF CLANG_PREFIX=/usr/local/clang+llvm-tapir5.0 BUILD_TYPE=Release ./build.sh --all
20+
fi
21+
fi
22+
23+
if [[ "$DISTRIB_RELEASE" == 16.04 ]]; then
24+
if which conda &> /dev/null; then
25+
echo "Building TC in conda env"
26+
conda install -y pytorch cuda90 -c pytorch
27+
conda install -y pyyaml
28+
WITH_PYTHON_C2=OFF CLANG_PREFIX=/usr/local/clang+llvm-tapir5.0 BUILD_TYPE=Release ./build.sh --all
29+
else
30+
echo "Building TC in non-conda env"
31+
WITH_PYTHON_C2=OFF CLANG_PREFIX=/usr/local/clang+llvm-tapir5.0 BUILD_TYPE=Release ./build.sh --all
32+
fi
33+
fi

.jenkins/run_test.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
source /etc/lsb-release
6+
7+
# condition: if 14.04 and conda, also run python tests
8+
# condition: if 16.04 and conda, run only python tests
9+
# condition: if any and non-conda, run test.sh only
10+
11+
if [[ "$DISTRIB_RELEASE" == 14.04 ]]; then
12+
echo "Running TC backend tests"
13+
./test.sh
14+
if which conda &> /dev/null; then
15+
source activate
16+
echo "Running TC PyTorch tests"
17+
./test_python/run_test.sh
18+
fi
19+
fi
20+
21+
if [[ "$DISTRIB_RELEASE" == 16.04 ]]; then
22+
if which conda &> /dev/null; then
23+
echo "Running TC PyTorch tests"
24+
source activate
25+
./test_python/run_test.sh
26+
else
27+
echo "Running TC backend tests"
28+
./test.sh
29+
fi
30+
fi

docker/common/install_cuda.sh

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,41 @@
22

33
set -ex
44

5+
# NOTE: This script is called only when we are in conda environment
6+
7+
apt-get update
8+
apt-get install -y --no-install-recommends wget curl
9+
510
source /etc/lsb-release
611

712
if [[ "$DISTRIB_RELEASE" == 14.04 ]]; then
13+
export CUDA_REPO_PATH="ubuntu1404"
814
export CUDA_VERSION=8.0
9-
export CUDNN_VERSION=7
10-
11-
apt-get update
12-
apt-get install -y --no-install-recommends wget curl
13-
14-
pushd /tmp
15-
export ML_REPO_PKG="nvidia-machine-learning-repo-ubuntu1404_4.0-2_amd64.deb"
16-
wget --no-check-certificate https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1404/x86_64/${ML_REPO_PKG}
17-
dpkg -i ${ML_REPO_PKG}
18-
rm -f ${ML_REPO_PKG}
19-
popd
20-
21-
CUDNN_PKG_VERSION="7.0.5.15-1+cuda${CUDA_VERSION}"
22-
apt-get update
23-
# force-yes install since there is already a libcudnn shipped by nvidia docker
24-
# image but with a much higher libcudnn version
25-
apt-get install -y --force-yes --no-install-recommends \
26-
"libcudnn${CUDNN_VERSION}=${CUDNN_PKG_VERSION}" \
27-
"libcudnn${CUDNN_VERSION}-dev=${CUDNN_PKG_VERSION}"
28-
29-
ls /usr/local/cuda/targets/x86_64-linux/lib
30-
31-
# Cleanup package manager
32-
apt-get autoclean && apt-get clean
33-
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
15+
export ML_REPO_PKG="nvidia-machine-learning-repo-${CUDA_REPO_PATH}_4.0-2_amd64.deb"
16+
else
17+
export CUDA_REPO_PATH="ubuntu1604"
18+
export CUDA_VERSION=9.0
19+
export ML_REPO_PKG="nvidia-machine-learning-repo-${CUDA_REPO_PATH}_1.0.0-1_amd64.deb"
3420
fi
21+
22+
export CUDNN_VERSION=7
23+
24+
pushd /tmp
25+
wget --no-check-certificate https://developer.download.nvidia.com/compute/machine-learning/repos/${CUDA_REPO_PATH}/x86_64/${ML_REPO_PKG}
26+
dpkg -i ${ML_REPO_PKG}
27+
rm -f ${ML_REPO_PKG}
28+
popd
29+
30+
CUDNN_PKG_VERSION="7.0.5.15-1+cuda${CUDA_VERSION}"
31+
apt-get update
32+
# force-yes install since there is already a libcudnn shipped by nvidia docker
33+
# image but with a much higher libcudnn version
34+
apt-get install -y --force-yes --no-install-recommends \
35+
"libcudnn${CUDNN_VERSION}=${CUDNN_PKG_VERSION}" \
36+
"libcudnn${CUDNN_VERSION}-dev=${CUDNN_PKG_VERSION}"
37+
38+
ls /usr/local/cuda/targets/x86_64-linux/lib
39+
40+
# Cleanup package manager
41+
apt-get autoclean && apt-get clean
42+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

docker/ubuntu-cuda-conda/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,7 @@ RUN python --version
5959
RUN which cmake
6060
RUN cmake --version
6161

62+
# activate the root conda environment
63+
RUN source activate
64+
6265
CMD ["bash"]

0 commit comments

Comments
 (0)