This repository allows to deploy a lifemap backend.
You must first install Ansible, for example with pipx:
pipx install --include-deps ansibleOr with uv:
uv tool install ansible-core
uv tool install ansibleThe backend is composed of several elements:
- A postgis server, deployed with docker. The database contains "build" tables (
points,linesandpolygonstables), as well as "production" tables (points_prod,lines_prodandpolygons_prodtables). When the tree is updated, build tables are emptied and recreated, and production tables are copied from build tables only if the update process is successful. - A solr server, deployed with docker. The server contains two cores,
taxofor tree data andaddifor additional data. - A modified mod_tile server for bitmap tiles generation, build and deployed with docker.
- A bbox vector tiles server, deployed with docker.
These elements are build and deployed with docker compose, from back/docker-compose.yml.
Another element deployed to the backend is the builder, a set of Python and shell scripts that download and process data to build both the tree data in postgis and additional informations stored in solr.
The backend should be deployable on any recent debian-based distribution by following these steps:
-
Copy the file
ansible/inventory_example.ymltoansible/inventory.yml. -
Edit
ansible/inventory.ymland change the values ofbackend_hostname,ansible-user,postgresql_passwordandsolr_password. -
Install the base system by running:
ansible-playbook -i ansible/inventory.yml ansible/install_system.yml- Install the backend elements with:
ansible-playbook -i ansible/inventory.yml ansible/install_back.yml- Install the builder with:
ansible-playbook -i ansible/inventory.yml ansible/install_builder.ymlThis repository also contains two test frontends which are deployable on the backend server (it should also be possible to deploy them on another machine). These are development frontends, the real one is in the lifemap-front repository.
To deploy these frontends:
ansible-playbook -i ansible/inventory.yml ansible/install_front.ymlThey will be accessible at the /ncbi/ (for the mod_tile bitmap frontend) and /bbox/ (for the bbox vector frontend) urls.
To create or update the data needed to run Lifemap, ssh to the backend and run:
cd ~/builder/
./update_lifemap.sh
# Optional: prerender mod_tile tiles
./prerender_mod_tiles.shThe ~/builder/cron_update.sh can be used to automate updates. To have an automated weekly update each sunday at 2am, you can create a cronjob such as:
0 2 * * 1 user . /home/user/.profile && cd /home/user/builder && ./cron_update.sh
- Solr API is at
/solr/- Solr english taxonomy autocompletion is at
/solr/taxo/suggesthandler - Solr french taxonomy autocompletion is at
/solr/taxo/suggesthandlerfr
- Solr english taxonomy autocompletion is at
- JSON metadata file is at
/static/metadata.json - Vector tiles are at
/vector_tiles/ - Bitmap mod_tile tiles are at
/osm_tiles/,/nolabels/and/only_labels/ - Optional test vector frontend is at
/bbox/ - Optional bitmap mod_tile frontend is at
/ncbi/ - Data files for
pylifemapandlifemapRare at/static/data/or/data/
- Global backend health endpoint is at
/health - Solr health endpointsare at
/solr/taxo/admin/pingand/solr/addi/admin/ping - Bbox health endpoint is at
/vector_tiles/health
- Vernacular taxonomic french names are automatically imported from https://github.com/Lifemap-ToL/taxonomy-fr/blob/master/TAXONOMIC-VERNACULAR-FR-LATEST.txt