Skip to content

Conversation

@vlad-activeloop
Copy link
Contributor

🚀 🚀 Pull Request

Impact

  • Bug fix (non-breaking change which fixes expected existing functionality)
  • Enhancement/New feature (adds functionality without impacting existing logic)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Things to be aware of

Things to worry about

Additional Context

Copilot AI review requested due to automatic review settings January 16, 2026 13:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR optimizes the Postgres Docker image build process by improving package installation practices and pre-configuring the pg_deeplake extension. The changes reduce image size and eliminate the need for runtime extension initialization.

Changes:

  • Replaced generic BASE_IMAGE with specific postgres:18 base image
  • Added --no-install-recommends and --no-cache-dir flags to reduce image size
  • Pre-installed pg_deeplake extension in template1 database during build

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 30 to 34
RUN apt-get install --no-install-recommends -y /tmp/debs/pg-deeplake-${VERSION}_${TARGETARCH}.deb && rm -rf /tmp/debs/ \
su postgres -c "psql --username postgres <<'EOF' \
\\c template1; \
CREATE EXTENSION IF NOT EXISTS pg_deeplake; \
EOF";
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The multi-line RUN command uses backslash continuation but combines apt-get install with su/psql execution. If the extension creation fails, the apt-get install will still succeed, potentially masking errors. Consider splitting into separate RUN commands or adding error handling between the install and extension creation steps.

Suggested change
RUN apt-get install --no-install-recommends -y /tmp/debs/pg-deeplake-${VERSION}_${TARGETARCH}.deb && rm -rf /tmp/debs/ \
su postgres -c "psql --username postgres <<'EOF' \
\\c template1; \
CREATE EXTENSION IF NOT EXISTS pg_deeplake; \
EOF";
RUN apt-get install --no-install-recommends -y /tmp/debs/pg-deeplake-${VERSION}_${TARGETARCH}.deb && rm -rf /tmp/debs/
RUN su postgres -c "psql --username postgres -d template1 -c 'CREATE EXTENSION IF NOT EXISTS pg_deeplake;'"

Copilot uses AI. Check for mistakes.
Comment on lines 30 to 31
RUN apt-get install --no-install-recommends -y /tmp/debs/pg-deeplake-${VERSION}_${TARGETARCH}.deb && rm -rf /tmp/debs/ \
su postgres -c "psql --username postgres <<'EOF' \
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command uses backslash for line continuation immediately followed by su postgres -c without the && operator. This creates unclear execution flow. Add && before the su command to ensure the extension creation only runs if the package installation succeeds.

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link

@vlad-activeloop vlad-activeloop merged commit 128b2d2 into main Jan 16, 2026
4 checks passed
@vlad-activeloop vlad-activeloop deleted the sre__change_postgres_build branch January 16, 2026 14:01
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Your Name seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@vlad-activeloop vlad-activeloop restored the sre__change_postgres_build branch January 16, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants