From a26a5bcb0477ad0d08f678453b31696948e39e07 Mon Sep 17 00:00:00 2001 From: Richard Hitier Date: Thu, 13 Apr 2023 14:16:22 +0200 Subject: [PATCH] Upgrade README --- README.md | 91 ++++++++----------------------------------------------------------------------------------- SPACEWEATHERONLINE.md | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 83 deletions(-) create mode 100644 SPACEWEATHERONLINE.md diff --git a/README.md b/README.md index 02aed1b..bdd9324 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,13 @@ +# Heliopropa Web -## http://heliopropa.irap.omp.eu +A web site writen in flask for the visualisation of solarwind propagation simulations. -# What +Builds and serves heliopropa's visualizations. -## Web Server - -Build and serve heliopropa's visualizations. It's a `flask` webserver, serving `d3.js` plots. It also gathers NetCDF data from AMDA, and serves it as CSV to the plotter. - -### Rationale - -- Reading NetCDF from javascript is doable, but still *very* hacky. -- The bridge can handle pagination and collecting multiple NetCDF into one CSV. - - -# How - -## Source - -https://gitlab.irap.omp.eu/CDPP/SPACEWEATHERONLINE - - -## Overview +## Files Overview - `config.yml` : the main configuration file. - `web/run.py` : the front controller, holding most of the code. @@ -32,56 +16,14 @@ https://gitlab.irap.omp.eu/CDPP/SPACEWEATHERONLINE - `web/static/js/swapp.ls` : most of the javascript client-side. -## Install - -### Prerequisites -gcc -libncurses-dev -python3 -python3-virtualenv -libapache2-mod-wsgi-py3 - ### Python venv ``` bash python3 -m venv venv source venv/bin/activate -pip install matplotlib -pip install numpy==1.8.* pip install -r requirements.txt ``` -### CentOs 6 Shenanigans - -``` bash -yum install https://centos6.iuscommunity.org/ius-release.rpm -yum install python27* -``` - -But then `virtualenv` yields - -``` -File "/var/www/html/HELIOPROPA/web/run.py", line 24, in -[Fri Nov 30 14:30:38 2018] [error] [client 10.10.135.119] from netCDF4 import Dataset, date2num -[Fri Nov 30 14:30:38 2018] [error] [client 10.10.135.119] File "/var/www/html/HELIOPROPA/venv/lib/python2.7/site-packages/netCDF4/__init__.py", line 3, in -[Fri Nov 30 14:30:38 2018] [error] [client 10.10.135.119] from ._netCDF4 import * -[Fri Nov 30 14:30:38 2018] [error] [client 10.10.135.119] ImportError: /var/www/html/HELIOPROPA/venv/lib/python2.7/site-packages/netCDF4/_netCDF4.so: undefined symbol: PyUnicodeUCS2_FromStringAndSize -``` - -_Solution:_ -Configure Apache to use `web/run_ssa.wsgi` and use pip2.7 install system wide. - - -### Install libcdf. - -``` bash -wget https://spdf.gsfc.nasa.gov/pub/software/cdf/dist/cdf38_1/cdf38_1-dist-all.tar.gz -tar -xzvf cdf38_1-dist-all.tar.gz -cd cdf38_1-dist -make all OS=linux ENV=gnu -make INSTALLDIR=/usr/local/lib/libcdf install -``` - ## Develop ``` bash @@ -91,29 +33,12 @@ DEBUG=true python web/run.py Then, browse [localhost:5000](http://localhost:5000). - -## Troubleshoot - -### Installing scipy - -Getting `MemoryErrors` ? -Try with the `--no-cache-dir` option. - -`pip install scipy --no-cache-dir` - -### Fix permissions problems with the cache - -``` -sudo setfacl -R -m u:apache:rwx -m u:`whoami`:rwx cache -sudo setfacl -dR -m u:apache:rwx -m u:`whoami`:rwx cache -``` - -# Gunicorn and Nginx deployment on OVH for development +## Gunicorn and Nginx deployment on OVH for development see [ Digital Ocean documentation ] (https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-20-04-fr) -## wep app service and Gunicorn +### wep app service and Gunicorn see ./resources/heliopropa.service @@ -133,7 +58,7 @@ see ./resources/heliopropa.service [Install] WantedBy=multi-user.target -## Nginx +### Nginx see ./resources/heliopropa.nginx @@ -150,7 +75,7 @@ see ./resources/heliopropa.nginx } -## Start and Allow at system reboot +### Start and Allow at system reboot sudo systemctl start nginx sudo systemctl start heliopropa diff --git a/SPACEWEATHERONLINE.md b/SPACEWEATHERONLINE.md new file mode 100644 index 0000000..8712337 --- /dev/null +++ b/SPACEWEATHERONLINE.md @@ -0,0 +1,75 @@ + +## http://heliopropa.irap.omp.eu + +# What + + +### Rationale + +- Reading NetCDF from javascript is doable, but still *very* hacky. +- The bridge can handle pagination and collecting multiple NetCDF into one CSV. + + +# How + +## Source + +https://gitlab.irap.omp.eu/CDPP/SPACEWEATHERONLINE + + +## Install + +### Prerequisites +gcc +libncurses-dev +python3 +python3-virtualenv +libapache2-mod-wsgi-py3 +### CentOs 6 Shenanigans + +``` bash +yum install https://centos6.iuscommunity.org/ius-release.rpm +yum install python27* +``` + +But then `virtualenv` yields + +``` +File "/var/www/html/HELIOPROPA/web/run.py", line 24, in +[Fri Nov 30 14:30:38 2018] [error] [client 10.10.135.119] from netCDF4 import Dataset, date2num +[Fri Nov 30 14:30:38 2018] [error] [client 10.10.135.119] File "/var/www/html/HELIOPROPA/venv/lib/python2.7/site-packages/netCDF4/__init__.py", line 3, in +[Fri Nov 30 14:30:38 2018] [error] [client 10.10.135.119] from ._netCDF4 import * +[Fri Nov 30 14:30:38 2018] [error] [client 10.10.135.119] ImportError: /var/www/html/HELIOPROPA/venv/lib/python2.7/site-packages/netCDF4/_netCDF4.so: undefined symbol: PyUnicodeUCS2_FromStringAndSize +``` + +_Solution:_ +Configure Apache to use `web/run_ssa.wsgi` and use pip2.7 install system wide. + + +### Install libcdf. + +``` bash +wget https://spdf.gsfc.nasa.gov/pub/software/cdf/dist/cdf38_1/cdf38_1-dist-all.tar.gz +tar -xzvf cdf38_1-dist-all.tar.gz +cd cdf38_1-dist +make all OS=linux ENV=gnu +make INSTALLDIR=/usr/local/lib/libcdf install +``` + + +## Troubleshoot + +### Installing scipy + +Getting `MemoryErrors` ? +Try with the `--no-cache-dir` option. + +`pip install scipy --no-cache-dir` + +### Fix permissions problems with the cache + +``` +sudo setfacl -R -m u:apache:rwx -m u:`whoami`:rwx cache +sudo setfacl -dR -m u:apache:rwx -m u:`whoami`:rwx cache +``` + -- libgit2 0.21.2