newrelic / newrelic-lambda-layers

Source code and utilities to build and publish New Relic's public AWS Lambda layers.
https://newrelic.com/products/serverless-aws-lambda
Apache License 2.0
34 stars 42 forks source link

Introduce support for Ruby #214

Closed fallwith closed 1 month ago

fallwith commented 4 months ago

Add content for building and publishing layers for Ruby based Lambda functions. See ruby/README.md for more detailed information.

fallwith commented 4 months ago

I'm ready to share a layer with a customer for beta testing! Thanks again, @mrickard!

Screenshot 2024-03-01 at 7 19 22 PM
mrickard commented 3 months ago

We'll want to make sure the automation is wired up for this.

For running automated tests on push/PR, we currently have GitHub Actions at https://github.com/newrelic/newrelic-lambda-layers/tree/master/.github/workflows ...though this could be made a little more responsive. For example, right now you're getting a lot of unreported status messages, because the changes aren't in the Node repo, and Node tests are skipped. (As they should be for that scenario...but here it presents as incomplete tests.)

Currently the layer publishing jobs are defined in https://github.com/newrelic/newrelic-lambda-layers/tree/master/.circleci/config.yml ...which I'm currently porting to GHA.

The build jobs may need a Dockerfile for Ruby. (If not, great! But Java and Node currently use them.) If so, those are defined in https://github.com/newrelic/newrelic-lambda-layers/tree/master/dockerfiles

I don't expect you'd need to change the makefile, but you may want to take a look there.

fallwith commented 3 months ago

The build jobs may need a Dockerfile for Ruby. (If not, great! But Java and Node currently use them.) If so, those are defined in https://github.com/newrelic/newrelic-lambda-layers/tree/master/dockerfiles

I'm curious about the approach Python takes, as I don't see Dockerfiles for the supported Python runtimes.

For building the Ruby layers, I have made the build script fairly fault tolerant to a Ruby version that doesn't match the supported AWS Ruby Lambda runtime(s) (only Ruby v3.2 at this time), but it would be great to build things using the same Ruby version that we are targetting. If Docker helps with that, I welcome it.

fallwith commented 3 months ago

For building the Ruby layers, I have made the build script fairly fault tolerant to a Ruby version that doesn't match the supported AWS Ruby Lambda runtime(s) (only Ruby v3.2 at this time), but it would be great to build things using the same Ruby version that we are targetting. If Docker helps with that, I welcome it.

Ok, @mrickard. I've added a Ruby Dockerfile (only one because only one Lambda runtime exists) with be426c6.

mrickard commented 2 months ago

@fallwith This is looking good to me! This coming week I should be able to check in a fork, and we can verify built-layer behavior.