Skip to content
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

Permenant diff #1386

Open
aeweda opened this issue Sep 26, 2024 · 7 comments
Open

Permenant diff #1386

aeweda opened this issue Sep 26, 2024 · 7 comments
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec

Comments

@aeweda
Copy link

aeweda commented Sep 26, 2024

What happened?

i'm facing an issue that's driving me a bit insane, everytime i do a preview or an update all my ecs clusters are marked as changed, specifically task definitions & container definition

i had this issue before but it was contained to container env vars and i was gonna fix it by implementing a deep sort however now it's global

the problem is persistent in ci,local

Example

- Command          : [
-     [0]: "sleep"
-     [1]: "60"
]
- Cpu              : 0
- DependsOn        : [
-     [0]: {
        - Condition    : "START"
        - ContainerName: "gateway"
    }
]
- Environment      : []
- Essential        : false
- Image            : "alpine:latest"
- LogConfiguration : {
    - LogDriver    : "awslogs"
    - Options      : {
        - awslogs-group        : "rx-b6b2f05"
        - awslogs-region       : "us-east-2"
        - awslogs-stream-prefix: "x"
    }
    - SecretOptions: <null>
}
- MemoryReservation: 65
- MountPoints      : []
- Name             : "x"
- PortMappings     : []
- SystemControls   : []
- VolumesFrom      : []
+ command          : [
+     [0]: "sleep"
+     [1]: "60"
]
+ cpu              : 0
+ dependsOn        : [
+     [0]: {
        + condition    : "START"
        + containerName: "gateway"
    }
]
+ environment      : []
+ essential        : false
+ image            : "alpine:latest"
+ logConfiguration : {
    + logDriver: "awslogs"
    + options  : {
        + awslogs-group        : "rx-b6b2f05"
        + awslogs-region       : "us-east-2"
        + awslogs-stream-prefix: "x"
    }
}
+ memoryReservation: 65
+ mountPoints      : []
+ name             : "x"
+ portMappings     : []
+ volumesFrom      : []

Output of pulumi about

CLI          
Version      3.134.1
Go Version   go1.23.1
Go Compiler  gc

Plugins
KIND      NAME     VERSION
resource  aws      6.52.0
resource  awsx     2.16.0
resource  command  1.0.1
resource  docker   4.5.6
resource  docker   3.6.1
language  nodejs   unknown

Host     
OS       ubuntu
Version  22.04
Arch     x86_64

This project is written in nodejs: executable='/home/x/nvm/versions/node/v20.12.2/bin/node' version='v20.12.2'

Additional context

i checked on AWS itself and the task definition is stored as camelCase as it should be, idk why pulumi is comparing with a downstream of PascalCase

also i tried switching to pulumi-aws instead of awsx yet the same problem persisted, i should also mention this problem did not happen 2 days ago

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).

@aeweda aeweda added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Sep 26, 2024
@t0yv0
Copy link
Member

t0yv0 commented Sep 26, 2024

I'm sorry this is not working as expected! There are some subtleties like pulumi/pulumi-aws#4336 where we're normalization logic is not quite complete, we've been working with the upstream provider (Terraform AWS provider) to get this to work better. Unfortunately to make progress on this our team needs a very specific self-contained repro. If you could provide this it would be greatly appreciated!

@t0yv0 t0yv0 added needs-repro Needs repro steps before it can be triaged or fixed and removed needs-triage Needs attention from the triage team labels Sep 26, 2024
@aeweda
Copy link
Author

aeweda commented Sep 29, 2024

Hi, sorry this took a while i had some things i needed to finish and i worked on this during the weekend

repro-repo

i tried to mimic my current deployment without a ton of other extras but i was still able to reproduce it, details are in the readme

@t0yv0 let me know if i can be of further hellp

@t0yv0
Copy link
Member

t0yv0 commented Sep 30, 2024

Thank you!

@t0yv0 t0yv0 added needs-triage Needs attention from the triage team and removed needs-repro Needs repro steps before it can be triaged or fixed labels Sep 30, 2024
@flostadler
Copy link
Contributor

Hey @aeweda, I wasn't able to trigger a perma-diff with the repro you provided. Is there any additional steps/setups needed to trigger this?

@flostadler flostadler added awaiting-feedback Blocked on input from the author and removed needs-triage Needs attention from the triage team labels Oct 1, 2024
@aeweda
Copy link
Author

aeweda commented Oct 1, 2024

@flostadler i just re tried it with a fresh stack / clone of the repo and it's still consistent, here's what i did

  1. clone repo
  2. pnpm install
  3. pulumi stack create org/bug-repro
  4. pulumi stack select org/bug-repro
  5. pulumi up -y
  6. change any true to false in clusters.ts, like Line 11
  7. pulumi up -y
  8. after step 7 you can see that the inbound diff is pascalcase while the outbound is camelcase
    Image

not sure why you can't reproduce it but it's pretty consistent, as i said this is the pascalcase vs camelcase issue.

the perma diff is i'm assuming is related to the fact i have 60 different clusters in my workflow and that could be a factor, but if that pascal/camel issue was fixed i could focus on reproducing the other one as i believe they're somewhat separate

just to clarify something as well, i said perma diff because on my repo it's always showing the pascal vs camel as changes even without changing anything unlike the bug-repro repo

@pulumi-bot pulumi-bot added needs-triage Needs attention from the triage team and removed awaiting-feedback Blocked on input from the author labels Oct 1, 2024
@aeweda
Copy link
Author

aeweda commented Oct 1, 2024

@flostadler i've also been doing some digging and the cloud formation schema linked on aws docs shows the json/yaml config in pascalcase, could it be a recent change or something that broke this?

@flostadler
Copy link
Contributor

Ah ok @aeweda, yes I can reproduce the pascal case vs camel case issue now but not the perma-diff.
Let's tackle the two separately.

Cloudformation uses pascal case (generally, not only for this resource), but we're integrating with the AWS APIs directly. RegisterTaskDefinition shows the props in camel case, so that should be correct.
What's interesting is that this behavior doesn't trigger on a slimmed down example, so it seems like a specific setting is tripping up the normalization logic.
I'll dig deeper to find the root cause for that.

I understand that it's hard to further debug the perma diff on your end with 60 different clusters. Let me know if you have any observations or a hunch what could trigger it, otherwise I'll first focus on getting the pascal case vs camel case diff issue resolved.

@flostadler flostadler self-assigned this Oct 2, 2024
@flostadler flostadler removed the needs-triage Needs attention from the triage team label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

4 participants