Skip to content

Commit bce0899

Browse files
pitroukou
authored andcommitted
ARROW-7374: [Dev] [C++] Fix cuda-cpp docker build
Also add a CUDA 9.1 Dockerfile for Ubuntu 18.04 hosts. (official Ubuntu 18.04 packages don't provide CUDA 10.0, only 9.1) Closes apache#6016 from pitrou/ARROW-7374-docker-cuda-cpp and squashes the following commits: 6fa82b2 <Antoine Pitrou> Apply @kou's proposed fix 3e65972 <Antoine Pitrou> ARROW-7374: Fix cuda-cpp docker build Authored-by: Antoine Pitrou <antoine@python.org> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
1 parent 860796e commit bce0899

4 files changed

Lines changed: 111 additions & 9 deletions

File tree

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
REPO=apache/arrow-dev
2222
ARCH=amd64
23-
CUDA=10.0
23+
CUDA=9.1
2424
DEBIAN=10
2525
UBUNTU=18.04
2626
FEDORA=29

ci/docker/cuda-10.0-cpp.dockerfile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ RUN apt-get update -y -q && \
5959
ninja-build \
6060
pkg-config \
6161
protobuf-compiler \
62+
python-minimal \
6263
rapidjson-dev \
6364
thrift-compiler \
6465
tzdata && \
@@ -72,17 +73,23 @@ RUN apt-get update -y -q && \
7273
# - libgtest-dev only provide sources
7374
# - libprotobuf-dev only provide sources
7475
# - thrift is too old
75-
ENV ARROW_CUDA=ON \
76+
ENV ARROW_BUILD_STATIC=OFF \
77+
ARROW_BUILD_TESTS=ON \
78+
ARROW_COMPUTE=OFF \
79+
ARROW_CSV=OFF \
80+
ARROW_CUDA=ON \
81+
ARROW_DATASET=OFF \
7682
ARROW_DEPENDENCY_SOURCE=SYSTEM \
83+
ARROW_FILESYSTEM=OFF \
7784
ARROW_FLIGHT=OFF \
7885
ARROW_HOME=/usr/local \
7986
ARROW_INSTALL_NAME_RPATH=OFF \
8087
ARROW_NO_DEPRECATED_API=ON \
8188
ARROW_PLASMA=ON \
82-
ARROW_USE_ASAN=ON \
8389
ARROW_USE_CCACHE=ON \
84-
ARROW_USE_UBSAN=ON \
90+
CUDA_LIB_PATH=${LIBRARY_PATH} \
8591
GTest_SOURCE=BUNDLED \
8692
ORC_SOURCE=BUNDLED \
8793
PATH=/usr/lib/ccache/:$PATH \
88-
Thrift_SOURCE=BUNDLED
94+
Thrift_SOURCE=BUNDLED \
95+
LD_LIBRARY_PATH=/usr/local/cuda/lib64/

ci/docker/cuda-9.1-cpp.dockerfile

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
FROM nvidia/cuda:9.1-devel-ubuntu16.04
19+
20+
# pipefail is enabled for proper error detection in the `wget | apt-key add`
21+
# step
22+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
23+
24+
ENV DEBIAN_FRONTEND=noninteractive
25+
26+
RUN apt-get update -y -q && \
27+
apt-get install -y -q --no-install-recommends \
28+
wget software-properties-common && \
29+
apt-get clean && rm -rf /var/lib/apt/lists*
30+
31+
# Installs C++ toolchain and dependencies
32+
RUN apt-get update -y -q && \
33+
apt-get install -y -q --no-install-recommends \
34+
autoconf \
35+
bison \
36+
ca-certificates \
37+
ccache \
38+
cmake \
39+
flex \
40+
g++ \
41+
gcc \
42+
git \
43+
libboost-filesystem-dev \
44+
libboost-regex-dev \
45+
libboost-system-dev \
46+
libbrotli-dev \
47+
libbz2-dev \
48+
libgflags-dev \
49+
libgoogle-glog-dev \
50+
liblz4-dev \
51+
liblzma-dev \
52+
libprotobuf-dev \
53+
libprotoc-dev \
54+
libre2-dev \
55+
libsnappy-dev \
56+
libssl-dev \
57+
libzstd-dev \
58+
ninja-build \
59+
pkg-config \
60+
protobuf-compiler \
61+
python-minimal \
62+
rapidjson-dev \
63+
thrift-compiler \
64+
tzdata && \
65+
apt-get clean && rm -rf /var/lib/apt/lists*
66+
67+
# Prioritize system packages and local installation
68+
# The following dependencies will be downloaded due to missing/invalid packages
69+
# provided by the distribution:
70+
# - libc-ares-dev does not install CMake config files
71+
# - flatbuffer is not packaged
72+
# - libgtest-dev only provide sources
73+
# - libprotobuf-dev only provide sources
74+
# - thrift is too old
75+
ENV ARROW_BUILD_STATIC=OFF \
76+
ARROW_BUILD_TESTS=ON \
77+
ARROW_COMPUTE=OFF \
78+
ARROW_CSV=OFF \
79+
ARROW_CUDA=ON \
80+
ARROW_DATASET=OFF \
81+
ARROW_DEPENDENCY_SOURCE=SYSTEM \
82+
ARROW_FILESYSTEM=OFF \
83+
ARROW_FLIGHT=OFF \
84+
ARROW_HOME=/usr/local \
85+
ARROW_INSTALL_NAME_RPATH=OFF \
86+
ARROW_NO_DEPRECATED_API=ON \
87+
ARROW_PLASMA=ON \
88+
ARROW_USE_CCACHE=ON \
89+
GTest_SOURCE=BUNDLED \
90+
ORC_SOURCE=BUNDLED \
91+
PATH=/usr/lib/ccache/:$PATH \
92+
Thrift_SOURCE=BUNDLED

docker-compose.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ volumes:
3131
# like ARM64v8 with debian 10, then the appropiate parametrized volume name
3232
# must be added the the list below: arm64v8-debian-10-cache
3333
amd64-conda-cache:
34+
amd64-cuda-9.1-cache:
3435
amd64-cuda-10.0-cache:
3536
amd64-debian-9-cache:
3637
amd64-debian-10-cache:
37-
amd64-ubuntu-18.04-cache:
38-
amd64-ubuntu-16.04-cache:
39-
amd64-ubuntu-14.04-cache:
4038
amd64-fedora-29-cache:
39+
amd64-ubuntu-14.04-cache:
40+
amd64-ubuntu-16.04-cache:
41+
amd64-ubuntu-18.04-cache:
4142
maven-cache:
4243

4344
x-ccache: &ccache
@@ -93,9 +94,11 @@ services:
9394
# Usage:
9495
# docker-compose build cuda-cpp
9596
# docker-compose run --rm cuda-cpp
97+
# Also need to edit the host docker configuration as follows:
98+
# https://github.com/docker/compose/issues/6691#issuecomment-561504928
9699
# Parameters:
97100
# ARCH: amd64
98-
# CUDA: 8.0, 10.0, ...
101+
# CUDA: 9.1, 10.0
99102
image: ${REPO}:${ARCH}-cuda-${CUDA}-cpp
100103
build:
101104
context: .

0 commit comments

Comments
 (0)