- Notifications
You must be signed in to change notification settings - Fork352
git add cuda support to docker that works with wsl#681
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
46 changes: 46 additions & 0 deletionsdocker-compose.cuda.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| version: "3" | ||
| services: | ||
| postgres: | ||
| deploy: | ||
| resources: | ||
| reservations: | ||
| devices: | ||
| - driver: nvidia | ||
| count: 1 | ||
| capabilities: [ gpu ] | ||
| healthcheck: | ||
| test: [ "CMD-SHELL", "pg_isready" ] | ||
| interval: 1s | ||
| timeout: 5s | ||
| retries: 100 | ||
| build: | ||
| context: ./pgml-extension/ | ||
| dockerfile: Dockerfile | ||
| ports: | ||
| - "5433:5432" | ||
| command: | ||
| - sleep | ||
| - infinity | ||
| dashboard: | ||
| depends_on: | ||
| postgres: | ||
| condition: service_healthy | ||
| build: | ||
| context: ./pgml-dashboard/ | ||
| dockerfile: Dockerfile | ||
| ports: | ||
| - "8000:8000" | ||
| environment: | ||
| ROCKET_ADDRESS: 0.0.0.0 | ||
| DATABASE_URL: postgres://postgres:postgres@postgres:5432/pgml_development | ||
| command: bash -c "sqlx migrate run && cargo run" | ||
| docs: | ||
| build: | ||
| context: ./pgml-docs/ | ||
| dockerfile: Dockerfile | ||
| ports: | ||
| - "8001:8001" | ||
| command: | ||
| - mkdocs | ||
| - serve | ||
| - -a 0.0.0.0:8001 |
2 changes: 1 addition & 1 deletiondocker-compose.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
75 changes: 33 additions & 42 deletionspgml-extension/Dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,47 +1,38 @@ | ||
| FROM nvidia/cuda:12.1.1-devel-ubuntu22.04 | ||
| LABEL maintainer="team@postgresml.com" | ||
| RUN apt-get update | ||
| ARG DEBIAN_FRONTEND=noninteractive | ||
| 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 | ||
| 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 - && \ | ||
| 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 | ||
| 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 | ||
| WORKDIR /app | ||
| RUN pip3 install -r requirements.txt | ||
| # 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 | ||
| RUN cp /app/docker/pg_hba.conf /etc/postgresql/14/main/pg_hba.conf | ||
| RUN cd /tmp && \ | ||
| git clone --branch v0.4.1 https://github.com/pgvector/pgvector.git && \ | ||
| cd pgvector && \ | ||
| make && \ | ||
| make install | ||
| WORKDIR /app | ||
| ENTRYPOINT ["/bin/bash", "/app/docker/entrypoint.sh"] |
61 changes: 40 additions & 21 deletionspgml-extension/Dockerfile.local
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1,49 @@ | ||
| FROM ubuntu:jammy | ||
| MAINTAINER team@postgresml.com | ||
| RUN apt-get update | ||
| ARG DEBIAN_FRONTEND=noninteractive | ||
| ENV TZ=Etc/UTC | ||
| RUN apt-get install -y software-properties-common | ||
| RUN add-apt-repository ppa:apt-fast/stable --yes | ||
| RUN apt update && apt-get install -y apt-fast | ||
| RUN apt-get update && apt-fast install -y \ | ||
| libopenblas-dev \ | ||
| libssl-dev \ | ||
| bison \ | ||
| flex \ | ||
| pkg-config \ | ||
| cmake \ | ||
| libreadline-dev \ | ||
| libz-dev \ | ||
| curl \ | ||
| lsb-release \ | ||
| tzdata \ | ||
| sudo \ | ||
| cmake \ | ||
| libpq-dev \ | ||
| libclang-dev \ | ||
| wget \ | ||
| postgresql-plpython3-14 \ | ||
| postgresql-14 \ | ||
| postgresql-server-dev-14 | ||
| RUN add-apt-repository ppa:deadsnakes/ppa --yes | ||
| RUN apt update && apt-fast install -y \ | ||
| python3.10 \ | ||
| python3-pip \ | ||
| libpython3.10-dev \ | ||
| python3.10-dev | ||
| RUN useradd postgresml -m -s /bin/bash -G sudo | ||
| RUN echo 'postgresml ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers | ||
| USER postgresml | ||
| RUN curl https://sh.rustup.rs -sSf | sh -s -- -y | ||
| RUN $HOME/.cargo/bin/cargo install cargo-pgrx --version "0.8.2" --locked | ||
| RUN $HOME/.cargo/bin/cargo pgrx init | ||
| RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg >/dev/null | ||
| RUN sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' | ||
| RUN sudo apt update | ||
| RUN sudo apt-get install -y postgresql-15 postgresql-13 postgresql-12 postgresql-11 | ||
| RUN sudo apt install -y postgresql-server-dev-15 postgresql-server-dev-15 postgresql-server-dev-12 postgresql-server-dev-11 | ||
| WORKDIR /app | ||
| RUN pip3 install -r requirements.txt | ||
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.