bndxn / raspi-weather-station

Training pipeline for an LSTM model to predict temperature
0 stars 0 forks source link

Creating web front end #3

Open bndxn opened 1 year ago

bndxn commented 1 year ago

Some options

Katya's app here

Guides

bndxn commented 1 year ago

Guide on using flask with lightsail here

bndxn commented 1 year ago

Up to step 4 of that guide

bndxn commented 1 year ago

An elastic beanstalk guide here - from 2020, but maybe following these answers, lightsail is a bit easier to use?

bndxn commented 1 year ago

Trying Mo's suggestions of creating the app locally then pushing it. Had to install lightsail plugin (link)

bndxn commented 1 year ago

How to serve a flask app (link)

Web visualisation with plotly and flask here

bndxn commented 1 year ago

A helpful link on resolving docker dependency issue

https://stackoverflow.com/questions/66100767/from-dockers-doc-could-not-find-a-version-that-satisfies-the-requirement-aptur

bndxn commented 1 year ago

cmake issue? https://stackoverflow.com/questions/71470989/python-setup-py-bdist-wheel-did-not-run-successfully

I think this ended up being caused by FROM python:3.8-alpine, changed to 3.8-slim-buster and it worked on the mac and ubuntu, but now not working on the pi.

bndxn commented 1 year ago

https://stackoverflow.com/questions/55032695/docker-build-for-numpy-pandas-giving-error and https://www.freecodecamp.org/news/how-to-dockerize-a-flask-app/

bndxn commented 1 year ago

https://stackoverflow.com/questions/52799146/docker-flask-jinja2-exceptions-templatenotfound-index-html

bndxn commented 1 year ago

https://stackoverflow.com/questions/58840929/docker-flask-jinja2-exceptions-templatenotfound-error

bndxn commented 1 year ago

Useful: https://www.digitalocean.com/community/tutorials/how-to-make-a-web-application-using-flask-in-python-3

bndxn commented 1 year ago

Lightsail seems to make it difficult to upload to an S3 bucket or change roles, so I think I'm going to try another option. Apparently static websites can be hosted with EC2.

Some googling suggested doing this with elastic beanstalk - will try that now.

bndxn commented 1 year ago

Installing docker on pi guide

bndxn commented 1 year ago

Installing elastic beanstalk? https://github.com/aws/aws-elastic-beanstalk-cli-setup

bndxn commented 1 year ago

Had issues initialising elastic beanstalk, possibly because python was old version. Looked at this (guide), and added symlink sudo ln -s /usr/local/bin/python3 python. Now Symlink issue - still exploring.

bndxn commented 1 year ago

Dealing with issues on two fronts:

  1. elastic beanstalk on the pi, not able to create or list buckets
  2. can't build docker image on the pi (but can on the macbook), some issue with numpy dependencies and wheel
bndxn commented 1 year ago

Uploading to S3 using flask - video here

bndxn commented 1 year ago

Another idea - streamlit https://streamlit.io/

bndxn commented 1 year ago

Flask app now deployed to Elastic beanstalk! Uploaded a zip of the file, but still!

Now improving styling: https://www.digitalocean.com/community/tutorials/how-to-make-a-web-application-using-flask-in-python-3#step-3-using-html-templates

bndxn commented 1 year ago

Tried the website format from here