Skip to content

add pg_bestmatch.rs #151

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

Merged
Merged
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: 4 additions & 0 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ jobs:
psql -c "CREATE SCHEMA partman;"
psql -c "CREATE EXTENSION pg_partman SCHEMA partman;"

echo "Test pg_bestmatch Extension"
psql -c "CREATE EXTENSION pg_bestmatch;"
psql -c "SET search_path TO public, bm_catalog;"

break
fi
sleep 1
Expand Down
28 changes: 26 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG TS_VERSION
############################
# Build tools binaries in separate image
############################
ARG GO_VERSION=1.18.7
ARG GO_VERSION=1.23
FROM golang:${GO_VERSION}-alpine AS tools

ENV TOOLS_VERSION 0.8.1
Expand Down Expand Up @@ -390,4 +390,28 @@ RUN set -e \
&& cd / \
&& rm /tmp/pg_partman.tar.gz \
&& rm -rf /tmp/pg_partman \
&& apk del .pg_partman-deps .pg_partman-build-deps
&& apk del .pg_partman-deps .pg_partman-build-deps

ENV RUSTFLAGS="-C target-feature=-crt-static"
ARG PG_BESTMATCH_RS_SHA
ARG PG_VERSION
RUN set -x && apk add --no-cache --virtual .pg_bestmatch-build-deps \
git \
curl \
build-base \
clang \
llvm \
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& export PATH="$HOME/.cargo/bin:$PATH" \
&& rustup update stable \
&& cd /tmp && git clone --branch main https://github.com/tensorchord/pg_bestmatch.git \
&& ls -alh \
&& cd pg_bestmatch \
&& git checkout ${PG_BESTMATCH_RS_SHA} \
&& export PATH="$HOME/.cargo/bin:$PATH" \
&& cargo install --locked cargo-pgrx --version 0.12.0-alpha.1 \
&& cargo pgrx init --pg${PG_VERSION}=$(which pg_config) \
&& cargo pgrx install --release \
&& cd .. \
&& rm -rf ./pg_bestmatch \
&& apk del .pg_bestmatch-build-deps
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ PG_AUTO_FAILOVER_VERSION=2.1
POSTGRES_HLL_VERSION=2.18
PG_JOBMON_VERSION=1.4.1
PG_PARTMAN_VERSION=5.0.1
PG_BESTMATCH_RS_SHA=312617392c8a32121907496f05c23fce1e3d056c
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 = !!')
PREV_TS_IMAGE="timescale/timescaledb:$(PREV_TS_VERSION)-pg$(PG_VER_NUMBER)$(PREV_EXTRA)"
PREV_IMAGE=$(shell if docker pull $(PREV_TS_IMAGE) >/dev/null; then echo "$(PREV_TS_IMAGE)"; else echo "postgres:$(PG_VER_NUMBER)-alpine"; fi )
Expand Down Expand Up @@ -42,7 +43,8 @@ DOCKER_BUILD_ARGS = --build-arg TS_VERSION=$(TS_VERSION) \
--build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) \
--build-arg POSTGRES_HLL_VERSION=$(POSTGRES_HLL_VERSION)\
--build-arg PG_JOBMON_VERSION=$(PG_JOBMON_VERSION) \
--build-arg PG_PARTMAN_VERSION=$(PG_PARTMAN_VERSION)
--build-arg PG_PARTMAN_VERSION=$(PG_PARTMAN_VERSION) \
--build-arg PG_BESTMATCH_RS_SHA=$(PG_BESTMATCH_RS_SHA)



Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ WarpSQL is a powerful solution that provides opinionated extensions to Postgres,
| [postgresql-hll](https://github.com/citusdata/postgresql-hll) | 2.18 | 2.18 | 2.18 |
| [PgJobmon](https://github.com/omniti-labs/pg_jobmon) | 1.4.1 | 1.4.1 | 1.4.1 |
| [PgPartman](https://github.com/pgpartman/pg_partman) | 5.0.1 | 5.0.1 | 5.0.1 |
| [pg_bestmatch](https://github.com/tensorchord/pg_bestmatch.rs)| [commit 3126173](https://github.com/tensorchord/pg_bestmatch.rs/commit/312617392c8a32121907496f05c23fce1e3d056c) |

## Releases
- [Versioning Policy](./docs/version-policy.md)
Expand Down
28 changes: 25 additions & 3 deletions bitnami/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ ARG TS_VERSION
############################
# Build tools binaries in separate image
############################
ARG GO_VERSION=1.19.1
ARG GO_VERSION=1.23
FROM golang:${GO_VERSION}-alpine AS tools

ENV TOOLS_VERSION 0.8.1

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

Expand Down Expand Up @@ -426,7 +426,29 @@ RUN set -ex \
&& apt-get clean -y \
&& rm /tmp/pg_partman.tar.gz \
&& rm -rf /tmp/pg_partman


ENV RUSTFLAGS="-C target-feature=-crt-static"
ARG PG_BESTMATCH_RS_SHA
ARG PG_VERSION
RUN apt-get update -y -qq \
&& apt-get install -y curl gnupg openssl pkg-config libssl-dev git \
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& export PATH="/.cargo/bin:$PATH" \
&& export PGRX_HOME="/.pgrx/" \
&& mkdir -p $PGRX_HOME \
&& cargo install cargo-pgrx --version 0.9.3 \
&& rustup update stable \
&& cd /tmp && git clone --branch main https://github.com/tensorchord/pg_bestmatch.git \
&& cd pg_bestmatch \
&& git checkout ${PG_BESTMATCH_RS_SHA} \
&& export PATH="$HOME/.cargo/bin:$PATH" \
&& cargo install --locked cargo-pgrx --version 0.12.0-alpha.1 \
&& cargo pgrx init --pg${PG_VERSION}=$(which pg_config) \
&& cargo pgrx install --release \
&& cd .. \
&& rm -rf ./pg_bestmatch \
&& apt-get clean -y

USER 1001

ENTRYPOINT [ "/opt/bitnami/scripts/postgresql/timescaledb-bitnami-entrypoint.sh" ]
Expand Down
4 changes: 3 additions & 1 deletion bitnami/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ PG_REPACK_VERSION=1.5.0
POSTGRES_HLL_VERSION=2.18
PG_JOBMON_VERSION=1.4.1
PG_PARTMAN_VERSION=5.0.1
PG_BESTMATCH_RS_SHA=312617392c8a32121907496f05c23fce1e3d056c
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 = !!')
PREV_TS_IMAGE="timescale/timescaledb:$(PREV_TS_VERSION)-pg$(PG_VER_NUMBER)-bitnami"
PREV_IMAGE=$(shell if docker pull $(PREV_TS_IMAGE) >/dev/null; then echo "$(PREV_TS_IMAGE)"; else echo "bitnami/postgresql:$(PG_VER_NUMBER)"; fi )
Expand All @@ -39,7 +40,8 @@ DOCKER_BUILD_ARGS = --build-arg PG_VERSION=$(PG_VER_NUMBER) \
--build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) \
--build-arg POSTGRES_HLL_VERSION=$(POSTGRES_HLL_VERSION)\
--build-arg PG_JOBMON_VERSION=$(PG_JOBMON_VERSION) \
--build-arg PG_PARTMAN_VERSION=$(PG_PARTMAN_VERSION)
--build-arg PG_PARTMAN_VERSION=$(PG_PARTMAN_VERSION) \
--build-arg PG_BESTMATCH_RS_SHA=$(PG_BESTMATCH_RS_SHA)


default: image
Expand Down
Loading