-
Notifications
You must be signed in to change notification settings - Fork 2
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
feature: only re-build with pull: true
when base images have changed
#222
Comments
@brettwillis sorry you're running into this. We need some additional information in order to debug the problem:
In general it's very difficult to diagnose issues like this that are sensitive to the build environment, so the more information you can provide the better! |
Sorry yes here's the provider versions from the stack output,
And the relevant part of the program (sorry I should have known to include this in the first place!): const indexerImage = new docker.Image('image-indexer', {
tags: [
pulumi.interpolate`${imageRegistryUrl}/indexer:v${indexerPkg.version}`,
pulumi.interpolate`${imageRegistryUrl}/indexer:latest`,
],
context: {
location: '../service-indexer',
},
platforms: [
'linux/amd64',
],
push: true,
pull: true,
secrets: {
'bun': pulumi.secret(pulumi.interpolate`[install.scopes]\nmyorg = { url = "https://npm.pkg.github.com/", token = "${config.requireSecret('github_packages_token')}" }\n`),
},
}, {
dependsOn: imageRegistry,
deletedWith: imageRegistry,
}); |
@brettwillis ahh I see now, thank you! It's always re-building due to The original thinking behind this behavior was that I'm curious about your use case for pulling, though? And does the reasoning above make sense to you or is it unreasonable? |
@blampe ah yes that seems obvious now when you point it out.
Yeah I imagined something a little different in my mind: when I need to do a rebuild due to actual context changes, then you might as well pull the latest images while you're at it... or when it's been a while since the last build... However I can certainly see the reasoning behind the current behaviour. So maybe what I should be doing instead is specifying the fully-qualified tags of my images in my But yes at least two points of feedback:
|
Yep, that's all super reasonable. One of the aims of the provider has been to stay as close as possible to the native CLI, and this is one area where we're deviating in a surprising way. For example running In other words, we could:
Then, when
That way you would get something much closer to Docker's own behavior -- if your app and remotes are both unchanged nothing happens. |
That sounds like it would be amazing! |
pull: true
when base images have changed
What happened?
pulumi up
always says thecontextHash
has changed, and always rebuilds, only to discover that the output has not changed. Immediately re-running will again say context hash is different, event after refresh etc.Example
pulumi up
diff:Output of
pulumi about
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: