Skip to content

Commit 4acb83d

Browse files
committed
Fix: merge with pg vector
1 parent 9e07e32 commit 4acb83d

9 files changed

Lines changed: 275 additions & 11 deletions

File tree

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*~
2+
.build_*
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Workflow to build docker images for a specific branch
2+
#
3+
# You can use the GitHub CLI to trigger this workflow like so:
4+
# gh workflow run docker-branch.yml -R timescale/timescaledb-docker -f branch=1-step-policy-alpha
5+
#
6+
# The built images will be uploaded to our timescaledev account on dockerhub.
7+
# You can view them here: https://hub.docker.com/r/timescaledev/timescaledb/tags
8+
#
9+
name: Docker Image for specific branch
10+
11+
on:
12+
workflow_dispatch:
13+
inputs:
14+
branch:
15+
description: 'branch or tag to build'
16+
required: true
17+
18+
env:
19+
ORG: timescaledev
20+
TS_VERSION: ${{ github.event.inputs.branch }}
21+
PLATFORM: linux/amd64
22+
23+
jobs:
24+
25+
# Build ubuntu TimescaleDB images for both TSL and OSS code.
26+
timescaledb:
27+
28+
name: Docker ${{ github.event.inputs.branch }} PG${{ matrix.pg }}
29+
runs-on: ubuntu-latest
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
pg: [14]
34+
35+
steps:
36+
- uses: actions/checkout@v3
37+
38+
- name: Set up Docker Buildx
39+
id: buildx
40+
uses: docker/setup-buildx-action@v1
41+
42+
- name: Linux available buildx platforms
43+
run: echo ${{ steps.buildx.outputs.platforms }}
44+
45+
- name: Linux available buildx platforms
46+
run: echo ${TS_VERSION}
47+
48+
- name: Login to DockerHub Registry
49+
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USER }} --password-stdin
50+
51+
- name: Build and push nightly Docker image for TimescaleDB
52+
run: make multi ORG=$ORG PG_VER=pg${{ matrix.pg }} TS_VERSION="${TS_VERSION}" PLATFORM=$PLATFORM TAG="-t timescaledev/timescaledb:branch-${TS_VERSION}-pg${{ matrix.pg }}"
53+

