I would love to use streamlit for one of our use cases. Cloud options are not allowed for corporate IT requirements.
I will have many single-page apps that will run very infrequently by many different users on many machines around our factory. The rough scale is 40 users infrequently looking at 1 or 2 of 100+ visualizations daily. I would expect changes to these scripts on a weekly basis.
I want very low deployment friction. Having every script run on its own port is just not an option.
Installing and maintaining a streamlit environment on viewer/user machines is not viable/scalable.
Would this work (or is there a better similar solution)?
All streamlet apps live in a folder/folders on the server.
A single streamlit app will run on our server that serves up the table of contents app.
An index/table-of-contents file allows users to pick from one of the many apps using the new multi-page app functionality.
Index file is auto-generated when OS detects file changes (I can write this no-problem).
This way, deployment is as simple as copying a file to a folder. But I’m concerned about:
Will we need to restart the streamlit instance if the index changes?
If a streamlit app is changed while it is being viewed, what happens?
As an aside, I can imagine autogenerating some of these apps using configuration data from our MES.
For what it is worth, I have verified that streamlit detects scripts that are running and have changed on the server. They give a nice prompt offering a reload.
@Chuck_Bass have you managed to build s solution that you like or are you still interested in solutions?
I am currently developing a lightly modified version of streamlit server in order to fulfill some of our requirements for a shared internal deployment server.
I’d be happy to share the code once it’s done, but meanwhile regarding the deployment step… I solved it by forcing users to write their streamlit apps within a function and wrapping it in a custom deploy function.
The deploy function is essentially a streamlit app that gives a menu in the sidebar with a text input for name and button to deploy. When pressed a file is created and copied to the deployment server.
This eliminates the need of copying files to a server.
@PZ1 I’m still looking for a similar way to maintain a package catalog of streamlit apps. If you have any updated instructions I would love to know more.
I am building Clace : Streamlit app deployment platform to solve such use cases. For the original requirement, of installing multiple apps, the way to solve that with Clace would be
The app paths can use a nested structure, like /utils/app1, /genai/myteam/app2 etc. You can also do domain level apps, if DNS is setup, like app1.finance.example.com:/.
Use Overview – Clace to pass environment values for apps as required. At this point all the apps are installed and ready for use. They are lazily initialized on first access.
To do updates. there are multiple ways
Manual updates clace app reload --promote all updates all the apps with the latest code in the branch originally specified during app creation. Glob patterns are supported, to update a set of apps, App Management Overview – Clace.
A cron job could be setup to run the manual update automatically
Updates based on CI. You can setup a github action which updates specific apps when a commit happens. This requires admin API to be enabled over HTTPS Security – Clace, by default only unix domain sockets are enabled for admin APIs.
If using source control other than GitHub, you will have to manually fetch the code onto the server and use a local path during app create. Clace does versioning for local code also, although it cannot keep track of the commit hash and commit message Quick Start – Clace.
If you are making large changes to an app and want to verify whether the change works before making it live, use the staged deployment feature. Run the reload without --promote and then verify the staging env and promote when stage looks good. Application Lifecycle – Clace
Our current solution is now running on k8s and have support for deployments, timed jobs and autoconfigures ingress to applications and provides a fallback to a service. It pulls the application from Gitlab, support different entrypoints and requirements (so you can store multiple applications within the same repo).
Is deploying to kubernetes an option for you ? Can you create a service account with the right permissions for it (creating jobs/pods/services/ingresses within a separate namespace) ? If so I can clean up the code and post it somewhere!
Ola,
Fiz o deploy de um aplicativo no github usando o streamlit. Estava funcionando perfeitamente, quando hoje, apareceu do nada o seguinte erro:
Traceback:
File “/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 565, in _run_script
exec(code, module.dict)File “interface_2.15.py”, line 13, in
st.divider()
^^^^^^^^^^
O código está no seguinte endereço:
calculaonus/interface_2.15.py at main · yroarf/calculaonus (github.com )
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.