CrunchyData / postgres-operator

Production PostgreSQL for Kubernetes, from high availability Postgres clusters to full-scale database-as-a-service.
https://access.crunchydata.com/documentation/postgres-operator/v5/
Apache License 2.0
3.87k stars 584 forks source link

PLV8 #3460

Open pietrobaricco opened 1 year ago

pietrobaricco commented 1 year ago

I have been using PGO v5 for a while now, and it's great. Unfortunately, it doesn't come with the PLV8 extension, which I need. Thus, I resorted to a hacky way of enabling it:

stage 1 an intermediate container is created extending the one I need: crunchy-postgres-gis:centos8-* inside this intermediate container, plv8 is built. The generated libraries are zipped at the end of the process. The same goes for other stuff I need, such as mysql_fdw

stage2 a new final container is built extending the same base crunchy-postgres-gis:centos8-* the zipped libraries are copied from the intermediate container, and extracted to their location

The result is good, the extensions work as intended, no issues whatsoever. Bloat in the final images is minimal as the heavy chromium compilation happens in a temporary container which is discarded.

I wrote this hoping that any of that may be useful to you to reconsider adding plv8 and other useful extensions to the official containers, maybe as options.

benjaminjb commented 8 months ago

Thanks for reaching out about adding the plv8 extension. (Also, since this is a year later, are you still using this workaround to add the extension to the image?)

We do not have any immediate plans for adding the plv8 extension at this time and do not have an approved set of instructions for adding them at the moment. In the meantime, I have captured a story in our backlog for adding plv8 in a future release and/or update. And I'm going to leave this issue open so that others can chime in with their use-cases.

Feel free to reach out at info@crunchydata.com if you would like to discuss your use case further.

pietrobaricco commented 7 months ago

Hello! Yes, I'm still using the very same workaround, but this is the situation:

plv8 3.0.0 is the last one that can be compiled in rocky8, as later releases depend on newer versions of V8 which require some stuff with in the c++ standard library which can't be installed on rhel8 and clones. I was fine with that, but even that required a couple of rpms from a guy who was maintaining them, in particular:

http://www.tarnyko.net/repo/libcxx-11.0.0-1.el8.x86_64.rpm && \ http://www.tarnyko.net/repo/libcxx-devel-11.0.0-1.el8.x86_64.rpm

With these two now missing, my builds fail.

I tried to use rocky9 as the base image, but running rhel9 containers on a rhel7 host is not supported, so the build process fails immediately as not even curl/dnf work under such circumnstances.

So now I'm kind of stuck, I see no clean way of solving this.

EDIT: I managed to build everything using rocky9 as base, by using rocky 8 as build platform. I can get a recent plv8 with postgres 14. I'd like to test 15 and 16, but can't build the containers because the crunchypg15 and crunchypg16 rpm repos are paywalled.

It works and for now I can live with it, but it's suboptimal and cumbersome for sure