Giter Site home page Giter Site logo

Comments (4)

jysheng123 avatar jysheng123 commented on June 3, 2024

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.

georgetakla avatar georgetakla commented on June 3, 2024

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.

jysheng123 avatar jysheng123 commented on June 3, 2024

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.

georgetakla avatar georgetakla commented on June 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.