Skip to content

feat: add pgrouting container image - #299

Open
ofalk wants to merge 5 commits into
cloudnative-pg:mainfrom
ofalk:feat/add-pgrouting
Open

feat: add pgrouting container image#299
ofalk wants to merge 5 commits into
cloudnative-pg:mainfrom
ofalk:feat/add-pgrouting

Conversation

@ofalk

@ofalk ofalk commented Jul 28, 2026

Copy link
Copy Markdown

Description

Add pgRouting extension container image for CloudNativePG targeting PostgreSQL 18 across Debian bookworm and trixie distributions, as discussed in cloudnative-pg/postgis-containers#134

Type of change

  • Update to an existing extension (version bump, fix)
  • Shared build infrastructure / tooling change
  • Documentation only
  • Other (please describe above)

Contributor checklist

  • My commits are signed off for DCO
    compliance (git commit -s).
  • This PR targets the main branch of the upstream repository.
  • task checks:all passes locally.
  • For changes affecting one or more extensions, the relevant build and E2E
    tests pass (e.g. task bake TARGET=<ext>, task e2e:test:full TARGET=<ext>).
  • Any // renovate: comments touched in metadata.hcl / README.md remain
    intact (suite=, depName=, extractVersion=).
  • Documentation (README.md, BUILD.md, ...) updated where relevant.

Maintainer review checklist

  • CI is green for all affected targets / shared changes.
  • DCO check passes.
  • Change reviewed for correctness and scope; no unintended targets rebuilt.
  • // renovate: annotations preserved so automated version tracking keeps
    working.
  • If shared infrastructure changed, the _shared filter in
    .github/workflows/bake.yml was updated when all extensions must rebuild.
  • PR targets main and is ready to merge.

Closes #300

@ofalk

ofalk commented Jul 28, 2026

Copy link
Copy Markdown
Author

Please have a look @gbartolini !

Comment on lines +26 to +28
DB_URI=$(echo $DB_URI | sed "s|/\*|/|")
test "$(psql "$DB_URI" -tAc "SELECT EXISTS (SELECT FROM pg_catalog.pg_extension WHERE extname = 'postgis')" -q)" = "t"
test "$(psql "$DB_URI" -tAc "SELECT EXISTS (SELECT FROM pg_catalog.pg_extension WHERE extname = 'pgrouting' AND extversion = '${EXT_VERSION}')" -q)" = "t"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This test assertions are already covered by generic smoke tests:

test "$(psql "$DB_URI" -tAc "SELECT EXISTS (SELECT FROM pg_catalog.pg_extension WHERE extname = '${EXT_SQL_NAME}' AND extversion = '${EXT_VERSION}')" -q)" = "t"

I believe that adding custom/dedicated tests for an extension should exercise specific aspects of it, like calling a function the extension exposes and verifying the outcome, eg

psql "$DB_URI" -c "DROP TABLE IF EXISTS test_ivm CASCADE;"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Limited (time) bandwidth here... Do you want me to implement this or are you going to add it?

ofalk and others added 4 commits July 29, 2026 16:54
Add pgRouting extension container image for CloudNativePG targeting PostgreSQL 18 across Debian bookworm and trixie distributions.

Signed-off-by: Oliver Falk <oliver@linux-kernel.at>
pgRouting is self-contained: its shared library links only against
standard libraries already present in the core base image, so the
build stage does not need to resolve complex dependencies and stage
them into the resulting container. Drop the system-library gathering
and the $libdir SQL rewrite and keep a minimal.

Signed-off-by: Gabriele Fedi <gabriele.fedi@enterprisedb.com>
…fication

pgRouting links only against libraries already present in the base
image, so the container no longer ships a /system directory. Clear
ld_library_path and disable auto_update_os_libs accordingly, keeping
metadata.hcl consistent with the simplified Dockerfile.

Signed-off-by: Gabriele Fedi <gabriele.fedi@enterprisedb.com>
Add the CloudNativePG SPDX headers to the Dockerfile, metadata.hcl and
README so the extension follows the project's licensing convention, and
document the extension licensing in a "Licenses and Copyright" section.

Also drop the obsolete ld_library_path from the README Cluster example,
since the simplified image no longer ships a /system directory.

Signed-off-by: Gabriele Fedi <gabriele.fedi@enterprisedb.com>
@GabriFedi97
GabriFedi97 force-pushed the feat/add-pgrouting branch 2 times, most recently from ed7f8c7 to 2ef1cea Compare July 29, 2026 15:01
List the pgRouting image in the root README so users can discover it
alongside the other supported extensions.

Signed-off-by: Gabriele Fedi <gabriele.fedi@enterprisedb.com>
Comment thread README.md
| **[pgAudit](pgaudit)** | PostgreSQL audit extension | [github.com/pgaudit/pgaudit](https://github.com/pgaudit/pgaudit) | CNPG maintainers |
| **[pg_crash](pg-crash)** | **Disruptive** fault injection and chaos engineering extension | [github.com/cybertec-postgresql/pg_crash](https://github.com/cybertec-postgresql/pg_crash) | CNPG maintainers |
| **[pg_ivm](pg-ivm)** | Incremental View Maintenance for PostgreSQL | [github.com/sraoss/pg_ivm](https://github.com/sraoss/pg_ivm) | @shusaan |
| **[pgRouting](pgrouting)** | Geospatial routing and network analysis for PostgreSQL/PostGIS | [pgrouting.org](https://pgrouting.org/) | |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I left the Maintained By column empty on purpose as I'm not sure yet who is going to maintain this extension for this project. The CODEOWNER file needs to be updated accordingly as well.

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.

[New Extension]: pgrouting

2 participants