Deploy Streamlit Application with extra components on GCP

Hi community of Streamlit,

Problem: I need your assistance with deploying an application on App Engine (GCP). I have encountered an issue where after deploying the app using the app.yaml file, the Streamlit Extra components or images fail to load and display properly.
In particular the error was this for the Hydralit library :cold_face:

Screenshot Problem:

Could someone help me extend the loading time of the Streamlit objects?
Let me know and thank you for your time :rocket:



Hi there @M-ballabio1 ,

I don’t have a specific solution for App Engine, but my suggestion is to deploy on Cloud Run with session affinity activated. Custom components render successfully with this configuration.

Hope it helps!

1 Like

Can you share directions or a screenshot of how to setup the Session Affinity?? I tried deploying on Cloud Run and session management was nonexistent. After googling I ended up going to Google Cloud App Engine - which seems to have it’s own set of bugs. Would love to go back to Cloud Run if your session affinity actually solves my session issue.

EDIT: Found it - testing now… Not sure how i didn’t see this before.

1 Like

What does your yaml file look like? I recently deployed on GCP App Engine and didn’t run into issues during deployment:

Following commands for Google Cloud Terminal
Activate project: gcloud config set project PROJECT-NAME
CD into directory: cd WORKING FOLDER
Deploy in Google Cloud App Engine: gcloud app deploy app.yaml

FILE: app.yaml:
runtime: custom
env: flex

FILE: Dockerfile:
FROM python:3.10
COPY . ./
RUN apt-get update
RUN pip install -r requirements.txt
ENTRYPOINT [“streamlit”, “run”, “”, “–server.port=8080”, “–server.address=”]

Hi there @ryan.ganshert ,

I understand you found where to configure session affinity in Google Cloud Run. Hope it went well.

FYI and for everyone’s reference, you don’t even need the .yaml file, a simple Dockerfile will do the trick. See below two helpful tutorials:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.