Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eb64857

Browse filesBrowse files
authored
Docker fix of the day (#733)
1 parent 1a95786 commit eb64857
Copy full SHA for eb64857

18 files changed

+51
-30
lines changed

‎docker-compose.yml

Copy file name to clipboardExpand all lines: docker-compose.yml
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ services:
2828
environment:
2929
ROCKET_ADDRESS: 0.0.0.0
3030
DATABASE_URL: postgres://postgres:postgres@postgres:5432/pgml_development
31+
RUST_LOG: info
3132
command: bash -c "sqlx migrate run && cargo run"
3233

3334
volumes:

‎pgml-dashboard/.dockerignore

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
target/
2+
search_index/

‎pgml-dashboard/Dockerfile

Copy file name to clipboardExpand all lines: pgml-dashboard/Dockerfile
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
FROM rust:1
2+
RUN cargo install sqlx-cli
3+
RUN apt-get update && apt-get install -y nodejs npm
4+
RUN npm install -g sass
25
COPY . /app
36
WORKDIR /app
4-
RUN cargo install sqlx-cli

‎pgml-dashboard/build.rs

Copy file name to clipboardExpand all lines: pgml-dashboard/build.rs
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ fn main() {
1818
.arg("static/css/bootstrap-theme.scss")
1919
.arg("static/css/style.css")
2020
.status()
21-
.unwrap();
21+
.expect("`npm exec sass` failed");
2222

2323
if !status.success() {
24-
println!("SCSS compilation failed");
24+
println!("SCSS compilation failed to run");
2525
}
2626

2727
// Bundle CSS to bust cache.
@@ -38,7 +38,7 @@ fn main() {
3838
.arg("static/css/style.css")
3939
.arg(format!("static/css/style.{}.css", css_version))
4040
.status()
41-
.unwrap()
41+
.expect("cp static/css/style.css failed to run")
4242
.success()
4343
{
4444
println!("Bundling CSS failed");
@@ -54,7 +54,7 @@ fn main() {
5454
// Build JS to bust cache
5555
for file in glob::glob("static/js/*.js").expect("failed to glob") {
5656
let file = file.expect("failed to glob path");
57-
let contents = read_to_string(file).unwrap().as_bytes().to_vec();
57+
let contents = read_to_string(file).expect("failed to read js file").as_bytes().to_vec();
5858

5959
js_version.push(format!("{:x}", md5::compute(contents)));
6060
}
@@ -73,7 +73,7 @@ fn main() {
7373
.arg(&filename)
7474
.arg(format!("{}.{}.js", name, js_version))
7575
.status()
76-
.unwrap()
76+
.expect("failed to cp js file")
7777
.success()
7878
{
7979
println!("Bundling JS failed");

‎pgml-dashboard/templates/layout/footer.html

Copy file name to clipboardExpand all lines: pgml-dashboard/templates/layout/footer.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ <h5 class="h5 d-flex align-items-center gap-2 mb-5">
1515
<a class="nav-link text-white" href="https://discord.gg/DmyJP3qJ7U">Discord</a>
1616
</nav>
1717
</div>
18-
<% if !crate::utils::config::standalone_dashboard() {; %>
18+
<% if !crate::utils::config::standalone_dashboard() { %>
1919
<div class="col-12 col-lg-6 col-xl-4">
2020
<nav class="nav d-flex flex-column">
2121
<a class="nav-link text-white" href="<%= crate::utils::config::signup_url() %>">Create an Account</a>

‎pgml-dashboard/templates/layout/nav/top.html

Copy file name to clipboardExpand all lines: pgml-dashboard/templates/layout/nav/top.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@
5151
</div>
5252
</div>
5353
</div>
54-
<% include!("../../components/search_modal.html");%>
54+
<% include!("../../components/search_modal.html"); %>
5555
</nav>
5656

‎pgml-extension/.dockerignore

Copy file name to clipboardExpand all lines: pgml-extension/.dockerignore
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Cargo
22
Cargo.lock
3-
/target
3+
target/
4+
venv/
45
**/*.rs.bk
56

67
# PyCharm

‎pgml-extension/Dockerfile

Copy file name to clipboard
+26-10Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,48 @@
11
FROM nvidia/cuda:12.1.1-devel-ubuntu22.04
22
LABEL maintainer="team@postgresml.com"
33

4-
RUN apt-get update
54
ARG DEBIAN_FRONTEND=noninteractive
5+
ARG PGML_VERSION=2.5.2
66
ENV TZ=Etc/UTC
77
ENV PATH="/usr/local/cuda/bin:${PATH}"
88

9-
RUN apt-get update && apt-get install -y curl lsb-release python3 python3-pip tzdata sudo cmake libpq-dev libclang-dev wget git
10-
9+
# Dependencies
1110
RUN apt-get update && \
12-
apt-get install -y wget gnupg lsb-release && \
13-
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
11+
apt-get install -y \
12+
curl \
13+
lsb-release \
14+
python3 \
15+
python3-pip \
16+
tzdata \
17+
sudo \
18+
cmake \
19+
libpq-dev \
20+
libclang-dev \
21+
wget \
22+
git \
23+
gnupg \
24+
lsb-release
25+
26+
# PostgreSQL
27+
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
1428
echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
1529
apt-get update && \
1630
apt-get install -y postgresql-14 && \
1731
apt-get install -y postgresql-plpython3-14
1832

19-
33+
# PostgresML
2034
RUN echo "deb [trusted=yes] https://apt.postgresml.org $(lsb_release -cs) main" >> /etc/apt/sources.list
2135
RUN cat /etc/apt/sources.list
22-
RUN apt-get update && apt-get install -y postgresql-pgml-14
23-
# Cache this, quicker
24-
COPY --chown=postgres:postgres . /app
36+
RUN apt-get update && apt-get install -y postgresql-pgml-14=${PGML_VERSION}
37+
38+
COPY --chown=postgres:postgres requirements.txt /app/requirements.txt
2539
WORKDIR /app
2640
RUN pip3 install -r requirements.txt
41+
42+
COPY --chown=postgres:postgres requirements-xformers.txt /app/requirements-xformers.txt
2743
RUN pip3 install -r requirements-xformers.txt --no-dependencies
2844

45+
COPY --chown=postgres:postgres . /app
2946
# Listen on 0.0.0.0 and allow 'root' to connect without a password.
3047
# Please modify for production deployments accordingly.
3148
RUN cp /app/docker/postgresql.conf /etc/postgresql/14/main/postgresql.conf
@@ -36,5 +53,4 @@ RUN cd /tmp && \
3653
make && \
3754
make install
3855

39-
WORKDIR /app
4056
ENTRYPOINT ["/bin/bash", "/app/docker/entrypoint.sh"]

‎pgml-extension/docker/entrypoint.sh

Copy file name to clipboardExpand all lines: pgml-extension/docker/entrypoint.sh
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ done
2525
fi
2626

2727
echo "Installing pgvector.. "
28-
psql -U postgres -h 127.0.0.1 pgml_development -c 'CREATE EXTENSION vector'
28+
psql -U postgres -h 127.0.0.1 pgml_development -c 'CREATE EXTENSION IF NOT EXISTS vector'
2929

3030
echo "Ready!"
3131
if [[ ! -z $@ ]]; then

‎pgml-extension/examples/binary_classification.sql

Copy file name to clipboardExpand all lines: pgml-extension/examples/binary_classification.sql
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- Exit on error (psql)
2-
\set ON_ERROR_STOP true
2+
-- \set ON_ERROR_STOP true
33
\timing on
44

55
SELECT pgml.load_dataset('breast_cancer');

‎pgml-extension/examples/finetune.sql

Copy file name to clipboardExpand all lines: pgml-extension/examples/finetune.sql
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- Exit on error (psql)
2-
\set ON_ERROR_STOP true
2+
-- \set ON_ERROR_STOP true
33
\timing on
44

55

‎pgml-extension/examples/image_classification.sql

Copy file name to clipboardExpand all lines: pgml-extension/examples/image_classification.sql
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
-- solutions can solve problems these days.
1111

1212
-- Exit on error (psql)
13-
\set ON_ERROR_STOP true
13+
-- \set ON_ERROR_STOP true
1414
\timing on
1515

1616
SELECT pgml.load_dataset('digits');

‎pgml-extension/examples/joint_regression.sql

Copy file name to clipboardExpand all lines: pgml-extension/examples/joint_regression.sql
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
-- for regression, along with multiple jointly optimized targets.
44

55
-- Exit on error (psql)
6-
\set ON_ERROR_STOP true
6+
-- \set ON_ERROR_STOP true
77
\timing on
88

99
SELECT pgml.load_dataset('linnerud');

‎pgml-extension/examples/multi_classification.sql

Copy file name to clipboardExpand all lines: pgml-extension/examples/multi_classification.sql
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- Exit on error (psql)
2-
\set ON_ERROR_STOP true
2+
-- \set ON_ERROR_STOP true
33
\timing on
44

55
SELECT pgml.load_dataset('iris');

‎pgml-extension/examples/regression.sql

Copy file name to clipboardExpand all lines: pgml-extension/examples/regression.sql
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
-- for regression.
1111

1212
-- Exit on error (psql)
13-
\set ON_ERROR_STOP true
13+
-- \set ON_ERROR_STOP true
1414
\timing on
1515

1616
SELECT pgml.load_dataset('diabetes');

‎pgml-extension/examples/transformers.sql

Copy file name to clipboardExpand all lines: pgml-extension/examples/transformers.sql
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- Exit on error (psql)
2-
\set ON_ERROR_STOP true
2+
-- \set ON_ERROR_STOP true
33
\timing on
44

55
SELECT pgml.embed('intfloat/e5-small', 'hi mom');

‎pgml-extension/examples/vectors.sql

Copy file name to clipboardExpand all lines: pgml-extension/examples/vectors.sql
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- Exit on error (psql)
2-
\set ON_ERROR_STOP true
2+
-- \set ON_ERROR_STOP true
33
\timing on
44

55
-- Elementwise arithmetic w/ constants

‎pgml-extension/sql/setup_examples.sql

Copy file name to clipboardExpand all lines: pgml-extension/sql/setup_examples.sql
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
--- $ cargo pgrx run --release
77
--- $ psql -P pager-off -h localhost -p 28813 -d pgml -f sql/setup_examples.sql
88
---
9-
\set ON_ERROR_STOP true
9+
-- \set ON_ERROR_STOP true
1010
\timing on
1111

1212
-- The intention is to only allow setup_examples.sql to run on a database that
1313
-- has not had example data installed before, e.g. docker run. This should
1414
-- error and stop the process if the extension is already present.
15-
CREATE EXTENSION pgml;
15+
CREATE EXTENSION IF NOT EXISTS pgml;
1616

1717
SELECT pgml.load_dataset('breast_cancer');
1818
SELECT pgml.load_dataset('diabetes');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.