- Notifications
You must be signed in to change notification settings - Fork352
Development dockerfile#685
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
Show all changes
3 commits Select commitHold shift + click to select a range
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
101 changes: 101 additions & 0 deletionsDockerfile.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 |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| FROM ubuntu:jammy | ||
| LABEL maintainer="team@postgresml.com" | ||
| ARG PG_MAJOR_VER | ||
| ENV PG_MAJOR_VER=${PG_MAJOR_VER} | ||
| 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-$PG_MAJOR_VER \ | ||
| postgresql-$PG_MAJOR_VER \ | ||
| postgresql-server-dev-$PG_MAJOR_VER \ | ||
| git | ||
| 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 echo 'postgres ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers | ||
| COPY ./pgml-extension/requirements.txt /app/requirements.txt | ||
| RUN pip3 install -r /app/requirements.txt | ||
| # Running pgrx and tests require a non-root user | ||
| WORKDIR /app | ||
| RUN chmod a+rwx `$(which pg_config) --pkglibdir` \ | ||
| `$(which pg_config) --sharedir`/extension \ | ||
| /var/run/postgresql/ | ||
| RUN useradd postgresml -m -s /bin/bash -G sudo | ||
| RUN echo 'postgresml ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers | ||
| USER postgresml | ||
| # Install cargo and Rust | ||
| RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
| ENV PATH="/home/postgresml/.cargo/bin:${PATH}" | ||
| # Install pgrx | ||
| RUN cargo install cargo-pgrx --version "0.8.2" --locked | ||
| COPY --chown=postgresml:postgresml ./ /app | ||
| RUN sudo chown -R postgresml:postgresml /app | ||
| RUN git submodule update --init --recursive | ||
| RUN sudo cp /app/pgml-extension/docker/postgresql.conf /etc/postgresql/$PG_MAJOR_VER/main/postgresql.conf | ||
| RUN sudo cp /app/pgml-extension/docker/pg_hba.conf /etc/postgresql/$PG_MAJOR_VER/main/pg_hba.conf | ||
| # RUN sudo chown -R rust:rust /usr/share/postgresql/$PG_MAJOR_VER/extension | ||
| RUN sudo chown -R postgresml:postgresml /usr/share/postgresql/$PG_MAJOR_VER/ | ||
| RUN sudo chown -R postgresml:postgresml /usr/share/postgresql/$PG_MAJOR_VER/extension | ||
| # commenting this three make things work | ||
| # USER rust | ||
| RUN cd /app/pgml-extension && cargo pgrx init --pg$PG_MAJOR_VER=$(which pg_config) | ||
| RUN cd /app/pgml-extension && cargo pgrx install --pg-config $(which pg_config) | ||
| EXPOSE 5432 | ||
| USER postgres | ||
| CMD ["/usr/lib/postgresql/14/bin/postgres", "-c", "config_file=/etc/postgresql/14/main/postgresql.conf"] | ||
15 changes: 15 additions & 0 deletionsdocker-compose.local.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,15 @@ | ||
| version: "3" | ||
| # Run by doing docker compose -f docker-compose.local.yml build --build-arg PG_MAJOR_VER=14 | ||
| # docker compose -f docker-compose.local.yml up | ||
| services: | ||
| postgres: | ||
| healthcheck: | ||
| test: [ "CMD-SHELL", "pg_isready" ] | ||
| interval: 1s | ||
| timeout: 5s | ||
| retries: 100 | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile.local | ||
| ports: | ||
| - "5433:5432" |
49 changes: 0 additions & 49 deletionspgml-extension/Dockerfile.local
This file was deleted.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
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.