Deploying a webapp on rorodata
The rorodata platform is designed for machine learning applications but it is flexible enough to support web app dashboards as well. You can code your dashboard application in any Python framework and make the necessary changes in the roro.yml file before deploying.
2.1.1 How to add a Flask dashboard to my project?
Create a Flask application in the project directory as usual. A simple (no DB) Flask project comprises /static
folder, /templates
folder, requirements.txt
and app.py
with all the views. A typical project will look like so:
$ ls
/static
/templates
app.py
train.py
predict.py
requirements.txt
roro.yml
$ nano roro.yml
Create a roro.yml
like this
project: <your-project-name>
runtime: rorodata/sandbox
services:
- name: api
function: <file-with-predict-function>.<predict-function-name>
- name: default
command: gunicorn app:app
Ensure that all the web app specific dependencies are included in the requirements.txt
gunicorn
flask
firefly-python
pillow
Jinja2
Werkzeug
2.1.2 How to do I deploy the web app along with APIs?
If you have setup the project like above, then all you need to do is roro deploy
$ roro deploy
Deploying project <your-project-name>. This may take a few moments ...
Restarted one service.
api: https://<your-project-name>--api.rorocloud.io/
default: https://<your-project-name>.rorocloud.io/
Your web app is available as https://<your-project-name>.rorocloud.io/
while the API endpoint is available at https://<your-project-name>--api.rorocloud.io/
Notice the difference in the URL structure