Does anyone know how Pulumi detects changes in Lam...
# aws
c
Does anyone know how Pulumi detects changes in Lambda Code? I am seeing a very weird behavior which I have not figured out yet. When doing
pulumi preview...
after the first
pulumi up
there are no changes detected when running it locally. However, when I put it in Azure DevOps pipeline, after I compile the code for a dotnet function and use
FileArchive()
every new compile causes pulumi to see a
change
even though the branch is static and no other commits have occurred. Which my thought process is that Pulumi hashes the folder, since no files have changed the hash should remain the same. Everything should compile exactly the same.
g
Is your Azure Devops agent running on a different OS than running locally? Just a theory, but might be something related to encoding on the source files.
c
Yes technically OS's are different, I am compiling on Mac while the Build Pipeline Compiles the Lambda and Java function between Windows and Linux OS. However, "it shouldn't matter", It works as expected with our Pulumi VPC program however we aren't compiling lambda functions etc. If that was expected then new builds using Azure DevOps should eventually clean itself. Meaning that once a pulumi up was done through the Pipelines, it should in-theory if you build and push another set of artifacts without any code changes, should detect zero changes.
@gentle-diamond-70147 when using
FileArchive
does it utilize File Fully Qualified Path when calculating hash?
w
@chilly-hairdresser-56259 Is it that you see different hashes from different machines running different OSes? I do think that may be the case today - though it would be good to open a GitHub issues with details of what you are seeing so we can look into it.
c
Hard to say to be honest. I can't point my figure on what is causing the issue. Which is why I asked the question on how its being produced. If Path if involved or anything outside the directory. For example /program/ or /docs/program/
w
The bytes of the archive are used for the hash - and that archive may be created on the fly if you don't have a fixed archive involved - which may depend on details of the build environment - though I'm not immediately positive of what aspects of the build environment will get picked up. Definitely if you have a reproducible issue here - please do open an issue as I can believe we may need to make this more robust to operating system level differences in archive creation.