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

Add ruby support #916

Merged
merged 1 commit into from Dec 13, 2018

Conversation

Projects
None yet
2 participants
@minamijoyo
Copy link
Contributor

minamijoyo commented Nov 30, 2018

Fixes #114

https://aws.amazon.com/about-aws/whats-new/2018/11/aws-lambda-supports-ruby/

$ cd _examples/ruby

$ $GOPATH/bin/apex deploy --dry-run


  + function ruby_simple
    runtime: ruby2.5
    memory: 128
    timeout: 3
    handler: lambda.handler

  + alias ruby_simple
    version: 1
    alias: current

  + function ruby_dependency
    runtime: ruby2.5
    memory: 128
    timeout: 3
    handler: lambda.handler

  + alias ruby_dependency
    alias: current
    version: 1

$ $GOPATH/bin/apex deploy
   • creating function         env= function=simple
   • creating function         env= function=dependency
   • created alias current     env= function=simple version=3
   • function created          env= function=simple name=ruby_simple version=3
   • created alias current     env= function=dependency version=3
   • function created          env= function=dependency name=ruby_dependency version=3
$ $GOPATH/bin/apex invoke simple < event.json
null

$ $GOPATH/bin/apex logs simple --since 5m
/aws/lambda/ruby_simple start simple function
/aws/lambda/ruby_simple START RequestId: dcac4cb2-f46a-11e8-9186-834116da1e63 Version: 3
/aws/lambda/ruby_simple processing event: {"hello"=>"world"}
/aws/lambda/ruby_simple END RequestId: dcac4cb2-f46a-11e8-9186-834116da1e63
/aws/lambda/ruby_simple REPORT RequestId: dcac4cb2-f46a-11e8-9186-834116da1e63  Duration: 7.80 ms       Billed Duration: 100 ms       Memory Size: 128 MB     Max Memory Used: 18 MB
$ $GOPATH/bin/apex invoke dependency < event.json

$ $GOPATH/bin/apex logs dependency --since 5m
/aws/lambda/ruby_dependency start dependency function
/aws/lambda/ruby_dependency START RequestId: f2e98178-f46a-11e8-acbb-910b7838e0fd Version: 3
/aws/lambda/ruby_dependency event.blank?: false
/aws/lambda/ruby_dependency END RequestId: f2e98178-f46a-11e8-acbb-910b7838e0fd
/aws/lambda/ruby_dependency REPORT RequestId: f2e98178-f46a-11e8-acbb-910b7838e0fd      Duration: 2.46 ms       Billed Duration: 100 ms       Memory Size: 128 MB     Max Memory Used: 19 MB
@minamijoyo

This comment has been minimized.

Copy link
Contributor

minamijoyo commented Dec 13, 2018

@tj I'd appreciate it if you could review this.

@tj

This comment has been minimized.

Copy link
Member

tj commented Dec 13, 2018

LGTM! I might not be able to cut a release soon though, I remember I ran into some weird build issues last time, haven't had time to look into it

@tj tj merged commit ff99a6d into apex:master Dec 13, 2018

@@ -20,6 +21,7 @@ func init() {
"main.go": golang.Runtime,
"target/apex.jar": java.Runtime,
"build/libs/apex.jar": java.Runtime,
"lambda.rb": ruby.Runtime,

This comment has been minimized.

@tj

tj Dec 13, 2018

Member

wonder if we should change this to main.rb, unless there's an idiomatic "entrypoint" file name for Ruby stuff (like index.js)

This comment has been minimized.

@minamijoyo

minamijoyo Dec 14, 2018

Contributor

@tj Thank you for reviewing and merging this 😄
Now, this pull request has been already merged, so I've just opened a new issue #922 to discuss a filename.

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