12@1.14.0-incubating
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEE/iDNm7hL3CLbiTzQIpBwZBR/iG4FAl0cylQACgkQIpBwZBR/
iG7n6xAA0GGminQ+6JtEBlBlv0L9MOAeEEzo3aNyf1T/g8mjCqWJ1klOs+vuHbn9
5ECU9Tj9ZZ3Dlp6jCmNV8WBcFJnPp1bMmoBTYIVMsgGpyvBr88jX0qNnsoo+6ZUx
tfRXSPuBG8AH7KZOXSe9Frf1UTYl5qL8oDxr2g8toI52OHkU4O8L88fXQc05zLpQ
y1cLeoEwhncNshH5B1WKhdMckm4pKBmfgyXpzFvbxapprHC2iLA+4/nZWYGR4J8i
KtgsTyF8wUjaoGYsBF7Og40/2eJ46OSHiqO4hXF1juL0p3rKi/mU+bACo6ybsEZv
7GB0vnfJD9Wc2Hhc014iOqEkso7LSQeQHf5TDs2nSC5uE51/cVDzgVRx1DSPjgXt
rIh5Ne9fIx1ESpXU3+jlj5ZfbK3E2BhIJCVVS1e++SGsV180xSklk/R5Qv+unq7g
KbOmrJ5AXtORuB5JFP8/MkANsbImAo7YmIoDymKC049pcDvzw4i9eRA3nhMCeL4r
pdAqTWBT6PKB+zQ7x5vCbeO0fhYEkJ2RNhKSIfmzoimbn8My7rsTvKXNDxhosSLU
Z6gF3fHjS4XBJ0vpSyZrKU6wouosTT2g9hC1S4pu3BHWlptTPkolTuRuEl2eENUq
ibDW8eIEdxA9tUVyNpIC6+s4+JLiSPpzanljpBm0MUZYvxrUJjY=
=UiGe
-----END PGP SIGNATURE-----
Remove deadcode. (#129)

1 file changed
tree: a8326a0833801a3bdbd8158b7773ce326491f1c0
  1. .gitattributes
  2. .github/
  3. .gitignore
  4. .scalafmt.conf
  5. .travis.yml
  6. CONTRIBUTING.md
  7. DISCLAIMER.txt
  8. LICENSE.txt
  9. NOTICE.txt
  10. README.md
  11. build.gradle
  12. core/
  13. gradle/
  14. gradlew
  15. gradlew.bat
  16. settings.gradle
  17. tests/
  18. tools/
README.md

Apache OpenWhisk runtimes for Node.js

License Build Status

This repository contains sources files needed to build the Node.js runtimes for Apache OpenWhisk. The build system will produce a series of docker images for each runtime version. These images are used in the platform to execute Node.js actions.

The following Node.js runtime versions (with kind & image labels) are generated by the build system:

  • Node.js 6.17.1 (nodejs:6 & openwhisk/nodejs6action)
  • Node.js 8.16.0 (nodejs:8 & openwhisk/action-nodejs-v8)
  • Node.js 10.15.3 (nodejs:10 & openwhisk/action-nodejs-v10)
  • Node.js 12.1.0 (nodejs:12 & openwhisk/action-nodejs-v12)

This README documents the build, customisation and testing of these runtime images.

Do you want to learn more about using Node.js actions to build serverless applications? Please see the main project documentation here for that information.

Usage

If the deployment of Apache OpenWhisk includes these images in the runtime manifest, use the --kind parameter to select the Node.js runtime version.

Node.js v6

wsk action update myAction myAction.js --kind nodejs:6

Node.js v8

wsk action update myAction myAction.js --kind nodejs:8

Node.js v10

wsk action update myAction myAction.js --kind nodejs:10

Node.js v12

wsk action update myAction myAction.js --kind nodejs:12

Images

All the runtime images are published by the project to Docker Hub @ https://hub.docker.com/u/openwhisk

These images can be used to execute Node.js actions on any deployment of Apache OpenWhisk, even those without those images defined the in runtime manifest, using the --docker action parameter.

wsk action update myAction myAction.js --docker openwhisk/action-nodejs-v12

If you build a custom version of the images, pushing those an external Docker Hub repository will allow you to use those on the Apache OpenWhisk deployment.

Runtimes Manifest

Available runtimes in Apache OpenWhisk are defined using the runtimes manifest in this file: runtimes.json

Modify the manifest and re-deploy the platform to pick up local images changes.

Development

Dockerfiles for runtime images are defined in the core directory. Each runtime version folder has a custom Dockerfile and package.json. If you need to add extra dependencies to a runtime version - modify these files.

The core/nodejsActionBase folder contains the Node.js app server used to implement the action interface, used by the platform to inject action code into the runtime and fire invocation requests. This common code is used in all runtime versions.

Build

  • Run the distDocker command to generate local Docker images for the different runtime versions.
./gradlew core:nodejs6Action:distDocker
./gradlew core:nodejs8Action:distDocker
./gradlew core:nodejs10Action:distDocker
./gradlew core:nodejs12Action:distDocker

This will return the following runtime images with the following names: nodejs6action, action-nodejs-v8, action-nodejs-v10 and action-nodejs-v12.

Testing

  • Install project dependencies from the top-level Apache OpenWhisk project, which ensures correct versions of dependent libraries are available in the Maven cache.
./gradlew install

This command MUST BE run from the directory containing the main Apache OpenWhisk repository, not this repository's directory.

  • Build the local Docker images for the runtime versions (see the instructions above).
  • Build the custom Docker images used in local testing.
./gradlew tests:dat:docker:nodejs6docker:distDocker
./gradlew tests:dat:docker:nodejs8docker:distDocker
./gradlew tests:dat:docker:nodejs10docker:distDocker
./gradlew tests:dat:docker:nodejs12docker:distDocker
  • Run the project tests.
./gradlew :tests:test

Disclaimer

Apache OpenWhisk Runtime Node.js is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.