Skip to content

Latest commit

 

History

History
69 lines (49 loc) · 2.09 KB

dev-notes.md

File metadata and controls

69 lines (49 loc) · 2.09 KB

This Markdown page is for the GPlates Web Service developers only. It contains some technical notes which may seem confusing for other people. Contact the development team if you would like to know some details about anything in this page.

Redis

  • docker pull redis
  • docker run --name gplates-redis --network gplates-net -d redis
  • docker run -it --network gplates-net --rm redis redis-cli -h gplates-redis

Dev

  • ./docker/start-postgis.sh
  • ./docker/start-gws-dev.sh

Test

Logging

You need to specify a writable folder for the log files in settings.py. By default, the folder is /gws/log.

Load Balancing

  • sudo a2enmod proxy_balancer
  • sudo a2enmod lbmethod_bytraffic
  • sudo a2enmod lbmethod_byrequests
  • sudo systemctl restart apache2
<proxy balancer://serverpool>
    BalancerMember http://localhost:18000
    BalancerMember https://gws-nci.gplates.org
    ProxySet lbmethod=bytraffic
</proxy>
ProxyPass / "balancer://serverpool/"
ProxyPassReverse / "balancer://serverpool/"

https://gws.gplates.org/lb-manager

Docker

  • docker compose run --rm -d --service-ports gplates-postgis
  • docker run -d -v `pwd`:/gws -p 18000:80 --network gplates-net --restart always gplates/gws

wsgi process and thread numbers

You can change the numbers at docker/gws.conf. Each wsgi process may require 1.5~2.0GB memory. Check how much memory your computer has.

Setup server

  • install Apache2
  • install certbot
  • add gws.conf and gws-ssl.conf on host computer and redirect https traffic to http://localhost:18000
  • sudo a2enmod proxy && sudo a2enmod proxy_http && sudo a2enmod ssl
  • sudo systemctl restart apache2
  • sudo certbot --apache
  • go into gws docker container and change number of processes

make screenshot gif

  • command + shif + space and click
  • magick -delay 20 $(ls *.png | sort -Vr) out.gif
  • magick out.gif -coalesce temporary.gif (make .gif smaller - step 1)
  • magick temporary.gif -resize 504x315 gws-location-reconstruction.gif (make .gif smaller - step 2)