public inbox for [email protected]  
help / color / mirror / Atom feed
From: Bear Giles <[email protected]>
To: [email protected]
Subject: Announcing docker hub repos with auto-updating pgxnclient and pl/java pre-installed
Date: Thu, 8 Jun 2023 14:39:34 -0600
Message-ID: <CALBNtw4U927J7++-ZRzKvO2QZrFJfsmnp9GS3oCb_qyxkvrUaw@mail.gmail.com> (raw)

I won't finish with the CI/CD and 'readme' until tomorrow but I wanted to
announce my new docker hub repos with auto-updating pgxnclient and pl/java
preinstalled. I felt that giving you a bit of advance notice would make it
more likely I'll get feedback before I move onto a new task and have
totally forgotten why I was doing things that way. :-)


General Motivation

The motivation is the constant requests for help setting up a server ready
for use with pgxnclient, or pl/java in particular. Both PGXN and PL/Java
have a list of available docker images but those images are often very
out-of-date if they still exist at all.

Creating docker hub repos that are kept up-to-date via CI/CD (github
actions) won't solve everyone's problems... but it will solve a lot of
problems. This is especially true when I add an example of how to use these
repos, Docker, and TestContainers in order to greatly simplify testing the
*applications* that use these extensions.

(The docker images have pg-tap installed so you can easily run tests within
the docker container.)

The images are built using the official postgres releases on docker hub and
are intended as suitable drop-in replacements suitable for testing before
your code reaches your production database. There's some related work at
github.com/pgxn/pgxnclient but it looks like it's oriented around the
development of pgxn clients.


Personal Motivation

I want do resume working on some side-projects involving pl/java. I found
an easier version of these repos very useful since it made it trivial to
create fresh instances as I developed my code.

An application that's *using* an extension can use the appropriate docker
image. I'll be providing a TestContainer example that shows how the latest
version of the required jar(s). That's java-specific but easily extended to
other environments.

Someone who's *developing* an extension can use the *pgxnclient* image and
then use a similar approach to load both their extension and anything it
requires.


My github repo and CI/CD

This work is currently in the 'github-actions' branch of
beargiles/postgresql-pljava-docker.

The auto-update is handled via .github/workflows/main.yml. It will
periodically wake up (currently every Monday), get a list of tags for the
official postgres image, get a list of tags on my repos, and compare them.
Note: it only considers the base versions, e.g., '15.3', and only for major
releases of 12+. If there are any new tags the github action will build,
tag, and push the appropriate versions.

There's always an update of the major version, e.g., postgres-pljava:14.12
-> postgres-pljava:14.

There is also an update of 'latest' if appropriate.

Note: this *could* cause incorrect aliases if more than one minor version
is being added. I can't use a simple sort since the 'tags' are strings and
15.9 will appear to be more recent than 15.10. At this point I could
convert the tags to numbers and reliably sort those but I think it will be
enough to keep a short update cycle.


Testing

I'm using ansible and have put in the boilerplate for running molecule
tests on the newly built docker images. I haven't yet - but I'll probably
add a basic smoke test soon. Nothing fancy - just verifying that the docker
image can be successfully loaded.


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Announcing docker hub repos with auto-updating pgxnclient and pl/java pre-installed
  In-Reply-To: <CALBNtw4U927J7++-ZRzKvO2QZrFJfsmnp9GS3oCb_qyxkvrUaw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox