ffcaa21eb7
As PyMySQL is a dependency to run api, it should be in requirements file. Change-Id: I8c587235088897db96bf6c78238046a094dbe879 Co-Authored-By: Dhiana Deva <ddeva@thoughtworks.com> |
||
---|---|---|
app | ||
doc/source | ||
etc | ||
gulp | ||
openstack_health | ||
test | ||
.gitignore | ||
.gitreview | ||
.jshintrc | ||
.testr.conf | ||
CONTRIBUTING.rst | ||
HACKING.rst | ||
LICENSE | ||
README.rst | ||
gulpfile.js | ||
package.json | ||
requirements.txt | ||
setup.cfg | ||
setup.py | ||
test-requirements.txt | ||
tox.ini |
README.rst
openstack-health
webclient for visualizing test results of OpenStack CI jobs.
Installation
API
Frontend
Installation of the frontend requires Node.js and Gulp. On Ubuntu:
sudo apt-get install nodejs npm nodejs-legacy
sudo npm install -g gulp
Then, install the Node modules by running, from the project directory:
npm install
Usage - Development
API
To run the REST API for development you either install the openstack_health python package and run:
$ openstack_health_api config_file
or alternatively just can just run the api.py file manually. For example, from the top of the repo you would run:
$ python2 openstack_health/api.py config_file
This will start up a local webserver listening on the localhost. You can then send requests to the specified port on stdout to see the response.
Frontend
A development server can be run as follows:
gulp dev
This will open a web browser and reload code automatically as it changes on the filesystem.
Usage - Production
API
The rest api is a flask application so any of the methods for deploying a flask application can be used. The standalone entrypoint used for development isn't suitable for production because it's single threaded. For example you can use something like uwsgi or mod_wsgi to deploy it for real.
Frontend
The production application can be build using:
gulp prod
The result will be written to ./build
and should be
appropriate for distribution. Note that all files are not required:
- Directory structure (
js/
,css/
,fonts/
,images/
): required. - Static resources (
fonts/
,images/
): required. - Core files (
index.html
,js/main.js
,css/main.css
): required unless gzipped versions are used. - Gzipped versions of core files (
*.gz
): not required, but preferred. Use instead of plain core files to save on disk usage and bandwidth. - Source maps (
js/main.js.map
,js/main.js.map.gz
): only required for debugging purposes.