From: | Bear Giles <bgiles(at)coyotesong(dot)com> |
---|---|
To: | pljava-dev(at)lists(dot)postgresql(dot)org |
Subject: | Announcing docker hub repos with auto-updating pgxnclient and pl/java pre-installed |
Date: | 2023-06-08 20:39:34 |
Message-ID: | CALBNtw4U927J7++-ZRzKvO2QZrFJfsmnp9GS3oCb_qyxkvrUaw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pljava-dev |
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.
From | Date | Subject | |
---|---|---|---|
Next Message | chap | 2023-06-13 23:37:35 | PL/Java 1.6.5 released |
Previous Message | OLSEN Frank | 2022-09-22 07:18:23 | Sequences not updated after restore |