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.

Bug: markdownlint not supported on ARM

See original GitHub issue

Expected Behaviour

On a clean fetch from develop branch, make pr should work.

both mypy and markdown-cli linter either fail or raise warning.

Current Behaviour

First issue: docker run -v /Users/xxxx/aws-lambda-powertools-python:/markdown 06kellyjac/markdownlint-cli “docs” WARNING: The requested image’s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

I’m running Mac studio M1 (hence the arm64).

Second issue: poetry run mypy --pretty aws_lambda_powertools examples examples/jmespath_functions/src/powertools_custom_jmespath_function.py:4:1: error: Cannot find implementation or library stub for module named “snappy” [import] import snappy ^ examples/jmespath_functions/src/powertools_custom_jmespath_function.py:4:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports examples/jmespath_functions/src/powertools_json_idempotency_jmespath.py: note: In function “handler”: examples/jmespath_functions/src/powertools_json_idempotency_jmespath.py:24:31: error: “Dict[Any, Any]” has no attribute “id” [attr-defined] return {“payment_id”: payment.id, “message”: “success”, “statusCode”: 200} ^ Found 2 errors in 2 files (checked 240 source files) make: *** [mypy] Error 1

Code snippet

make pr

Possible Solution

No response

Steps to Reproduce

make pr

AWS Lambda Powertools for Python version

latest

AWS Lambda function runtime

3.8

Packaging format used

PyPi

Debugging logs

docker run -v /Users/xxxx/aws-lambda-powertools-python:/markdown 06kellyjac/markdownlint-cli "docs"
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
poetry run mypy --pretty aws_lambda_powertools examples
examples/jmespath_functions/src/powertools_custom_jmespath_function.py:4:1: error: Cannot find implementation or library stub for module named "snappy"  [import]
    import snappy
    ^
examples/jmespath_functions/src/powertools_custom_jmespath_function.py:4:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
examples/jmespath_functions/src/powertools_json_idempotency_jmespath.py: note: In function "handler":
examples/jmespath_functions/src/powertools_json_idempotency_jmespath.py:24:31: error: "Dict[Any, Any]" has no attribute "id"  [attr-defined]
            return {"payment_id": payment.id, "message": "success", "statusCode": 200}
                                  ^
Found 2 errors in 2 files (checked 240 source files)
make: *** [mypy] Error 1

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
eldritchideencommented, Oct 3, 2022

@heitorlessa Yes, I have some time in the coming week to take a look at this further.

1reaction
eldritchideencommented, Aug 26, 2022

Just testing this out on my M1 Mac. I’m not sure the issue with markdownlint is what is initially seems.

 % docker run -v /Users/awscook/projects/py/aws-lambda-powertools-python:/markdown 06kellyjac/markdownlint-cli "docs"
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

The container runs okay, Docker on M1 will emulate linux/amd64, it just warns that it is not running an Arm container. The warning can be suppressed by adding --platform linux/amd64 to the docker run command. Eg:

docker run --platform linux/amd64 -v /Users/awscook/projects/py/aws-lambda-powertools-python:/markdown 06kellyjac/markdownlint-cli "docs"

I don’t believe there is an issue here with docker on M1 Macs running the make pr.

However I have discovered, that if I use the container image from https://github.com/igorshubovych/markdownlint-cli I get a different result on both M1 and Linux x86 builds. Replacing the markdownlint-cli in the lint targets of the Makefile with

docker run --platform linux/amd64 -v $PWD:/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "docs"

Finds the following issues with docs.

docs/changelog.md:1:1 MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "comment"] [Context: "[comment]: <> (Includes Change..."]
docs/tutorial/index.md:1044 MD043/required-headings/required-headers Required heading structure [Context: "## Key features"]
docs/utilities/idempotency.md:405:31 MD051/link-fragments Link fragments should be valid [Context: "[@idempotent_function decorator](#idempotentfunction-decorator)"]

This is the same whether running this on my M1 Mac or Linux EC2 instance.

Should we consider changing the markdown-cli container?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Markdown Lint Check - Project Mu - Microsoft Open Source
This supports package relative files, folders, and glob patterns to ignore. These are passed to the markdownlint-cli tool as quoted -i parameters. Linter ......
Read more >
Gitee 极速下载/markdownlint
The CommonMark specification standardizes parsers - but not authors. markdownlint is a static analysis tool for Node.js with a library of rules to...
Read more >
Linting Markdown And Documentation - Earthly Blog
markdownlint is a node.js markdown linter that is easy to install and easy to ... Ignoring and excluding rules are also not fully...
Read more >
#200 - feat/markdownlint - helm-chart - Gitea: Git with a cup of tea
the problem is, that in your CI are only arm64 nodes available. I tried first to build an image for arm with my...
Read more >
Taskade Feedback - Bugs
Report any bugs or issues you may have encountered while using Taskade ... multiple Tasks not showing at same timeslot when it used...
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