Skip to content

feat: Add support for Ruby 3.2 #76

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

Merged
merged 26 commits into from
May 10, 2023
Merged

Conversation

duncanista
Copy link
Contributor

@duncanista duncanista commented Apr 27, 2023

What does this PR do?

Updates gem to work with Ruby 3.2.

Motivation

AWS posted an image of AWS Lambda for Ruby 3.2 in their ECR gallery. And users have also raised an issue about the gem needed small changes to work.

#70
#74

Testing Guidelines

  • Manual tests
  • Unit tests
  • Integration tests

Additional Notes

  • This PR also allows the user to use the Datadog Lambda Extension to send: logs, metrics, and traces, asynchronously.

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

@duncanista duncanista requested a review from a team as a code owner April 27, 2023 21:27
@joeyzhao2018
Copy link
Contributor

Integration test failed during docker build

0.234 exec /bin/sh: exec format error
#9 ERROR: executor failed running [/bin/sh -c apt-get update]: exit code: 1

I think this is usually from a mismatch between the architectures of the image and the host?
So maybe we just need to provide the architecture param by changing this line to

docker buildx build -t datadog-lambda-layer-ruby:$1 . --no-cache \
        --build-arg "image=lambci/lambda:build-ruby${1}"  \
        --build-arg "runtime=${1}.0" \
        --platform linux/${arch} \

@duncanista duncanista requested a review from a team May 2, 2023 19:02
@duncanista duncanista requested a review from joeyzhao2018 May 2, 2023 20:04
Copy link
Contributor

@astuyve astuyve left a comment

Choose a reason for hiding this comment

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

Awesome job on this Jordan!

duncanista and others added 2 commits May 9, 2023 14:15
Avoid overhead of creating the URL on every invocation of the `extension_running` check

Co-authored-by: Marco Costa <[email protected]>
@duncanista duncanista requested a review from marcotc May 10, 2023 18:03
@duncanista duncanista merged commit 9cc9e82 into main May 10, 2023
@duncanista duncanista deleted the jordan.gonzalez/ruby-3.2-support branch May 10, 2023 19:08

# Run the image by runtime tag, tar its generatd `ruby` directory to sdout,
# then extract it to a temp directory.
docker run --rm datadog-lambda-layer-ruby:$1 tar cf - /opt/ruby | tar -xf - -C $temp_dir
docker run --rm datadog-lambda-ruby-${arch}:$1 tar cf - /opt/ruby | tar -xf - -C $temp_dir
Copy link
Member

Choose a reason for hiding this comment

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

Do we only ship /opt/ruby to the client? Nothing else is needed for the layer? @duncanista

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is correct, since this layer is later merged in the AWS Lambda runtime /opt/ruby, this is enough to make it work!

@duncanista duncanista mentioned this pull request May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants