Add cuda 8/9.1 centos 6 builds, test GPU wheel on CPU only container. (#3309)
* Add cuda 8/9.1 centos 6 builds, test GPU wheel on CPU only container. * Add Google test
This commit is contained in:
@@ -1,49 +0,0 @@
|
||||
FROM ubuntu:14.04
|
||||
|
||||
# Environment
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
# Install all basic requirements
|
||||
RUN \
|
||||
apt-get update -q -y && \
|
||||
apt-get -y dist-upgrade && \
|
||||
apt-get -y --no-install-recommends install \
|
||||
build-essential \
|
||||
wget \
|
||||
unzip \
|
||||
gfortran \
|
||||
# BLAS
|
||||
libatlas-base-dev \
|
||||
# Python 2
|
||||
python-setuptools \
|
||||
python-pip \
|
||||
python-dev \
|
||||
&& \
|
||||
# CMake
|
||||
wget http://www.cmake.org/files/v3.5/cmake-3.5.2.tar.gz && \
|
||||
tar -xvzf cmake-3.5.2.tar.gz && \
|
||||
cd cmake-3.5.2/ && ./configure && make && make install && cd ../ && \
|
||||
# Clean up
|
||||
rm -rf cmake-3.5.2/ && rm -rf cmake-3.5.2.tar.gz && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/cache/apt/*
|
||||
|
||||
|
||||
# Install Python packages
|
||||
RUN pip install numpy nose scipy scikit-learn wheel
|
||||
|
||||
ENV GOSU_VERSION 1.10
|
||||
|
||||
# Install lightweight sudo (not bound to TTY)
|
||||
RUN set -ex; \
|
||||
dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" && \
|
||||
wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" && \
|
||||
chmod +x /usr/local/bin/gosu && \
|
||||
gosu nobody true
|
||||
|
||||
# Default entry-point to use if running locally
|
||||
# It will preserve attributes of created files
|
||||
COPY entrypoint.sh /scripts/
|
||||
|
||||
WORKDIR /workspace
|
||||
ENTRYPOINT ["/scripts/entrypoint.sh"]
|
||||
@@ -1,43 +1,38 @@
|
||||
FROM nvidia/cuda:8.0-devel-ubuntu14.04
|
||||
ARG CUDA_VERSION
|
||||
FROM nvidia/cuda:$CUDA_VERSION-devel-centos6
|
||||
|
||||
# Environment
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
# Install all basic requirements
|
||||
RUN \
|
||||
apt-get update -q -y && \
|
||||
apt-get -y dist-upgrade && \
|
||||
apt-get -y --no-install-recommends install \
|
||||
build-essential \
|
||||
wget \
|
||||
unzip \
|
||||
gfortran \
|
||||
# BLAS
|
||||
libatlas-base-dev \
|
||||
# Python 2
|
||||
python-setuptools \
|
||||
python-pip \
|
||||
python-dev \
|
||||
&& \
|
||||
yum -y update && \
|
||||
yum install -y wget unzip && \
|
||||
wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo && \
|
||||
yum install -y devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c++ && \
|
||||
# Python
|
||||
wget https://repo.continuum.io/miniconda/Miniconda2-4.3.27-Linux-x86_64.sh && \
|
||||
bash Miniconda2-4.3.27-Linux-x86_64.sh -b -p /opt/python && \
|
||||
# CMake
|
||||
wget http://www.cmake.org/files/v3.5/cmake-3.5.2.tar.gz && \
|
||||
tar -xvzf cmake-3.5.2.tar.gz && \
|
||||
cd cmake-3.5.2/ && ./configure && make && make install && cd ../ && \
|
||||
# Clean up
|
||||
rm -rf cmake-3.5.2/ && rm -rf cmake-3.5.2.tar.gz && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/cache/apt/*
|
||||
rm -rf cmake-3.5.2/ && rm -rf cmake-3.5.2.tar.gz
|
||||
|
||||
ENV PATH=/opt/python/bin:$PATH
|
||||
ENV CC=/opt/rh/devtoolset-2/root/usr/bin/gcc
|
||||
ENV CXX=/opt/rh/devtoolset-2/root/usr/bin/c++
|
||||
ENV CPP=/opt/rh/devtoolset-2/root/usr/bin/cpp
|
||||
|
||||
# Install Python packages
|
||||
RUN pip install numpy nose scipy scikit-learn wheel
|
||||
RUN \
|
||||
pip install numpy nose scipy scikit-learn wheel
|
||||
|
||||
ENV GOSU_VERSION 1.10
|
||||
|
||||
# Install lightweight sudo (not bound to TTY)
|
||||
RUN set -ex; \
|
||||
dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" && \
|
||||
wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" && \
|
||||
wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-amd64" && \
|
||||
chmod +x /usr/local/bin/gosu && \
|
||||
gosu nobody true
|
||||
|
||||
|
||||
34
tests/ci_build/Dockerfile.release
Normal file
34
tests/ci_build/Dockerfile.release
Normal file
@@ -0,0 +1,34 @@
|
||||
FROM centos:6
|
||||
|
||||
# Environment
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
# Install all basic requirements
|
||||
RUN \
|
||||
yum -y update && \
|
||||
yum install -y wget graphviz && \
|
||||
# Python
|
||||
wget https://repo.continuum.io/miniconda/Miniconda2-4.3.27-Linux-x86_64.sh && \
|
||||
bash Miniconda2-4.3.27-Linux-x86_64.sh -b -p /opt/python
|
||||
|
||||
ENV PATH=/opt/python/bin:$PATH
|
||||
|
||||
# Install Python packages
|
||||
RUN \
|
||||
conda install numpy scipy pandas matplotlib nose scikit-learn && \
|
||||
pip install nose wheel auditwheel graphviz
|
||||
|
||||
ENV GOSU_VERSION 1.10
|
||||
|
||||
# Install lightweight sudo (not bound to TTY)
|
||||
RUN set -ex; \
|
||||
wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-amd64" && \
|
||||
chmod +x /usr/local/bin/gosu && \
|
||||
gosu nobody true
|
||||
|
||||
# Default entry-point to use if running locally
|
||||
# It will preserve attributes of created files
|
||||
COPY entrypoint.sh /scripts/
|
||||
|
||||
WORKDIR /workspace
|
||||
ENTRYPOINT ["/scripts/entrypoint.sh"]
|
||||
@@ -1,7 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
make clean
|
||||
# Build gtest via cmake
|
||||
rm -rf gtest
|
||||
wget https://github.com/google/googletest/archive/release-1.7.0.zip
|
||||
unzip release-1.7.0.zip
|
||||
mv googletest-release-1.7.0 gtest && cd gtest
|
||||
cmake . && make
|
||||
mkdir lib && mv libgtest.a lib
|
||||
cd ..
|
||||
rm -rf release-1.7.0.zip*
|
||||
|
||||
rm -rf build
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. "$@"
|
||||
make
|
||||
cmake .. "$@" -DGOOGLE_TEST=ON -DGTEST_ROOT=../gtest
|
||||
make clean
|
||||
make -j
|
||||
cd ..
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
make clean
|
||||
make "$@"
|
||||
@@ -37,6 +37,12 @@ if [[ "$1" == "-it" ]]; then
|
||||
shift 1
|
||||
fi
|
||||
|
||||
if [[ "$1" == "--build-arg" ]]; then
|
||||
CI_DOCKER_BUILD_ARG+="$1"
|
||||
CI_DOCKER_BUILD_ARG+=" $2"
|
||||
shift 2
|
||||
fi
|
||||
|
||||
if [[ ! -f "${DOCKERFILE_PATH}" ]]; then
|
||||
echo "Invalid Dockerfile path: \"${DOCKERFILE_PATH}\""
|
||||
exit 1
|
||||
@@ -76,6 +82,10 @@ WORKSPACE="${WORKSPACE:-${SCRIPT_DIR}/../../}"
|
||||
# Determine the docker image name
|
||||
DOCKER_IMG_NAME="xgb-ci.${CONTAINER_TYPE}"
|
||||
|
||||
# Append cuda version if available
|
||||
CUDA_VERSION=$(echo "${CI_DOCKER_BUILD_ARG}" | grep CUDA_VERSION | egrep -o '[0-9]*\.[0-9]*')
|
||||
DOCKER_IMG_NAME=$DOCKER_IMG_NAME$CUDA_VERSION
|
||||
|
||||
# Under Jenkins matrix build, the build tag may contain characters such as
|
||||
# commas (,) and equal signs (=), which are not valid inside docker image names.
|
||||
DOCKER_IMG_NAME=$(echo "${DOCKER_IMG_NAME}" | sed -e 's/=/_/g' -e 's/,/-/g')
|
||||
@@ -96,6 +106,7 @@ fi
|
||||
cat <<EOF
|
||||
WORKSPACE: ${WORKSPACE}
|
||||
CI_DOCKER_EXTRA_PARAMS: ${CI_DOCKER_EXTRA_PARAMS[*]}
|
||||
CI_DOCKER_BUILD_ARG: ${CI_DOCKER_BUILD_ARG}
|
||||
COMMAND: ${COMMAND[*]}
|
||||
CONTAINER_TYPE: ${CONTAINER_TYPE}
|
||||
BUILD_TAG: ${BUILD_TAG}
|
||||
@@ -108,7 +119,12 @@ EOF
|
||||
# Build the docker container.
|
||||
echo "Building container (${DOCKER_IMG_NAME})..."
|
||||
# --pull should be default
|
||||
echo "docker build \
|
||||
${CI_DOCKER_BUILD_ARG} \
|
||||
-t ${DOCKER_IMG_NAME} \
|
||||
-f ${DOCKERFILE_PATH} ${DOCKER_CONTEXT_PATH}"
|
||||
docker build \
|
||||
${CI_DOCKER_BUILD_ARG} \
|
||||
-t "${DOCKER_IMG_NAME}" \
|
||||
-f "${DOCKERFILE_PATH}" "${DOCKER_CONTEXT_PATH}"
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
true
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
cd python-package
|
||||
python setup.py install --user
|
||||
cd ..
|
||||
python -m nose tests/python-gpu
|
||||
python -m nose --attr='!slow' tests/python-gpu/
|
||||
./testxgboost
|
||||
|
||||
|
||||
Reference in New Issue
Block a user