question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(core): Normalize hashing algorithm between different OSs

See original GitHub issue

The 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:closed
  • Created 2 years ago
  • Reactions:8
  • Comments:23 (14 by maintainers)

github_iconTop GitHub Comments

3reactions
jogoldcommented, Aug 6, 2021

Hi @peterwoodworth, not yet. I should have time to address this before the end of August.

2reactions
mlippenscommented, Sep 16, 2021

We have the same issue with function resources NodejsFunction and PythonFunction.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found