Comments (4)
Hi, thanks for bringing up the issue. It seems that https://gallery.ecr.aws/lambda/python made a release that has issues and should be fixed next release. Until then we have a mitigation. As you can see in the documentation (https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/serverless-apps-run-debug-config-ref.html), there is a field is launch.json sam properties called skipNewImageCheck. Add this to your launch.json and set it to be true. Then you have to manually delete the images on your docker locally, both public.ecr.aws/lambda/python:3.11-rapid-x86_64 and public.ecr.aws/lambda/python:3.11-x86_64. After deleting it, you can then pull an older version of the image on their website, for my example I used public.ecr.aws/lambda/python:3.11.2023.11.18.02-x86_64 (change architecture to match yours). After that you have to retag the image to the x86-64 tag itself. Therefore the command should be docker tag <YOUR IMAGE ID> public.ecr.aws/lambda/python:3.11-x86_64
. After that, running the debugger should work properly.
After running the steps this is what a sample launch.json and docker images
command should output:
{ "configurations": [ { "type": "aws-sam", "request": "direct-invoke", "name": "test", "invokeTarget": { "target": "code", "projectRoot": "hello_world", "lambdaHandler": "app.lambda_handler" }, "lambda": { "runtime": "python3.11", "payload": {}, "environmentVariables": {} }, "sam": { "skipNewImageCheck": true } } ] }
docker images
command ouput:
public.ecr.aws/lambda/python 3.11-x86_64 3e02a31fb67a 2 weeks ago 752MB public.ecr.aws/lambda/python 3.11.2023.11.18.02-x86_64 3e02a31fb67a 2 weeks ago 752MB
Please let me know if you have any questions or any issues still. Thanks
from aws-sam-build-images.
Thank you jysheng123!
I followed the steps and provided the action log for reference
docker_images_updates.txt
I noticed in the (https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/serverless-apps-run-debug-config-ref.html), that we can define for sam the build-image. I have not tested this approach yet and I wonder if you recommend it for specific cases
config will be like
{ "configurations": [ { "type": "aws-sam", "request": "direct-invoke", "name": "test", "invokeTarget": { "target": "code", "projectRoot": "hello_world", "lambdaHandler": "app.lambda_handler" }, "lambda": { "runtime": "python3.11", "payload": {}, "environmentVariables": {} }, "sam": { "skipNewImageCheck": true, "build-image": "http://public.ecr.aws/lambda/python:3.11-x86_64" } } ] }
from aws-sam-build-images.
Hi, well turns out the mitigation will not be needed as the lambda aws team has fixed the issue on their side so your original debugger should be working just fine now, I tested it on mine and it works properly. Let me know if your issue is fixed and in regards to your approach, I don't believe there is a build option in sam for build-image
. If you want to be able to pass in your custom image, I suggest you do something similar to the mitigation I was talking about, as in tag your custom image as the image that it is looking for (in this case public.ecr.aws/lambda/python:3.11-x86_64) then pass in the skipNewImageCheck as True then it should be using that image. Let me know if your debugger is working properly now.
from aws-sam-build-images.
Hi,
1- the mitigation is working for me, thank you!. I did not test the updated image yet
2- in the buildArguments of build option , it points to sam build that has build-image
from aws-sam-build-images.
Related Issues (20)
- Bug: cannot use pycrypto with python3.11 HOT 2
- Possible to update pip in the public.ecr.aws/sam/build-python3.6 build image? HOT 1
- Dockerfile-java11 - Bump maven to 3.9.5 HOT 2
- Bug: build-nodejs20.x requires LD_LIBRARY_PATH= to run SAM CLI commands HOT 1
- Running SAM CLI commands within the Nodejs20.x Build Image HOT 1
- Yarn HOT 1
- Add .NET runtimes HOT 5
- Add YUM to all build images HOT 1
- Missing Yum on Node Build Images HOT 4
- Add Go runtime HOT 1
- Please add rsync to images HOT 8
- Access denied for image pull using latest SAM HOT 3
- Update Go? HOT 2
- Make emulation base images available HOT 2
- What happened with aws-sam-cli-build-image-nodejs16.x HOT 1
- Feature request: Add docker to images HOT 2
- Add node16.x image to docker hub HOT 1
- [Question] enable unit test on Bitbucket Pipelines and using npm/npx HOT 1
- Bug: UseNpmCi broken in build-nodejs18.x:1.85-x86_64 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-sam-build-images.