diff --git a/docker-compose.yml b/docker-compose.yml
index 4a392c300..3f9e29ff7 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -28,6 +28,7 @@ services:
environment:
ROCKET_ADDRESS: 0.0.0.0
DATABASE_URL: postgres://postgres:postgres@postgres:5432/pgml_development
+ RUST_LOG: info
command: bash -c "sqlx migrate run && cargo run"
volumes:
diff --git a/pgml-dashboard/.dockerignore b/pgml-dashboard/.dockerignore
index 2f7896d1d..a6d3b3fcc 100644
--- a/pgml-dashboard/.dockerignore
+++ b/pgml-dashboard/.dockerignore
@@ -1 +1,2 @@
target/
+search_index/
diff --git a/pgml-dashboard/Dockerfile b/pgml-dashboard/Dockerfile
index a6bef3507..7c76db74d 100644
--- a/pgml-dashboard/Dockerfile
+++ b/pgml-dashboard/Dockerfile
@@ -1,4 +1,6 @@
FROM rust:1
+RUN cargo install sqlx-cli
+RUN apt-get update && apt-get install -y nodejs npm
+RUN npm install -g sass
COPY . /app
WORKDIR /app
-RUN cargo install sqlx-cli
diff --git a/pgml-dashboard/build.rs b/pgml-dashboard/build.rs
index 5cb29bb96..62334bfc2 100644
--- a/pgml-dashboard/build.rs
+++ b/pgml-dashboard/build.rs
@@ -18,10 +18,10 @@ fn main() {
.arg("static/css/bootstrap-theme.scss")
.arg("static/css/style.css")
.status()
- .unwrap();
+ .expect("`npm exec sass` failed");
if !status.success() {
- println!("SCSS compilation failed");
+ println!("SCSS compilation failed to run");
}
// Bundle CSS to bust cache.
@@ -38,7 +38,7 @@ fn main() {
.arg("static/css/style.css")
.arg(format!("static/css/style.{}.css", css_version))
.status()
- .unwrap()
+ .expect("cp static/css/style.css failed to run")
.success()
{
println!("Bundling CSS failed");
@@ -54,7 +54,7 @@ fn main() {
// Build JS to bust cache
for file in glob::glob("static/js/*.js").expect("failed to glob") {
let file = file.expect("failed to glob path");
- let contents = read_to_string(file).unwrap().as_bytes().to_vec();
+ let contents = read_to_string(file).expect("failed to read js file").as_bytes().to_vec();
js_version.push(format!("{:x}", md5::compute(contents)));
}
@@ -73,7 +73,7 @@ fn main() {
.arg(&filename)
.arg(format!("{}.{}.js", name, js_version))
.status()
- .unwrap()
+ .expect("failed to cp js file")
.success()
{
println!("Bundling JS failed");
diff --git a/pgml-dashboard/templates/layout/footer.html b/pgml-dashboard/templates/layout/footer.html
index 98cd64b62..b2abb5104 100644
--- a/pgml-dashboard/templates/layout/footer.html
+++ b/pgml-dashboard/templates/layout/footer.html
@@ -15,7 +15,7 @@
Discord
- <% if !crate::utils::config::standalone_dashboard() {; %>
+ <% if !crate::utils::config::standalone_dashboard() { %>
Create an Account
diff --git a/pgml-dashboard/templates/layout/nav/top.html b/pgml-dashboard/templates/layout/nav/top.html
index a35c883a8..86b30b16a 100644
--- a/pgml-dashboard/templates/layout/nav/top.html
+++ b/pgml-dashboard/templates/layout/nav/top.html
@@ -51,6 +51,6 @@
- <% include!("../../components/search_modal.html");%>
+ <% include!("../../components/search_modal.html"); %>
diff --git a/pgml-extension/.dockerignore b/pgml-extension/.dockerignore
index 6c5283362..46b4b2d73 100644
--- a/pgml-extension/.dockerignore
+++ b/pgml-extension/.dockerignore
@@ -1,6 +1,7 @@
# Cargo
Cargo.lock
-/target
+target/
+venv/
**/*.rs.bk
# PyCharm
diff --git a/pgml-extension/Dockerfile b/pgml-extension/Dockerfile
index c3263388c..93bc128c1 100644
--- a/pgml-extension/Dockerfile
+++ b/pgml-extension/Dockerfile
@@ -1,31 +1,48 @@
FROM nvidia/cuda:12.1.1-devel-ubuntu22.04
LABEL maintainer="team@postgresml.com"
-RUN apt-get update
ARG DEBIAN_FRONTEND=noninteractive
+ARG PGML_VERSION=2.5.2
ENV TZ=Etc/UTC
ENV PATH="/usr/local/cuda/bin:${PATH}"
-RUN apt-get update && apt-get install -y curl lsb-release python3 python3-pip tzdata sudo cmake libpq-dev libclang-dev wget git
-
+# Dependencies
RUN apt-get update && \
- apt-get install -y wget gnupg lsb-release && \
- wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
+ apt-get install -y \
+ curl \
+ lsb-release \
+ python3 \
+ python3-pip \
+ tzdata \
+ sudo \
+ cmake \
+ libpq-dev \
+ libclang-dev \
+ wget \
+ git \
+ gnupg \
+ lsb-release
+
+# PostgreSQL
+RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
apt-get update && \
apt-get install -y postgresql-14 && \
apt-get install -y postgresql-plpython3-14
-
+# PostgresML
RUN echo "deb [trusted=yes] https://apt.postgresml.org $(lsb_release -cs) main" >> /etc/apt/sources.list
RUN cat /etc/apt/sources.list
-RUN apt-get update && apt-get install -y postgresql-pgml-14
-# Cache this, quicker
-COPY --chown=postgres:postgres . /app
+RUN apt-get update && apt-get install -y postgresql-pgml-14=${PGML_VERSION}
+
+COPY --chown=postgres:postgres requirements.txt /app/requirements.txt
WORKDIR /app
RUN pip3 install -r requirements.txt
+
+COPY --chown=postgres:postgres requirements-xformers.txt /app/requirements-xformers.txt
RUN pip3 install -r requirements-xformers.txt --no-dependencies
+COPY --chown=postgres:postgres . /app
# Listen on 0.0.0.0 and allow 'root' to connect without a password.
# Please modify for production deployments accordingly.
RUN cp /app/docker/postgresql.conf /etc/postgresql/14/main/postgresql.conf
@@ -36,5 +53,4 @@ RUN cd /tmp && \
make && \
make install
-WORKDIR /app
ENTRYPOINT ["/bin/bash", "/app/docker/entrypoint.sh"]
diff --git a/pgml-extension/docker/entrypoint.sh b/pgml-extension/docker/entrypoint.sh
index 9a32f90d9..9d1cbff4f 100644
--- a/pgml-extension/docker/entrypoint.sh
+++ b/pgml-extension/docker/entrypoint.sh
@@ -25,7 +25,7 @@ done
fi
echo "Installing pgvector.. "
-psql -U postgres -h 127.0.0.1 pgml_development -c 'CREATE EXTENSION vector'
+psql -U postgres -h 127.0.0.1 pgml_development -c 'CREATE EXTENSION IF NOT EXISTS vector'
echo "Ready!"
if [[ ! -z $@ ]]; then
diff --git a/pgml-extension/examples/binary_classification.sql b/pgml-extension/examples/binary_classification.sql
index 3ddc23fd6..678cf0002 100644
--- a/pgml-extension/examples/binary_classification.sql
+++ b/pgml-extension/examples/binary_classification.sql
@@ -1,5 +1,5 @@
-- Exit on error (psql)
-\set ON_ERROR_STOP true
+-- \set ON_ERROR_STOP true
\timing on
SELECT pgml.load_dataset('breast_cancer');
diff --git a/pgml-extension/examples/finetune.sql b/pgml-extension/examples/finetune.sql
index ca52acfea..ab260af7c 100644
--- a/pgml-extension/examples/finetune.sql
+++ b/pgml-extension/examples/finetune.sql
@@ -1,5 +1,5 @@
-- Exit on error (psql)
-\set ON_ERROR_STOP true
+-- \set ON_ERROR_STOP true
\timing on
diff --git a/pgml-extension/examples/image_classification.sql b/pgml-extension/examples/image_classification.sql
index d1781d285..ef2524d6b 100644
--- a/pgml-extension/examples/image_classification.sql
+++ b/pgml-extension/examples/image_classification.sql
@@ -10,7 +10,7 @@
-- solutions can solve problems these days.
-- Exit on error (psql)
-\set ON_ERROR_STOP true
+-- \set ON_ERROR_STOP true
\timing on
SELECT pgml.load_dataset('digits');
diff --git a/pgml-extension/examples/joint_regression.sql b/pgml-extension/examples/joint_regression.sql
index 6a56afb2a..8921eaf97 100644
--- a/pgml-extension/examples/joint_regression.sql
+++ b/pgml-extension/examples/joint_regression.sql
@@ -3,7 +3,7 @@
-- for regression, along with multiple jointly optimized targets.
-- Exit on error (psql)
-\set ON_ERROR_STOP true
+-- \set ON_ERROR_STOP true
\timing on
SELECT pgml.load_dataset('linnerud');
diff --git a/pgml-extension/examples/multi_classification.sql b/pgml-extension/examples/multi_classification.sql
index a1ef56efd..1cc1f15a8 100644
--- a/pgml-extension/examples/multi_classification.sql
+++ b/pgml-extension/examples/multi_classification.sql
@@ -1,5 +1,5 @@
-- Exit on error (psql)
-\set ON_ERROR_STOP true
+-- \set ON_ERROR_STOP true
\timing on
SELECT pgml.load_dataset('iris');
diff --git a/pgml-extension/examples/regression.sql b/pgml-extension/examples/regression.sql
index 000afd2b5..17a58544f 100644
--- a/pgml-extension/examples/regression.sql
+++ b/pgml-extension/examples/regression.sql
@@ -10,7 +10,7 @@
-- for regression.
-- Exit on error (psql)
-\set ON_ERROR_STOP true
+-- \set ON_ERROR_STOP true
\timing on
SELECT pgml.load_dataset('diabetes');
diff --git a/pgml-extension/examples/transformers.sql b/pgml-extension/examples/transformers.sql
index 24c861286..b6017310f 100644
--- a/pgml-extension/examples/transformers.sql
+++ b/pgml-extension/examples/transformers.sql
@@ -1,5 +1,5 @@
-- Exit on error (psql)
-\set ON_ERROR_STOP true
+-- \set ON_ERROR_STOP true
\timing on
SELECT pgml.embed('intfloat/e5-small', 'hi mom');
diff --git a/pgml-extension/examples/vectors.sql b/pgml-extension/examples/vectors.sql
index 335124705..094d0374b 100644
--- a/pgml-extension/examples/vectors.sql
+++ b/pgml-extension/examples/vectors.sql
@@ -1,5 +1,5 @@
-- Exit on error (psql)
-\set ON_ERROR_STOP true
+-- \set ON_ERROR_STOP true
\timing on
-- Elementwise arithmetic w/ constants
diff --git a/pgml-extension/sql/setup_examples.sql b/pgml-extension/sql/setup_examples.sql
index 872588f1a..4f14924ea 100644
--- a/pgml-extension/sql/setup_examples.sql
+++ b/pgml-extension/sql/setup_examples.sql
@@ -6,13 +6,13 @@
--- $ cargo pgrx run --release
--- $ psql -P pager-off -h localhost -p 28813 -d pgml -f sql/setup_examples.sql
---
-\set ON_ERROR_STOP true
+-- \set ON_ERROR_STOP true
\timing on
-- The intention is to only allow setup_examples.sql to run on a database that
-- has not had example data installed before, e.g. docker run. This should
-- error and stop the process if the extension is already present.
-CREATE EXTENSION pgml;
+CREATE EXTENSION IF NOT EXISTS pgml;
SELECT pgml.load_dataset('breast_cancer');
SELECT pgml.load_dataset('diabetes');
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy