Skip to content

Commit

Permalink
Add postgresml extension (#200)
Browse files Browse the repository at this point in the history
Co-authored-by: Evan Stanton <evan.h.stanton@gmail.com>
  • Loading branch information
ianstanton and EvanHStanton authored Jul 12, 2023
1 parent e22ff57 commit c73e987
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
43 changes: 43 additions & 0 deletions contrib/postgresml/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
ARG PG_VERSION=15
FROM quay.io/coredb/pgrx-builder:pg${PG_VERSION}-pgrx0.9.7
USER root
# quay.io/coredb/pgrx-builder:pg15-pgrx0.9.7
# Extension build dependencies
RUN apt-get update && apt-get install -y \
build-essential \
libreadline-dev \
zlib1g-dev \
flex \
bison \
libxml2-dev \
libxslt-dev \
libssl-dev \
libxml2-utils \
xsltproc \
ccache \
python3-dev \
clang \
cmake \
libclang-dev \
libopenblas-dev \
libpython3-dev \
pkg-config

# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

# Set default Rust version
RUN /root/.cargo/bin/rustup default stable

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

ARG RELEASE=v2.7.1

RUN cd postgresml && \
git submodule update --init --recursive && \
git fetch origin ${RELEASE} && \
git checkout ${RELEASE} && \
cd pgml-extension && \
cargo pgrx init --pg15 /usr/bin/pg_config && \
cargo pgrx package
19 changes: 19 additions & 0 deletions contrib/postgresml/Trunk.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[extension]
name = "pgml"
version = "2.7.1"
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"
categories = ["machine_learning"]

[build]
postgres_version = "15"
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
"""

0 comments on commit c73e987

Please sign in to comment.