Olivine-Ryo / streamlit-cloudrun-sample

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sample code to deploy Streamlit dashboard app with Google Cloud Run

Summary

You can deploy Streamlit dashboard app with only two commands. This sample dashboard visualizes greenhouse gas open data. Data sources are written below.

Usage

  1. Clone this repository in Google Cloud Shell
$ git clone https://github.com/Olivine-Ryo/streamlit-cloudrun-sample.git
  1. Deploy with Buildpacks (if asked "Allow unauthenticated invocations to [greenhousegas-dashboard] (y/N)?", return yes.)
$ cd ./streamlit-cloudrun-sample
$ gcloud run deploy greenhousegas-dashboard --source . --timeout=3600

Then you can see your dashboard link in the terminal.

Note

Deployment by Buildpacks occasionally fails because its build time takes more than 10 minutes. Then you can deploy to other regions or deploy with Dockerfile as below.

$ gcloud builds submit --tag asia.gcr.io/${PROJECT-ID}/greenhousegas-dashboard:v

$ gcloud run deploy greenhousegas-dashboard --image asia.gcr.io/${PROJECT-ID}/greenhousegas-dashboard:v1

Data sources

This dashboard is the reproduction of CO2 Data Explorer in Our World in Data under the Creative Commons BY license. The data sources are as below. All of them are under the Creative Commons BY license.

About

License:MIT License


Languages

Language:Python 95.1%Language:Dockerfile 4.2%Language:Procfile 0.7%