Skip to content

Commit 36b64df

Browse files
authored
Merge branch 'main' into dev
2 parents 2df4bfc + 39bcbc6 commit 36b64df

File tree

4 files changed

+23
-51
lines changed

4 files changed

+23
-51
lines changed

.github/workflows/release_lambda.yml

Lines changed: 12 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Release Lambda layer
33
on:
44
workflow_dispatch:
55
inputs:
6+
version:
7+
description: The version to tag the lambda release with, e.g., 1.2.0
8+
required: true
69
aws_region:
710
description: 'Deploy to aws regions'
811
required: true
@@ -98,7 +101,7 @@ jobs:
98101
aws lambda publish-layer-version \
99102
--layer-name ${{ env.LAYER_NAME }} \
100103
--content S3Bucket=${{ env.BUCKET_NAME }},S3Key=aws-opentelemetry-python-layer.zip \
101-
--compatible-runtimes python3.10 python3.11 python3.12 \
104+
--compatible-runtimes python3.10 python3.11 python3.12 python3.13 \
102105
--compatible-architectures "arm64" "x86_64" \
103106
--license-info "Apache-2.0" \
104107
--description "AWS Distro of OpenTelemetry Lambda Layer for Python Runtime" \
@@ -184,45 +187,13 @@ jobs:
184187
with:
185188
name: layer.tf
186189
path: layer.tf
187-
- name: Commit changes
188-
env:
189-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
190-
run: |
191-
git config user.name "github-actions[bot]"
192-
git config user.email "github-actions[bot]@users.noreply.github.com"
193-
mv layer.tf lambda-layer/terraform/lambda/
194-
git add lambda-layer/terraform/lambda/layer.tf
195-
git commit -m "Update Lambda layer ARNs for releasing" || echo "No changes to commit"
196-
git push
197-
create-release:
198-
runs-on: ubuntu-latest
199-
needs: generate-release-note
200-
steps:
201-
- name: Checkout Repo @ SHA - ${{ github.sha }}
202-
uses: actions/checkout@v4
203-
- name: Get latest commit SHA
204-
run: |
205-
echo "COMMIT_SHA=${GITHUB_SHA}" >> $GITHUB_ENV
206-
SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7)
207-
echo "SHORT_SHA=${SHORT_SHA}" >> $GITHUB_ENV
208-
- name: Create Tag
209-
run: |
210-
git config user.name "github-actions[bot]"
211-
git config user.email "github-actions[bot]@users.noreply.github.com"
212-
TAG_NAME="lambda-${SHORT_SHA}"
213-
git tag -a "$TAG_NAME" -m "Release Lambda layer based on commit $TAG_NAME"
214-
git push origin "$TAG_NAME"
215-
echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_ENV
216-
env:
217-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
218-
- name: Create Release
190+
- name: Create GH release
219191
id: create_release
220-
uses: actions/create-release@v1
221192
env:
222-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
223-
with:
224-
tag_name: ${{ env.TAG_NAME }}
225-
release_name: "Release AWSOpenTelemetryDistroPython Lambda Layer"
226-
body_path: lambda-layer/terraform/lambda/layer.tf
227-
draft: true
228-
prerelease: false
193+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
194+
run: |
195+
gh release create --target "$GITHUB_REF_NAME" \
196+
--title "Release lambda-v${{ github.event.inputs.version }}" \
197+
--draft \
198+
"lambda-v${{ github.event.inputs.version }}" \
199+
layer.tf

lambda-layer/src/Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM public.ecr.aws/sam/build-python3.12 AS python312
1+
FROM public.ecr.aws/sam/build-python3.13 AS python313
22

33
ADD . /workspace
44

@@ -19,6 +19,13 @@ RUN mkdir -p /build && \
1919
chmod 755 /build/otel-instrument && \
2020
rm -rf /build/python/urllib3*
2121

22+
FROM public.ecr.aws/sam/build-python3.12 AS python312
23+
24+
WORKDIR /workspace
25+
26+
COPY --from=python313 /build /build
27+
28+
RUN python3 -m compileall /build/python
2229

2330
FROM public.ecr.aws/sam/build-python3.11 AS python311
2431

lambda-layer/terraform/lambda/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ locals {
55
resource "aws_lambda_layer_version" "sdk_layer" {
66
layer_name = var.sdk_layer_name
77
filename = "${path.module}/../../src/build/aws-opentelemetry-python-layer.zip"
8-
compatible_runtimes = ["python3.10", "python3.11", "python3.12"]
8+
compatible_runtimes = ["python3.10", "python3.11", "python3.12", "python3.13"]
99
license_info = "Apache-2.0"
1010
source_code_hash = filebase64sha256("${path.module}/../../src/build/aws-opentelemetry-python-layer.zip")
1111
}

lambda-layer/terraform/lambda/variables.tf

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
variable "sdk_layer_name" {
22
type = string
33
description = "Name of published SDK layer"
4-
default = "aws-opentelemetry-distro-python"
4+
default = "AWSOpenTelemetryDistroPython"
55
}
66

77
variable "function_name" {
@@ -19,17 +19,11 @@ variable "architecture" {
1919
variable "runtime" {
2020
type = string
2121
description = "Python runtime version used for sample Lambda Function"
22-
default = "python3.12"
22+
default = "python3.13"
2323
}
2424

2525
variable "tracing_mode" {
2626
type = string
2727
description = "Lambda function tracing mode"
2828
default = "Active"
2929
}
30-
31-
variable "enable_collector_layer" {
32-
type = bool
33-
description = "Enables building and usage of a layer for the collector. If false, it means either the SDK layer includes the collector or it is not used."
34-
default = false
35-
}

0 commit comments

Comments
 (0)