I’ve just created this Git repo https://github.com/nicolasmetallo/legendary-streamlit-demo where I’m trying to show step by step how you can take your demo.ipynb, create an Streamlit app, package into a container image, and then deploy everything to AWS Fargate (serverless managed containers). That means that once you are done with the tutorial, you will have an app with: it’s own VPC, ECS Cluster, Application Load Balancer with a public-facing DNS, Auto-scaling, can talk to other AWS services, and that you can quickly edit and re-deploy.
Let me know your thoughts and any idea/comment on how to improve it.
Wow, that’s a really thorough demo @nicolasmetallo, thanks for sharing that! I hope to have a little time later to day to actually walk through this in detail
Hi, you can specify the type of instance you want to run your ECS cluster on when you are writing your AWS CDK script, so I don’t see why it wouldn’t support GPU inference .
That’s amazing @tzaffi! I’ll have a go at it during the week. Nice work . Quick update on teh previous question by @avn3r, Fargate doesn’t support GPU instances as of now, but you can choose to deploy onto a cluster of EC2 instances instead.
Sorry for bumping an old thread, but I was wondering if you guys had seen any issues where lots of users connect to the app at the same time. Does streamlit handle that well currently in your experience?
@nicolasmetallo, I’ve been looking into AWS serverless deployments of Streamlit.
Ideally, I’d be able to use AWS Lambda for this use case, but I’m not sure whether this is supported. I believe that Lambda execution timeout terminates after 15 minutes. (This was 2018 so things might have changed.)
The typical SPA, say a React app, would be delivered to the user from an S3 bucket; so that’s a one-time data transfer. Now, when the user navigates the SPA, occasionally data from your backend server will be needed. These Fetch API calls might be routed to API Gateway and subsequently sent to AWS Lambda functions for execution. No big deal! The SPA maintains the state and that work has been offloaded to client side.
But as I understand Streamlit, there isn’t an equivalent of sending the SPA from an S3 bucket to a user as a one-time data transfer. Due to the usage of Python code, the Streamlit app will always be run on backend servers. In terms of computations, you (and your AWS account) are on the hook for every interaction the user makes with your server.
Sure, you could decouple your architecture and move code out of your Streamlit app and into Lambda functions, which are called by the Streamlit SPA. But at the end of the day, the 15 min timeout just isn’t going to work for Streamlit.
This would be the fundamental reason why you chose Fargate, right?
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.