* Basic script for using compilation database. * Add `GENERATE_COMPILATION_DATABASE' to CMake. * Rearrange CMakeLists.txt. * Add basic python clang-tidy script. * Remove modernize-use-auto. * Add clang-tidy to Jenkins * Refine logic for correct path detection In Jenkins, the project root is of form /home/ubuntu/workspace/xgboost_PR-XXXX * Run clang-tidy in CUDA 9.2 container * Use clang_tidy container
46 lines
1.6 KiB
Docker
46 lines
1.6 KiB
Docker
ARG CUDA_VERSION
|
|
FROM nvidia/cuda:$CUDA_VERSION-devel-ubuntu18.04
|
|
|
|
# Environment
|
|
ENV DEBIAN_FRONTEND noninteractive
|
|
|
|
# Install all basic requirements
|
|
RUN \
|
|
apt-get update && \
|
|
apt-get install -y tar unzip wget git build-essential cmake python3 python3-pip llvm-7 clang-tidy-7 clang-7
|
|
|
|
# Set default clang-tidy version
|
|
RUN \
|
|
update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-7 100 && \
|
|
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-7 100
|
|
|
|
# NCCL2 (License: https://docs.nvidia.com/deeplearning/sdk/nccl-sla/index.html)
|
|
RUN \
|
|
export CUDA_SHORT=`echo $CUDA_VERSION | egrep -o '[0-9]+\.[0-9]'` && \
|
|
if [ "${CUDA_SHORT}" != "10.0" ]; then \
|
|
wget https://developer.download.nvidia.com/compute/redist/nccl/v2.2/nccl_2.2.13-1%2Bcuda${CUDA_SHORT}_x86_64.txz && \
|
|
tar xf "nccl_2.2.13-1+cuda${CUDA_SHORT}_x86_64.txz" && \
|
|
cp nccl_2.2.13-1+cuda${CUDA_SHORT}_x86_64/include/nccl.h /usr/include && \
|
|
cp nccl_2.2.13-1+cuda${CUDA_SHORT}_x86_64/lib/* /usr/lib && \
|
|
rm -f nccl_2.2.13-1+cuda${CUDA_SHORT}_x86_64.txz && \
|
|
rm -r nccl_2.2.13-1+cuda${CUDA_SHORT}_x86_64; fi
|
|
|
|
# Install Python packages
|
|
RUN \
|
|
pip3 install pyyaml
|
|
|
|
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"]
|