.github/workflows/docker-image.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Release Docker Image
2+
on:
3+
push:
4+
branches: [ release_docker, dev-build ]
5+
workflow_dispatch:
6+
inputs:
7+
version:
8+
description: 'Version to release'
9+
required: true
10+
# This is a manual workaround until the latest tagging is fixed:
11+
# https://github.com/timescale/timescaledb-docker/issues/205
12+
no_tag_latest:
13+
description: 'Do not tag the published images as latest'
14+
type: boolean
15+
required: false
16+
default: false
17+
env:
18+
ORG: timescale #timescaledev
19+
TS_VERSION: ${{ github.event.inputs.version || '2.10.0' }}
20+
jobs:
21+
22+
# Build multi-arch TimescaleDB images for both TSL and OSS code.
23+
timescaledb:
24+
25+
name: PG${{ matrix.pg }}${{ matrix.oss }}
26+
runs-on: ubuntu-latest
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
pg: [12, 13, 14, 15]
31+
oss: [ "", "-oss" ]
32+
steps:
33+
- uses: actions/checkout@v3
34+
35+
- name: Set up QEMU
36+
uses: docker/setup-qemu-action@v1
37+
with:
38+
platforms: all
39+
40+
- name: Set up Docker Buildx
41+
id: buildx
42+
uses: docker/setup-buildx-action@v1
43+
44+
- name: Available platforms
45+
run: echo ${{ steps.buildx.outputs.platforms }}
46+
47+
- name: Login to DockerHub Registry
48+
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USER }} --password-stdin
49+
50+
- name: Build and push multi-platform Docker image for TimescaleDB
51+
run: |
52+
if [ "${{ github.event.inputs.no_tag_latest }}" == "true" ]
53+
then
54+
export BETA=1
55+
fi
56+
make multi${{ matrix.oss }} ORG=$ORG PG_VER=pg${{ matrix.pg }} \
57+
TS_VERSION=$TS_VERSION PREV_EXTRA="${{ matrix.oss }}" BETA=$BETA
58+
59+
# Build bitnami images of TimscaleDB.
60+
# The images are built only for amd64, since it is the only supported architecture in the base image bitname/postgresql.
61+
# The images are only built for TSL code.
62+
timescaledb-bitnami:
63+
64+
name: PG${{ matrix.pg }}-bitnami
65+
runs-on: ubuntu-latest
66+
strategy:
67+
fail-fast: false
68+
matrix:
69+
pg: [12, 13, 14, 15]
70+
71+
steps:
72+
- uses: actions/checkout@v3
73+
74+
- name: Login to DockerHub Registry
75+
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USER }} --password-stdin
76+
77+
- name: Build and push amd64 Docker image for TimescaleDB bitnami
78+
run: |
79+
if [ "${{ github.event.inputs.no_tag_latest }}" == "true" ]
80+
then
81+
export BETA=1
82+
fi
83+
make push ORG=$ORG PG_VER=pg${{ matrix.pg }} TS_VERSION=$TS_VERSION BETA=$BETA
84+
working-directory: bitnami
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Docker Image Nightly Build CI
2+
3+
on:
4+
push:
5+
branches:
6+
- cron_build
7+
8+
schedule:
9+
# run daily 0:00
10+
- cron: '0 0 * * *'
11+
12+
env:
13+
ORG: timescaledev
14+
TS_VERSION: main
15+
PLATFORM: linux/amd64
16+
17+
jobs:
18+
19+
# Build ubuntu TimescaleDB images for both TSL and OSS code.
20+
timescaledb:
21+
22+
name: PG${{ matrix.pg }}
23+
runs-on: ubuntu-latest
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
pg: [12, 13, 14, 15]
28+
29+
steps:
30+
- uses: actions/checkout@v3
31+
32+
- name: Set up Docker Buildx
33+
id: buildx
34+
uses: docker/setup-buildx-action@v1
35+
36+
- name: Linux available buildx platforms
37+
run: echo ${{ steps.buildx.outputs.platforms }}
38+
39+
- name: Login to DockerHub Registry
40+
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USER }} --password-stdin
41+
42+
- name: Build and push nightly Docker image for TimescaleDB
43+
run: make multi ORG=$ORG PG_VER=pg${{ matrix.pg }} TS_VERSION=$TS_VERSION PLATFORM=$PLATFORM TAG="-t timescaledev/timescaledb:nightly-pg${{ matrix.pg }}"
44+

.github/workflows/issues.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Add bugs to bugs project
2+
3+
on:
4+
issues:
5+
types: [ opened ]
6+
7+
jobs:
8+
add-to-project:
9+
name: Add issue to project
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/add-to-project@v0.1.0
13+
with:
14+
project-url: https://github.com/orgs/timescale/projects/55
15+
github-token: ${{ secrets.ORG_AUTOMATION_TOKEN }}

.github/workflows/smoke-test.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Smoke Test Docker Image
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
8+
env:
9+
ORG: timescaledev
10+
TS_VERSION: main
11+
PLATFORM: linux/amd64
12+
13+
jobs:
14+
smoketest:
15+
name: PG${{ matrix.pg }}-${{ matrix.type }}
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
pg: [12,13,14,15]
21+
type: ['normal', 'bitnami']
22+
steps:
23+
- name: Check out the source
24+
uses: actions/checkout@v3
25+
26+
- name: Build Docker Image for TimescaleDB
27+
run: |
28+
if [ ${{ matrix.type }} == bitnami ]
29+
then
30+
cd bitnami
31+
fi
32+
make image PG_VER=pg${{ matrix.pg }} TAG_VERSION=smoketest-image BETA=1
33+
34+
- name: Install psql
35+
run: sudo apt install postgresql-client
36+
37+
- name: Run the smoke test
38+
run: |
39+
set -eu
40+
export PGHOST=localhost
41+
export PGUSER=postgres
42+
export PGPASSWORD=test1234
43+
docker container stop smoketest-container || true
44+
docker container rm smoketest-container || true
45+
docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=${PGPASSWORD} --name smoketest-container smoketest-image
46+
for _ in {1..120}
47+
do
48+
if [ -z "$(docker container ls -q --filter name=smoketest-container)" ]
49+
then
50+
echo "Smoketest container is not running"
51+
exit 1
52+
fi
53+
if psql -c "select 1"
54+
then
55+
break
56+
fi
57+
sleep 1
58+
done
59+
if ! psql -c "select 1"
60+
then
61+
echo "Cannot connect to PostgreSQL"
62+
exit 1
63+
fi
64+
65+
- name: Show the logs
66+
if: always()
67+
run: |
68+
docker logs smoketest-container

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*~
2+
/.build_*
3+
*/.build_*

