-
Notifications
You must be signed in to change notification settings - Fork 292
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
Live update without injecting an image #4577
Comments
Thanks for the report! It looks like:
Of course, all decisions are tradeoffs, and it's also annoying to specify the image digest in your config in git and have it automatically bumped when new images are pushed. I just wanted to make sure to bring that up since the discussion here had only covered the speed side of things. I think we'll need to look into this and talk about it a bit. In the meantime, you might be able to work around it with the AlwaysPullImages admission controller |
Re: " Here's what the documentation says:
The problem is that when Tilt manages an image build, it wants to be responsible for getting the image into the container runtime. AFAIR, there are a few different cases where querying the container image registry will end up getting the wrong image into the container runtime, and will lead to incorrect behavior. (There are also performance reasons at play, but they're a bit more nuanced now due to some advancements in layer caching and stargz) |
Since Tilt relies on In different circumstances, how to tag images, whether or not continuously update a tag (can be
|
ya, i've been thinking about this problem. imagePullPolicy: Always will have incorrect behavior with many common image-builders (most notably, Minikube's Docker socket and Kubernetes on Docker for Desktop). Tilt is building directly into the container runtime rather than pushing to an upstream registry, so pulling from the upstream registry won't work right. This matters a lot to us because most of our users use Tilt to build images. file_sync_only does a "fake" no-op image build. So, as a file_sync_only user, breaking image builds doesn't matter, because you're not using it for image builds anyway. The use-case you're describing reminds me of that old xkcd cartoon about "spacebar heating" - https://xkcd.com/1172/. Like, ya, we could add an option that breaks image builds but makes file_sync_only work correctly, but I think the real solution here it to have a file_sync_only API that doesn't rely on fake image builds. does that make sense? |
I'm not pretty sure about this point. If not pushing to a registry (either local or remote), how can a container runtime pull an image built by Tilt? Could you explain more? With Tilt APIs at the moment, I'm not sure how to achieve files sync like |
Haha, yes @ninjaprox ! You're exactly right. I'm suggesting we need to fix the Tilt API to support this As a short-term hack, I wonder if we could special-case Tilt so that if it sees a custom_build that uses ':' like here: |
Yes, that would work too. Compared with the option for whether or not to override |
I updated the issue description to express what we really want from this PR - a way to live-update an image without replacing the image or updating its imagePullPolicy. A couple teams have asked for this and i think i have an idea on how to do it cheaply |
This is the first step towards a general-purpose live-update API that's independent of a general-purpose image build API, and suggests how they might interoperate. Fixes #4577 I played around with a couple different ways to test this effectively, but ultimately, the most valuable test was the file_sync_only integration test we already have. Almost all of our live-update specs are ultimately designed to catch bugs in how we do the live-update, rather than asserting things about the live-update spec itself.
This is the first step towards a general-purpose live-update API that's independent of a general-purpose image build API, and suggests how they might interoperate. Fixes #4577 I played around with a couple different ways to test this effectively, but ultimately, the most valuable test was the file_sync_only integration test we already have. Almost all of our live-update specs are ultimately designed to catch bugs in how we do the live-update, rather than asserting things about the live-update spec itself.
This is the first step towards a general-purpose live-update API that's independent of a general-purpose image build API, and suggests how they might interoperate. Fixes #4577 I played around with a couple different ways to test this effectively, but ultimately, the most valuable test was the file_sync_only integration test we already have. Almost all of our live-update specs are ultimately designed to catch bugs in how we do the live-update, rather than asserting things about the live-update spec itself.
This is the first step towards a general-purpose live-update API that's independent of a general-purpose image build API, and suggests how they might interoperate. Fixes #4577 I played around with a couple different ways to test this effectively, but ultimately, the most valuable test was the file_sync_only integration test we already have. Almost all of our live-update specs are ultimately designed to catch bugs in how we do the live-update, rather than asserting things about the live-update spec itself.
…4768) This is the first step towards a general-purpose live-update API that's independent of a general-purpose image build API, and suggests how they might interoperate. Fixes #4577 I played around with a couple different ways to test this effectively, but ultimately, the most valuable test was the file_sync_only integration test we already have. Almost all of our live-update specs are ultimately designed to catch bugs in how we do the live-update, rather than asserting things about the live-update spec itself.
Describe the Feature You Want
Allow to config
imagePullPolicy
whenever Tilt's managing an image buildCurrent Behavior
imagePullPolicy
is always set toIfNotPresent
Why Do You Want This?
I have a development version of an image, e.g.
example.com/my-app:dev
and usesync_file_only
extension to sync local changes to the container and hot reload the app with new changes in the container without having to restart the pod.sync_file_only
does the trick withcustom_build
(it actually doesn't build anything) for this, which causes Tilt to overrideimagePullPolicy
toIfNotPresent
. When I have some changes inexample.com/my-app:dev
, the container doesn't pull the latest version due toimagePullPolicy: NotIfPresent
.I read through the discussion in #3209. It looks like
Always
is fast enough to use (I tested with a custom Tilt build). According to this documentation,Always
doesn't pull the image if the image digest unchanged.Therefore I'd suggest having the ability to config
imagePullPolicy
or not overriding it toIfNotPresent
.The text was updated successfully, but these errors were encountered: