geopython / GeoHealthCheck

Service Status and QoS Checker for OGC Web Services
https://geohealthcheck.org
MIT License
84 stars 71 forks source link

External JS/CSS libs via CDNs where possible #231

Open justb4 opened 5 years ago

justb4 commented 5 years ago

GHC uses several common external JS/CSS libs like Leaflet. These libs are downloaded and assembled during build time via paver setup. For several reasons it is more optimal to use hosted CDN-versions of these libs:

For the latter it appeared today some libs (select2 and Leaflet) were missing in the Docker image running https://demo.geohealthcheck.org. Inspecting the Build on Docker Hub revealed:

---> pavement.setup
mkdir path('/GeoHealthCheck/instance')
mkdir path('/GeoHealthCheck/instance/data')
copy path('/GeoHealthCheck/GeoHealthCheck/config_main.py') path('/GeoHealthCheck/instance/config_site.py')
pip install -r requirements.txt
move path('/GeoHealthCheck/GeoHealthCheck/static/lib/startbootstrap-sb-admin-2-3.3.7-1/dist') path('/GeoHealthCheck/GeoHealthCheck/static/lib/dist')
move path('/GeoHealthCheck/GeoHealthCheck/static/lib/startbootstrap-sb-admin-2-3.3.7-1/vendor') path('/GeoHealthCheck/GeoHealthCheck/static/lib/vendor')
Traceback (most recent call last):
File "/venv/lib/python2.7/site-packages/paver/tasks.py", line 201, in _run_task
return do_task()
File "/venv/lib/python2.7/site-packages/paver/tasks.py", line 198, in do_task
return func(**kw)
File "pavement.py", line 117, in setup
zipstr = StringIO(urlopen(select2).read())
File "/usr/local/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/lib/python2.7/urllib2.py", line 435, in open
response = meth(req, response)
File "/usr/local/lib/python2.7/urllib2.py", line 548, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/local/lib/python2.7/urllib2.py", line 473, in error
return self._call_chain(*args)
File "/usr/local/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/usr/local/lib/python2.7/urllib2.py", line 556, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 502: Bad Gateway

This may be due to some temporary failure on either Docker Hub or else. Triggering a new build with same GH version on DockerHub rendered success.

Also JQueryUI is currently part of GHC in GitHub and needs to be moved as well to a CDN version.

dersteppenwolf commented 4 years ago

Hi.

Looks that the way paver works causes some errors due to Reverse proxys / Load Balancers.

I published the docker container on OKD and appeared many errors related to ERR_CONTENT_LENGTH_MISMATCH

I had to switch jquery and fontawesome to CDN like #281

Those changes were published to this tag https://github.com/dersteppenwolf/GeoHealthCheck/tree/0.7.2

Best