(core): Normalize hashing algorithm between different OSs
See original GitHub issueThe Question
How can I have the same asset hash when building the stack from different OS? I’m very reluctant to implement a custom hash for the source content but the snapshot test we have will fail when run in the CI container since the snapshot was created on Windows.
Environment
- CDK CLI Version: 1.100.0
- Module Version: 1.100.0
- Node.js Version: v14.16.0
- OS: Windows 10 Pro 19042.928
- Language (Version): ~3.9.7
Other information
For example I have a PythonFunction as belows
new PythonFunction(this, 'TaskMonitoringLambda', {
entry: path.join(__dirname, '..', 'lambda'),
index: 'failed_task_notification.py',
handler: 'push',
runtime: Runtime.PYTHON_3_7,
retryAttempts: this.node.tryGetContext('max_retries'),
memorySize: 128,
functionName: `${machineID}TaskMonitoringLambda`,
assetHashType: AssetHashType.SOURCE, // see https://github.com/aws/aws-cdk/pull/12984
environment: {
'FAILED_TASK_TOPIC': failedTaskTopic.topicArn,
'REGION': this.node.tryGetContext('region'),
'ENV': env
}
})
and the asset hash for this is stable between repeated builds in Windows, despite cleaning out the caches and docker images etc… However the hash produced in Centos container is different.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:8
- Comments:23 (14 by maintainers)
Top Results From Across the Web
General Purpose Hash Function Algorithms - By Arash Partow
A hash value is computed from the constellation of features. This is typically done by initially defining a space where the hash values...
Read more >Analysis of Perceptual Hashing Algorithms in Image ...
In this paper Normalized Hamming Distance (NHD) has been used for all performance analysis. Hamming Distance (HD) is the minimum number of bits ......
Read more >Encryption, hashing, salting: What's the difference and how do ...
Salting involves adding random data before it is put through a cryptographic hash function. It's mostly used to keep passwords safe during ...
Read more >0823-hash-simplification - The Rust RFC Book
The Hash trait is implemented by various types where the H type parameter signifies the hashing algorithm that the impl block corresponds to....
Read more >Implementation and Benchmarking of Perceptual Image Hash ...
a block mean value based image hash function. pHash, an open source im- plementation of various perceptual hash functions, was used to benchmark....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @peterwoodworth, not yet. I should have time to address this before the end of August.
We have the same issue with function resources
NodejsFunction
andPythonFunction
.