Hi there, is there a way to see how FileArchive is...
# general
s
Hi there, is there a way to see how FileArchive is implemented in Pulumi? I'm trying to upload Lambda to AWS using Pulumi Python and it always shows changes when different developers are doing pulumi up. So I'm wondering what exactly does it hash, e.g. are timestamps considered and so on - I could try to switch to StringAsset but this sounds stupid
b
The Pulumi SDK is open source, you can find the python implementation of FileArchive here: https://github.com/pulumi/pulumi/blob/06ba63bb57e90706c1550861b785075ae860144a/sdk/python/lib/pulumi/asset.py#L99
You'll need to dig around a bit more in the
/sdk/python/lib/pulumi
directory to find how it is used.
s
@bored-oyster-3147 well, I've seen that already thanks but it doesn't help. It seems to be some Python wrapper round allegedly deep Go internals and you can't see what is being done or not done (as in hashed) by just reading the Python SDK code. This is why I'm asking where I could find the real source. Searching Pulumi repositories for "FileArchive" didn't get me far. I only found some Go generator code
b
The SDK components are essentially serialized and sent to the golang side for interpretation and provisioning. So you'd likely need to find where the golang server side code for the file archive is deserialized and handled.
s
Right, that's why I'm asking for pointers here
b
I think you want to search
archive
instead of
filearchive
. I don't think the backend differentiates from the different types of archives much. I have found the following: Some hashing mentioned in the object diffing here: https://github.com/pulumi/pulumi/blob/a5687d16a9d9dfa0c562a10489a88ce2a5986421/pkg/backend/display/object_diff.go#L586 This is an engine event you could trace around to see what its doing: https://github.com/pulumi/pulumi/blob/a5687d16a9d9dfa0c562a10489a88ce2a5986421/pkg/engine/events.go#L506 And another archive handling event for stack deployment: https://github.com/pulumi/pulumi/blob/5528cde977ff1006895ad1a56b089a3ff43a3d90/pkg/resource/stack/deployment.go#L574
s
Hmmm, so my problem is that in the state file, the outputs look like
Copy code
"code": "/tmp/pulumi-asset-049f885f54552ba53ad1a1c8c477c3681be05baf8e6fb7465fc5a2fdf72ffe18"
o_O
b
Might need to open an issue or ping someone on the Pulumi team so that you can get an answer from one of them!
s
b
Gotcha. Ironically that was actually an old coworker of mine lol. Well if you can get your issue reproducible like he did wouldn't hurt to open it back up