Skip to content

Commit 7e4db69

Browse files
committed
add pg_bestmatch.rs and update golang version
- https://github.com/tensorchord/pg_bestmatch.rs - updated golang version to 1.23 Signed-off-by: Piyush Raj <[email protected]>
1 parent d3810cb commit 7e4db69

File tree

6 files changed

+62
-7
lines changed

6 files changed

+62
-7
lines changed

.github/workflows/smoke-test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ jobs:
9898
psql -c "CREATE SCHEMA partman;"
9999
psql -c "CREATE EXTENSION pg_partman SCHEMA partman;"
100100
101+
echo "Test pg_bestmatch Extension"
102+
psql -c "CREATE EXTENSION pg_bestmatch;"
103+
psql -c "SET search_path TO public, bm_catalog;"
104+
101105
break
102106
fi
103107
sleep 1

Dockerfile

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ARG TS_VERSION
44
############################
55
# Build tools binaries in separate image
66
############################
7-
ARG GO_VERSION=1.18.7
7+
ARG GO_VERSION=1.23
88
FROM golang:${GO_VERSION}-alpine AS tools
99

1010
ENV TOOLS_VERSION 0.8.1
@@ -390,4 +390,28 @@ RUN set -e \
390390
&& cd / \
391391
&& rm /tmp/pg_partman.tar.gz \
392392
&& rm -rf /tmp/pg_partman \
393-
&& apk del .pg_partman-deps .pg_partman-build-deps
393+
&& apk del .pg_partman-deps .pg_partman-build-deps
394+
395+
ENV RUSTFLAGS="-C target-feature=-crt-static"
396+
ARG PG_BESTMATCH_RS_SHA
397+
ARG PG_VERSION
398+
RUN set -x && apk add --no-cache --virtual .pg_bestmatch-build-deps \
399+
git \
400+
curl \
401+
build-base \
402+
clang \
403+
llvm \
404+
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
405+
&& export PATH="$HOME/.cargo/bin:$PATH" \
406+
&& rustup update stable \
407+
&& cd /tmp && git clone --branch main https://github.com/tensorchord/pg_bestmatch.git \
408+
&& ls -alh \
409+
&& cd pg_bestmatch \
410+
&& git checkout ${PG_BESTMATCH_RS_SHA} \
411+
&& export PATH="$HOME/.cargo/bin:$PATH" \
412+
&& cargo install --locked cargo-pgrx --version 0.12.0-alpha.1 \
413+
&& cargo pgrx init --pg${PG_VERSION}=$(which pg_config) \
414+
&& cargo pgrx install --release \
415+
&& cd .. \
416+
&& rm -rf ./pg_bestmatch \
417+
&& apk del .pg_bestmatch-build-deps

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ PG_AUTO_FAILOVER_VERSION=2.1
1313
POSTGRES_HLL_VERSION=2.18
1414
PG_JOBMON_VERSION=1.4.1
1515
PG_PARTMAN_VERSION=5.0.1
16+
PG_BESTMATCH_RS_SHA=312617392c8a32121907496f05c23fce1e3d056c
1617
PREV_TS_VERSION=$(shell wget --quiet -O - https://raw.githubusercontent.com/timescale/timescaledb/${TS_VERSION}/version.config | grep update_from_version | sed -e 's!update_from_version = !!')
1718
PREV_TS_IMAGE="timescale/timescaledb:$(PREV_TS_VERSION)-pg$(PG_VER_NUMBER)$(PREV_EXTRA)"
1819
PREV_IMAGE=$(shell if docker pull $(PREV_TS_IMAGE) >/dev/null; then echo "$(PREV_TS_IMAGE)"; else echo "postgres:$(PG_VER_NUMBER)-alpine"; fi )
@@ -42,7 +43,8 @@ DOCKER_BUILD_ARGS = --build-arg TS_VERSION=$(TS_VERSION) \
4243
--build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) \
4344
--build-arg POSTGRES_HLL_VERSION=$(POSTGRES_HLL_VERSION)\
4445
--build-arg PG_JOBMON_VERSION=$(PG_JOBMON_VERSION) \
45-
--build-arg PG_PARTMAN_VERSION=$(PG_PARTMAN_VERSION)
46+
--build-arg PG_PARTMAN_VERSION=$(PG_PARTMAN_VERSION) \
47+
--build-arg PG_BESTMATCH_RS_SHA=$(PG_BESTMATCH_RS_SHA)
4648

4749

4850

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ WarpSQL is a powerful solution that provides opinionated extensions to Postgres,
2323
| [postgresql-hll](https://github.com/citusdata/postgresql-hll) | 2.18 | 2.18 | 2.18 |
2424
| [PgJobmon](https://github.com/omniti-labs/pg_jobmon) | 1.4.1 | 1.4.1 | 1.4.1 |
2525
| [PgPartman](https://github.com/pgpartman/pg_partman) | 5.0.1 | 5.0.1 | 5.0.1 |
26+
| [pg_bestmatch](https://github.com/tensorchord/pg_bestmatch.rs)| [commit 3126173](https://github.com/tensorchord/pg_bestmatch.rs/commit/312617392c8a32121907496f05c23fce1e3d056c) |
2627

2728
## Releases
2829
- [Versioning Policy](./docs/version-policy.md)

bitnami/Dockerfile

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ ARG TS_VERSION
44
############################
55
# Build tools binaries in separate image
66
############################
7-
ARG GO_VERSION=1.19.1
7+
ARG GO_VERSION=1.23
88
FROM golang:${GO_VERSION}-alpine AS tools
99

1010
ENV TOOLS_VERSION 0.8.1
1111

12-
RUN apk update && apk add --no-cache git gcc \
12+
RUN apk update && apk add --no-cache git gcc musl-dev \
1313
&& go install github.com/timescale/timescaledb-tune/cmd/timescaledb-tune@latest \
1414
&& go install github.com/timescale/timescaledb-parallel-copy/cmd/timescaledb-parallel-copy@latest
1515

@@ -426,7 +426,29 @@ RUN set -ex \
426426
&& apt-get clean -y \
427427
&& rm /tmp/pg_partman.tar.gz \
428428
&& rm -rf /tmp/pg_partman
429-
429+
430+
ENV RUSTFLAGS="-C target-feature=-crt-static"
431+
ARG PG_BESTMATCH_RS_SHA
432+
ARG PG_VERSION
433+
RUN apt-get update -y -qq \
434+
&& apt-get install -y curl gnupg openssl pkg-config libssl-dev git \
435+
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
436+
&& export PATH="/.cargo/bin:$PATH" \
437+
&& export PGRX_HOME="/.pgrx/" \
438+
&& mkdir -p $PGRX_HOME \
439+
&& cargo install cargo-pgrx --version 0.9.3 \
440+
&& rustup update stable \
441+
&& cd /tmp && git clone --branch main https://github.com/tensorchord/pg_bestmatch.git \
442+
&& cd pg_bestmatch \
443+
&& git checkout ${PG_BESTMATCH_RS_SHA} \
444+
&& export PATH="$HOME/.cargo/bin:$PATH" \
445+
&& cargo install --locked cargo-pgrx --version 0.12.0-alpha.1 \
446+
&& cargo pgrx init --pg${PG_VERSION}=$(which pg_config) \
447+
&& cargo pgrx install --release \
448+
&& cd .. \
449+
&& rm -rf ./pg_bestmatch \
450+
&& apt-get clean -y
451+
430452
USER 1001
431453

432454
ENTRYPOINT [ "/opt/bitnami/scripts/postgresql/timescaledb-bitnami-entrypoint.sh" ]

bitnami/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ PG_REPACK_VERSION=1.5.0
1313
POSTGRES_HLL_VERSION=2.18
1414
PG_JOBMON_VERSION=1.4.1
1515
PG_PARTMAN_VERSION=5.0.1
16+
PG_BESTMATCH_RS_SHA=312617392c8a32121907496f05c23fce1e3d056c
1617
PREV_TS_VERSION=$(shell wget --quiet -O - https://raw.githubusercontent.com/timescale/timescaledb/${TS_VERSION}/version.config | grep update_from_version | sed -e 's!update_from_version = !!')
1718
PREV_TS_IMAGE="timescale/timescaledb:$(PREV_TS_VERSION)-pg$(PG_VER_NUMBER)-bitnami"
1819
PREV_IMAGE=$(shell if docker pull $(PREV_TS_IMAGE) >/dev/null; then echo "$(PREV_TS_IMAGE)"; else echo "bitnami/postgresql:$(PG_VER_NUMBER)"; fi )
@@ -39,7 +40,8 @@ DOCKER_BUILD_ARGS = --build-arg PG_VERSION=$(PG_VER_NUMBER) \
3940
--build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) \
4041
--build-arg POSTGRES_HLL_VERSION=$(POSTGRES_HLL_VERSION)\
4142
--build-arg PG_JOBMON_VERSION=$(PG_JOBMON_VERSION) \
42-
--build-arg PG_PARTMAN_VERSION=$(PG_PARTMAN_VERSION)
43+
--build-arg PG_PARTMAN_VERSION=$(PG_PARTMAN_VERSION) \
44+
--build-arg PG_BESTMATCH_RS_SHA=$(PG_BESTMATCH_RS_SHA)
4345

4446

4547
default: image

0 commit comments

Comments
 (0)