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
109 lines (85 loc) · 5.13 KB
/
Dockerfile.cugraph
File metadata and controls
109 lines (85 loc) · 5.13 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
ARG RAPIDS_VERSION=25.12
ARG CUDA_VERSION=13
ARG CUDA_VERSION_MINOR=13.1.0
ARG PY_VERSION=3.12
ARG MG_VERSION=3.7.2
FROM nvcr.io/nvidia/rapidsai/base:${RAPIDS_VERSION}-cuda${CUDA_VERSION}-py${PY_VERSION} AS cugraph-dev
FROM nvidia/cuda:${CUDA_VERSION_MINOR}-devel-ubuntu24.04 AS dev
USER root
ARG DEBIAN_FRONTEND=noninteractive
ARG MG_VERSION
ARG PY_VERSION
ARG CACHE_PRESENT
ENV MG_VERSION=${MG_VERSION}
ENV PY_VERSION=${PY_VERSION}
COPY --from=cugraph-dev /opt/conda/lib/libcugraph.so /opt/conda/lib/libcugraph.so
COPY --from=cugraph-dev /opt/conda/lib/libcugraph_c.so /opt/conda/lib/libcugraph_c.so
COPY --from=cugraph-dev /opt/conda/lib/librmm.so /opt/conda/lib/librmm.so
COPY --from=cugraph-dev /opt/conda/lib/librapids_logger.so /opt/conda/lib/librapids_logger.so
COPY --from=cugraph-dev /opt/conda/include /opt/conda/include
ENV LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda/lib64:/usr/local/lib:/opt/conda/lib
RUN apt-get update && apt-get install -y \
libcurl4t64 libpython${PY_VERSION} libssl-dev openssl build-essential curl g++ \
python3 python3-pip python3-setuptools python3-dev clang git \
software-properties-common lsb-release wget uuid-dev gdb procps \
linux-tools-generic ninja-build libc6-dbg cmake libboost-all-dev \
unixodbc-dev --no-install-recommends && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENV PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
EXPOSE 7687
RUN curl https://download.memgraph.com/memgraph/v${MG_VERSION}/ubuntu-24.04/memgraph_${MG_VERSION}-1_amd64.deb --output memgraph.deb \
&& dpkg -i memgraph.deb && rm memgraph.deb
WORKDIR /mage
COPY . /mage
ENV CXXFLAGS="-DLIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE"
ENV CUDAFLAGS="-DLIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE"
# Install PyTorch with CUDA 13.0 support FIRST
# Then install all dependencies that require matching PyTorch/CUDA versions
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \
export PATH="/root/.cargo/bin:${PATH}" && \
python3 -m pip install --break-system-packages torch torchvision --index-url https://download.pytorch.org/whl/cu130 && \
python3 -m pip install --break-system-packages --ignore-installed -r /mage/python/requirements.txt && \
python3 -m pip install --break-system-packages --ignore-installed -r /mage/python/tests/requirements.txt && \
(if [ "$CACHE_PRESENT" = "true" ]; then \
echo "Using cached packages" && \
pip install /mage/wheels/*.whl --break-system-packages; \
else \
python3 -m pip install --break-system-packages dgl -f https://data.dgl.ai/wheels/torch-2.9/cu130/repo.html && \
python3 -m pip install --break-system-packages torch_geometric && \
python3 -m pip install --break-system-packages ninja wheel && \
python3 -m pip install --break-system-packages --no-build-isolation git+https://github.com/pyg-team/pyg-lib.git && \
python3 -m pip install --break-system-packages --no-build-isolation git+https://github.com/rusty1s/pytorch_scatter.git && \
python3 -m pip install --break-system-packages --no-build-isolation git+https://github.com/rusty1s/pytorch_sparse.git && \
python3 -m pip install --break-system-packages --no-build-isolation git+https://github.com/rusty1s/pytorch_cluster.git && \
python3 -m pip install --break-system-packages --no-build-isolation git+https://github.com/rusty1s/pytorch_spline_conv.git && \
python3 -m pip install --break-system-packages --upgrade numpy gensim; \
fi) && \
python3 /mage/setup build --gpu \
--cpp-build-flags MAGE_CUGRAPH_ROOT=/opt/conda/ CMAKE_BUILD_TYPE=Release \
-p /usr/lib/memgraph/query_modules/
USER memgraph
ENTRYPOINT ["/usr/lib/memgraph/memgraph"]
FROM nvidia/cuda:${CUDA_VERSION_MINOR}-runtime-ubuntu24.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 --from=dev /usr/lib/memgraph/query_modules/ /usr/lib/memgraph/query_modules/
COPY --from=dev /opt/conda/lib/libcugraph.so /opt/conda/lib/libcugraph.so
COPY --from=dev /opt/conda/lib/libcugraph_c.so /opt/conda/lib/libcugraph_c.so
COPY --from=dev /opt/conda/lib/librmm.so /opt/conda/lib/librmm.so
COPY --from=dev /opt/conda/lib/librapids_logger.so /opt/conda/lib/librapids_logger.so
COPY --from=dev /usr/local/lib/python${PY_VERSION}/ /usr/local/lib/python${PY_VERSION}/
ENV LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda/lib64:/usr/local/lib:/opt/conda/lib
RUN apt-get update && apt-get install -y \
libcurl4t64 libpython${PY_VERSION} libssl3t64 openssl curl libgomp1 libatomic1 python3 python3-setuptools \
unixodbc --no-install-recommends \
&& curl https://download.memgraph.com/memgraph/v${MG_VERSION}/ubuntu-24.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/*
ENV PATH="/usr/local/lib/python${PY_VERSION}:${PATH}"
RUN rm -rf /mage && apt-get -y --purge autoremove curl python3-dev && apt-get clean
USER memgraph
ENTRYPOINT ["/usr/lib/memgraph/memgraph"]