Skip to content

Commit

Permalink
Upgrade the engine Python to 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
mildbyte committed Feb 27, 2023
1 parent 04f8845 commit 8481827
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 23 deletions.
29 changes: 12 additions & 17 deletions engine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
##### toolchain
#####

FROM postgres:12.3 AS toolchain
FROM postgres:12.14-bullseye AS toolchain

RUN apt-get update -qq && \
apt-get install -y --allow-downgrades \
Expand All @@ -31,17 +31,13 @@ RUN apt-get update -qq && \
libmongoc-dev \
protobuf-c-compiler \
libprotobuf-c-dev \
libpython3.7-dev \
python3.7 \
libpython3.9-dev \
python3.9 \
python3-setuptools \
cmake \
clang-7 && \
clang-11 && \
rm -rf /var/lib/apt/lists/*

# python3.8 executable required by Multicorn to install itself
# python3-setuptools also needed by Multicorn and it pulls in python3.7 but
# we'll get rid of all this junk in the next build stage.

# Set locale to C instead of en-US, Postgres initdb breaks with default
# locale otherwise + we get build warnings for FDWs.
ENV LANG C.UTF-8
Expand Down Expand Up @@ -97,7 +93,7 @@ RUN /build/build_mysql_fdw.sh
##### splitgraph/engine
#####

FROM postgres:12.3
FROM postgres:12.14-bullseye

# We still have to install some runtime libraries here, but no dev.

Expand All @@ -106,15 +102,14 @@ RUN apt-get update -qq && \
curl \
libprotobuf-c1 \
libmongoc-1.0-0 \
libpython3.7 \
python3.7 \
libpython3.9 \
python3.9 \
python3-setuptools \
postgresql-plpython3-12 \
git \
wget && \

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python3.7 get-pip.py && \
python3.9 get-pip.py && \
rm get-pip.py && \
rm -rf /var/lib/apt/lists/*

Expand Down Expand Up @@ -154,11 +149,11 @@ RUN mkdir ~/.gnupg && echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf && \

COPY --from=builder_cstore_multicorn /output/root /
COPY --from=builder_cstore_multicorn \
/usr/local/lib/python3.7/dist-packages/easy-install.pth \
/usr/local/lib/python3.7/dist-packages/easy-install.pth
/usr/local/lib/python3.9/dist-packages/easy-install.pth \
/usr/local/lib/python3.9/dist-packages/easy-install.pth
COPY --from=builder_cstore_multicorn \
/usr/local/lib/python3.7/dist-packages/multicorn-1.4.0.dev0-py3.7-linux-x86_64.egg \
/usr/local/lib/python3.7/dist-packages/multicorn-1.4.0.dev0-py3.7-linux-x86_64.egg
/usr/local/lib/python3.9/dist-packages/multicorn-1.4.0.dev0-py3.9-linux-x86_64.egg \
/usr/local/lib/python3.9/dist-packages/multicorn-1.4.0.dev0-py3.9-linux-x86_64.egg

COPY --from=builder_mongo_fdw /output/root /
COPY --from=builder_mysql_fdw /output/root /
Expand Down
4 changes: 2 additions & 2 deletions engine/build_scripts/build_splitgraph.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ cd /splitgraph

export POETRY_VERSION=1.3.2

curl -sSL https://install.python-poetry.org | python3.7 -
curl -sSL https://install.python-poetry.org | python3.9 -
export PATH="/root/.local/bin:$PATH"

# Install globally (otherwise we'll need to find a way to get Multicorn to see the venv)
ln -sf /usr/bin/python3.7 /usr/bin/python
ln -sf /usr/bin/python3.9 /usr/bin/python
poetry config virtualenvs.create false

# Export the requirements into pip and install them separately (faster than Poetry)
Expand Down
7 changes: 4 additions & 3 deletions engine/build_scripts/fdws/multicorn/build_multicorn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ cd /src/Multicorn
# fragments rather than passing data through python.

export DESTDIR=/output/root
export PYTHON_OVERRIDE=python3.7
export PYTHON_CONFIG=x86_64-linux-gnu-python3.7-config
export PYTHON_OVERRIDE=python3.9
export PYTHON_CONFIG=x86_64-linux-gnu-python3.9-config
ln -sf /usr/bin/python3.9 /usr/bin/python

# Do "make CFLAGS=-DDEBUG install" instead to enable debug output for scans.
# Include and dynamically link to cstore_fdw
make \
CPPFLAGS="-I ../cstore_fdw" \
SHLIB_LINK="-L/output/root/usr/local/lib -lcstore_fdw -lpython3.7m" \
SHLIB_LINK="-L/output/root/usr/local/lib -lcstore_fdw -lpython3.9" \
install
2 changes: 1 addition & 1 deletion engine/src/Multicorn
Submodule Multicorn updated 1 files
+1 −4 Makefile

0 comments on commit 8481827

Please sign in to comment.