diff --git a/Dockerfile b/Dockerfile index 20a423f..5e8596c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -66,21 +66,27 @@ ARG TARGETARCH RUN set -ex; \ if [ "$PG_MAJOR_VERSION" -ge 16 ] && [ "$TARGETARCH" != "arm" ]; then \ apk update; \ + # install shared libraries required by pyarrow needed at runtime + apk add libarrow libparquet; \ + # install required dependencies for building pyarrow from source apk add --no-cache --virtual .pgai-deps \ git \ build-base \ cargo \ cmake \ python3-dev \ - apache-arrow-dev \ - py3-pip; \ + py3-pip \ + apache-arrow-dev; \ + # pgai requires pip 23.0.1 or greater due to the use of --break-system-packages flag + if [ "$(pip --version | awk '{print $2; exit}')" \< "23.0.1" ]; then \ + python3 -m pip install --upgrade pip==23.0.1; \ + fi; \ git clone --branch ${PGAI_VERSION} https://github.com/timescale/pgai.git /build/pgai; \ cd /build/pgai; \ - # note: this is a hack. pyarrow will be built from source, so must be pinned to this arrow version \ - echo pyarrow==$(pkg-config --modversion arrow) >> ./projects/extension/requirements.txt; \ if [ "$TARGETARCH" == "386" ]; then \ # note: pinned because pandas 2.2.0-2.2.3 on i386 is affected by https://github.com/pandas-dev/pandas/issues/59905 \ - echo pandas==2.1.4 >> ./projects/extension/requirements.txt; \ + echo "pandas==2.1.4" > constraints.txt; \ + export PIP_CONSTRAINT=$(pwd)/constraints.txt; \ # note: no prebuilt binaries for pillow on i386 \ apk add --no-cache --virtual .pgai-deps-386 \ jpeg-dev \ diff --git a/Makefile b/Makefile index 050f99a..2099889 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ ORG=timescaledev PG_VER=pg16 PG_VER_NUMBER=$(shell echo $(PG_VER) | cut -c3-) PG_MAJOR_VERSION=$(shell echo $(PG_VER_NUMBER) | cut -d. -f1) -ifeq ($(shell test $(PG_MAJOR_VERSION) -ge 17; echo $$?),0) +ifeq ($(shell test $(PG_MAJOR_VERSION) -ge 16; echo $$?),0) ALPINE_VERSION=3.21 CLANG_VERSION=19 else @@ -28,7 +28,7 @@ TAG=-t $(TAG_VERSION) $(if $(BETA),,-t $(TAG_LATEST)) TAG_OSS=-t $(TAG_VERSION)-oss $(if $(BETA),,-t $(TAG_LATEST)-oss) PGVECTOR_VERSION=v0.7.2 -PGAI_VERSION=extension-0.6.0 +PGAI_VERSION=extension-0.7.0 COMMON_BUILD_ARGS= --build-arg TS_VERSION=$(TS_VERSION) \ --build-arg PREV_IMAGE=$(PREV_IMAGE) \