diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 094866e..30ed372 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -3,7 +3,6 @@ on: push: branches: [ release_docker, dev-build ] pull_request: - paths: .github/workflows/docker-image.yml workflow_dispatch: inputs: version: @@ -25,7 +24,7 @@ jobs: timescaledb: name: PG${{ matrix.pg }}${{ matrix.oss }} - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: @@ -54,6 +53,7 @@ jobs: if [ "${{ github.event_name }}" == "pull_request" ] then export ORG=timescaledev + export BETA=1 fi if [ "${{ github.event.inputs.no_tag_latest }}" == "true" ] then diff --git a/Dockerfile b/Dockerfile index 628dbdc..2a50dc5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,28 +36,37 @@ LABEL maintainer="Timescale https://www.timescale.com" ARG PG_VERSION +ARG PG_MAJOR_VERSION +ARG ALPINE_VERSION RUN set -ex; \ + echo "https://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/community/" >> /etc/apk/repositories; \ apk update; \ - apk add --no-cache \ - postgresql${PG_VERSION}-plpython3; + if [ "$PG_MAJOR_VERSION" -ge 16 ] ; then \ + apk add --no-cache postgresql${PG_VERSION}-plpython3; \ + fi ARG PGVECTOR_VERSION ARG PG_VERSION ARG CLANG_VERSION +ARG PG_MAJOR_VERSION RUN set -ex; \ apk update; \ - apk add --no-cache --virtual .vector-deps \ - postgresql${PG_VERSION}-dev \ - git \ - build-base \ - clang${CLANG_VERSION} \ - llvm${CLANG_VERSION}-dev \ - llvm${CLANG_VERSION}; \ - git clone --branch ${PGVECTOR_VERSION} https://github.com/pgvector/pgvector.git /build/pgvector; \ - cd /build/pgvector; \ - make; \ - make install; \ - apk del .vector-deps; + if [ "$PG_MAJOR_VERSION" -ge 17 ] ; then \ + apk add --no-cache postgresql-pgvector; \ + else \ + apk add --no-cache --virtual .vector-deps \ + postgresql${PG_VERSION}-dev \ + git \ + build-base \ + clang${CLANG_VERSION} \ + llvm${CLANG_VERSION}-dev \ + llvm${CLANG_VERSION}; \ + git clone --branch ${PGVECTOR_VERSION} https://github.com/pgvector/pgvector.git /build/pgvector; \ + cd /build/pgvector; \ + make; \ + make install; \ + apk del .vector-deps; \ + fi # install pgai only on pg16+ and not on 32 bit arm ARG PGAI_VERSION @@ -67,7 +76,7 @@ RUN set -ex; \ if [ "$PG_MAJOR_VERSION" -ge 16 ] && [ "$TARGETARCH" != "arm" ]; then \ apk update; \ # install shared libraries needed at runtime - apk add libarrow libparquet geos; \ + apk add libarrow libparquet geos py3-pandas py3-pyarrow py3-pillow; \ # install required dependencies for building pyarrow from source apk add --no-cache --virtual .pgai-deps \ git \ @@ -78,11 +87,13 @@ RUN set -ex; \ py3-pip \ apache-arrow-dev \ geos-dev; \ - # using uv reduces space required for pgai's dependencies \ - python3 -m pip install uv --break-system-packages; \ + 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 \ + if [ false ]; then \ echo "pyarrow==$(pkg-config --modversion arrow)" > constraints.txt; \ export PIP_CONSTRAINT=$(pwd)/constraints.txt; \ if [ "$TARGETARCH" == "386" ]; then \ @@ -94,6 +105,7 @@ RUN set -ex; \ jpeg-dev \ zlib-dev; \ fi; \ + fi; \ PG_BIN="/usr/local/bin" PG_MAJOR=${PG_MAJOR_VERSION} ./projects/extension/build.py install; \ if [ "$TARGETARCH" == "386" ]; then apk del .pgai-deps-386; fi; \ apk del .pgai-deps; \ diff --git a/Makefile b/Makefile index 2713499..860d32f 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ NAME=timescaledb # Default is to timescaledev to avoid unexpected push to the main repo # Set ORG to timescale in the caller ORG=timescaledev -PG_VER=pg16 +PG_VER=pg17 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 16; echo $$?),0) @@ -44,6 +44,8 @@ default: image .multi_$(TS_VERSION)_$(PG_VER)_oss: Dockerfile test -n "$(TS_VERSION)" # TS_VERSION test -n "$(PREV_TS_VERSION)" # PREV_TS_VERSION + test -n "$(PREV_IMAGE)" # PREV_IMAGE + test -n "$(ALPINE_VERSION)" # ALPINE_VERSION docker buildx create --platform $(PLATFORM) --name multibuild --use docker buildx inspect multibuild --bootstrap docker buildx build --platform $(PLATFORM) \ @@ -57,6 +59,7 @@ default: image test -n "$(TS_VERSION)" # TS_VERSION test -n "$(PREV_TS_VERSION)" # PREV_TS_VERSION test -n "$(PREV_IMAGE)" # PREV_IMAGE + test -n "$(ALPINE_VERSION)" # ALPINE_VERSION docker buildx create --platform $(PLATFORM) --name multibuild --use docker buildx inspect multibuild --bootstrap docker buildx build --platform $(PLATFORM) \