Skip to content

Lighweight PostgresML image for regression #1638

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

Open
gaspardc-met opened this issue Oct 14, 2024 · 1 comment
Open

Lighweight PostgresML image for regression #1638

gaspardc-met opened this issue Oct 14, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@gaspardc-met
Copy link

Hi,
Looking into PostgresML and really impressed by what I'm seeing with the examples.
My use cases are mainly to run regression with (many) scikit-learn models on tabular or TS data.
Do you see anything preventing me from building a custom docker image based on your Dockerfile but not based on Cuda ?

Starting from debian bookworm or ubuntu, installing pgml and pgml dashboard and forgoing cuda and pgvector for example

Thanks,

@gaspardc-met
Copy link
Author

gaspardc-met commented Oct 14, 2024

Seems like I can't really do that.
Tried with debian bookworm and ubuntu latest:

Error in Docker build:

 => ERROR [4/8] RUN apt update -y &&     apt install -y        4.9s 
------                                                              
 > [4/8] RUN apt update -y &&     apt install -y         git         postgresml-15         postgresml-dashboard:                        
0.471                                                               
0.471 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.                                                   
0.471 
0.564 Hit:1 http://archive.ubuntu.com/ubuntu noble InRelease
0.564 Get:2 http://apt.postgresql.org/pub/repos/apt noble-pgdg InRelease [129 kB]
0.564 Hit:3 http://archive.ubuntu.com/ubuntu noble-updates InRelease
0.564 Hit:4 http://security.ubuntu.com/ubuntu noble-security InRelease
0.577 Hit:5 http://archive.ubuntu.com/ubuntu noble-backports InRelease
1.030 Get:6 http://apt.postgresql.org/pub/repos/apt noble-pgdg/main amd64 Packages [495 kB]
1.055 Ign:7 https://apt.postgresml.org noble InRelease
1.235 Ign:8 https://apt.postgresml.org noble Release
1.412 Ign:9 https://apt.postgresml.org noble/main all Packages
1.584 Ign:10 https://apt.postgresml.org noble/main amd64 Packages
1.763 Ign:9 https://apt.postgresml.org noble/main all Packages
1.937 Ign:10 https://apt.postgresml.org noble/main amd64 Packages
2.110 Ign:9 https://apt.postgresml.org noble/main all Packages
2.282 Ign:10 https://apt.postgresml.org noble/main amd64 Packages
2.461 Ign:9 https://apt.postgresml.org noble/main all Packages
2.636 Ign:10 https://apt.postgresml.org noble/main amd64 Packages
2.818 Ign:9 https://apt.postgresml.org noble/main all Packages
2.989 Ign:10 https://apt.postgresml.org noble/main amd64 Packages
3.169 Ign:9 https://apt.postgresml.org noble/main all Packages
3.339 Ign:10 https://apt.postgresml.org noble/main amd64 Packages
3.513 Ign:9 https://apt.postgresml.org noble/main all Packages
3.685 Err:10 https://apt.postgresml.org noble/main amd64 Packages
3.685   403  Forbidden [IP: REDACTED IP]
3.694 Fetched 624 kB in 3s (195 kB/s)
3.694 Reading package lists...
4.801 E: Failed to fetch https://apt.postgresml.org/dists/noble/main/binary-amd64/Packages  403  Forbidden [IP: REDACTED IP]
4.801 E: Some index files failed to download. They have been ignored, or old ones used instead.

Dockerfile I tried:

# Use Debian Bookworm as the base image
# FROM debian:bookworm
FROM ubuntu:latest

# Set up environment variables
ENV TZ=UTC
ENV DEBIAN_FRONTEND=noninteractive

# Update and install necessary packages
RUN apt update && \
    apt install -y \
        lsb-release \
        curl \
        ca-certificates \
        gnupg \
        coreutils \
        sudo \
        openssl

# Add PostgresML and PostgreSQL repositories
RUN echo "deb [trusted=yes] https://apt.postgresml.org $(lsb_release -cs) main" > /etc/apt/sources.list.d/postgresml.list && \
    echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
    curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg >/dev/null

# Install PostgresML and other packages
RUN apt update -y && \
    apt install -y \
        git \
        postgresml-15 \
        postgresml-dashboard

# Copy necessary scripts and configuration files
COPY entrypoint.sh /app/entrypoint.sh
COPY dashboard.sh /app/dashboard.sh
COPY --chown=postgres:postgres local_dev.conf /etc/postgresql/15/main/conf.d/01-local_dev.conf
COPY --chown=postgres:postgres pg_hba.conf /etc/postgresql/15/main/pg_hba.conf

# Set the entrypoint
ENTRYPOINT ["bash", "/app/entrypoint.sh"]

However building the Dockerfile as found on main poses no issues locally to install pgml.
It's just really long and produces a huge image. So it's not only the IP, one really needs to base from cuda ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants