Skip to content
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

Build local debian image for specific pg versions using the base podman image #9

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

qount25
Copy link

@qount25 qount25 commented Apr 1, 2025

No description provided.

qount25 added 3 commits April 1, 2025 04:18
…o use when building dev pkg

In its official deb repository, postgresql packages may have the following
names:

    postgresql-17
    postgresql-16
    postgresql-15

etc. The problem here is that the latest minor version will be installed, wherease
users may want a different version.

Solution: packages have versions. Inside pbuilder_install_script.sh.erb we pick
up which version our user wants and match it agains what's available. If it
exists, we install that particular version:

    ...
    apt -y install postgresql-$PG_MAJOR_VERSION=$pkg_version
    ...

And then build the local podman image named after the chosen postgresql version.
If user selected postgresql version 17.14 on amd64, the image will be called:

    pgpm-debian-pg17.4-amd64

BONUS FIX: LD_CONFIG error messages are no longer present!
@qount25 qount25 force-pushed the pg-ver-on-demand-deb-image branch from 8950a5b to 2ae1b01 Compare April 2, 2025 09:00
…the first build

Solution: adding a documentation md file on how to solve it by followin
a few simple steps
@qount25 qount25 force-pushed the pg-ver-on-demand-deb-image branch 3 times, most recently from cd9796b to 61af2ae Compare April 5, 2025 04:34
…d argument"

The issue is present on podman hosts when they are themslves KVM guests, but
is not present if podman is used on host OS, which iteself is installed on
bare metal.

Solution: create `faketar` script and patch pbuilder to use it instead of tar.
The `faketar` script uses simple `cp` and `mv` commands, which not only help
us avoid the issue with `tar`, but also make our builds faster by skipping
compression & decompression of tgz.

Due to a rather esoteric nature of the problem `faketar` script is reasonable
workaround, which also saves on build time.
@qount25 qount25 force-pushed the pg-ver-on-demand-deb-image branch from 61af2ae to 8977f44 Compare April 6, 2025 14:15
@qount25 qount25 changed the title WIP: build local debian image for specific pg versions using the base podman image Build local debian image for specific pg versions using the base podman image Apr 6, 2025
@@ -21,11 +21,12 @@ MAINTAINER PGPM Debian Maintainer [email protected]
VOLUME /proc
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update
RUN apt install -y build-essential pbuilder fakeroot fakechroot
RUN apt install -y build-essential pbuilder fakeroot fakechroot vim ripgrep
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need vim and ripgrep in this image?

Copy link
Author

Choose a reason for hiding this comment

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

I actually decided that yes, because I ended up installing those two every single time I needed to debug an issue. I think those two tools are generally useful, so my suggestions is to keep them. Their relative size is negligible.

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.

2 participants