-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 Ruby2.5 runtime support #3725
Conversation
Thanks for this contribution! Two comments:
Following the email we can propose creating a repository to accept the runtime into a new repository. |
@@ -0,0 +1 @@ | |||
FROM openwhisk/action-ruby-v2.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With #3680 we won’t need this (and can remove all the others like it).
cc @csantanapr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I will see for how #3680 goes then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't canceled this change yet since it looks like Dockerfile and build.gradle files in the actionRuntime/ folder still remains for other language runtimes while #3680 has been merged
docs/parameters.md
Outdated
@@ -25,7 +25,7 @@ This page outlines how to configure parameters when deploying packages and actio | |||
|
|||
### Passing parameters to an action at invoke time | |||
|
|||
Parameters can be passed to the action when it is invoked. These examples use JavaScript but all the other languages work the same way (see documentation on [Swift actions](./actions.md#creating-swift-actions), [Python actions](./actions.mdcreating-python-actions), [Java actions](./actions.mdcreating-java-actions), [PHP actions](./actions.mdcreating-php-actions), [Docker actions](./actions.mdcreating-docker-actions) or [Go actions](./actions.mdcreating-go-actions) as appropriate for more detailed examples). | |||
Parameters can be passed to the action when it is invoked. These examples use JavaScript but all the other languages work the same way (see documentation on [Swift actions](./actions.md#creating-swift-actions), [Python actions](./actions.mdcreating-python-actions), [Java actions](./actions.mdcreating-java-actions), [PHP actions](./actions.mdcreating-php-actions), [Ruby actions](./actions.md#creating-ruby-actions), [Docker actions](./actions.mdcreating-docker-actions) or [Go actions](./actions.mdcreating-go-actions) as appropriate for more detailed examples). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This list will just keep getting longer. Perhaps we should provide just one reference to the index above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated accordingly.
docs/reference.md
Outdated
@@ -434,6 +434,14 @@ The following Composer packages are also available: | |||
- guzzlehttp/guzzle v6.3.0 | |||
- ramsey/uuid v3.6.1 | |||
|
|||
## Ruby actions | |||
|
|||
Ruby actions are executed using Ruby 2.5. To use this runtime, specify the `wsk` CLI parameter `--kind ruby:2.5` when creating or updating an action. This is the default when creating an action with file that has a `.rb` extension. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You’ll have modified the cli then to recognize this extension. I have an alternate proposal here: apache/openwhisk-cli#286
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I will keep my eyes open on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs/reference.md
Outdated
|
||
A few Ruby gems such as `mechanize` and `jwt` are available in addition to the default and bundled gems. See Dockerfile of ruby runtime image for more information. | ||
|
||
Last but not least, you can use arbitrary gem so long as you use zipped actions to package all the dependencies. doc/actions.md will explain how to do this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
settings.gradle
Outdated
@@ -28,6 +28,7 @@ include 'actionRuntimes:swift3.1.1Action' | |||
include 'actionRuntimes:swift4.1Action' | |||
include 'actionRuntimes:javaAction' | |||
include 'actionRuntimes:php7.1Action' | |||
include 'actionRuntimes:ruby2.5Action' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@csantanapr we can also drop all of these I think.
@rabbah Thanks for catching this up. I have just sent an email to |
docs/parameters.md
Outdated
@@ -25,7 +25,7 @@ This page outlines how to configure parameters when deploying packages and actio | |||
|
|||
### Passing parameters to an action at invoke time | |||
|
|||
Parameters can be passed to the action when it is invoked. These examples use JavaScript but all the other languages work the same way (see documentation on [Swift actions](./actions.md#creating-swift-actions), [Python actions](./actions.mdcreating-python-actions), [Java actions](./actions.mdcreating-java-actions), [PHP actions](./actions.mdcreating-php-actions), [Docker actions](./actions.mdcreating-docker-actions) or [Go actions](./actions.mdcreating-go-actions) as appropriate for more detailed examples). | |||
Parameters can be passed to the action when it is invoked. These examples use JavaScript but all the other languages work the same way (see documentation on [this page](./actions.md) as appropriate for more detailed examples). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for more details examples ... that are language specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
@@ -0,0 +1,408 @@ | |||
/* | |||
* Licensed to the Apache Software Foundation (ASF) under one or more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will also go with #3467.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I will remove this once #3467 get merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed this with 3cc287c
@@ -0,0 +1,2 @@ | |||
ext.dockerImageName = 'action-ruby-v2.5' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this also becomes unnecessary - same comment as dockerfile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it🙋
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as this applies here
"kind": "ruby:2.5", | ||
"default": true, | ||
"deprecated": false, | ||
"image": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with #3680, the image prefix and tag should be specified explicitly (to openwhisk
and latest
respectively).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
made a change as a result of #3680
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed prefix
and name
temporarily to workaround the build failure. (thank you @rabbah for the quick advice to fix this)
Travis CI was kicking up the following error in apache#3725 ``` Scan detected 1 error(s) in 1 file(s): [/home/travis/build/apache/incubator-openwhisk/tools/travis/../../actionRuntimes/ruby2.5Action/build.gradle]: 1: file does not include required license header. Scan detected 1 error(s) in 1 file(s): ``` Super easy fix, thought I'd help you out. Thanks for working on Ruby runtime support!
Codecov Report
@@ Coverage Diff @@
## master #3725 +/- ##
=========================================
- Coverage 75.9% 71.21% -4.7%
=========================================
Files 147 147
Lines 7048 7048
Branches 422 422
=========================================
- Hits 5350 5019 -331
- Misses 1698 2029 +331
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both noted PRs are now committed eschewing several files in this PR.
b9699cf
to
9032997
Compare
@remore i squashed and rebased this to master to resolve a new conflicts with docs i updated. @csantanapr we'll need to document the examples to be included here for system tests; should we just test a hello world here and defer the rest (including unicode) to the runtime tests? |
d1de77f
to
c46c3ad
Compare
@remore @csantanapr I rebased this to pick up the latest refactoring. |
docs/actions.md
Outdated
@@ -54,13 +54,14 @@ the [Docker](docker-actions.md) action or [native binary](docker-actions.md#crea | |||
paths more suitable. Multiple actions may be composed together to create a longer processing pipeline called a | |||
[sequence](#creating-action-sequences). A more advanced form of composition is described [here](conductors.md). | |||
|
|||
* [JavaScript](actions-node.md) | |||
* [Python](actions-python.md) | |||
* [Go](actions-go.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akrabat @csantanapr I reordered these alphabetically (but keeping docker actions last). FYI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alphabetical ordering makes sense to me.
c46c3ad
to
270f44f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually we will need a hello.rb files under tests/dat/actions.md for the automated system tests (that will be added).
it would be nice to automatically extract the example from the doc and turn it into a test :)... not for this pr
f367e6f
to
02fb9e5
Compare
Looks like this PR is almost ready to go but the doc re-org needs the Ruby action details in a separate markdown file now? @remore are you able to do this small change and we can get it merged? |
@jthomas we need to do a couple of things apart form updating this pr:
|
Yes for sure, I have just made a few changes to get everything organized in the ruby-actions.md.
Here is the log output of test code which is executed in my laptop with the latest code today just FYI @rabbah
I'm willing to proceed with these steps only if I'm eligible. If so, please let me know. |
There some conflicts to resolve on the PR. |
@remore I opened 3 issues against the ruby repo that we’ll need to also address. |
2ac254e
to
f273f0b
Compare
@rabbah the conflict has been fixed. I will take a look at those issues. |
f273f0b
to
49154d7
Compare
FYI: I have just squashed as well to make both git tree view and log messages cleaner. (I have just realized that my commit messages were not following comment message convention here. My apologies.) |
Repository requested: https://issues.apache.org/jira/browse/INFRA-16764 |
https://github.com/apache/incubator-openwhisk-runtime-ruby repo is now available. |
The first PR has been sent: |
@remore we (@csantanapr or i) will be fixing the travis publishing step in the ruby repo shortly. and go ahead and change the image prefix s/remore/openwhisk - travis will fail for now but i'll rebuild it when the image is published. this gets the PR ready for merging. |
ansible/files/runtimes.json
Outdated
"deprecated": false, | ||
"image": { | ||
"prefix": "remore", | ||
"name": "openwhisk-runtime-ruby", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the image name should be action-ruby-v2.5 per the naming convention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ansible/files/runtimes.json
Outdated
"default": true, | ||
"deprecated": false, | ||
"image": { | ||
"prefix": "remore", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go ahead and change this image prefix to openwhisk.
49154d7
to
0889a48
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@remore I went ahead and made the changes.
0889a48
to
b6b3176
Compare
@rabbah Thank you for going ahead about this.
Can't wait to see that happen. |
image now published to dockerhub https://hub.docker.com/r/openwhisk/action-ruby-v2.5 (thanks @csantanapr). |
b6b3176
to
95a4414
Compare
Great to see this merged. 💯 |
This PR adds a new ruby:2.5 kind to allow Ruby methods like this:
Description
This PR is quite similar to #2415, but this time I did it in Ruby. I do believe there are certain number of developers who'd love to pick Ruby as a primary language (see #2046 for an instance).
Currently Ruby runtime is tentatively hosted at remore/openwhisk-runtime-ruby, but needless to say I'd love to move/transfer this to anywhere The Apache Software Foundation manage.
Related issue and scope
#2046 is most likely related
My changes affect the following components
Types of changes
Checklist: