Hi,

This email is follow-up from #3725 which proposes Ruby2.5 runtime addition.
https://github.com/apache/incubator-openwhisk/pull/3725

> (perhaps including a small example on how to try it)
Here is a quick introduction on how to use and test this runtime. Excuse me
in advance for a little bit awkward installation step, I guess there would
be better way to do this with fewer steps.

```
# 1. Setting up both openwhisk and openwhisk-runtime-ruby
git clone https://github.com/remore/incubator-openwhisk.git
cd incubator-openwhisk
git checkout origin/add-ruby-as-a-kind
cd tools/vagrant
./hello  # fail here because pulling image from openwhisk/action-ruby-v2.5
is not possible yet
vagrant ssh
git clone https://github.com/remore/openwhisk-runtime-ruby.git
cd openwhisk-runtime-ruby/core/ruby2.5Action/
docker build -t action-ruby-v2.5 -t whisk/action-ruby-v2.5
openwhisk/action-ruby-v2.5 .
exit  # go back to the host machine
vagrant provision  # resume installation

# 2. Creating a ruby action
vagrant ssh
cd openwhisk-runtime-ruby
echo -e "def main(param)\n  {result: param}\nend" > my_action.rb
wsk action update myAction my_action.rb --docker whisk/action-ruby-v2.5
./gradlew core:ruby2.5Action:distDocker

# 3. Try it out
wsk action invoke myAction --result -p message hello

# 4. Test it
cd ../openwhisk && ./gradlew install && cd ../openwhisk-runtime-ruby
./gradlew :tests:test --tests *actionContainers.Ruby25ActionContainerTests*
```

Best,
Kei

Reply via email to