A historical weather charter web app that displays ~25 years of highs and mins on a per month scale for any input location.
- Install Python 3.11.x
- Create virtual environment
$ cd historical-weather-app
$ python3 -m venv env- Activate virtual environment and install packages
$ ./env/Scripts/activate # For PowerShell
$ source env/bin/activate # For ZSH
$ pip install --upgrade pip
$ pip install -r app/requirements.txt- Ensure that the
model_backendingbmodel/__init__is set tosqlite3 - Run app
$ python3 app/app.py- Clone repo in Cloud Shell
- Ensure that the
model_backendingbmodel/__init__.pyis set todatastore - Ensure that the
CLIENTingbmodel/model_datastore.pyis set to the project name (same as${GOOGLE_CLOUD_PROJECT}) - Create docker container from
historical-weather-charter/directory - Create a service account called "weather" with the
Cloud Datastore Userrole - Create Google Datastore database in "Datastore Mode" that resides in the US West1 region
- Create a "weather" entity kind in datastore with a "[default]" namespace and "Numeric ID (auto-generated)" Key identifier. It should have the following properties:
- A "date" value
- A "lat_long" value
- A "max_temp" floating point number
- A "min_temp" floating point number
- Create an index on the
lat_longanddateproperties of the weather kind - Deploy to Cloud Run
$ git clone https://github.com/henrykaus/historical-weather-charter
# Make changes for steps 2 and 3
$ gcloud builds submit --timeout=900 --tag gcr.io/${GOOGLE_CLOUD_PROJECT}/gcp-weather
# Create and configure datastore db for steps 5-7
$ gcloud datastore indexes create index.yaml
$ gcloud run deploy gcp-weather --image gcr.io/${GOOGLE_CLOUD_PROJECT}/gcp-weather --service-account weather@${GOOGLE_CLOUD_PROJECT}.iam.gserviceaccount.com