Apps deployed on Streamlit Community Cloud reacts only on main app file changes, but not on changes in the py modules
Steps to reproduce
In general when you deploy an app on streamlit cloud, commit-pushes to github are immediately reflected in the deployed app.
This does not seem to be a case when you split your code into modules and you are commit-pushing changes only to one of the modules.
Example: GitHub - TomJohnH/streamlit-game
I’ve observed that change of game_config.py requires app reboot to be reflected in the deployed app.
Obviously, it would be great if all changes were immediately reflected in production. I am not sure if I am the only one experiencing such behavior, or maybe it is expected behavior by design?
After some reasearch: in accordance to this post Streamlit should detect changes in modules. I am really curious is anyone expecting same issue as I do.
I have seen that when deploying to Streamlit Cloud from GitHub.
I experience it too. I use requirements.txt and import a module to the main app.py. Unless it rebooted, the streamlit cant detect the change in module. Have you overcame the issue?
I have to reboot the app too. I thought this was the normal way to make an update to the app actualy. What I think is happening during a reboot is :
- the virtual machine / file system of the app are reinitialized
- Github repo is cloned (with the last code updates)
- requirements are installed
- the app is ready to function again
It doesn’t feel like the app is synchronized in real time to the repo (which would be annoying, as my app creates a personal folder for each new user where they can create/store their own files on the app’s file system. The files remain there between different sessions but they don’t when I reboot. A real-time synchronization with the entire repo’s file system would mean loosing the folders/files created every time the app loads in a browser… Idk, maybe there is a form of synchronization in place to deal with real-time file modification from the repo, but it doesn’t look so.)
I guess the thing to understand is that, when you push a modification to the repo, it only updates the github repo itself, not the cloned one on the app’s file system. Unless you reboot the app to reclone it. What I understand from the post you mention is a different thing. It says that if the modules/main script are modified in the app’s file system, then these changes will take effect immediately at the next rerun (=refresh) of the app in your browser. But a modification of files in the repo doesn’t imply a modification of these (cloned) files in the app’s file system…