This brief talk will give a bird's-eye view of the different ways you can deploy a streamlit app as an executable and my personal experience with trying some of them.
I had a built a simple streamlit demo app that uses IndictTrans2 to translate an uploaded document. It was required that the demo be runnable offline. Ideally, by anyone, as a one click desktop executable -- on Linux, Mac and Windows
I explored the following solutions:
Packaging the app into a docker container. This wasn't feasible as it's not always user friendly to install and run docker. Also, the docker image was huge ~12GB
Using nativefier. Can't run offline as we need to upload the app to streamlit share.
Packaging it as an electron app using stlite/pyodide(currently an expiremental project). Did not work for me. The resulting electron app just kept crashing.
Using pyinstaller. Didn't work even after adding relevant hooks. App kept crashing being unable to find metadata/static files. Also, I couldn't do cross compilation on my sole Linux machine (cross compilation support dropped in recent pyinstaller versions). Might have to use their docker images
Found the one method to rule them all and in the executable bind them. This cool starter project https://github.com/Enopios/Enopios uses pyoxidizer to build streamlit into an executable. It also uses poetry for dependency management and a CI workflow to build cross platform releases.
Forked the repo, modified and added dependencies and a few other minor changes to make the build work. Packaged the ct2 model zip separately for the app to load at run time.
Title of the talk
Deploying a streamlit app as an executable
Description
This brief talk will give a bird's-eye view of the different ways you can deploy a streamlit app as an executable and my personal experience with trying some of them.
I had a built a simple streamlit demo app that uses IndictTrans2 to translate an uploaded document. It was required that the demo be runnable offline. Ideally, by anyone, as a one click desktop executable -- on Linux, Mac and Windows
I explored the following solutions:
Forked the repo, modified and added dependencies and a few other minor changes to make the build work. Packaged the ct2 model zip separately for the app to load at run time.
Final result: https://github.com/nagendra-y/Enopios
Executables for Linux, Mac and Windows https://github.com/nagendra-y/Enopios/actions/runs/6978427474
Resources
Slides
https://docs.google.com/presentation/d/1C1fSrIyQ1tIdv3vlisf_3hHb_31hpHyWAtkM-EOIXF8/edit?usp=sharing
What format do you have in mind for your talk?
Talk
Table of contents
What domain would you say your talk falls under?
CLI & Tooling
Duration in minutes (including Q&A)
10mins
Prerequisites
No response
Speaker bio
https://twitter.com/nagendra__y https://in.linkedin.com/in/nagendra-y-a976081a3
Full stack dev. Likes python. Looking for opportunities!
The talk/workshop speaker agrees to
[X] Share the slides, code snippets and other material used during the talk
[X] If the talk is recorded, you grant the permission to release the video on BangPyper's YouTube channel under CC-BY-4.0 license
[X] Not do any hiring pitches during the talk and follow the Code of Conduct