rubenf
rubenf2mo ago

Full Recompilation every unique run

it should be stored on cache
20 Replies
metapontum
metapontum2mo ago
If you load the default rust script, and change one letter of a println, and test the script, it compiles from the start
rubenf
rubenf2mo ago
yes that's normal
metapontum
metapontum2mo ago
Typically it does not rebuild all of the crates from the beginning as that takes minutes of compilation time per minor change for any sophisticated project Locally the same changes im making are taking a few seconds to prepare
rubenf
rubenf2mo ago
yes but locally you have a cache in target that is unique to your project once rust has an efficient global cache we can use that but it doesn't and sscache is a bit complicated for now we only cache the deployed bin windmill is not yet the place one should iterate on for rust, only deploy
metapontum
metapontum2mo ago
Imo it severely limits the usefulness of rust scripts, since doesn't make sense to develop in-app, and at that point might as well load and run the binary instead
rubenf
rubenf2mo ago
I agree, it's more of a way to benefit from the other ability of having windmill managing your sources easy review and diff, hash versioning, integrates with the CLI, etc loading a bin with init script is way more inconvenient than using our rust integration rust support is early and it's not a big enough business yet that we can spend too many cycles on this. Once we have enterprises users on it, we may be able to refine it more
metapontum
metapontum2mo ago
Hmm, all I know is I had a lot of use-cases for it which all disappeared due to that small detail. Others might end up with the same problems & not utilize rust as a result. So it might not end up being popular enough to seem worth refining In my case, I was deploying a finished, already working script, but naturally there was a error caused by the worker's container. Spent ~4 hours making changes, waiting for it to recompile everything and run, making changes, recompile, etc. Would be more feasible to do all of it locally and make a script for automatically providing binary to workers
rubenf
rubenf2mo ago
I understand the frustration but we do not have the resources to solve that right now, we're happy to take contribution to improve the incremental compilation ability of the workers usually enterprise customers will let us know first the contract value, then ask us to solve it so it's easier to budget for it
metapontum
metapontum2mo ago
I'm just providing my experience in case it helps
rubenf
rubenf2mo ago
https://github.com/mozilla/sccache this is likely what would need to be used on every worker to solve your pain
GitHub
GitHub - mozilla/sccache: Sccache is a ccache-like tool. It is used...
Sccache is a ccache-like tool. It is used as a compiler wrapper and avoids compilation when possible. Sccache has the capability to utilize caching in remote storage environments, including various...
metapontum
metapontum2mo ago
do workers have a folder that persists throughout jobs?
rubenf
rubenf2mo ago
everything but the job dir persists
rubenf
rubenf2mo ago
you can vote for it with a 👍
metapontum
metapontum2mo ago
@rubenf spent a few hours experimenting and trying to get rust to use sccache, but it seems to disregard env variables, Cargo.toml doesn't seem to be able to override it either
metapontum
metapontum2mo ago
It feels really close
rubenf
rubenf2mo ago
I really think you would have an easier time modifying our sources directly
rubenf
rubenf2mo ago
GitHub
windmill/backend/windmill-worker/src/rust_executor.rs at main · win...
Open-source developer platform to turn scripts into workflows and UIs. Fastest workflow engine (5x vs Airflow). Open-source alternative to Airplane and Retool. - windmill-labs/windmill
metapontum
metapontum2mo ago
Any pointers for where to look? I may give it a h- Epic
rubenf
rubenf2mo ago
windmill is pretty easy to run from sources