-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
69 lines (53 loc) · 1.89 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
# NVIDIA GPU SM version (Compute Capability)
ARG SM_VERSION=75
# Mirror PyPi repository
ARG PIP_SOURCE_URL=https://mirrors.aliyun.com/pypi/simple/
# ===========================
# Build image
FROM nvidia/cuda:11.6.2-devel-centos7 as build-image
ARG SM_VERSION
RUN yum clean all && yum makecache
RUN yum install -y wget patch openssl-devel
RUN yum install -y centos-release-scl && yum install -y devtoolset-10
WORKDIR /root/building
# Install CMake
RUN wget https://github.com/Kitware/CMake/releases/download/v3.26.3/cmake-3.26.3.tar.gz
RUN tar xzf cmake-3.26.3.tar.gz
RUN cd cmake-3.26.3 && source /opt/rh/devtoolset-10/enable \
&& ./configure --parallel=`nproc` && make -j`nproc` && make install
# Clean up
RUN rm -rf /root/building
ENV CUDA_SM_VERSION ${SM_VERSION}
ENV CUDA_HOME /usr/local/cuda
WORKDIR /radik
# Build bitonic select
COPY bitonic bitonic
COPY patches/bitonic/Makefile.patch bitonic
RUN cd bitonic && patch Makefile Makefile.patch
RUN cd bitonic && source /opt/rh/devtoolset-10/enable \
&& make -j`nproc` CUDA_PATH=$CUDA_HOME GENCODE_FLAGS=-arch=sm_$CUDA_SM_VERSION
# Build block select (PQ-block)
COPY blockselect blockselect
RUN cd blockselect && source /opt/rh/devtoolset-10/enable \
&& make -j`nproc` all && make clean
# Build RadiK & grid select (PQ-grid)
COPY radik radik
RUN cd radik && source /opt/rh/devtoolset-10/enable && make -j`nproc` all
# ===========================
# Release image
FROM nvidia/cuda:11.6.2-runtime-centos7
ARG PIP_SOURCE_URL
RUN yum install -y python3 python3-pip
# Copy built binaries
COPY --from=build-image /radik /radik
WORKDIR /radik
# Install Python requirements
ENV PIP_SOURCE ${PIP_SOURCE_URL}
RUN python3 -m pip install pip -U -i $PIP_SOURCE
COPY requirements.txt .
RUN python3 -m pip install -r requirements.txt -i $PIP_SOURCE
# Evaluation scripts
COPY eval eval
COPY scripts/entry.sh /opt
RUN chmod +x /opt/entry.sh
ENTRYPOINT ["/opt/entry.sh"]