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

Upgrade pgml to v2.10.0 (#) #901

Merged
merged 1 commit into from
Jan 17, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/extensions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ jobs:
if: matrix.pg == 15
shell: bash -e {0}
run: |
for val in pg_cron timescaledb pg_search pg_analytics citus plrust pg_net pg_stat_kcache pg_squeeze pg_tle pgaudit pglogical anon:postgresql_anonymizer; do
for val in pg_cron timescaledb pg_search pg_analytics citus plrust pg_net pg_stat_kcache pg_squeeze pg_tle pgaudit pglogical anon:postgresql_anonymizer pgml:postgresml; do
if [[ "${{ matrix.ext.path }}" == *"${val#*:}"* ]]; then
echo handling shared_preload_libraries for ${val#*:}
echo "shared_preload_libraries = '${val%:*}'" >> /var/lib/postgresql/data2/postgresql.conf
Expand Down
50 changes: 13 additions & 37 deletions contrib/postgresml/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,48 +1,24 @@
ARG PG_VERSION=16
FROM quay.io/coredb/pgrx-builder:pg${PG_VERSION}-pgrx0.11.3
USER root
FROM quay.io/coredb/pgrx-builder:pg${PG_VERSION}-pgrx0.12.9

ARG RELEASE=v2.9.3
ARG PG_VERSION=16
# Download and build the extension.
ARG PG_VERSION
ARG EXTENSION_NAME
ARG EXTENSION_VERSION

# Extension build dependencies
USER root
RUN apt-get update && apt-get install -y \
build-essential \
clang \
bison flex \
libopenblas-dev \
libssl-dev \
bison \
flex \
pkg-config \
cmake \
libreadline-dev \
libz-dev \
tzdata \
sudo \
libpq-dev \
libclang-dev \
postgresql-${PG_VERSION} \
postgresql-server-dev-${PG_VERSION} \
python3 \
python3-pip \
libpython3-dev \
lld

# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN $HOME/.cargo/bin/cargo install cargo-pgrx --version=0.11.3 --locked
ARG PG_VERSION=16
RUN $HOME/.cargo/bin/cargo pgrx init --pg$PG_VERSION $(which pg_config)

# Clone repository
RUN git clone https://github.com/postgresml/postgresml.git

# Build the extension
RUN cd postgresml && \
git submodule update --init --recursive && \
git fetch origin ${RELEASE} && \
git checkout ${RELEASE} && \
cd pgml-extension && \
cargo update && \
cargo pgrx init --pg${PG_VERSION} /usr/bin/pg_config && \
cargo pgrx package
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& /root/.cargo/bin/rustup default stable \
&& git clone --depth 1 --branch v${EXTENSION_VERSION} https://github.com/${EXTENSION_NAME}/${EXTENSION_NAME}.git \
&& cd ${EXTENSION_NAME}/pgml-extension \
&& cargo pgrx init --pg${PG_VERSION}=/usr/bin/pg_config \
&& cargo pgrx package
11 changes: 4 additions & 7 deletions contrib/postgresml/Trunk.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
[extension]
name = "postgresml"
version = "2.9.3"
version = "2.10.0"
repository = "https://github.com/postgresml/postgresml"
license = "MIT"
description = "PostgresML is a machine learning extension to PostgreSQL that enables you to perform training and inference on text and tabular data using SQL queries."
homepage = "https://postgresml.org/"
documentation = "https://postgresml.org/docs/guides/setup/quick_start_with_docker"
preload_libraries = ["pgml"]
categories = ["machine_learning"]

[dependencies]
apt = ["libpython3.10", "libstdc++6", "libgomp1", "libopenblas0-pthread", "libc6", "libgcc-s1"]
pip = ["xgboost"]

[build]
postgres_version = "15"
postgres_version = "17"
platform = "linux/amd64"
dockerfile = "Dockerfile"
install_command = """
cd postgresml/pgml-extension
mv target/release/pgml-pg15/usr/lib/postgresql/15/lib/* /usr/lib/postgresql/15/lib
mv target/release/pgml-pg15/usr/share/postgresql/15/extension/* /usr/share/postgresql/15/extension
"""
install_command = "cd postgresml/pgml-extension && cargo pgrx install --release"