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
- Install Clace on a server, setup port to 443, setup DNS and then enable TLS certs Ports and Certificates – Clace
- Enable OAuth auth, set the default auth to the OAuth account you want to use App Authentication – Clace
- Setup private GitHub repo access Security – Clace
- Ensure Docker or Podman is running
At this point, you can install any number of Streamlit apps (limited by machine resources). Each app can be installed by doing
clace app create --spec python-streamlit --branch master --approve <repo_path> <app_path>
For example
clace app create --spec python-streamlit --branch master --approve github.com/streamlit/streamlit-example /streamlit1
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