-
Notifications
You must be signed in to change notification settings - Fork 914
/
Dockerfile
76 lines (68 loc) · 2.62 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Copyright (c) 2021, NVIDIA CORPORATION.
# An integration test & dev container which builds and installs cuDF from main
ARG CUDA_VERSION=11.0
ARG CUDA_SHORT_VERSION=${CUDA_VERSION}
ARG LINUX_VERSION=ubuntu18.04
FROM nvidia/cuda:${CUDA_VERSION}-devel-${LINUX_VERSION}
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/lib
ENV DEBIAN_FRONTEND=noninteractive
ARG CC=9
ARG CXX=9
RUN apt update -y --fix-missing && \
apt upgrade -y && \
apt install -y --no-install-recommends software-properties-common && \
add-apt-repository ppa:ubuntu-toolchain-r/test && \
apt update -y --fix-missing && \
apt install -y --no-install-recommends \
git \
gcc-${CC} \
g++-${CXX} \
tzdata && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install conda
ADD https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh /miniconda.sh
RUN sh /miniconda.sh -b -p /conda && /conda/bin/conda update -n base conda
ENV PATH=${PATH}:/conda/bin
# Enables "source activate conda"
SHELL ["/bin/bash", "-c"]
# Build cuDF conda env
ARG CUDA_SHORT_VERSION
ARG PYTHON_VERSION
ENV PYTHON_VERSION=$PYTHON_VERSION
ARG NUMBA_VERSION
ENV NUMBA_VERSION=$NUMBA_VERSION
ARG NUMPY_VERSION
ENV NUMPY_VERSION=$NUMPY_VERSION
ARG PANDAS_VERSION
ENV PANDAS_VERSION=$PANDAS_VERSION
ARG PYARROW_VERSION
ENV PYARROW_VERSION=$PYARROW_VERSION
ARG CYTHON_VERSION
ENV CYTHON_VERSION=$CYTHON_VERSION
ARG CMAKE_VERSION
ENV CMAKE_VERSION=$CMAKE_VERSION
ARG CUDF_REPO=https://github.com/rapidsai/cudf
ENV CUDF_REPO=$CUDF_REPO
ARG CUDF_BRANCH=main
ENV CUDF_BRANCH=$CUDF_BRANCH
# Add everything from the local build context
ADD . /cudf/
# Checks if local build context has the source, if not clone it then run a bash script to modify
# the environment file based on versions set in build args
RUN ls -la /cudf
RUN if [ -f /cudf/docker/package_versions.sh ]; \
then /cudf/docker/package_versions.sh /cudf/conda/environments/cudf_dev_cuda${CUDA_SHORT_VERSION}.yml && \
conda env create --name cudf --file /cudf/conda/environments/cudf_dev_cuda${CUDA_SHORT_VERSION}.yml ; \
else rm -rf /cudf && \
git clone --recurse-submodules -b ${CUDF_BRANCH} ${CUDF_REPO} /cudf && \
/cudf/docker/package_versions.sh /cudf/conda/environments/cudf_dev_cuda${CUDA_SHORT_VERSION}.yml && \
conda env create --name cudf --file /cudf/conda/environments/cudf_dev_cuda${CUDA_SHORT_VERSION}.yml ; \
fi
ENV CC=/opts/conda/envs/rapids/bin/gcc-${CC}
ENV CXX=/opts/conda/envs/rapids/bin/g++-${CXX}
# libcudf & cudf build/install
RUN source activate cudf && \
cd /cudf/ && \
./build.sh libcudf cudf