Dockerfile

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
ARG PG_VERSION
22
ARG PREV_IMAGE
33
ARG TS_VERSION
4+
ARG PG_MAJOR=15
5+
ARG GO_VERSION=1.18.7
6+
ARG OSS_ONLY
7+
48
############################
59
# Build tools binaries in separate image
610
############################
7-
ARG GO_VERSION=1.18.7
811
FROM golang:${GO_VERSION}-alpine AS tools
912

1013
ENV TOOLS_VERSION 0.8.1
@@ -16,10 +19,7 @@ RUN apk update && apk add --no-cache git gcc musl-dev \
1619
############################
1720
# Grab old versions from previous version
1821
############################
19-
ARG PG_VERSION
20-
ARG PREV_IMAGE
2122
FROM ${PREV_IMAGE} AS oldversions
22-
# Remove update files, mock files, and all but the last 5 .so/.sql files
2323
RUN rm -f $(pg_config --sharedir)/extension/timescaledb*mock*.sql \
2424
&& if [ -f $(pg_config --pkglibdir)/timescaledb-tsl-1*.so ]; then rm -f $(ls -1 $(pg_config --pkglibdir)/timescaledb-tsl-1*.so | head -n -5); fi \
2525
&& if [ -f $(pg_config --pkglibdir)/timescaledb-1*.so ]; then rm -f $(ls -1 $(pg_config --pkglibdir)/timescaledb-*.so | head -n -5); fi \
@@ -28,9 +28,7 @@ RUN rm -f $(pg_config --sharedir)/extension/timescaledb*mock*.sql \
2828
############################
2929
# Now build image and copy in tools
3030
############################
31-
ARG PG_VERSION
32-
FROM postgres:${PG_VERSION}-alpine
33-
ARG OSS_ONLY
31+
FROM postgres:${PG_MAJOR}-alpine
3432

3533
LABEL maintainer="Timescale https://www.timescale.com"
3634

@@ -39,7 +37,6 @@ COPY --from=tools /go/bin/* /usr/local/bin/
3937
COPY --from=oldversions /usr/local/lib/postgresql/timescaledb-*.so /usr/local/lib/postgresql/
4038
COPY --from=oldversions /usr/local/share/postgresql/extension/timescaledb--*.sql /usr/local/share/postgresql/extension/
4139

42-
ARG TS_VERSION
4340
RUN set -ex \
4441
&& apk add libssl1.1 \
4542
&& apk add --no-cache --virtual .fetch-deps \
@@ -70,5 +67,4 @@ RUN set -ex \
7067
\
7168
&& if [ "${OSS_ONLY}" != "" ]; then rm -f $(pg_config --pkglibdir)/timescaledb-tsl-*.so; fi \
7269
&& apk del .fetch-deps .build-deps \
73-
&& rm -rf /build \
74-
&& sed -r -i "s/[#]*\s*(shared_preload_libraries)\s*=\s*'(.*)'/\1 = 'timescaledb,\2'/;s/,'/'/" /usr/local/share/postgresql/postgresql.conf.sample
70+
&& rm

timescaledb-docker

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)