feat: use python binary as a resource instead of a sidecar#74
Conversation
|
Nice! I was imagining a world where we ship the binary as a sidecar but the shared libraries as resources. With this approach do we lose Tauri’s process supervision? In other words do we need to clean up the resources used by our Python process such as sockets, and do we need to monitor and restart it ourselves if it fails? Also I agree we should not fire AI interactions on select, we should have a way for the user to trigger the interactions either in the editor or the sidebar or both. |
I don't believe so since we're ultimately still using the same command api, but agree we should get some clarity on the tradeoffs between this approach and the sidecar. |
…resource_tracker-import-main
|
Answers from the Tauri team on my questions above: Do we have to include the target-triple in the filepath? How do we bundle resources for other OS using this pattern? I was only able to get this working by specifying the full path, including the target-triple.
Since we are all using Macs and not checking in the binary, we will likely need CI/CD to build it for us anyway. So in this case, we shouldn't have to worry about the target-triple and should be able to have the following Does using the binary as a resource vs a sidecar change anything about how we have to manage the underlying processes? Do we need to clean up the resources used by our Python process such as sockets, and do we need to monitor and restart it ourselves if it fails?
|
…resource_tracker-import-main
…resource_tracker-import-main
This PR no longer creates the python binary in
--onefilemode, which is why the binary is so slow, and instead we now use the default--onedirmode.For this to work with Tauri, we cannot bundle the binary as a sidecar and instead need to add it as a resource.
The first call to the binary is still fairly slow, but subsequent calls are much quicker. We can probably warm up the binary on app startup with a simple "hello world" command.
Open Questions
interactWithAicommand fires, so that we aren't firing so many of them?scopeseven if the underlying cmd will be the same?Screen.Recording.2023-06-01.at.2.42.16.PM.mov