DemoVIPS
This project encapsulates VIPS into a single Docker container, a VIPS at a snapshot in time. For demonstration purposes. It stays at the same date indefinately, so that you have a consistent view of VIPS
Subsystems included:
- VIPSWeb
- VIPSLogic with database
- VIPSCore with a selection of VIPS Models
External services dependencies: The container expects these "static" risk map WMSs to be available
- Carrot rust fly risk map: https://gridweb.vips.nibio.no/cgi-bin/PSILARTEMP_DEMO?service=WMS&version=1.3.0&request=GetCapabilities&language=nb
- Naerstad's potato late blight model risk map: https://gridweb.vips.nibio.no/cgi-bin/NAERSTADMO_DEMO?service=WMS&version=1.3.0&request=GetCapabilities&language=nb
Configuring
DemoVIPS date
The date is set when running the container (see below).
Building
You need Docker installed to build DemoVIPS.
You must dump the VIPSLogic database from your preferred source like this
pg_dumpall | gzip > vipslogic.sql.gz
...and place it in the project folder
The building of the image takes quite a lot of time, since there's a lot of code that needs to be build with Maven.
$ sudo docker build --tag demovips:1.0 .
Running
Run the container for the first time like this
$ sudo docker run --publish 18080:80 --detach --name demovips -e SYSTEM_TIME_EXACT_DATE=2023-07-01 demovips:1.0
...where SYSTEM_TIME_EXACT_DATE is the date that you want DemoVIPS to be stuck in.
Skip the --detach if you want to see the output when the container is booting. On the first run of the container, the database is imported and cache tables need to be initalized, which can take 5-10 minutes. Please be patient. When the container is ready, DemoVIPS is visible on http://localhost:18080/
Subsequent startups of the container can be done like this:
$ sudo docker start demovips
Upgrading to newer version of VIPS
When upgrading to a newer version of VIPS and/or Ubuntu and/or Wildfly; Here are some key configurations to change. Also, remember to dump the latest version of the VIPSLogic database (see above)
Dockerfile
FROM ubuntu:noble
ENV JDK_VERSION=17
# VIPSCore 3.0.1 See https://gitlab.nibio.no/groups/VIPS/-/packages
# To find the id, check the link to the war file uner "Assets" (bottom of page of selected package)
ENV VIPSCORE_PACKAGE_ID=3260
ENV VIPSLOGIC_VERSION=2025.1
ENV WILDFLY_VERSION=34.0.1.Final
# Check the contents of SHA-1 next to the tgz download file on wildfly.org/downloads
ENV WILDFLY_SHA1=eca3a94bb8a91538f7f2642f9d04d89a25f53846
# [...]
# Database may have been upgraded in latest Ubuntu
RUN sed -i -e 's/scram-sha-256/md5/g' /etc/postgresql/16/main/pg_hba.conf
# VIPSWeb
# Python version may have been upgraded in latest version
RUN apt-get install --assume-yes apache2 libapache2-mod-wsgi-py3 memcached python3-pip python3.12-venv
call_me_from_cmd
# Add the date to VIPSWeb
echo "SYSTEM_TIME_EXACT = '${SYSTEM_TIME_EXACT_DATE=2024-07-01}'" >> /opt/jboss/VIPSWeb/VIPSWeb/local_settings.py
WildFly: modules/ and standalone.xml
If you are upgrading WildFly: Check what's in the modules/ folder of the new version, and copy that into here - delete/overwrite all the old stuff.
Also, your old standalone.xml is likely not compatible with the new WildFly, so get a fresh one and add system-properties and database connection info.
Troubleshooting
If you need to inspect the Docker instance, you can either do it from the host
$ sudo docker logs demovips
...or you can log in on the container and check all aspects. The container is a Ubuntu instance, so you can install and configure as you like, and even clone git repos and build parts of the application there directly.
$ sudo docker exec -it demovips /bin/bash