Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable ccache for cudfjni build in Docker #10790

Merged
merged 18 commits into from
May 5, 2022
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,28 +112,39 @@ function buildLibCudfJniInDocker {
local localMavenRepo=${LOCAL_MAVEN_REPO:-"$HOME/.m2/repository"}
local workspaceRepoDir="$workspaceDir/cudf"
local workspaceMavenRepoDir="$workspaceDir/.m2/repository"
local workspaceCcacheDir="$workspaceDir/.ccache"
mkdir -p "$CUDF_JAR_JAVA_BUILD_DIR/libcudf-cmake-build"
mkdir -p "$HOME/.ccache" "$HOME/.m2"
nvidia-docker build \
-f java/ci/Dockerfile.centos7 \
--build-arg CUDA_VERSION=${cudaVersion} \
-t $imageName .
nvidia-docker run -it -u $(id -u):$(id -g) --rm \
-e PARALLEL_LEVEL \
-e CCACHE_DISABLE \
-e CCACHE_DIR="$workspaceCcacheDir" \
-v "/etc/group:/etc/group:ro" \
-v "/etc/passwd:/etc/passwd:ro" \
-v "/etc/shadow:/etc/shadow:ro" \
-v "/etc/sudoers.d:/etc/sudoers.d:ro" \
-v "$HOME/.ccache:$workspaceCcacheDir:rw" \
-v "$REPODIR:$workspaceRepoDir:rw" \
-v "$localMavenRepo:$workspaceMavenRepoDir:rw" \
--workdir "$workspaceRepoDir/java/target/libcudf-cmake-build" \
${imageName} \
scl enable devtoolset-9 \
"cmake $workspaceRepoDir/cpp \
-G${CMAKE_GENERATOR} \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_CUDA_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_LINKER_LAUNCHER=ccache \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCUDA_STATIC_RUNTIME=ON \
-DCMAKE_CUDA_ARCHITECTURES=${CUDF_CMAKE_CUDA_ARCHITECTURES} \
-DCMAKE_INSTALL_PREFIX==/usr/local/rapids \
-DUSE_NVTX=ON -DCUDF_USE_ARROW_STATIC=ON \
-DCMAKE_INSTALL_PREFIX=/usr/local/rapids \
-DUSE_NVTX=ON \
-DCUDF_USE_ARROW_STATIC=ON \
-DCUDF_ENABLE_ARROW_S3=OFF \
-DBUILD_TESTS=OFF \
-DPER_THREAD_DEFAULT_STREAM=ON \
Expand All @@ -145,6 +156,10 @@ function buildLibCudfJniInDocker {
-Dmaven.repo.local=$workspaceMavenRepoDir \
-DskipTests=${SKIP_TESTS:-false} \
-Dparallel.level=${PARALLEL_LEVEL} \
-Dcmake.ccache.opts='-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_CUDA_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_LINKER_LAUNCHER=ccache' \
-DCUDF_CPP_BUILD_DIR=$workspaceRepoDir/java/target/libcudf-cmake-build \
-DCUDA_STATIC_RUNTIME=ON \
-DPER_THREAD_DEFAULT_STREAM=ON \
Expand Down
21 changes: 20 additions & 1 deletion java/ci/Dockerfile.centos7
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ ARG CUDA_VERSION=11.5.0
FROM gpuci/cuda:$CUDA_VERSION-devel-centos7

### Install basic requirements
ARG DEVTOOLSET_VERSION=9
RUN yum install -y centos-release-scl
RUN yum install -y devtoolset-9 epel-release
RUN yum install -y devtoolset-${DEVTOOLSET_VERSION} epel-release
RUN yum install -y git zlib-devel maven tar wget patch ninja-build

## pre-create the CMAKE_INSTALL_PREFIX folder, set writable by any user for Jenkins
Expand All @@ -37,4 +38,22 @@ ARG CMAKE_VERSION=3.22.3
RUN cd /usr/local/ && wget --quiet https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz && \
tar zxf cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz && \
rm cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz

ENV PATH /usr/local/cmake-${CMAKE_VERSION}-linux-x86_64/bin:$PATH

ARG CCACHE_VERSION=4.6
RUN cd /tmp && wget --quiet https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz && \
tar zxf ccache-${CCACHE_VERSION}.tar.gz && \
rm ccache-${CCACHE_VERSION}.tar.gz && \
cd ccache-${CCACHE_VERSION} && \
mkdir build && \
cd build && \
scl enable devtoolset-${DEVTOOLSET_VERSION} \
"cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DZSTD_FROM_INTERNET=ON \
-DREDIS_STORAGE_BACKEND=OFF && \
cmake --build . --parallel ${PARALLEL_LEVEL} && \
cmake --build . --target install" && \
gerashegalov marked this conversation as resolved.
Show resolved Hide resolved
cd ../.. && \
rm -rf ccache-${CCACHE_VERSION}
2 changes: 2 additions & 0 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
<arrow.version>0.15.1</arrow.version>
<parallel.level>4</parallel.level>
<CUDF_CPP_BUILD_DIR/>
<cmake.ccache.opts/>
</properties>

<profiles>
Expand Down Expand Up @@ -382,6 +383,7 @@
failonerror="true"
executable="cmake">
<arg value="${basedir}/src/main/native"/>
<arg line="${cmake.ccache.opts}"/>
gerashegalov marked this conversation as resolved.
Show resolved Hide resolved
<arg value="-DCUDA_STATIC_RUNTIME=${CUDA_STATIC_RUNTIME}" />
<arg value="-DPER_THREAD_DEFAULT_STREAM=${PER_THREAD_DEFAULT_STREAM}" />
<arg value="-DUSE_GDS=${USE_GDS}" />
Expand Down