Skip to content

tan-z-tan/streamlit-on-cloudrun

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Streamlit on GCP Cloud Run

This is a demo app for running Steamlit on Cloud Run. It runs a rembg that removes the background from an image as a sample.

Note that:

This is just a test application. Cloudrun distributes its requests to multiple instances by default. Because of that, Streamlit's FileUploader may cause a 404. To avoid this, set max-instance to 1.

Try it

https://streamlit-on-cloudrun-wnj6lnxzja-an.a.run.app/

(If my GCP bills go up, I might just delete it🤔)

Prepare mdoel file

Download u2netp.onnx file from here and put it in model_files/.

Run in a local environment

docker-compose up

Build & Deploy on GCP

  • Build docker image and register to GCR
gcloud builds submit --project ${GCP_PROJECT} --tag gcr.io/${GCP_PROJECT}/streamlit-on-cloudrun
  • Deploy app
gcloud beta run deploy streamlit-on-cloudrun --project ${GCP_PROJECT} --region asia-northeast1 --image gcr.io/${GCP_PROJECT}/streamlit-on-cloudrun --memory 2G --max-instances 1

About

This is a demo app for running Steamlit on Cloud Run.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published