I’m getting into another issue and was wondering if I can get some guidance.
So I can do a manual gcloud app deploy, but now I want to do it in CI/CD with Cloud Build. Unfortunately the build runs, but the app does not respond on the weblink.
FROM python:3.9.3
WORKDIR /app
EXPOSE 8080
COPY requirements.txt ./requirements.txt
RUN pip3 install -r requirements.txt
RUN find /usr/local/lib/python3.9/site-packages/streamlit -type f \( -iname \*.py -o -iname \*.js \) -print0 | xargs -0 sed -i 's/healthz/health-check/g'
COPY main.py ./main.py
CMD streamlit run --server.port 8080 --browser.serverAddress 0.0.0.0 --server.enableCORS False --server.enableXsrfProtection False main.py
/healthz was an existing endpoint in streamlit that conflicted with GCP’s internal expectations, so I needed to run the sed one-liner.
Cloud Run seems to work as well, pointed to the image published to the google cloud registry associated with the most recent App Engine build (in the same project), and had it up and running quickly (image didn’t need to be rebuilt).
Digital Ocean Apps deployment worked well (started playing with it while waiting on GCP deployment with the above combo, which was taking much longer once I started using the flex environment with the Dockerfile…). For Digital Ocean, defaults from dockerhub as the app source worked great. I only needed to configure the health check from default TCP to HTTP at /health-check and it worked with the same Dockerfile above.
Turns out the fact of streamlit running on websockets complicates autoscaling, so … I suggest you don’t deploy streamlit this way (on elastic beanstalk, cloud run, app engine, etc).
After “request timeout” is reached, or if scaling happens behind the scenes, the client may be routed to a different backend worker, meaning the app resets, state is lost, etc. leading to a bad user experience.
Deploying into a single VM on digital ocean (or the equivalent non-scaled solution on gcp/aws/azure) is the way to share (besides streamlit sharing) but can’t quite handle scaling (except vertical).
Definitely learned the hard way that the proper way to build apps that can scale on these managed platforms is to decouple front/back end. streamlit helped prototype the interface / experience but can’t be what I use to go to production. As far as I can tell, the only way to scale is to go the “binder” route (kubernetes under the hood) and assign a single VM to each user, which can get expensive quickly.
Hi @monchier! - I know this is a very old post but right now I think I have the same issue trying to setup an envoy-based proxy for my Streamlit app. Do you mind sharing a little bit about the way you set it up? Specially, I’m using Gloo Edge and haven’t been able to pass through the “Please wait…” screen.
Thanks in advance!
Hello, I’m facing the same issue after deploying my web app in app engine.
I have a time out after 40 to 50 minutes of running the app in a browser! Any updates on this topic ?
Thanks in advance.
Despite all recommendations I couldn’t get it working on AppEngine flex.
Getting same error:
ERROR: (gcloud.app.deploy) Error Response: [4] An internal error occurred while processing task /app-engine-flex/flex_await_healthy/flex_await_healthy>2022-11-29T07:55:05.850Z21335.wa.2: Your deployment has failed to become healthy in the allotted time and therefore was rolled back. If you believe this was an error, try adjusting the ‘app_start_timeout_sec’ setting in the ‘readiness_check’ section.
I tried this Dockerfile:
FROM python:3.9.3
WORKDIR /app
EXPOSE 8080
COPY requirements.txt ./requirements.txt
RUN pip3 install -r requirements.txt
RUN find /usr/local/lib/python3.9/site-packages/streamlit -type f \( -iname \*.py -o -iname \*.js \) -print0 | xargs -0 sed -i 's/healthz/health-check/g'
COPY main.py ./main.py
CMD streamlit run --server.port 8080 --browser.serverAddress 0.0.0.0 --server.enableCORS False --server.enableXsrfProtection False main.py
Hi all, I am trying to deploy to GCP App Engine. Currently I deployed to Streamlit’s Community Cloud and it handles secrets easily by adding to the config. Should I change st.secrets references in my code to use managed secret service like GCP Secrets Manager for the GCP deployment? Thank you!
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.