-
Notifications
You must be signed in to change notification settings - Fork 516
/
Copy pathDockerfile
58 lines (43 loc) · 1.6 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
#---
# name: cuml
# group: rapids
# config: config.py
# requires: '>=34.1.0'
# depends: [cudf]
# test: [test.py]
# notes: installed under `/usr/local`
#---
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
ARG CUML_VERSION
ARG CUML_CMAKE_CUDA_ARCHITECTURES
ARG INSTALL_PREFIX=/usr/local
ARG BUILD_DIR=/opt/rapids
WORKDIR ${BUILD_DIR}
# force rebuild on new git commits - https://stackoverflow.com/a/56945508
ADD https://api.github.com/repos/dusty-nv/cuml/git/refs/heads/${CUML_VERSION} /tmp/cuml_version.json
# install prerequisites
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libopenblas-dev \
rapidjson-dev \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
RUN pip3 install --no-cache-dir scikit-build && \
pip3 install --no-cache-dir ninja
# build libcuml (C++)
RUN git clone --branch ${CUML_VERSION} --depth=1 https://github.com/dusty-nv/cuml && \
cd cuml && \
PARALLEL_LEVEL=$(nproc) ./build.sh libcuml --singlegpu -v
# build cuml (Python)
RUN cd cuml/python && \
sed -i "s|versioneer.get_version()|\"${CUML_VERSION}\".lstrip('v')|g" setup.py && \
sed -i "s|get_versions().*|\"${CUML_VERSION}\".lstrip('v')|g" cuml/__init__.py && \
python3 setup.py --verbose build_ext -j$(nproc) --singlegpu bdist_wheel && \
cp dist/cuml*.whl /opt && \
pip3 install --no-cache-dir --verbose /opt/cuml*.whl
# cuml/decomposition/pca.pyx: No module named 'scipy'
RUN pip3 install --no-cache-dir --verbose scipy scikit-learn treelite treelite_runtime
# make sure it loads
RUN pip3 show cuml && python3 -c 'import cuml; print(cuml.__version__)'
WORKDIR /