-
Notifications
You must be signed in to change notification settings - Fork 387
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
[AWSX-537] Support python version 3.10 #719
Conversation
8102d49
to
d11a039
Compare
had to use python versions as strings for triggering GH actions |
@@ -1,7 +1,7 @@ | |||
service: forwarder-tests-external-lambda | |||
provider: | |||
name: aws | |||
runtime: python2.7 | |||
runtime: python3.11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this file really used ? I'm surprised in was on 2.X
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
caught that when I was doing the version changes, not sure if it is used.
aws/logs_monitoring/README.md
Outdated
@@ -138,6 +138,10 @@ If you can't install the Forwarder using the provided CloudFormation template, y | |||
|
|||
If you encounter issues upgrading to the latest version, check the Troubleshooting section. | |||
|
|||
### Upgrade an older version to +3.97.0 | |||
|
|||
Since version 3.97.0 the Lambda function has been updated to require **Python 3.11**. If upgrading an older forwarder installation to 3.97.0 or above, ensure the AWS Lambda function is configured to use Python 3.11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems from most other files that we actually support 3.10 and 3.11 which is not really clear in this doc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can update the readme to include both versions, I followed the convention in the readme file
@@ -19,4 +19,3 @@ RUN rm -rf ./botocore* | |||
# like `os.execl`, which cause security scans to fail for certain customers. | |||
# These files are not directly used by the Forwarder. | |||
RUN rm ./ddtrace/commands/ddtrace_run.py | |||
RUN rm ./decorator.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this change ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file not found error was thrown during ITests, it seems it was added during a dependency version bump which created this file.
Now, it is not created, so rm is failing
@@ -12,7 +12,7 @@ set -e | |||
|
|||
OLD_REGION='us-east-1' | |||
|
|||
PYTHON_VERSIONS_FOR_AWS_CLI=("python3.9") | |||
PYTHON_VERSIONS_FOR_AWS_CLI=("python3.11") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we support only one version here ? why an array then ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems we support only the highest version, not sure why
@@ -11,7 +11,7 @@ jobs: | |||
- name: Setup Python | |||
uses: actions/setup-python@v3 | |||
with: | |||
python-version: 3.9 | |||
python-version: '3.10' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we add quotes here?
@@ -8,7 +8,7 @@ jobs: | |||
strategy: | |||
max-parallel: 4 | |||
matrix: | |||
python-version: [3.8, 3.9] | |||
python-version: ['3.9', '3.10'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question, why do we use quotes now ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see actions/runner#1989, same for the above
aws/logs_monitoring/README.md
Outdated
@@ -138,6 +138,10 @@ If you can't install the Forwarder using the provided CloudFormation template, y | |||
|
|||
If you encounter issues upgrading to the latest version, check the Troubleshooting section. | |||
|
|||
### Upgrade an older version to +3.97.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to update the cloudformation template we use to deploy the forwarder to ensure we use Python 3.10 as well
aws/logs_monitoring/setup.py
Outdated
python_requires=">=3.7, <3.10", | ||
install_requires=["datadog-lambda==3.39.0", "requests-futures==1.0.0"], | ||
python_requires=">=3.9, <3.11", | ||
install_requires=["datadog-lambda==4.77.0", "requests-futures==1.0.0"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where's that version change coming from ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required dependency version update to support versions 3.10 -> 3.11
@@ -1,4 +1,4 @@ | |||
FROM python:3.9 | |||
FROM python:3.11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still mentions 3.11 (PR title states 3.10)
@@ -13,7 +13,7 @@ set -e | |||
# Makes sure any subprocesses will be terminated with this process | |||
trap "pkill -P $$; exit 1;" INT | |||
|
|||
PYTHON_VERSIONS_FOR_AWS_CLI=("python3.9") | |||
PYTHON_VERSIONS_FOR_AWS_CLI=("python3.11") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still mentions 3.11 vs 3.10 in title of the PR
Python 3.10 version is seen as 3.1 in github actions. See actions/runner#1989
Support Python version 3.10 for first version bump before adding support for Python 3.11
eaad826
to
b7a1e2c
Compare
- Use the correct python runtime for tester and recorder docker images - Add a health check for the recorder service in the docker-compose file - Update service dependency - Pass the correct python runtime version when bundling the forwarder code for the Itests - Remove unused docker files as we are using the image version in the compose file
What does this PR do?
Support python version 3.10
Motivation
Support request
Testing Guidelines
Additional Notes
This PR adds support for python version 3.10 which requires a higher version for
datadog-lambda
package.The usage of the higher version for that package adds a new field
DD-API-KEY
in the header section of the of the events response forwarded by the function. It also removes the API key string from thepath
parameter.Types of changes
Check all that apply