Skip to content

Commit 3252d0f

Browse files
authored
Support Python3.10 runtime for python Lambda Layer (#778)
1 parent c6a7138 commit 3252d0f

File tree

8 files changed

+18
-15
lines changed

8 files changed

+18
-15
lines changed

.github/workflows/pr-python.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
strategy:
2121
matrix:
22-
python: ['3.8', '3.9']
22+
python: ['3.8', '3.9', '3.10']
2323

2424
steps:
2525
- name: Checkout this repo

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ terraform.*
1515
.tox
1616
__pycache__/*
1717
.pyc
18+
build.toml
1819

1920
*.zip

collector/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ package: build
4848

4949
.PHONY: publish
5050
publish:
51-
aws lambda publish-layer-version --layer-name $(LAYER_NAME) --zip-file fileb://$(BUILD_SPACE)/opentelemetry-collector-layer-$(GOARCH).zip --compatible-runtimes nodejs14.x nodejs16.x nodejs18.x java11 python3.8 python3.9 --query 'LayerVersionArn' --output text
51+
aws lambda publish-layer-version --layer-name $(LAYER_NAME) --zip-file fileb://$(BUILD_SPACE)/opentelemetry-collector-layer-$(GOARCH).zip --compatible-runtimes nodejs14.x nodejs16.x nodejs18.x java11 python3.8 python3.9 python3.10 --query 'LayerVersionArn' --output text
5252

5353
.PHONY: publish-layer
5454
publish-layer: package
5555
@echo Publishing collector extension layer...
56-
aws lambda publish-layer-version --layer-name $(LAYER_NAME) --zip-file fileb://$(BUILD_SPACE)/opentelemetry-collector-layer-$(GOARCH).zip --compatible-runtimes nodejs14.x nodejs16.x nodejs18.x java11 python3.8 python3.9 --query 'LayerVersionArn' --output text
56+
aws lambda publish-layer-version --layer-name $(LAYER_NAME) --zip-file fileb://$(BUILD_SPACE)/opentelemetry-collector-layer-$(GOARCH).zip --compatible-runtimes nodejs14.x nodejs16.x nodejs18.x java11 python3.8 python3.9 python3.10 --query 'LayerVersionArn' --output text
5757
@echo OpenTelemetry Collector layer published.
5858

5959
.PHONY: gotidy

python/README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ Scripts and files used to build AWS Lambda Layers for running OpenTelemetry on A
44

55
### Sample App
66

7-
1. Install
8-
* [SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html)
9-
* [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html)
10-
* [Go](https://go.dev/doc/install)
11-
* [Docker](https://docs.docker.com/get-docker)
12-
3. Run aws configure to [set aws credential(with administrator permissions)](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install-mac.html#serverless-sam-cli-install-mac-iam-permissions) and default region.
13-
4. Download a local copy of this repository from Github.
14-
5. `cd python/src`
15-
6. If you just want to create a zip file with the OpenTelemetry Python AWS Lambda layer, then use the `-b true` option: `bash run.sh -n <LAYER_NAME_HERE> -b true`
16-
7. If you want to create the layer and automatically publish it, use no options: `bash run.sh`
7+
1. Install
8+
* [SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html)
9+
* [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html)
10+
* [Go](https://go.dev/doc/install)
11+
* [Docker](https://docs.docker.com/get-docker)
12+
2. Run aws configure to [set aws credential(with administrator permissions)](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install-mac.html#serverless-sam-cli-install-mac-iam-permissions) and default region.
13+
3. Download a local copy of this repository from Github.
14+
4. Navigate to the path `cd python/src`
15+
5. If you just want to create a zip file with the OpenTelemetry Python AWS Lambda layer, then use the `-b true` option: `bash run.sh -n <LAYER_NAME_HERE> -b true`
16+
6. If you want to create the layer and automatically publish it, use no options: `bash run.sh`

python/sample-apps/template.yml

+1
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,6 @@ Resources:
4444
CompatibleRuntimes:
4545
- python3.8
4646
- python3.9
47+
- python3.10
4748
Metadata:
4849
BuildMethod: makefile

python/src/otel/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG runtime=python3.9
1+
ARG runtime=python3.10
22

33
FROM public.ecr.aws/sam/build-${runtime}
44

python/src/template.yml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Resources:
1616
CompatibleRuntimes:
1717
- python3.8
1818
- python3.9
19+
- python3.10
1920
Metadata:
2021
BuildMethod: makefile
2122
api:

python/src/tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
envlist =
33
; opentelemetry-instrumentation-aws-lambda
4-
py3{8,9}-test-instrumentation-aws-lambda
4+
py3{8,9,10}-test-instrumentation-aws-lambda
55

66
minversion = 3.8
77

0 commit comments

Comments
 (0)