diff --git a/.github/workflows/release_lambda.yml b/.github/workflows/release_lambda.yml index 74ceda1ff..01b1d2443 100644 --- a/.github/workflows/release_lambda.yml +++ b/.github/workflows/release_lambda.yml @@ -98,7 +98,7 @@ jobs: aws lambda publish-layer-version \ --layer-name ${{ env.LAYER_NAME }} \ --content S3Bucket=${{ env.BUCKET_NAME }},S3Key=aws-opentelemetry-python-layer.zip \ - --compatible-runtimes python3.10 python3.11 python3.12 \ + --compatible-runtimes python3.10 python3.11 python3.12 python3.13 \ --compatible-architectures "arm64" "x86_64" \ --license-info "Apache-2.0" \ --description "AWS Distro of OpenTelemetry Lambda Layer for Python Runtime" \ @@ -184,16 +184,16 @@ jobs: with: name: layer.tf path: layer.tf - - name: Commit changes - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - mv layer.tf lambda-layer/terraform/lambda/ - git add lambda-layer/terraform/lambda/layer.tf - git commit -m "Update Lambda layer ARNs for releasing" || echo "No changes to commit" - git push +# - name: Commit changes +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# run: | +# git config user.name "github-actions[bot]" +# git config user.email "github-actions[bot]@users.noreply.github.com" +# mv layer.tf lambda-layer/terraform/lambda/ +# git add lambda-layer/terraform/lambda/layer.tf +# git commit -m "Update Lambda layer ARNs for releasing" || echo "No changes to commit" +# git push create-release: runs-on: ubuntu-latest needs: generate-release-note @@ -205,16 +205,16 @@ jobs: echo "COMMIT_SHA=${GITHUB_SHA}" >> $GITHUB_ENV SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7) echo "SHORT_SHA=${SHORT_SHA}" >> $GITHUB_ENV - - name: Create Tag - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - TAG_NAME="lambda-${SHORT_SHA}" - git tag -a "$TAG_NAME" -m "Release Lambda layer based on commit $TAG_NAME" - git push origin "$TAG_NAME" - echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_ENV - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# - name: Create Tag +# run: | +# git config user.name "github-actions[bot]" +# git config user.email "github-actions[bot]@users.noreply.github.com" +# TAG_NAME="lambda-${SHORT_SHA}" +# git tag -a "$TAG_NAME" -m "Release Lambda layer based on commit $TAG_NAME" +# git push origin "$TAG_NAME" +# echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_ENV +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create Release id: create_release uses: actions/create-release@v1 diff --git a/lambda-layer/src/Dockerfile b/lambda-layer/src/Dockerfile index ae13dc5ae..8a4f1f328 100644 --- a/lambda-layer/src/Dockerfile +++ b/lambda-layer/src/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/sam/build-python3.12 AS python312 +FROM public.ecr.aws/sam/build-python3.13 AS python313 ADD . /workspace @@ -19,6 +19,13 @@ RUN mkdir -p /build && \ chmod 755 /build/otel-instrument && \ rm -rf /build/python/urllib3* +FROM public.ecr.aws/sam/build-python3.12 AS python312 + +WORKDIR /workspace + +COPY --from=python313 /build /build + +RUN python3 -m compileall /build/python FROM public.ecr.aws/sam/build-python3.11 AS python311 diff --git a/lambda-layer/terraform/lambda/main.tf b/lambda-layer/terraform/lambda/main.tf index 49cdb762c..be81aac34 100644 --- a/lambda-layer/terraform/lambda/main.tf +++ b/lambda-layer/terraform/lambda/main.tf @@ -5,7 +5,7 @@ locals { resource "aws_lambda_layer_version" "sdk_layer" { layer_name = var.sdk_layer_name filename = "${path.module}/../../src/build/aws-opentelemetry-python-layer.zip" - compatible_runtimes = ["python3.10", "python3.11", "python3.12"] + compatible_runtimes = ["python3.10", "python3.11", "python3.12", "python3.13"] license_info = "Apache-2.0" source_code_hash = filebase64sha256("${path.module}/../../src/build/aws-opentelemetry-python-layer.zip") } diff --git a/lambda-layer/terraform/lambda/variables.tf b/lambda-layer/terraform/lambda/variables.tf index 7f1c5386e..8fdb7193b 100644 --- a/lambda-layer/terraform/lambda/variables.tf +++ b/lambda-layer/terraform/lambda/variables.tf @@ -1,7 +1,7 @@ variable "sdk_layer_name" { type = string description = "Name of published SDK layer" - default = "aws-opentelemetry-distro-python" + default = "AWSOpenTelemetryDistroPython" } variable "function_name" { @@ -19,7 +19,7 @@ variable "architecture" { variable "runtime" { type = string description = "Python runtime version used for sample Lambda Function" - default = "python3.12" + default = "python3.13" } variable "tracing_mode" { @@ -27,9 +27,3 @@ variable "tracing_mode" { description = "Lambda function tracing mode" default = "Active" } - -variable "enable_collector_layer" { - type = bool - 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." - default = false -}