So far I haven’t had any success getting Streamlit to run an application in GCP. I can get Streamlit deployed to both AppEngine and CloudRun and started up. But in both environments even something as basic as “streamlit hello” displays a “Please wait…” message in an st.info() bar and then hangs on the internal connection to “healthz”, eventually failing with a 404 Error. Github issue.
Hi @knorthover, I definitely got it going on GKE myself. I haven’t tried AppEngine or CloudRun, but I’d love to help. My guess is that there might be something boing on with Websocket. It seems to work just fine on GKE, but I am deploying directly with Kubernetes, so it might be a different networking setup. I really appreciate you filing the bug, so I will follow up from there. Also, thanks for uploading all your configuration and Dockerfile.
For now I’ve deployed on an internal server box. My users are enthusiastic about the application (a dashboard for our call center).
I don’t know enough about tornado to know where the problem is occurring but it seems that Cloud Run and AppEngine (I believe they are basically the same stack) are taking over control of the websocket connections.
I’m getting the same issue on app engine. I’m very eager to get streamlit working with either app engine or cloud function.
I’m mainly focus on ML, not good at eng and infra. Streamlit is awesome because I don’t have to be an expert on web dev eng. If Streamlit can be easily deployed to app enigne or cloud function then I don’t have to be an infra expert (e.g. kubernetes & docker) as well .
It’s possible to get an app to run in AppEngine (as I posted a while back) but they generally stop after a little while because AppEngine doesn’t support a persistent websocket connection. GKE is the recommended approach.
Hi! Do you know if it’s possible to deploy using Google App Engine’s standard environment? I’ve deployed a simple streamlit app with the flex environment (with minimum requirements to run it) but the standard env is way cheaper. Thank you!
As far as I know AppEngine will still not run Streamlit for any length of time. That was certainly my experience and I abandoned that approach some months back. The issue is Websocket support and timeout.
GKE deployment is mostly straightforward, it gets more complicated if you want to use the Identity Aware proxy to secure access to your pages. We did increase the Websocket timeouts for our GKE configurations.
Thanks for your prompt reply @knorthover ! I’ll give it a try. Btw, do you think that deployment on AWS would be easier (say, using EC2) than GCP?
It’s interesting because I’ve used the Google App Engine to deploy my simple app with a flex env and it’s worked for a couple of months. I do see however an error once in a while that may have to do with the websocket issue discussed in this forum.
I’m trying to deploy in App. Engine with no luck. I have followed the comments but I get this error:
Updating service [default] (this may take several minutes)...failed.
ERROR: (gcloud.app.deploy) Error Response: 
Application startup error! Code: APP_CONTAINER_CRASHED
Warning: the config option 'server.enableCORS=false' is not compatible with 'server.enableXsrfProtection=true'.
As a result, 'server.enableCORS' is being overridden to 'true'.
In order to protect against CSRF attacks, we send a cookie with each request.
To do so, we must specify allowable origins, which places a restriction on
cross-origin resource sharing.
If cross origin resource sharing is required, please disable server.enableXsrfProtection.
Usage: streamlit run [OPTIONS] TARGET [ARGS]...
Error: Invalid value: File does not exist: app.py
Is secure to disable XsrfProtection?
There is another way?
None of the suggestions above by the others have worked for me.
Does this mean Google App Engine ( same issue occurs with Google Cloud Run as well) is not an option for deploying Streamlit Apps?
Or… is there a way to override the health endpoint name used by Streamlit ?