Skip to content

Conversation

@florentinl
Copy link
Contributor

@florentinlflorentinl commented Aug 18, 2025

What does this PR do?

This PR changes the base image for the layer creation process.

Instead of using the generic python image (docker/library/python based on debian), I suggest using the lambda python image (lambda/python based on AL2 or AL2023 depending on python3 version).

Motivation

ddtrace contains native dependencies which enforce a minimal version of glibc set by the version found at build time.
This means that the glibc version of the build image must be the same as (or older than) the glibc version of the runtime image.

When pushing wheels to PyPi, the dd-trace-py compiles native dependencies for the manylinux2014 target which uses an old version of glibc (2.17).

With the release of Debian Trixie last week, all python have now a newer version of glibc than Amazon Linux 2023 (2.34) and executing a function with a layer built from source for python3.13 yields the following error

 Runtime.ImportModuleError: Unable to import module 'datadog_lambda.handler': /lib64/libc.so.6: version `GLIBC_2.38' not found (required by /opt/python/lib/python3.13/site-packages/ddtrace/internal/native/_native.cpython-313-x86_64-linux-gnu.so) 

By building on the same image used by the runtime, we ensure the binary compatibility.

Testing Guidelines

All builds in the CI and snapshot tests pass.

Additional Notes

This is a blocker for the enabling system-tests for lambda: https://github.com/DataDog/system-tests/actions/runs/17033940078/job/48282245449?pr=4891#step:91:105

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)

@florentinlflorentinlforce-pushed the florentinl/fix-glibc-compat branch 2 times, most recently from 4f8a701 to 3f57731CompareAugust 18, 2025 12:22
@florentinlflorentinlforce-pushed the florentinl/fix-glibc-compat branch from 3f57731 to 6c8e28fCompareAugust 18, 2025 13:35
@florentinlflorentinl changed the title build: use lambda image to build to ensure GLIBC version compatbuild: use lambda image to ensure ABI compatibility when building from sourceAug 18, 2025
@florentinlflorentinl changed the title build: use lambda image to ensure ABI compatibility when building from sourcebuild: use lambda image to ensure binary compatibility when building from sourceAug 18, 2025
@florentinlflorentinl marked this pull request as ready for review August 18, 2025 13:56
@florentinlflorentinl requested review from a team as code ownersAugust 18, 2025 13:56
Copy link
Contributor

@purple4reinapurple4reina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's be sure to add the docker tag before merging.

@florentinlflorentinlforce-pushed the florentinl/fix-glibc-compat branch from b7c84ea to 62693deCompareAugust 20, 2025 07:45
@florentinl
Copy link
ContributorAuthor

/merge

@dd-devflow-routing-codex
Copy link

dd-devflow-routing-codexbot commented Aug 20, 2025

View all feedbacks in Devflow UI.

2025-08-20 07:46:27 UTC ℹ️ Start processing command /merge


2025-08-20 07:46:32 UTC ℹ️ MergeQueue: waiting for PR to be ready

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2025-08-20 07:52:13 UTC ℹ️ MergeQueue: merge request added to the queue

The expected merge time in main is approximately 0s (p90).


2025-08-20 08:31:36 UTC ℹ️ MergeQueue: This merge request was already merged

This pull request was merged directly.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@florentinl@purple4reina