-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Containerized Builds with Tilt #6435
Comments
I'd probably try something like:
|
Came to say the same thing. Here's the syncback extension. |
Ah, but syncback says:
This means that every time the developer makes changes to the source code, once This extra manual step makes syncback impractical for any reasonable workflow. Is there a workaround for this, or have we hit a dead-end? |
Noodling on this a bit. Have you played around at all with Buildkit exporters? https://docs.docker.com/build/exporters/#multiple-exporters I might try setting it up like this:
what do you think? (Multiple exporters only came out earlier this year and we haven't added native tilt support yet but they might work really well for this use-case) |
I'm trying to set up a monorepo with multiple microservices for local development using Tilt, and I’ve hit a few roadblocks with live reloading and syncing that I’m hoping you can help with.
Project setup
Example Dockerfile for a Rust Microservice:
The Challenge
While building inside containers is fantastic for keeping the developer's machine clean, I’m running into issues with Tilt’s live reload and syncing features, which seem more geared towards builds happening on the host machine. Here are some of the problems I’ve encountered:
cargo watch
: I run cargo watch inside the container to automatically detect source code changes. I usesync()
inlive_update()
to transfer source files into the container. However:target/
directory) are generated inside the container, andrust-analyzer
on the host machine doesn’t work because it requires access totarget/
to provide its code analysis features.target/
Directory: To resolve this, I triedsync()
ing thetarget/
directory back to the host, but:target/
directory causes any change intarget/
to trigger a live reload, which leads to a continuous loop of rebuilding defeating the purpose of live reloading efficiently.target/
with Kubernetes: I could theoretically mount thetarget/
directory using a Kubernetes volume (hostPath
), but:The Ideal Setup
target/
, should be generated inside the container.target/
: Source files should be synced into the container, andtarget/
should be synced back to the host for tools likerust-analyzer
to function correctly.target/
changes: I need tosync()
target/
back to the host without triggering live reloads whenever thetarget/
directory is updated.Question
How can I approach this setup using Tilt to achieve:
rust-analyzer
on the host with access to thetarget/
directory.target/
directory from container to host, without triggering live reload ontarget/
changes.hostPath
absolute path requirements to make this setup agnostic of engineers’ local directory structures.Am I thinking about this the wrong way altogether?
Looking forward to your thoughts!
The text was updated successfully, but these errors were encountered: