Weather prediction model predictions Web App Fronend made with Streamlit (for a cloud computing uni course - RSO).
Its a simple app that shows the value of the latest prediction and a graph of the last month predictions.
To run the application locally, follow these steps:
-
Install Dependencies:
pip install -r requirements.txt
-
Set Google Application Credentials:
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/your/credentials.json
-
Start Ray Serve Application:
streamlit run streamlit_predict.py
To deploy the application using Docker and Google Cloud Run, follow these steps:
-
Build the Docker Image Locally:
docker build -t streamlit_wp_predict .
-
Run the Docker Image Locally for Testing:
- This command runs the Docker container locally and sets the Google Cloud credentials.
docker run -p 8080:8080 \ -e GOOGLE_APPLICATION_CREDENTIALS=/tmp/keys/gcp_credentials.json \ -v /path/to/your/credentials:/tmp/keys \ streamlit_wp_predict
Replace
/path/to/your/credentials
with the actual path to your Google Cloud credentials JSON file. -
Authenticate with Google Cloud:
gcloud auth login gcloud projects list --sort-by=projectId --limit=5 gcloud config set project <project_id> gcloud auth configure-docker
-
Build and Tag the Image for Google Container Registry:
docker build -t eu.gcr.io/<project_id>/streamlit_wp_predict:v1 .
-
Push the Docker Image to Google Container Registry:
docker push eu.gcr.io/<project_id>/streamlit_wp_predict:v1
-
Deploy to Google Cloud Run:
- Open the Google Cloud Console.
- Navigate to Cloud Run.
- Click on 'Create Service'.
- Choose the image you just pushed.
- Set any required configurations (like memory, CPU).
- Deploy the image.