-
Notifications
You must be signed in to change notification settings - Fork 104
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
Pulumi updates docker image with no changes even with Awsx.Ecr.Image.CacheFrom set #1293
Comments
Sorry for the trouble @snebjorn. Thanks for opening the issue. This looks like an issue with AWSX (or potentially the docker provider). Transferring this to the AWSX repo and someone will take a look soon. |
@snebjorn there could be several things going on here that make it difficult to diagnose (and I do not have multiple machines to test on). Even though you are running the build in docker, the build environment between builds of the same base image could be different. It might help if you could provide a more complete example including
|
@corymhall I made a small repo that should demonstrate the issue. Again I don't know how to reproduce this on a single machine. However I encountered a related issue. See no image in the ECR $ aws ecr list-images --repository-name ecr-<random-pulumi-id>
{
"imageIds": []
} pulumi refresh $ pulumi refresh
Enter your passphrase to unlock config/secrets
(set PULUMI_CONFIG_PASSPHRASE or PULUMI_CONFIG_PASSPHRASE_FILE to remember):
Enter your passphrase to unlock config/secrets
Previewing refresh (dev):
Type Name Plan
pulumi:pulumi:Stack Pulumi-cache-dev
├─ awsx:ecr:Image docker-image
│ └─ docker:index:Image latest
└─ awsx:ecr:Repository ecr
├─ aws:ecr:LifecyclePolicy ecr
└─ aws:ecr:Repository ecr
Resources:
6 unchanged
Do you want to perform this refresh?
No resources will be modified as part of this refresh; just your stack's state will be.
yes
Refreshing (dev):
Type Name Status
pulumi:pulumi:Stack Pulumi-cache-dev
├─ awsx:ecr:Image docker-image
│ └─ docker:index:Image latest
└─ awsx:ecr:Repository ecr
├─ aws:ecr:LifecyclePolicy ecr
└─ aws:ecr:Repository ecr
Resources:
6 unchanged
Duration: 4s pulumi up $ pulumi up
Enter your passphrase to unlock config/secrets
(set PULUMI_CONFIG_PASSPHRASE or PULUMI_CONFIG_PASSPHRASE_FILE to remember):
Enter your passphrase to unlock config/secrets
Previewing update (dev):
Type Name Plan
pulumi:pulumi:Stack Pulumi-cache-dev
Resources:
6 unchanged
Do you want to perform this update? yes
Updating (dev):
Type Name Status
pulumi:pulumi:Stack Pulumi-cache-dev
Resources:
6 unchanged
Duration: 6s As you can see Pulumi didn't notice the image was gone. But I have set the cache to use the ECR in AWS. After pulumi up was run from a different machine it wanted to update the image again. $ pulumi up
Enter your passphrase to unlock config/secrets
(set PULUMI_CONFIG_PASSPHRASE or PULUMI_CONFIG_PASSPHRASE_FILE to remember):
Enter your passphrase to unlock config/secrets
Previewing update (dev):
Type Name Plan Info
pulumi:pulumi:Stack Pulumi-cache-dev
└─ awsx:ecr:Image docker-image
~ └─ docker:index:Image latest update [diff: ~build]
Resources:
~ 1 to update
5 unchanged
Do you want to perform this update? no
confirmation declined, not proceeding with the update |
Are you able to reproduce this? Do you need any additional information? |
We also have this issue in our team. |
Bumping this issue - seems to occur on my side in a similar manner to OP. |
What happened?
Pulumi wants to update the docker image even though it didn't change
I tried using CacheFrom but to no avail. It still wants to update the image.
Note that it works when you run pulumi from the same machine. However if you switch to a different machine and deploy from that it wants to update the image.
Sometimes it also wants to update on the same machine, but I couldn't reproduce this every time.
Example
Machine A:
Machine B:
Output of
pulumi about
Additional context
For CacheFrom to work you need to docker login to the ecr.
See https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html
It would be neat if Pulumi could handle this docker login
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: