Deploy a Streamlit application on Google Cloud Run - all you need to know

  Рет қаралды 17,283

Federico Tartarini

Federico Tartarini

Күн бұрын

In this video, I will show you how to deploy your Streamlit application on Google Cloud Run for free. Google Cloud Run allows you to run your application as a stateless container in a fully managed environment. This means you can run your application at scale without having to manage servers or infrastructure. I will guide you through the process of setting up a project on the Google Cloud Platform, building a Docker container for your Streamlit application, and deploying it to Google Cloud Run. By the end of this video, you will have a fully deployed Streamlit application running on Google Cloud Run.
✅ Subscribe for more videos like this one
🔔 Click on the bell icon to be notified when I release a new video
👍 Please like my video!
⚠️ Join my channel to get access to perks: / @federicotartarini
🙏 Support my channel on Patreon at / federicotartarini
☕ Support my channel by buying me a coffee - www.buymeacoffee.com/FedericoT
✅ Let's connect:
🌍 My website - federicotartarini.github.io/
💻 GitHub - github.com/FedericoTartarini
Twitter - / federicotartar1
LinkedIn - / federico-tartarini
📝 Useful notes:
docs.streamlit.io/en/stable/t...
👨‍💻 Source code:
github.com/FedericoTartarini/...
🎥 Content of this video:
00:00 - What you will learn
00:30 - Advantages of Google Cloud Run
01:40 - What is Streamlit
02:50 - Google Cloud SDK
03:25 - Create Stremlit project
05:50 - Install dependencies
08:20 - Run application locally
10:00 - Dockerfile
12:30 - How to build and deploy to Cloud Run
13:40 - Create a Project
15:10 - Build application
16:00 - Deploy the application
🔣 Keywords:
#Streamlit #Python #WebApplication #DataScience #Dashboard

Пікірлер: 60
@86dansu
@86dansu 3 ай бұрын
Followed your steps and was able to get the app running on Cloud Run , thanks for all the help 👍
@FedericoTartarini
@FedericoTartarini 3 ай бұрын
Great to hear!
@gilzeevi9263
@gilzeevi9263 Жыл бұрын
I've seen many tutorials on deploying streamlit on different platforms. yours is TOP!! really thorough, professional and many good practices you show along the way. Thanks man, really helpful
@FedericoTartarini
@FedericoTartarini Жыл бұрын
Thank you so much. I really appreciate your feedback. I am very happy that you enjoyed the video and you took the time to leave a comment. This means a lot to me. Thank you again
@aadarshsingh7406
@aadarshsingh7406 2 жыл бұрын
You are a true hero! Saved my day!!
@FedericoTartarini
@FedericoTartarini 2 жыл бұрын
Thank you very much. I am glad it helped you.
@afinoor
@afinoor Жыл бұрын
This tutorial is the best. It covered everything from scratch. Learned many good practices (including the main thing: deploying a streamlit application) from the detailed walkthrough. Thank you for this awesome tutorial.
@FedericoTartarini
@FedericoTartarini Жыл бұрын
Glad it helped! Thank you so much for taking the time to write a comment, comments like yours mean a lot to me.
@yuong8139
@yuong8139 2 жыл бұрын
Thanks for your video, very educational and informative!!!!
@FedericoTartarini
@FedericoTartarini 2 жыл бұрын
Thank you so much.
@LucianoVincenzoGregoretti
@LucianoVincenzoGregoretti 8 ай бұрын
Grazie Federico, video molto chiaro e utile!
@FedericoTartarini
@FedericoTartarini 8 ай бұрын
Mi fa molto piacere. Grazie
@jaybakerwork
@jaybakerwork 3 жыл бұрын
Thank you for the tutorial. Have you had any issues with google blocking the health check url? I get errors with streamlit trying to use /_healthcheck which google blocks.
@kerednus1096
@kerednus1096 8 ай бұрын
thank you so much
@FedericoTartarini
@FedericoTartarini 7 ай бұрын
You're welcome!
@Vinaykumar-ng8eu
@Vinaykumar-ng8eu 2 жыл бұрын
Thankyou for the tutorial. But i want to make two modifications here for the users. 1. In Dockerfile write. update python version Python: 3.x.x , coz with Python: 3 some of the libraries were not installling in VM. 2. Dont make virtual environment and then link to gcp, it will upload libraries as well and pop TIMEOUT error in gcp. Silly mistakes but not for newbies :P
@FedericoTartarini
@FedericoTartarini 2 жыл бұрын
Thank you so much for the feedback
@clayherz_
@clayherz_ Ай бұрын
Sir even though my gcp is not biling enabled, can i still deploy my streamlit app with this cloud run?
@KshitijSharma-gr4yi
@KshitijSharma-gr4yi 20 күн бұрын
If i make changes in code how will it be rendered in app or i have to repeat this process again?
@mehuljethva4851
@mehuljethva4851 Ай бұрын
Thank you for this tutorial! I successfully deployed my app on cloud run. One question I have, do I use the same deploy command to push any code changes? I tried that and saw a the updated revision, but seems like it keeps pointing back to the old one. I need to add my secrets.toml in the .streamlit file
@franciscoriquelme5468
@franciscoriquelme5468 6 ай бұрын
thanks!, i didn't understand where you define the cloud run service, can you explain me? could you update this tutorial using terraform?
@jeffoberlander-jh2br
@jeffoberlander-jh2br 2 ай бұрын
Great tutorial! Thank you so much. I followed step by step but deployment always fails. Revision 'cl-dashboard-internal-00001-lm8' is not ready and cannot serve traffic. The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable. Logs for this revision might contain more information.
@lukasgroewestermann1679
@lukasgroewestermann1679 2 жыл бұрын
Very good video! Is it possible to move this app to a custom domain?
@FedericoTartarini
@FedericoTartarini 2 жыл бұрын
Thank you. Yes, it is. You just have to setup a custom domain using Google Cloud Run.
@phuongdongcompany
@phuongdongcompany 3 жыл бұрын
the cost of could run vs app engine, which one is cheaper? I deploy my app to app engingee ,they charge me 6 $ for 1 day. It is so expensive to me. How much do you pay for cloud run?
@FedericoTartarini
@FedericoTartarini 3 жыл бұрын
Google Cloud Run should be significantly cheaper. See more information here: cloud.google.com/run/pricing. The benefit of Cloud Run is that it has a time-out feature, whereby it stops the service when no-one is accessing your application. This should save money for small-scale applications. In addition, the first two million calls are free. The downside of using Cloud Run is that it performs docker run to activate the app, meaning load up times are slowly. You can increase the memory to 2 GB and add an additional CPU (to 2) to make this start-up faster.
@moaiedbetamour6078
@moaiedbetamour6078 Жыл бұрын
Thank you very much for sharing. I am guessing the data used to build the application was sourced from the web through the python code you used from the Streamlit site. What if data lives on your local machine? How will you create the application so that it is reading your data from your local machine? Will you have to create the data file and make it part of the environment project directory?
@FedericoTartarini
@FedericoTartarini Жыл бұрын
Yes you can add a database or a csv inside the project files and directly read the data from there.
@moaiedbetamour6078
@moaiedbetamour6078 Жыл бұрын
@@FedericoTartarini Thank you very much for your feedback. Great video.
@svenbuchholz9862
@svenbuchholz9862 2 жыл бұрын
Hey Federico, whenever I do the gcloud run deploy I get an error: Cloud Run error: Container failed to start. Failed to start and then listen on the port defined by the PORT environment variable. Are you familiar with that error?
@FedericoTartarini
@FedericoTartarini 2 жыл бұрын
Hi, have you followed all the steps, point by point as shown in the video?
@svenbuchholz9862
@svenbuchholz9862 2 жыл бұрын
@@FedericoTartarini Thank you for the quick response! And for the video in general! Yes, I have followed it step by step. I have it all in an environment that I already had with another app.py script. But that should work regardless, at least I thought so hehe. Could that be a problem?
@svenbuchholz9862
@svenbuchholz9862 2 жыл бұрын
@@FedericoTartarini Warning: the config option 'server.enableCORS=false' is not compatible with 'server.enableXsrfProtection=true'. As a result, 'server.enableCORS' is being overridden to 'true'. Could this be the problem? Was shown in the error logs.
@FedericoTartarini
@FedericoTartarini 2 жыл бұрын
Yes it could be. However, unfortunately it is very hard for me to determine what is causing the issue without having a lot at the code.
@faizififita3010
@faizififita3010 Жыл бұрын
Did you ever solve this? I am getting stuck on the same error.
@morris5648
@morris5648 Жыл бұрын
Much has changed in the last two years.
@FedericoTartarini
@FedericoTartarini Жыл бұрын
I should try to record a new video.
@bolluvaagdevi7492
@bolluvaagdevi7492 2 жыл бұрын
can you please let me know how to deploy multipage streamlit app to cloudrun. Thanks in advance. Hoping a response
@FedericoTartarini
@FedericoTartarini 2 жыл бұрын
Hi, I believe that when I uploaded the video the multi page feature was not yet available. I'll need to look into that but I am currently quite busy so it may take me some time. The prices should be quite similar. I don't see why it should be very different.
@easylearning29
@easylearning29 2 жыл бұрын
Gloud is not an internal or external.... Error is there Could you please help me to deploy my streamlit app Which is running properly on localhost but giving error online
@FedericoTartarini
@FedericoTartarini 2 жыл бұрын
Could you please share more information about the error you are getting? Have you followed all the instructions in the video and made sure there are no typos in the config files?
@FedericoTartarini
@FedericoTartarini 2 жыл бұрын
Your latest message was automatically deleted.
@WhiteLemon_Official
@WhiteLemon_Official Жыл бұрын
Thank you for this tutorial!! I wasa able to deploy my app in gcp. However, I am having issue with the app, It just stuck in "please wait".. have you encounter this?
@FedericoTartarini
@FedericoTartarini Жыл бұрын
Yes, sometimes that happens. Just refresh the page and should fix the issue.
@WhiteLemon_Official
@WhiteLemon_Official Жыл бұрын
@@FedericoTartarini thanks matee, it is working now. However, I am encountering a problem with streamlit web socket. my app refresh everytime it reaches the server timeout period of 300sec
@FedericoTartarini
@FedericoTartarini Жыл бұрын
I have not looked into it and maybe you can change that but I believe it is normal
@WhiteLemon_Official
@WhiteLemon_Official Жыл бұрын
@@FedericoTartarini Hello thank you for your reply. I appreciate it. I'm confused, so every user in the web has a certain duration only?? then the server reinitialize??
@WhiteLemon_Official
@WhiteLemon_Official Жыл бұрын
@@FedericoTartarini I think I found the problem. GCP need return a request?? how can I do it?
@ludvigdodi9476
@ludvigdodi9476 Жыл бұрын
Have you any idea how to deploy telegram bot to Cloud Run?
@FedericoTartarini
@FedericoTartarini Жыл бұрын
Sure, you can start by watching this video. The process will be very similar kzfaq.info/get/bejne/oOCngN2Gpqezh58.html
@venkateshch3765
@venkateshch3765 2 жыл бұрын
Error: (gcloud.builds.submit) The user is forbidden from accessing the bucket [ streamlit-app-3******_cloud build].Please check your organization's policy or if the user has the "serviceusage.services.use" Permission How can i solve please help
@FedericoTartarini
@FedericoTartarini 2 жыл бұрын
It means that the account that you are using doesn't have the permission to do that action. You need to activate a gcluod account as shown in the video
@phuongdongcompany
@phuongdongcompany 3 жыл бұрын
Hey, to update the deployed app, what should i do ? rerun the code against ( gcloud builds submit --tag gcr.io/)?
@FedericoTartarini
@FedericoTartarini 3 жыл бұрын
Hi Toan to update the application just re-run the code to build and deploy the application.
Slow motion boy #shorts by Tsuriki Show
00:14
Tsuriki Show
Рет қаралды 10 МЛН
Fast and Furious: New Zealand 🚗
00:29
How Ridiculous
Рет қаралды 45 МЛН
The Biggest Issues I've Faced Web Scraping (and how to fix them)
15:03
Deploy Your AI Streamlit App for FREE | Step-by-Step (Heroku Alternative)
30:10
Alejandro AO - Software & Ai
Рет қаралды 17 М.
Got Google Cloud Certified, bye Streamlit Cloud Deployment !
10:00
Fanilo Andrianasolo
Рет қаралды 2,2 М.
Why The Windows Phone Failed
24:08
Apple Explained
Рет қаралды 238 М.
Run your React app on Google Cloud
16:28
Google Cloud Tech
Рет қаралды 17 М.
Deploy Your Streamlit Web App on Heroku For Free (fast & easy)
9:15
How to Deploy Your App to Streamlit Community Cloud
11:32
Streamlit
Рет қаралды 47 М.
Slow motion boy #shorts by Tsuriki Show
00:14
Tsuriki Show
Рет қаралды 10 МЛН