Skip to content

Commit

Permalink
Install medvedi from wheel builder
Browse files Browse the repository at this point in the history
Signed-off-by: Lou Marvin Caraig <loumarvincaraig@gmail.com>
  • Loading branch information
se7entyse7en committed Jan 25, 2025
1 parent 699d82a commit 979124b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN cd medvedi && \
# First build mimalloc using medvedi's makefile
make mimalloc && \
# Then create the wheel package
make bdist_wheel
pip wheel --no-deps .

FROM ubuntu:22.04

Expand Down Expand Up @@ -221,11 +221,19 @@ ADD server/requirements.txt /server/requirements.txt

ADD patches /patches
ARG GKWILLIE_TOKEN

# 1. First copy our pre-built wheel
COPY --from=wheel-builder /build/medvedi/dist/medvedi*.whl /tmp/

# 2. Modify the original problematic RUN command to use our wheel
RUN apt-get update && \
apt-get install -y --no-install-suggests --no-install-recommends gcc g++ patch && \
sed -i "s/git+ssh:\/\/git@/git+https:\/\/gkwillie:$GKWILLIE_TOKEN@/g" server/requirements.txt && \
echo "Installing Python packages" && \
pip3 install --no-cache-dir -r /server/requirements.txt && \
# Install everything except medvedi
grep -v "medvedi==" /server/requirements.txt | pip3 install --no-cache-dir -r /dev/stdin && \
# Install our pre-built medvedi wheel
pip3 install /tmp/medvedi*.whl && \
sed -i "s/git+https:\/\/gkwillie:$GKWILLIE_TOKEN@/git+ssh:\/\/git@/g" server/requirements.txt && \
pip3 uninstall -y flask && \
rm /usr/local/lib/python*/dist-packages/medvedi/libmimalloc.so* && \
Expand All @@ -235,9 +243,9 @@ RUN apt-get update && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# The rest of your Dockerfile remains the same
ADD server /server
ADD README.md /

RUN apt-get update && \
apt-get install -y --no-install-suggests --no-install-recommends gcc g++ cmake make libcurl4 libcurl4-openssl-dev libssl-dev zlib1g-dev && \
echo "Building native libraries" && \
Expand All @@ -249,6 +257,7 @@ RUN apt-get update && \
apt-get autoremove -y --purge && \
apt-get upgrade -y && \
apt-get clean

ARG COMMIT
RUN echo "__commit__ = \"$COMMIT\"" >>/server/athenian/api/metadata.py && \
echo "__date__ = \"$(date -u +'%Y-%m-%dT%H:%M:%SZ')\"" >>/server/athenian/api/metadata.py
Expand Down

0 comments on commit 979124b

Please sign in to comment.