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

GEOS-11684: base image does not include GDAL #135

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stacy-rendall
Copy link

@stacy-rendall stacy-rendall commented Jan 20, 2025

Further notes/discussion: https://osgeo-org.atlassian.net/browse/GEOS-11684

Since the base image was changed from Ubuntu to Tomcat it no longer includes GDAL, which is required for GDAL/OGR extensions.

The rationale behind this PR is to enable installing GDAL without affecting (i.e. increasing the size of) the initial image.

This PR:

  • adds/documents an INSTALL_GDAL environment variable
  • prior to installing extensions in startup.sh:
    • check if INSTALL_GDAL=true
    • check if gdal-bin is already installed
    • modify permissions on /tmp to enable apt-get update (initially the directory is not writable, which will cause update to fail)
    • update and install gdal-bin, including recommended packages (notably proj)
    • restore /tmp permissions

Happy to discuss if an alternative approach might be more appropriate.

@stacy-rendall stacy-rendall changed the title Proposed fix for GEOS-11684 - base image does not include GDAL GEOS-11684: base image does not include GDAL Jan 20, 2025
@@ -100,6 +100,7 @@ The ``startup.sh`` script allows some customization on startup:

* ``INSTALL_EXTENSIONS`` to ``true`` to download and install extensions
* ``STABLE_EXTENSIONS`` list of extensions to download and install
* ``INSTALL_GDAL`` to ``true`` to download and install GDAL (required for GDAL/OGR extensions)
Copy link
Member

Choose a reason for hiding this comment

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

Would it enable usage of the GDAL extensions though? AFAIK the gdal-java JNI binding library is needed to support that case, which is no longer packaged in Debian based distributions, see this OSGeo-Live discussion for links and workarounds.

Copy link
Member

@buehner buehner Jan 20, 2025

Choose a reason for hiding this comment

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

I'd also like to know whether apt-get install -y gdal-bin already solves your problem and makes your extension (OGR based WFS Output Format) fully work. Can you confirm this @stacy-rendall ?

I never really had such a use case myself, but I know from others - like @aaime also mentioned - that the GDAL Java bindings are required for some GDAL based extensions/scenarios, which requires some more work.

This could also blow up a resulting image. It would be great to find a solution with full GDAL support. Maybe it also makes sense to provide two GS Docker Image flavors then:

  • the basic one (like now)
  • an GS Docker Image with full GDAL support (incl. bindings) (-> bigger footprint)

I will try to find some time soon to dive deeper into this GDAL world...

Copy link
Author

Choose a reason for hiding this comment

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

Just tested it all again with a clean image: apt-get install -y gdal-bin alone is enough for the ogr-wfs extension to basically work - it only seems to require that "ogr2ogr is available in the path".

To be clear: it is working equivalently for my use case as what it was with the image <= 2.25.3, i.e. prior to the base image changing.

Not sure if I can claim that it is "fully working" - I can't seem to get the extension to transform SRS on any version I have tested (2.25.3 or 2.25.5) - but I'm not sure if that is due to me or an issue with the extension.

@buehner
Copy link
Member

buehner commented Jan 23, 2025

I found some time for the GDAL Java Bindings. See here: #138

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.

3 participants