Skip to content

Commit

Permalink
WIP getting debian-12 working
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignition committed Oct 24, 2024
1 parent 844e344 commit 23f571e
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 29 deletions.
65 changes: 41 additions & 24 deletions Dockerfile.release
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG PY_VERSION_DEFAULT=3.9
ARG OS_VERSION=bullseye

FROM debian:bullseye as base
FROM debian:${OS_VERSION} as base

USER root

Expand All @@ -10,29 +11,33 @@ ENV PY_VERSION ${PY_VERSION_DEFAULT}

#essentials for production/dev
RUN apt-get update && apt-get install -y \
libcurl4 `memgraph` \
libpython${PY_VERSION} `memgraph` \
libssl-dev `memgraph` \
openssl `memgraph` \
build-essential `mage-memgraph` \
cmake `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` \
unixodbc-dev `mage-memgraph` \
libcurl4 \
libpython${PY_VERSION} \
libssl-dev \
openssl \
build-essential \
cmake \
curl \
g++ \
python3 \
python3-pip \
python3-setuptools \
python3-dev \
python${PY_VERSION}-venv \
clang \
git \
unixodbc-dev \
gdb \
procps \
linux-perf \
libc6-dbg \
--no-install-recommends \
&& ln -s /usr/bin/$(ls /usr/bin | grep perf) /usr/bin/perf \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN if [ "$OS_VERSION" = "bullseye" ]; then \
ln -s /usr/bin/$(ls /usr/bin | grep perf) /usr/bin/perf; \
fi

COPY memgraph-${TARGETARCH}.deb .

# Hack to remove modules that cause error on loading of torch modules
Expand All @@ -50,22 +55,34 @@ FROM base as dev
ARG BUILD_TYPE=Release

WORKDIR /mage
COPY . /mage
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y \
&& export PATH="/root/.cargo/bin:${PATH}" \
&& python3 -m venv /mage/venv


#MAGE
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 -m pip install torch-sparse torch-cluster torch-spline-conv torch-geometric torch-scatter -f https://data.pyg.org/whl/torch-1.12.0+cu102.html \
COPY ./python/requirements.txt /mage/python/requirements.txt
RUN . /mage/venv/bin/activate \
&& python3 -m pip install -r /mage/python/requirements.txt

COPY ./python/tests/requirements.txt /mage/python/tests/requirements.txt
RUN . /mage/venv/bin/activate \
&& python3 -m pip install -r /mage/python/tests/requirements.txt

RUN . /mage/venv/bin/activate \
&& python3 -m pip install torch-sparse torch-cluster torch-spline-conv torch-geometric torch-scatter -f https://data.pyg.org/whl/torch-2.4.0+cu124.html

COPY . /mage
RUN . /mage/venv/bin/activate \
&& python3 /mage/setup build -p /usr/lib/memgraph/query_modules/ --cpp-build-flags CMAKE_BUILD_TYPE=${BUILD_TYPE} \
&& chown -R memgraph: /mage/e2e

#DGL build from source
RUN git clone --recurse-submodules -b 0.9.x https://github.com/dmlc/dgl.git \
&& cd dgl && mkdir build && cd build && cmake .. \
&& make -j4 && cd ../python && python3 setup.py install
&& make -j4 && cd ../python \
&& . /mage/venv/bin/activate \
&& python3 setup.py install

USER memgraph
ENTRYPOINT ["/usr/lib/memgraph/memgraph"]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ 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 -m pip install torch-sparse torch-cluster torch-spline-conv torch-geometric torch-scatter -f https://data.pyg.org/whl/torch-1.12.0+cu102.html \
&& python3 -m pip install torch-sparse torch-cluster torch-spline-conv torch-geometric torch-scatter -f https://data.pyg.org/whl/torch-2.4.0+cu124.html \
```


Expand Down
2 changes: 1 addition & 1 deletion cpp/memgraph
Submodule memgraph updated 164 files
2 changes: 1 addition & 1 deletion python/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ python-Levenshtein==0.12.1
scikit-learn==1.5.2
scipy==1.13.0
six==1.16.0
torch==2.4.1
torch==2.4.0
torchmetrics==1.4.2
4 changes: 2 additions & 2 deletions python/tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pytest==7.0
PyYAML==5.4.1
PyYAML==6.0.2
black==22.3.0
flake8==3.9.2
pymgclient==1.3.1
Expand All @@ -9,4 +9,4 @@ pytest-cov==2.12.1
pytest-benchmark==3.4.1
pytest-flake8==1.0.7
pytest-black==0.3.12
gqlalchemy==1.4.1
gqlalchemy==1.4.1

0 comments on commit 23f571e

Please sign in to comment.