Skip to content

change default nodejs kind from nodejs:10 to nodejs:14 #5105

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

Merged
merged 2 commits into from
Apr 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ansible/files/runtimes-nodeonly.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"This file describes the different languages (aka. managed action runtimes) supported by the system",
"as well as blackbox images that support the runtime specification.",
"Only actions with runtime families / kinds defined here can be created / read / updated / deleted / invoked.",
"Define a list of runtime families (example: 'nodejs') with at least one kind per family (example: 'nodejs:10').",
"Define a list of runtime families (example: 'nodejs') with at least one kind per family (example: 'nodejs:14').",
"Each runtime family needs a default kind (default: true).",
"When removing or renaming runtime families or runtime kinds from this file, preexisting actions",
"with the affected kinds can no longer be read / updated / deleted / invoked. In order to remove or rename",
Expand All @@ -16,11 +16,11 @@
"runtimes": {
"nodejs": [
{
"kind": "nodejs:10",
"kind": "nodejs:14",
"default": true,
"image": {
"prefix": "openwhisk",
"name": "action-nodejs-v10",
"name": "action-nodejs-v14",
"tag": "nightly"
},
"deprecated": false,
Expand Down
34 changes: 17 additions & 17 deletions ansible/files/runtimes.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"nodejs": [
{
"kind": "nodejs:10",
"default": true,
"default": false,
"image": {
"prefix": "openwhisk",
"name": "action-nodejs-v10",
Expand All @@ -26,20 +26,7 @@
"attached": {
"attachmentName": "codefile",
"attachmentType": "text/plain"
},
"stemCells": [
{
"initialCount": 2,
"memory": "256 MB",
"reactive": {
"minCount": 1,
"maxCount": 4,
"ttl": "2 minutes",
"threshold": 1,
"increment": 1
}
}
]
}
},
{
"kind": "nodejs:12",
Expand All @@ -57,7 +44,7 @@
},
{
"kind": "nodejs:14",
"default": false,
"default": true,
"image": {
"prefix": "openwhisk",
"name": "action-nodejs-v14",
Expand All @@ -67,7 +54,20 @@
"attached": {
"attachmentName": "codefile",
"attachmentType": "text/plain"
}
},
"stemCells": [
{
"initialCount": 2,
"memory": "256 MB",
"reactive": {
"minCount": 1,
"maxCount": 4,
"ttl": "2 minutes",
"threshold": 1,
"increment": 1
}
}
]
}
],
"python": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class KamonRecorderTests extends KafkaSpecBase with BeforeAndAfterEach with Kamo
val namespaceGuest = "guest"
val actionWithCustomPackage = "apimgmt/createApi"
val actionWithDefaultPackage = "createApi"
val kind = "nodejs:10"
val kind = "nodejs:14"
val memory = 256

it should "push user events to kamon" in {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class PrometheusRecorderTests extends KafkaSpecBase with BeforeAndAfterEach with
val namespaceGuest = "guest"
val actionWithCustomPackage = "apimgmt/createApiOne"
val actionWithDefaultPackage = "createApi"
val kind = "nodejs:10"
val kind = "nodejs:14"
val memory = "256"
createCustomTopic(EventConsumer.userEventTopic)

Expand Down
2 changes: 1 addition & 1 deletion core/standalone/bin/waitready
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ wsk property set --apihost "http://$(hostname):3233" --auth "$AUTH"
until wsk action list 2>/dev/null >/dev/null
do sleep 1 ; echo server still not ready - retrying
done
wsk action update testme <(echo 'function main(){return {"ready":true}}') --kind nodejs:10
wsk action update testme <(echo 'function main(){return {"ready":true}}') --kind nodejs:14
until wsk action invoke testme -r 2>/dev/null | grep 'ready'
do sleep 1 ; echo server initializing...
done
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ object StandaloneDockerSupport {
}

def prePullImage(imageName: String)(implicit logging: Logging): Unit = {
//docker images openwhisk/action-nodejs-v10:nightly
//docker images openwhisk/action-nodejs-v14:nightly
//REPOSITORY TAG IMAGE ID CREATED SIZE
//openwhisk/action-nodejs-v10 nightly dbb0f8e1a050 5 days ago 967MB
//openwhisk/action-nodejs-v14 nightly dbb0f8e1a050 5 days ago 967MB
val imageResult = s"$dockerCmd images $imageName".!!
val imageExist = imageResult.linesIterator.toList.size > 1
if (!imageExist || imageName.contains(":nightly")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@ object StandaloneOpenWhisk extends SLF4JLogging {
| "runtimes": {
| "nodejs": [
| {
| "kind": "nodejs:10",
| "kind": "nodejs:14",
| "default": true,
| "image": {
| "prefix": "openwhisk",
| "name": "action-nodejs-v10",
| "name": "action-nodejs-v14",
| "tag": "latest"
| },
| "deprecated": false,
Expand Down
10 changes: 5 additions & 5 deletions docs/actions-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,21 @@ Further, you should automate and pass the following test suites:
Actions when created specify the desired runtime for the function via a property called "kind".
When using the `wsk` CLI, this is specified as `--kind <runtime-kind>`. The value is typically
a string describing the language (e.g., `nodejs`) followed by a colon and the version for the runtime
as in `nodejs:10` or `php:7.4`.
as in `nodejs:14` or `php:7.4`.

The manifest is a map of runtime family names to an array of specific kinds. The details of the
schema are found in the [Exec Manifest](../common/scala/src/main/scala/org/apache/openwhisk/core/entity/ExecManifest.scala).
As an example, the following entry add a new runtime family called `nodejs` with a single kind
`nodejs:10`.
`nodejs:14`.

```json
{
"nodejs": [{
"kind": "nodejs:10",
"kind": "nodejs:14",
"default": true,
"image": {
"prefix": "openwhisk",
"name": "nodejs10action",
"name": "action-nodejs-v10",
"tag": "latest"
}
}]
Expand Down Expand Up @@ -113,7 +113,7 @@ new language and added to the [test artifacts directory](../tests/dat/actions/un
with the name `<runtime-kind>.txt` for plain text file or `<runtime-kind>.bin` for a
a binary file. The `<runtime-kind>` must match the value used for `kind` in the corresponding
runtime manifest entry, replacing `:` in the kind with a `-`.
For example, a plain text function for `nodejs:10` becomes `nodejs-10.txt`.
For example, a plain text function for `nodejs:14` becomes `nodejs-14.txt`.

```js
function main(args) {
Expand Down
18 changes: 9 additions & 9 deletions docs/actions-nodejs.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@ zip -r action.zip *
- Create the action from the zip file.

```
wsk action create packageAction --kind nodejs:10 action.zip
wsk action create packageAction --kind nodejs:14 action.zip
```

When creating an action from a `.zip` archive with the CLI tool, you must explicitly provide a value for the `--kind` flag by using `nodejs:12`, or `nodejs:10`.
When creating an action from a `.zip` archive with the CLI tool, you must explicitly provide a value for the `--kind` flag by using `nodejs:14`, or `nodejs:12`.

- Invoke the action as normal.

Expand Down Expand Up @@ -268,7 +268,7 @@ zip -r action.zip *
- Create new action with action archive.

```
wsk action create my-action --kind nodejs:10 action.zip
wsk action create my-action --kind nodejs:14 action.zip
```

#### Building custom runtime image
Expand Down Expand Up @@ -353,7 +353,7 @@ npx rollup --config
- Create an action using the bundle source file.

```
wsk action create my-action bundle.js --kind nodejs:10
wsk action create my-action bundle.js --kind nodejs:14
```

- Invoke the action as normal. Results should be the same as the example above.
Expand Down Expand Up @@ -406,7 +406,7 @@ npx webpack --config webpack.config.js
- Create an action using the bundle source file.

```
wsk action create my-action dist/bundle.js --kind nodejs:10
wsk action create my-action dist/bundle.js --kind nodejs:14
```

- Invoke the action as normal. Results should be the same as the example above.
Expand Down Expand Up @@ -447,7 +447,7 @@ npm install parcel-bundler --save-dev
- Create an action using the bundle source file.

```
wsk action create my-action dist/index.js --kind nodejs:10
wsk action create my-action dist/index.js --kind nodejs:14
```

- Invoke the action as normal. Results should be the same as the example above.
Expand All @@ -459,8 +459,8 @@ wsk action invoke my-action --result --param lines "[\"and now\", \"for somethin

## Reference

JavaScript actions can be executed in Node.js version 8, 10, 12 or 14.
Currently actions are executed by default in a Node.js version 10 environment.
JavaScript actions can be executed in Node.js version 10, 12 or 14.
Currently actions are executed by default in a Node.js version 14 environment.

### Node.js version 10 environment
The Node.js version 10 environment is used if the `--kind` flag is explicitly specified with a value of 'nodejs:10' when creating or updating an Action.
Expand All @@ -479,6 +479,6 @@ The following packages are pre-installed in the Node.js version 12 environment:
### Node.js version 14 environment
The Node.js version 14 environment is used if the `--kind` flag is explicitly specified with a value of 'nodejs:14' when creating or updating an Action.

The following packages are pre-installed in the Node.js version 12 environment:
The following packages are pre-installed in the Node.js version 14 environment:

- [openwhisk](https://www.npmjs.com/package/openwhisk) - JavaScript client library for the OpenWhisk platform. Provides a wrapper around the OpenWhisk APIs.
2 changes: 1 addition & 1 deletion tests/dat/actions/echo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.1",
"publish": false,
"exec": {
"kind": "nodejs:10",
"kind": "nodejs:14",
"code": "/**\n * Returns params, or an empty string if no parameter values are provided\n */\nfunction main(params) {\n return params || {};\n}\n\n"
},
"annotations": [],
Expand Down
2 changes: 1 addition & 1 deletion tests/dat/actions/word_count.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.1",
"publish": false,
"exec": {
"kind": "nodejs:10",
"kind": "nodejs:14",
"code": "/**\n * word count utility\n */\nfunction main(params) {\n var str = params.payload.toString();\n var words = str.split(\" \");\n var count = words.length;\n console.log(\"The message '\"+str+\"' has\", count, 'words');\n return { count: count };\n}\n"
},
"annotations": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,12 @@ class WskAdminTests extends TestHelpers with WskActorSystem with Matchers with B
val subject = Subject().asString
try {
// set some limits
wskadmin.cli(Seq("limits", "set", subject, "--allowedKinds", "nodejs:10", "blackbox"))
wskadmin.cli(Seq("limits", "set", subject, "--allowedKinds", "nodejs:14", "blackbox"))
// check correctly set
val lines = wskadmin.cli(Seq("limits", "get", subject)).stdout.linesIterator.toSeq
lines should have size 1
lines(0) should (be("allowedKinds = [u'nodejs:10', u'blackbox']") or be(
"allowedKinds = ['nodejs:10', 'blackbox']"))
lines(0) should (be("allowedKinds = [u'nodejs:14', u'blackbox']") or be(
"allowedKinds = ['nodejs:14', 'blackbox']"))
} finally {
wskadmin.cli(Seq("limits", "delete", subject)).stdout should include("Limits deleted")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class DockerContainerFactoryTests

it should "set the docker run args based on ContainerArgsConfig" in {

val image = ExecManifest.runtimesManifest.manifests("nodejs:10").image
val image = ExecManifest.runtimesManifest.manifests("nodejs:14").image

implicit val tid = TransactionId.testing
val dockerApiStub = mock[DockerApiWithFileAccess]
Expand Down
Loading