How to deploy as a web application? #213
-
Firstly, a big THANK YOU to @ramedina86 for making GUI development fun and efficient again! I am creating a KNN demo for teaching purposes. Initially I tried Anvil (https://knn-demo.anvil.app/). Then Dash on Jupyter. Both experience was so-so. By chance, I came across StreamSync (the pigeon demo) and decided to give it a try. It was AWESOME! I love the separation of UI from backend code and the elegant UI designer. So my KNN demo in StreamSync is now on GitHub (https://github.com/crxi/knn). I am looking for a way to deploy it (like the Anvil version). How do I go about doing that? Do I have to run it in Docker and host it on Google cloud? I am looking for a low-cost solution so that I can let my students interact with it instead of just watching me demo it over Zoom lessons. Any advice is appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 7 replies
-
Hi @crxi, I have developped a blueprint that show on how to use streamsync inside gitpod. gitpod should match your usecase to allow students to start an environment from your code and play with it on a sandbox. If you want to release an application, you have to package it. We don't have option yet to host automatically streamsync project. It's recommended to use it with docker. |
Beta Was this translation helpful? Give feedback.
-
I can open a PR on your repo to implement this mechanism if it may help you. Let me know |
Beta Was this translation helpful? Give feedback.
-
Thanks @crxi that's an incredible compliment! I'm glad you find it useful. I encourage you to try the approach @FabienArcellier mentioned. When I first tried it I couldn't believe how straightforward it was. On Google Cloud (and Azure) you can deploy for free if you size it appropriately, check the free tiers. In the future (few months from now, at least), we'll likely be able to allow users to deploy to our own cloud, using a command like |
Beta Was this translation helpful? Give feedback.
-
Sorry for revisiting an old thread. (Should I start a new Discussion although it is related to the above?) I've recently migrated my mldemo code to Writer Framework (see https://github.com/crxi/mldemo-wr). The migration was easy - thanks to the team for making it so! I've combined the 3 apps into 1 and displayed them in 3 different Tabs. To manage the states, I've simply nested them (main.py):
However, that means in knn.py, I had to do this workaround:
to minimize the changes in my code migration. My question: Is this the best way to handle Tabs and their internal states? Or is there a better/recommended coding pattern/design? |
Beta Was this translation helpful? Give feedback.
Hi @crxi,
That great you find a way to run it on Renders.
I have already noticed this problem in #186 (comment). I did not document it and I did not open an issue to fix it. We use a FastAPI mechanism called lifespan which is incompatible with sub asgi application.
We need to adapt your code to make your program work. Cloud you try that and tell me if it's work fine ?