This repository was archived by the owner on Jan 23, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathDockerfile.cugraph
More file actions
127 lines (106 loc) · 4.51 KB
/
Copy pathDockerfile.cugraph
File metadata and controls
127 lines (106 loc) · 4.51 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
ARG CUGRAPH_VERSION=24.06a
ARG CUDA_VERSION=12.2
ARG CUDA_VERSION_MINOR=12.2.2
ARG PY_VERSION=3.11
ARG MG_VERSION=2.15.1
# TODO(gitbuda): Probably turn this into Dockerfile.only_cugraph
FROM rapidsai/base:${CUGRAPH_VERSION}-cuda${CUDA_VERSION}-py${PY_VERSION} as cugraph-dev
FROM nvidia/cuda:${CUDA_VERSION_MINOR}-devel-ubuntu22.04 AS dev
USER root
ARG DEBIAN_FRONTEND=noninteractive
ARG MG_VERSION
ARG PY_VERSION
ENV MG_VERSION ${MG_VERSION}
ENV PY_VERSION ${PY_VERSION}
# Copy RAPIDS libraries
COPY --from=cugraph-dev /opt/conda/lib/libcugraph.so /opt/conda/lib/libcugraph.so
COPY --from=cugraph-dev /opt/conda/include /opt/conda/include
# Prevent from linking the Conda environment
ENV LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda/lib64:/usr/local/lib
# Essentials for production/dev
RUN apt-get update && apt-get install -y \
libcurl4 `memgraph` \
libpython${PY_VERSION} `memgraph` \
libssl-dev `memgraph` \
libssl-dev `memgraph` \
openssl `memgraph` \
build-essential `mage-memgraph` \
curl `mage-memgraph` \
g++ `mage-memgraph` \
python3 `mage-memgraph` \
python3-pip `mage-memgraph` \
python3-setuptools `mage-memgraph` \
python3-dev `mage-memgraph` \
clang `mage-memgraph` \
git `mage-memgraph` \
software-properties-common `mage-cugraph` \
lsb-release `mage-cugraph` \
wget `mage-cugraph` \
--no-install-recommends && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
# Install newest CMake (cuGraph requires >= 20.01)
wget -qO - https://apt.kitware.com/keys/kitware-archive-latest.asc | apt-key add - && \
apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" && \
apt-get install -y \
cmake `mage-memgraph` \
--no-install-recommends
ENV PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/cmake:/usr/lib/cmake
# Memgraph listens for Bolt Protocol on this port by default.
EXPOSE 7687
# Copy and build MAGE
WORKDIR /mage
COPY . /mage
# TODO(gitbuda): In the meantime, we moved the whole memgraph repo under cpp -> init submodules.
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \
export PATH="/root/.cargo/bin:${PATH}" && \
python3 -m pip install -r /mage/python/requirements.txt && \
python3 -m pip install -r /mage/python/tests/requirements.txt && \
python3 /mage/setup build \
--gpu \
--cpp-build-flags MAGE_CUGRAPH_ROOT=/opt/conda/ CMAKE_BUILD_TYPE=Release \
-p /usr/lib/memgraph/query_modules/
# python3 -m pip install dgl -f https://data.dgl.ai/wheels/repo.html && \ # TODO(gitbuda): Figure out DGL
# # TODO(gitbuda): Figure out DGL
# # Build DGL from source.
# RUN git clone --recurse-submodules -b 2.1.x https://github.com/dmlc/dgl.git \
# && cd dgl && mkdir build && cd build && cmake -DUSE_CUDA=ON .. \
# && make -j4 && cd ../python && python3 setup.py install
USER memgraph
ENTRYPOINT ["/usr/lib/memgraph/memgraph"]
FROM nvidia/cuda:${CUDA_VERSION_MINOR}-runtime-ubuntu22.04 AS prod
USER root
ARG DEBIAN_FRONTEND=noninteractive
ARG MG_VERSION
ARG PY_VERSION
ENV MG_VERSION ${MG_VERSION}
ENV PY_VERSION ${PY_VERSION}
# Copy modules
COPY --from=dev /usr/lib/memgraph/query_modules/ /usr/lib/memgraph/query_modules/
# Copy cugraph library
COPY --from=dev /opt/conda/lib/libcugraph.so /opt/conda/lib/libcugraph.so
# Copy python build
COPY --from=dev /usr/lib/python${PY_VERSION}/ /usr/lib/python${PY_VERSION}/
# NVIDIA key rotation
RUN rm /etc/apt/sources.list.d/cuda.list
# Download and install Memgraph
RUN apt-get update && apt-get install -y \
libcurl4 `memgraph` \
libpython${PY_VERSION} `memgraph` \
libssl1.1 `memgraph` \
libssl-dev `memgraph` \
openssl `memgraph` \
curl `mage-memgraph` \
libgomp1 `mage-memgraph` \
python3 `mage-memgraph` \
python3-setuptools `mage-memgraph` \
&& curl https://download.memgraph.com/memgraph/v${MG_VERSION}/ubuntu-22.04/memgraph_${MG_VERSION}-1_amd64.deb --output memgraph.deb \
&& dpkg -i memgraph.deb \
&& rm memgraph.deb \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN export PATH="/usr/lib/python${PY_VERSION}:${PATH}"
RUN rm -rf /mage \
&& export PATH="/usr/lib/python${PY_VERSION}:${PATH}" \
&& apt-get -y --purge autoremove curl python3-dev \
&& apt-get clean
USER memgraph
ENTRYPOINT ["/usr/lib/memgraph/memgraph"]