This repository allows to deploy a lifemap backend.
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
andpolygons
tables), as well as "production" tables (points_prod
,lines_prod
andpolygons_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 andaddi
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:
-
Copy the file
inventory_example.yml
toinventory.yml
. -
Edit
inventory.yml
and change the values ofbackend_hostname
,ansible-user
,postgresql_password
andsolr_password
. -
Install the base system by running:
ansible-playbook -i inventory.yml back/00_install_system_back.yml
- Install the backend elements with:
ansible-playbook -i inventory.yml back/install_back.yml
- Install the builder with:
ansible-playbook -i inventory.yml back/install_builder.yml
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.
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
- 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
pylifemap
andlifemapR
are at/static/data/
or/data/
- 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
- 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