Web frontend for
the cesium
library. Within
the browser, users can upload time series data data, extract features,
fit a model, and generate predictions for new data.
The easiest way to try the web app is to run it through Docker:
Download the docker-compose file for Cesium:
curl -Lo docker-compose.yaml https://raw.githubusercontent.com/cesium-ml/cesium_web/master/docker-compose.yaml
Ensure you have Docker Compose up and running, then:
docker-compose up
Wait a few seconds and navigate to http://localhost:9000
Create a project and go! If you want some test data, an example header file and time series data are available at
curl -Lo example-headers.dat https://raw.githubusercontent.com/cesium-ml/cesium-data/master/asas_training/asas_training_subset_classes.dat
curl -Lo example-series.tar.gz https://raw.githubusercontent.com/cesium-ml/cesium-data/master/asas_training/asas_training_subset.tar.gz
A Python 3.6 or later installation is required.
Install the following dependencies: Supervisor, NGINX, PostgreSQL, Node.JS.
brew install supervisor nginx postgresql node
brew services start postgresql
pg_ctl -D /usr/local/var/postgres start
apt-get
: sudo apt-get install nginx supervisor postgresql libpq-dev npm nodejs-legacy
pg_hba.conf
(typically in /etc/postgresql/9.6/main
), add the following lines:local all postgres peer
local cesium cesium trust
local cesium_test cesium trust
and restart postgresl
(sudo service postgresql restart
).
Initialize the database with make db_init
If you've run this script before, you may see warnings here about the database already existing. Ignore those.
make
to start the server and navigate to localhost:5000
Copy config.yaml.defaults
to config.yaml
and customize.
server
, set 'multi_user' to True to enable logins. Also provide the
Google credentials, obtained as described in the config file.app
, modify the secret-key
.To execute the test suite:
make test_headless
or make test
To run a single test:
./tools/test_frontend.py cesium_app/tests/frontend/test_build_model.py::test_build_model_rfc
Prepend the above with xvfb-run
to run in headless mode.
Debugging:
make log
to watch log outputmake stop
to stop any running web services.make attach
to attach to output of webserver, e.g. for use with pdb.set_trace()
make check-js-updates
to see which Javascript packages are eligible for an upgrade.To ensure that JavaScript & JSX code conforms with industry style
recommendations, after adding or modifying any .js or .jsx files, run ESLint with
node_modules/eslint/bin/eslint.js -c .eslintrc --ext .jsx,.js static/js/
.
To automatically run ESLint when you make changes to your JavaScript code, add
a pre-commit hook by adding the following to your .git/hooks/pre-commit:
#!/bin/bash
# Pre-commit Git hook to run ESLint on JavaScript files.
#
# If you absolutely must commit without testing,
# use: git commit --no-verify (git commit -n)
filenames=($(git diff --cached --name-only HEAD))
for i in "${filenames[@]}"
do
if [[ $i =~ \.js$ ]] || [[ $i =~ \.jsx$ ]] ;
then
echo node_modules/eslint/bin/eslint.js -c .eslintrc $i
node_modules/eslint/bin/eslint.js -c .eslintrc $i
if [ $? -ne 0 ];
then
exit 1
fi
fi
done
Run make docker-images
to build and push to Docker hub.