Closed andormarkus closed 3 years ago
Source code or timestamp is probably changing, too. If it would be the same, the produced zip archive should also be the same.
Could you please show the debug output as described here with DEBUG2
level?
Hi Anton
Source code does not change because I just trigger a second run on CircleCI. Timestamp is manually overwritten find . -exec touch -t 202001010000 {} \;
˜
Step 4282 and 4277 compiled the deployment package.
As you can see the hash of the source code does not changes. However the has of the package is always changing. Im setting every time in the package as well.
The problem is coming from when you make a pip3 install --quiet --no-deps --target . --requirement requirements.txt
and the package is not pure python package. If the package contains C code like wrapt
package pip will create a .so
. This binary file will be always different and causing the shift of hash
This is how I generate packages
Thanks a lot for the detailed reply, we will take a look at this when one of us has time.
It would be great if we have some var to set the source_code_hash
.
Currently, I have another tool that uploads the code to s3, so I don't use the upload from this module but the s3_existing_package
parameter. In this case, I need to read the hash code from another file that the same tool populates, it's a gitops based deploy.
Without the option to explicitly set the source_code_hash
, the code will never be updated, since the s3 keys don't change either.
The issue is quite the opposite that @andormarkus is facing but with the same solution.
@dpeliss You can set bucket, key, and version_id like in this commented block:
I'll need to update my buckets to be versioned, but this will do the job, thank you @antonbabenko :call_me_hand:
Fixed in #175. Please update the module to use v2.10.0 or newer.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Hi All,
In the current implementation
hash_extra
is only working when the package in created by this module. We are compiling our packages in the CI/CD pipeline and the hash of the .zip file keeps changing however the source code does not change.It would be great if
hash_extra
or similarly named variable would have effect on thelocal_existing_package
as well.Implementation could look like this:
source_code_hash = (var.hash_extra != null ? var.hash_extra : local.filename == null ? false : fileexists(local.filename)) && !local.was_missing ? filebase64sha256(local.filename) : null
Thanks, Andor