Skip to content

Commit eb64857

Browse files
authored
Docker fix of the day (#733)
1 parent 1a95786 commit eb64857

18 files changed

+51
-30
lines changed

docker-compose.yml

Lines 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

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

pgml-dashboard/Dockerfile

Lines 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

Lines 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

Lines 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

Lines 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

Lines 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

Lines 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

Lines 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

Lines 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');

0 commit comments

Comments
 (0)
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