Skip to content

Lifemap-ToL/lifemap-back

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lifemap infrastructure

This repository allows to deploy a lifemap backend.

Deployment with ansible

You must first install Ansible, for example with pipx:

pipx install --include-deps ansible

The backend is composed of several elements:

  • A postgis server, deployed with docker. The database contains "build" tables (points, lines and polygons tables), as well as "production" tables (points_prod, lines_prod and polygons_prod tables). 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, taxo for tree data and addi for 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/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:

  1. Copy the file inventory_example.yml to inventory.yml.

  2. Edit inventory.yml and change the values of backend_hostname, ansible-user, postgresql_password and solr_password.

  3. Install the base system by running:

ansible-playbook -i inventory.yml back/00_install_system_back.yml
  1. Install the backend elements with:
ansible-playbook -i inventory.yml back/install_back.yml
  1. Install the builder with:
ansible-playbook -i inventory.yml back/install_builder.yml

Optional test frontends deployment

This 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 inventory.yml back/install_front.yml

They will be accessible at the /ncbi/ (for the mod_tile bitmap frontend) and /bbox/ (for the bbox vector frontend) urls.

Creating / updating lifemap data

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.sh
# Optional: seed bbox vector tiles
./prerender_bbox.sh

Endpoints

  • Solr API is at /solr/
    • Solr english taxonomy autocompletion is at /solr/taxo/suggesthandler
    • Solr french taxonomy autocompletion is at /solr/taxo/suggesthandlerfr
  • 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 pylifemap and lifemapR are at /static/data/ or /data/

Health endpoints

  • Global backend health endpoint is at /health
  • Solr health endpointsare at /solr/taxo/admin/ping and /solr/addi/admin/ping
  • Bbox health endpoint is at /vector_tiles/health

Notes

  • If not deploying on Ubuntu 24.04, the binary R arrow package installation and docker apt repository must be modified in Ansible scripts.
  • If the file TAXONOMIC-VERNACULAR-FR.txt has changed, remove the cache pkl file