Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A Python Lambda runtime version #13733

Open
imortkz opened this issue Apr 24, 2024 · 5 comments
Open

A Python Lambda runtime version #13733

imortkz opened this issue Apr 24, 2024 · 5 comments
Labels
feature-request Request a new feature functions Issues tied to the functions category

Comments

@imortkz
Copy link

imortkz commented Apr 24, 2024

Amplify CLI Version

12.11.1

Question

The latest Amplify version still generates v3.8 Python runtime, while it will be EOL soon:

We are ending support for Python 3.8 in Lambda on October 14, 2024. This follows Python 3.8 End-Of-Life (EOL) which is scheduled for October, 2024 [1].

As described in the Lambda runtime support policy [2], end of support for language runtimes in Lambda happens in several stages. Starting on October 14, 2024, Lambda will no longer apply security patches and other updates to the Python 3.8 runtime used by Lambda functions, and functions using Python 3.8 will no longer be eligible for technical support. Also, Python 3.8 will no longer be available in the AWS Console, although you can still create and update functions that use Python 3.8 via AWS CloudFormation, the AWS CLI, AWS SAM, or other tools. Starting February 28, 2025, you will no longer be able to create new Lambda functions using the Python 3.8 runtime. Starting March 31, 2025, you will no longer be able to update existing functions using the Python 3.8 runtime.

We recommend that you upgrade your existing Python 3.8 functions to the latest available Python runtime in Lambda before October 14, 2024.

I can manually update the CloudFormation for lambda function to use v3.10 runtime, but it still will create a v3.8 venv.

Is there any plans to upgrade a default Python runtime?

@imortkz imortkz added pending-triage Issue is pending triage question General question labels Apr 24, 2024
@ykethan
Copy link
Contributor

ykethan commented Apr 24, 2024

Hey @imortkz, thank you for reaching, marking this as feature-request to upgrade the default python runtime.
From

await execa.command('pipenv install', { cwd: params.srcRoot, stdio: 'inherit' }); // making virtual env in project folder

you should be able to update the runtime in the CloudFormation template and pip file present in the function to 3.10, then run amplify build function to build the function locally before pushing.

@ykethan ykethan added functions Issues tied to the functions category feature-request Request a new feature and removed question General question pending-triage Issue is pending triage labels Apr 24, 2024
@imortkz
Copy link
Author

imortkz commented May 2, 2024

It's supposed to work for new function only?

Tried that with already deployed Python lambda function, didn't work:

Pipfile.lock (a89a07) out of date, updating to (296d86)...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
✔ Success!
Locking [dev-packages] dependencies...
Updated Pipfile.lock (4575da8dd7dda667a455b5ea8c5b6bf1c2a8fde62a8d4b747ada6e2146296d86)!
Installing dependencies from Pipfile.lock (296d86)...
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
🛑 Could not find a pipenv site-packages directory at /Users/username/.local/share/virtualenvs/function-yFQL_vgG/lib/python3.10/site-packages

Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/

Session Identifier: e4c545fe-1701-4253-8053-da203153cc0f

I guess the problem is that virtualenv was already built for Python 3.8

Can you please recommend steps to migrate function from 3.8 to 3.10 properly?

@ykethan
Copy link
Contributor

ykethan commented May 2, 2024

@imortkz the information is currently documented here: https://docs.amplify.aws/react/build-a-backend/functions/configure-options/#updating-the-runtime
you will need to ensure the python version is installed locally as well for the push to build the function

@softwareengineerprogrammer

@ykethan I am having the same issue, updating the runtime in the cloudformation template json does not appear to be sufficient for python. Can you point us to a guide specifically for python (and not node)?

@hisham
Copy link
Contributor

hisham commented May 13, 2024

+1. Just want to emphasize these dates for the amplify team:

Starting February 28, 2025, you will no longer be able to create new Lambda functions using the Python 3.8 runtime. Starting March 31, 2025, you will no longer be able to update existing functions using the Python 3.8 runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request a new feature functions Issues tied to the functions category
Projects
None yet
Development

No branches or pull requests

4 participants