From 7d151548cf0b0276eac26c7e5cdc32f84bcc342b Mon Sep 17 00:00:00 2001 From: Tung Nguyen Date: Mon, 20 May 2024 19:43:06 +0000 Subject: [PATCH] 0.1.0 init release aws_lambda_ric_jets --- README.jets.md | 12 ++++++++ README.md | 16 +++++----- aws_lambda_ric.gemspec | 47 +++++++++++++++++------------- lib/aws_lambda_ric_jets/version.rb | 4 +++ 4 files changed, 51 insertions(+), 28 deletions(-) create mode 100644 README.jets.md create mode 100644 lib/aws_lambda_ric_jets/version.rb diff --git a/README.jets.md b/README.jets.md new file mode 100644 index 0000000..ce0567c --- /dev/null +++ b/README.jets.md @@ -0,0 +1,12 @@ +## AWS Lambda Ruby Runtime Interface Client Fork + +This fork for the Lambda Ruby RIC only exists until AWS releases an up-to-date version. + +See: https://github.com/aws/aws-lambda-ruby-runtime-interface-client/issues/15#issuecomment-1737318563 + +## Version Strategy + +This fork uses a separate version for its releases to clarify which version it is tracking. + +* [fork version](/lib/aws_lambda_ric_jets/version.rb): This is the fork version of with the renamed gem aws_lambda_ric_jets published to RubyGems. +* [upstream official version]((/lib/aws_lambda_ric/version.rb)): This is not necessarily what's been released on RubyGems, but the version at the point the fork was made from master. Master has the important fixes already. It's the whole reason for this gem. AWS probably need to make some time to test and release the gem. diff --git a/README.md b/README.md index dfb5348..9dbf90a 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,19 @@ ## AWS Lambda Ruby Runtime Interface Client +For the reason for this fork, see: [README.jets.md](/README.jets.md) + We have open-sourced a set of software packages, Runtime Interface Clients (RIC), that implement the Lambda [Runtime API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html), allowing you to seamlessly extend your preferred base images to be Lambda compatible. The Lambda Runtime Interface Client is a lightweight interface that allows your runtime to receive requests from and send requests to the Lambda service. -The Lambda Ruby Runtime Interface Client is vended through [rubygems](https://rubygems.org/gems/aws_lambda_ric). +The Lambda Ruby Runtime Interface Client is vended through [rubygems](https://rubygems.org/gems/aws_lambda_ric). You can include this package in your preferred base image to make that base image Lambda compatible. ## Requirements The Ruby Runtime Interface Client package currently supports Ruby versions: - 2.5.x up to and including 2.7.x - + ## Usage ### Creating a Docker Image for Lambda with the Runtime Interface Client @@ -88,18 +90,18 @@ end ### Local Testing -To make it easy to locally test Lambda functions packaged as container images we open-sourced a lightweight web-server, Lambda Runtime Interface Emulator (RIE), which allows your function packaged as a container image to accept HTTP requests. You can install the [AWS Lambda Runtime Interface Emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator) on your local machine to test your function. Then when you run the image function, you set the entrypoint to be the emulator. +To make it easy to locally test Lambda functions packaged as container images we open-sourced a lightweight web-server, Lambda Runtime Interface Emulator (RIE), which allows your function packaged as a container image to accept HTTP requests. You can install the [AWS Lambda Runtime Interface Emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator) on your local machine to test your function. Then when you run the image function, you set the entrypoint to be the emulator. *To install the emulator and test your Lambda function* -1) From your project directory, run the following command to download the RIE from GitHub and install it on your local machine. +1) From your project directory, run the following command to download the RIE from GitHub and install it on your local machine. ```shell script mkdir -p ~/.aws-lambda-rie && \ curl -Lo ~/.aws-lambda-rie/aws-lambda-rie https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie && \ chmod +x ~/.aws-lambda-rie/aws-lambda-rie ``` -2) Run your Lambda image function using the docker run command. +2) Run your Lambda image function using the docker run command. ```shell script docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 \ @@ -108,9 +110,9 @@ docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 \ /usr/local/bin/aws_lambda_ric app.App::Handler.process ``` -This runs the image as a container and starts up an endpoint locally at `http://localhost:9000/2015-03-31/functions/function/invocations`. +This runs the image as a container and starts up an endpoint locally at `http://localhost:9000/2015-03-31/functions/function/invocations`. -3) Post an event to the following endpoint using a curl command: +3) Post an event to the following endpoint using a curl command: ```shell script curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' diff --git a/aws_lambda_ric.gemspec b/aws_lambda_ric.gemspec index ac356a1..86e0ec1 100644 --- a/aws_lambda_ric.gemspec +++ b/aws_lambda_ric.gemspec @@ -2,39 +2,44 @@ # frozen_string_literal: true -lib = File.expand_path('lib', __dir__) +lib = File.expand_path("lib", __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require './lib/aws_lambda_ric/version' +require "./lib/aws_lambda_ric_jets/version" Gem::Specification.new do |spec| - spec.name = 'aws_lambda_ric' - spec.version = AwsLambdaRuntimeInterfaceClient::VERSION - spec.authors = ['AWS Lambda'] - - spec.summary = 'AWS Lambda Runtime Interface Client for Ruby' - spec.description = 'The AWS Lambda Ruby Runtime Interface Client implements the Lambda programming model for Ruby.' - spec.homepage = 'https://github.com/aws/aws-lambda-ruby-runtime-interface-client' - - spec.license = 'Apache-2.0' - spec.required_ruby_version = '>= 2.5' + spec.name = "aws_lambda_ric_jets" + spec.version = AwsLambdaRicJets::VERSION + spec.authors = ["Tung Nguyen"] + # Original name and authors below for credit. + # They are not maintaining this fork. + # spec.name = 'aws_lambda_ric_jets' + # spec.version = AwsLambdaRicJets::VERSION + # spec.authors = ['AWS Lambda'] + + spec.summary = "AWS Lambda Runtime Interface Client for Ruby" + spec.description = "The AWS Lambda Ruby Runtime Interface Client implements the Lambda programming model for Ruby." + spec.homepage = "https://github.com/aws/aws-lambda-ruby-runtime-interface-client" + + spec.license = "Apache-2.0" + spec.required_ruby_version = ">= 2.5" # Specify which files should be added to the gem when it is released. - spec.files = %w[ + spec.files = %w[ LICENSE README.md Gemfile NOTICE aws_lambda_ric.gemspec bin/aws_lambda_ric - ] + Dir['lib/**/*'] + ] + Dir["lib/**/*"] - spec.bindir = 'bin' + spec.bindir = "bin" # all application-style files are expected to be found in bindir - spec.executables = 'aws_lambda_ric' - spec.require_paths = ['lib'] + spec.executables = "aws_lambda_ric" + spec.require_paths = ["lib"] - spec.add_development_dependency 'bundler', '>= 2.0' - spec.add_development_dependency 'minitest', '~> 5.0' - spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'activesupport', '~> 6.0.1' + spec.add_development_dependency "bundler", ">= 2.0" + spec.add_development_dependency "minitest", "~> 5.0" + spec.add_development_dependency "rake", "~> 13.0" + spec.add_development_dependency "activesupport", "~> 6.0.1" end diff --git a/lib/aws_lambda_ric_jets/version.rb b/lib/aws_lambda_ric_jets/version.rb new file mode 100644 index 0000000..451a133 --- /dev/null +++ b/lib/aws_lambda_ric_jets/version.rb @@ -0,0 +1,4 @@ +# Separate version for the fork to keep it clear +module AwsLambdaRicJets + VERSION = "0.1.0" +end