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

Support Python version 3.11 on the log forwarder #722

Merged
merged 3 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ['3.9', '3.10']
python-version: ['3.10', '3.11']
steps:
- name: Checkout source
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
python-version: '3.11'

- name: Install pip
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ['3.9', '3.10']
python-version: ['3.10', '3.11']
steps:
- name: Checkout source
uses: actions/checkout@v3
Expand Down
4 changes: 4 additions & 0 deletions aws/logs_monitoring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.99.0

Since version 3.99.0 the Lambda function has been updated to require **Python 3.11**. If upgrading an older forwarder installation to +3.99.0 or above, ensure the AWS Lambda function is configured to use Python 3.11

### Upgrade an older version to +3.98.0

Since version 3.98.0 the Lambda function has been updated to require **Python 3.10**. If upgrading an older forwarder installation to 3.98.0 or above, ensure the AWS Lambda function is configured to use Python 3.10
Expand Down
4 changes: 2 additions & 2 deletions aws/logs_monitoring/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
author="Datadog, Inc.",
author_email="dev@datadoghq.com",
classifiers=[
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
],
keywords="datadog aws lambda layer",
python_requires=">=3.9, <3.11",
python_requires=">=3.10, <3.12",
install_requires=[
"datadog-lambda==4.77.0",
"requests-futures==1.0.0",
Expand Down
4 changes: 2 additions & 2 deletions aws/logs_monitoring/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ Resources:

MemorySize:
Ref: MemorySize
Runtime: python3.10
Runtime: python3.11
Timeout:
Ref: Timeout
Tags:
Expand Down Expand Up @@ -876,7 +876,7 @@ Resources:
Properties:
Description: Copies Datadog Forwarder zip to the destination S3 bucket
Handler: index.handler
Runtime: python3.10
Runtime: python3.11
Timeout: 300
Code:
ZipFile: |
Expand Down
2 changes: 1 addition & 1 deletion aws/logs_monitoring/tools/build_bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ else
VERSION=$1
fi

PYTHON_VERSION="${PYTHON_VERSION:-3.10}"
PYTHON_VERSION="${PYTHON_VERSION:-3.11}"
FORWARDER_PREFIX="aws-dd-forwarder"
FORWARDER_DIR="../.forwarder"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
service: integration-tests
provider:
name: aws
runtime: python3.10
runtime: python3.11

functions:
cache_test_lambda:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

set -e

PYTHON_VERSION="python3.10"
PYTHON_IMAGE="python:3.10"
PYTHON_VERSION="python3.11"
PYTHON_IMAGE="python:3.11"
SKIP_FORWARDER_BUILD=false
UPDATE_SNAPSHOTS=false
LOG_LEVEL=info
Expand Down Expand Up @@ -80,8 +80,8 @@ do
esac
done

if [ $PYTHON_VERSION != "python3.9" ] && [ $PYTHON_VERSION != "python3.10" ]; then
echo "Must use either Python 3.9 or 3.10"
if [ $PYTHON_VERSION != "python3.10" ] && [ $PYTHON_VERSION != "python3.11" ]; then
echo "Must use either Python 3.10 or 3.11"
exit 1
fi

Expand Down
2 changes: 1 addition & 1 deletion aws/logs_monitoring/tools/publish_layers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.10")
PYTHON_VERSIONS_FOR_AWS_CLI=("python3.11")
LAYER_PATHS=(".forwarder/aws-dd-forwarder-${FORWARDER_VERSION}-layer.zip")
AVAILABLE_LAYERS=("Datadog-Forwarder")
AVAILABLE_REGIONS=$(aws ec2 describe-regions | jq -r '.[] | .[] | .RegionName')
Expand Down