Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug docker #298

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches: [ release_docker, dev-build ]
pull_request:
paths: .github/workflows/docker-image.yml
workflow_dispatch:
inputs:
version:
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down
46 changes: 29 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand All @@ -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 \
Expand All @@ -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; \
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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) \
Expand All @@ -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) \
Expand Down
Loading