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

Upgrade of GDAL dependency to v3.6 #1466

Merged
merged 3 commits into from
May 12, 2023
Merged

Upgrade of GDAL dependency to v3.6 #1466

merged 3 commits into from
May 12, 2023

Conversation

dstenger
Copy link
Contributor

@dstenger dstenger commented Feb 3, 2023

GDAL dependency is updated to a more recent version v3.5.

Partly related to #1415.

@tfr42 tfr42 added enhancement enhancement or improvement dependencies Pull requests that update a dependency (library) labels Feb 8, 2023
@tfr42 tfr42 added this to the 3.5 milestone Feb 8, 2023
@dstenger
Copy link
Contributor Author

dstenger commented Feb 9, 2023

Added background information about Linux distributions and GDAL support of package managers: #1415

@tfr42 tfr42 changed the title Set GDAL dependency to v3.5 Upgrade GDAL dependency to v3.5 Mar 27, 2023
@tfr42 tfr42 changed the title Upgrade GDAL dependency to v3.5 Upgrade of GDAL dependency to v3.5 Mar 27, 2023
@dstenger
Copy link
Contributor Author

Reminder: GDAL just supports the last released feature version. 3.7 is the current release. The release cycle is around 6 months (at least, for the release of 3.8).

@tfr42
Copy link
Member

tfr42 commented May 11, 2023

@dstenger Please amend the PR with a short description how to use a newer version of gdal by applying the changes to the webapp, including replacement of the gdal.jar, JNI .so file and gdal binaries.

@dstenger
Copy link
Contributor Author

As Debian 12 will support GDAL 3.6.2, we decided during the deegree code sprint to update this pull request to v3.6.

@dstenger dstenger changed the title Upgrade of GDAL dependency to v3.5 Upgrade of GDAL dependency to v3.6 May 11, 2023
@dstenger
Copy link
Contributor Author

dstenger commented May 11, 2023

Test GDAL 3.6.2 with deegree

Check if GDAL Docker Image contains JNI interface:

stenger@elsbeere:~$ docker pull ghcr.io/osgeo/gdal:ubuntu-full-3.6.2
stenger@elsbeere:~$ docker run -it ghcr.io/osgeo/gdal:ubuntu-full-3.6.2 bash
root@f8b326455246:/# find / -iname libgdalalljni.so
/usr/share/java/libgdalalljni.so

JNI interface exists on Docker Image.

Created Dockerfile:

FROM ghcr.io/osgeo/gdal:ubuntu-full-3.6.2

ENV LD_LIBRARY_PATH="/usr/share/java"

RUN apt-get update && apt-get install -y openjdk-11-jdk wget
RUN wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.75/bin/apache-tomcat-9.0.75.tar.gz
RUN tar -xvf apache-tomcat-9.0.75.tar.gz
RUN mv apache-tomcat-9.0.75 /usr/local/tomcat

RUN wget "https://repo.deegree.org/service/rest/v1/search/assets/download?repository=public&maven.groupId=org.deegree&maven.artifactId=deegree-webservices&maven.extension=war&maven.baseVersion=3.5.0-SNAPSHOT&sort=version" -O "/usr/local/tomcat/webapps/deegree-webservices.war"

CMD ["/usr/local/tomcat/bin/catalina.sh", "run"]

Functional test:

stenger@elsbeere:~/deegree-gdal$ vim Dockerfile 
stenger@elsbeere:~/deegree-gdal$ docker build -t deegree-gdal .
stenger@elsbeere:~/deegree-gdal$ docker run -p 8080:8080 -v /path/to/workspace/directory:/root/.deegree deegree-gdal

A deegree Workspace with GDALTileStore could successfully be initialized. Also, the Capabilities could be retrieved and GetMap was tested via QGIS. A raster map was displayed in QGIS.

Switched the deegree webapp inside the Docker Container with a local build of deegree containing gdal jar v3.6.0.

stenger@elsbeere:~/git/deegree3/deegree-services/deegree-webservices/target$ docker cp deegree-webservices-3.5.0-SNAPSHOT.war container_name:/usr/local/tomcat/webapps/
stenger@elsbeere:~/git/deegree3/deegree-services/deegree-webservices/target$ docker exec -it container_name bash
root@6fac57f0012f:/# rm /usr/local/tomcat/webapps/deegree-webservices.war 
stenger@elsbeere:~/git/deegree3/deegree-services/deegree-webservices/target$ docker restart container_name 

The previously described test was repeated and returned the same result.

dstenger added a commit that referenced this pull request May 12, 2023
@dstenger
Copy link
Contributor Author

dstenger commented May 12, 2023

Documentation regarding used version of GDAL was enhanced: lat-lon@d2e6fb0

@dstenger
Copy link
Contributor Author

After further discussion, we decided to go with the latest available version 3.7.0 (see #1415 (comment)).

@dstenger
Copy link
Contributor Author

I executed tests with GDAL 3.7.0 (both cases, GDAL 3.0.0 jar and 3.7.0 jar) as described above. All functional tests were successful again.

However, during initialization of the workspace following error is logged:

...
Caught and handled this exception :
java.lang.IllegalAccessError: class it.geosolutions.imageio.stream.input.spi.FileImageInputStreamExtImplSpi (in unnamed module @0x4ad27667) cannot access class com.sun.imageio.spi.FileImageInputStreamSpi (in module java.desktop) because module java.desktop does not export com.sun.imageio.spi to unnamed module @0x4ad27667
	at it.geosolutions.imageio.stream.input.spi.FileImageInputStreamExtImplSpi.onRegistration(FileImageInputStreamExtImplSpi.java:116)
	at java.desktop/javax.imageio.spi.SubRegistry.registerServiceProvider(ServiceRegistry.java:761)
	at java.desktop/javax.imageio.spi.ServiceRegistry.registerServiceProvider(ServiceRegistry.java:305)
	at java.desktop/javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(IIORegistry.java:190)
	at java.desktop/javax.imageio.spi.IIORegistry.<init>(IIORegistry.java:113)
	at java.desktop/javax.imageio.spi.IIORegistry.getDefaultInstance(IIORegistry.java:134)
	at java.desktop/javax.imageio.ImageIO.<clinit>(ImageIO.java:66)
	at org.deegree.commons.config.DeegreeWorkspace.initAll(DeegreeWorkspace.java:340)
...

Thus, we decided to use GDAL 3.6.0 jar instead as this error does not occur here.

@dstenger
Copy link
Contributor Author

Replaced the 3.5 commits with 3.6 commits.

@stephanr stephanr merged commit 303ee15 into deegree:main May 12, 2023
@lgoltz lgoltz deleted the gdal35 branch August 17, 2023 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency (library) enhancement enhancement or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants