diff --git a/ansible/files/runtimes-nodeonly.json b/ansible/files/runtimes-nodeonly.json index 18de9caa8f3..a9a212567e7 100644 --- a/ansible/files/runtimes-nodeonly.json +++ b/ansible/files/runtimes-nodeonly.json @@ -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:14').", + "Define a list of runtime families (example: 'nodejs') with at least one kind per family (example: 'nodejs:20').", "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", @@ -16,11 +16,11 @@ "runtimes": { "nodejs": [ { - "kind": "nodejs:14", + "kind": "nodejs:20", "default": true, "image": { "prefix": "openwhisk", - "name": "action-nodejs-v14", + "name": "action-nodejs-v20", "tag": "nightly" }, "deprecated": false, diff --git a/ansible/files/runtimes.json b/ansible/files/runtimes.json index f3a7483441c..cd28fd11f71 100644 --- a/ansible/files/runtimes.json +++ b/ansible/files/runtimes.json @@ -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:14').", + "Define a list of runtime families (example: 'nodejs') with at least one kind per family (example: 'nodejs:20').", "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", @@ -15,11 +15,25 @@ "runtimes": { "nodejs": [ { - "kind": "nodejs:14", + "kind": "nodejs:18", + "default": false, + "image": { + "prefix": "openwhisk", + "name": "action-nodejs-v18", + "tag": "nightly" + }, + "deprecated": false, + "attached": { + "attachmentName": "codefile", + "attachmentType": "text/plain" + } + }, + { + "kind": "nodejs:20", "default": true, "image": { "prefix": "openwhisk", - "name": "action-nodejs-v14", + "name": "action-nodejs-v20", "tag": "nightly" }, "deprecated": false, @@ -40,43 +54,15 @@ } } ] - }, - { - "kind": "nodejs:16", - "default": false, - "image": { - "prefix": "openwhisk", - "name": "action-nodejs-v16", - "tag": "nightly" - }, - "deprecated": false, - "attached": { - "attachmentName": "codefile", - "attachmentType": "text/plain" - } - }, - { - "kind": "nodejs:18", - "default": false, - "image": { - "prefix": "openwhisk", - "name": "action-nodejs-v18", - "tag": "nightly" - }, - "deprecated": false, - "attached": { - "attachmentName": "codefile", - "attachmentType": "text/plain" - } } ], "python": [ { - "kind": "python:3", + "kind": "python:3.10", "default": true, "image": { "prefix": "openwhisk", - "name": "action-python-v3.7", + "name": "action-python-v3.10", "tag": "nightly" }, "deprecated": false, @@ -86,11 +72,11 @@ } }, { - "kind": "python:3.10", + "kind": "python:3.11", "default": false, "image": { "prefix": "openwhisk", - "name": "action-python-v3.10", + "name": "action-python-v3.11", "tag": "nightly" }, "deprecated": false, @@ -101,20 +87,6 @@ } ], "swift": [ - { - "kind": "swift:5.1", - "default": false, - "image": { - "prefix": "openwhisk", - "name": "action-swift-v5.1", - "tag": "nightly" - }, - "deprecated": false, - "attached": { - "attachmentName": "codefile", - "attachmentType": "text/plain" - } - }, { "kind": "swift:5.3", "default": true, @@ -130,11 +102,11 @@ } }, { - "kind": "swift:5.4", + "kind": "swift:5.7", "default": false, "image": { "prefix": "openwhisk", - "name": "action-swift-v5.4", + "name": "action-swift-v5.7", "tag": "nightly" }, "deprecated": false, @@ -162,51 +134,9 @@ } ], "php": [ - { - "kind": "php:7.3", - "default": false, - "deprecated": true, - "image": { - "prefix": "openwhisk", - "name": "action-php-v7.3", - "tag": "nightly" - }, - "attached": { - "attachmentName": "codefile", - "attachmentType": "text/plain" - } - }, - { - "kind": "php:7.4", - "default": true, - "deprecated": false, - "image": { - "prefix": "openwhisk", - "name": "action-php-v7.4", - "tag": "nightly" - }, - "attached": { - "attachmentName": "codefile", - "attachmentType": "text/plain" - } - }, - { - "kind": "php:8.0", - "default": false, - "deprecated": false, - "image": { - "prefix": "openwhisk", - "name": "action-php-v8.0", - "tag": "nightly" - }, - "attached": { - "attachmentName": "codefile", - "attachmentType": "text/plain" - } - }, { "kind": "php:8.1", - "default": false, + "default": true, "deprecated": false, "image": { "prefix": "openwhisk", @@ -236,23 +166,9 @@ } ], "go": [ - { - "kind": "go:1.17", - "default": true, - "deprecated": false, - "attached": { - "attachmentName": "codefile", - "attachmentType": "text/plain" - }, - "image": { - "prefix": "openwhisk", - "name": "action-golang-v1.17", - "tag": "nightly" - } - }, { "kind": "go:1.20", - "default": false, + "default": true, "deprecated": false, "attached": { "attachmentName": "codefile", @@ -266,21 +182,6 @@ } ], "dotnet": [ - { - "kind": "dotnet:2.2", - "default": false, - "deprecated": true, - "requireMain": true, - "image": { - "prefix": "openwhisk", - "name": "action-dotnet-v2.2", - "tag": "nightly" - }, - "attached": { - "attachmentName": "codefile", - "attachmentType": "text/plain" - } - }, { "kind": "dotnet:3.1", "default": true, diff --git a/core/controller/src/main/resources/apiv1swagger.json b/core/controller/src/main/resources/apiv1swagger.json index a2713a9d4b4..1366ac02dc2 100644 --- a/core/controller/src/main/resources/apiv1swagger.json +++ b/core/controller/src/main/resources/apiv1swagger.json @@ -2001,29 +2001,23 @@ "blackbox", "java:8", "java:default", - "nodejs:14", "nodejs:16", "nodejs:18", + "nodejs:20", "nodejs:default", - "php:7.3", - "php:7.4", - "php:8.0", "php:8.1", "php:default", - "python:3", "python:3.10", + "python:3.11", "python:default", "ruby:2.5", "ruby:default", - "go:1.17", "go:1.20", "go:default", "sequence", - "swift:5.1", "swift:5.3", - "swift:5.4", + "swift:5.7", "swift:default", - "dotnet:2.2", "dotnet:3.1", "dotnet:6.0", "dotnet:default", diff --git a/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/KamonRecorderTests.scala b/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/KamonRecorderTests.scala index 10726c815a8..aabc9e65329 100644 --- a/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/KamonRecorderTests.scala +++ b/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/KamonRecorderTests.scala @@ -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:14" + val kind = "nodejs:20" val memory = 256 it should "push user events to kamon" in { diff --git a/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/PrometheusRecorderTests.scala b/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/PrometheusRecorderTests.scala index 0e1b35ac340..4f8e7f7a251 100644 --- a/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/PrometheusRecorderTests.scala +++ b/core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/PrometheusRecorderTests.scala @@ -38,7 +38,7 @@ class PrometheusRecorderTests extends KafkaSpecBase with BeforeAndAfterEach with val namespaceGuest = "guest" val actionWithCustomPackage = "apimgmt/createApiOne" val actionWithDefaultPackage = "createApi" - val kind = "nodejs:14" + val kind = "nodejs:20" val memory = "256" createCustomTopic(EventConsumer.userEventTopic) diff --git a/core/standalone/bin/waitready b/core/standalone/bin/waitready index 0bc01ba5a8f..5349459e5e2 100755 --- a/core/standalone/bin/waitready +++ b/core/standalone/bin/waitready @@ -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:14 +wsk action update testme <(echo 'function main(){return {"ready":true}}') --kind nodejs:20 until wsk action invoke testme -r 2>/dev/null | grep 'ready' do sleep 1 ; echo server initializing... done diff --git a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/StandaloneOpenWhisk.scala b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/StandaloneOpenWhisk.scala index 4ea758dd712..964df73014b 100644 --- a/core/standalone/src/main/scala/org/apache/openwhisk/standalone/StandaloneOpenWhisk.scala +++ b/core/standalone/src/main/scala/org/apache/openwhisk/standalone/StandaloneOpenWhisk.scala @@ -175,11 +175,11 @@ object StandaloneOpenWhisk extends SLF4JLogging { | "runtimes": { | "nodejs": [ | { - | "kind": "nodejs:14", + | "kind": "nodejs:20", | "default": true, | "image": { | "prefix": "openwhisk", - | "name": "action-nodejs-v14", + | "name": "action-nodejs-v20", | "tag": "latest" | }, | "deprecated": false, diff --git a/docs/actions-new.md b/docs/actions-new.md index 66c40dd88bd..671f52494cb 100644 --- a/docs/actions-new.md +++ b/docs/actions-new.md @@ -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 `. 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:14` or `php:7.4`. +as in `nodejs:20` or `php:8.1`. 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:14`. +`nodejs:20`. ```json { "nodejs": [{ - "kind": "nodejs:14", + "kind": "nodejs:20", "default": true, "image": { "prefix": "openwhisk", - "name": "action-nodejs-v10", + "name": "action-nodejs-v20", "tag": "latest" } }] @@ -113,7 +113,7 @@ new language and added to the [test artifacts directory](../tests/dat/actions/un with the name `.txt` for plain text file or `.bin` for a a binary file. The `` 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:14` becomes `nodejs-14.txt`. +For example, a plain text function for `nodejs:20` becomes `nodejs-20.txt`. ```js function main(args) { diff --git a/docs/actions-nodejs.md b/docs/actions-nodejs.md index 7390f7605dc..b7e7edaa8df 100644 --- a/docs/actions-nodejs.md +++ b/docs/actions-nodejs.md @@ -69,7 +69,7 @@ and demonstrate how to bundle multiple JavaScript files and third party dependen The CLI automatically infers the type of the action by using the source file extension. For `.js` source files, the action runs by using a Node.js runtime. You may specify - the Node.js runtime to use by explicitly specifying the parameter `--kind nodejs:14`, or `--kind nodejs:12`. + the Node.js runtime to use by explicitly specifying the parameter `--kind nodejs:18`, or `--kind nodejs:20`. ## Creating asynchronous actions @@ -245,10 +245,10 @@ zip -r action.zip * - Create the action from the zip file. ``` -wsk action create packageAction --kind nodejs:14 action.zip +wsk action create packageAction --kind nodejs:20 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:14`, or `nodejs:12`. +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:18`, or `nodejs:20`. - Invoke the action as normal. @@ -294,7 +294,7 @@ zip -r action.zip * - Create new action with action archive. ``` -wsk action create my-action --kind nodejs:14 action.zip +wsk action create my-action --kind nodejs:20 action.zip ``` #### Building custom runtime image @@ -379,7 +379,7 @@ npx rollup --config - Create an action using the bundle source file. ``` -wsk action create my-action bundle.js --kind nodejs:14 +wsk action create my-action bundle.js --kind nodejs:20 ``` - Invoke the action as normal. Results should be the same as the example above. @@ -432,7 +432,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:14 +wsk action create my-action dist/bundle.js --kind nodejs:20 ``` - Invoke the action as normal. Results should be the same as the example above. @@ -473,7 +473,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:14 +wsk action create my-action dist/index.js --kind nodejs:20 ``` - Invoke the action as normal. Results should be the same as the example above. @@ -485,19 +485,19 @@ wsk action invoke my-action --result --param lines "[\"and now\", \"for somethin ## Reference -JavaScript actions can be executed in Node.js version 12 or 14. -Currently actions are executed by default in a Node.js version 14 environment. +JavaScript actions can be executed in Node.js version 18 or 20. +Currently actions are executed by default in a Node.js version 20 environment. -### Node.js version 12 environment -The Node.js version 12 environment is used if the `--kind` flag is explicitly specified with a value of 'nodejs:12' when creating or updating an Action. +### Node.js version 18 environment +The Node.js version 18 environment is used if the `--kind` flag is explicitly specified with a value of 'nodejs:18' 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 18 environment: - [openwhisk](https://www.npmjs.com/package/openwhisk) - JavaScript client library for the OpenWhisk platform. Provides a wrapper around the OpenWhisk APIs. -### 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. +### Node.js version 20 environment +The Node.js version 20 environment is used if the `--kind` flag is explicitly specified with a value of 'nodejs:20' when creating or updating an Action. -The following packages are pre-installed in the Node.js version 14 environment: +The following packages are pre-installed in the Node.js version 20 environment: - [openwhisk](https://www.npmjs.com/package/openwhisk) - JavaScript client library for the OpenWhisk platform. Provides a wrapper around the OpenWhisk APIs. diff --git a/docs/actions.md b/docs/actions.md index 9f814799f98..82eee6363ef 100644 --- a/docs/actions.md +++ b/docs/actions.md @@ -86,11 +86,11 @@ runtime kinds or language families. Prewarmed containers are created when an invoker starts, they are created according to runtimes.json's stemCells, e.g. ``` { - "kind": "nodejs:14", + "kind": "nodejs:20", "default": true, "image": { "prefix": "openwhisk", - "name": "action-nodejs-v14", + "name": "action-nodejs-v20", "tag": "nightly" }, "deprecated": false, @@ -106,9 +106,9 @@ Prewarmed containers are created when an invoker starts, they are created accord ] } ``` -In the above example, there is only one runtime configuration, which is `nodejs:14`. -It has a stem cell configuration and 2 containers with 256MB memory for `nodejs:14` will be provisioned when an invoker starts. -When an activation with the `nodejs:14` kind arrives, one of the prewarm containers can be used to alleviate a cold start. +In the above example, there is only one runtime configuration, which is `nodejs:20`. +It has a stem cell configuration and 2 containers with 256MB memory for `nodejs:20` will be provisioned when an invoker starts. +When an activation with the `nodejs:20` kind arrives, one of the prewarm containers can be used to alleviate a cold start. A prewarm container that is assigned to an action is moved to the busy pool and the invoker creates one more prewarm container to replenish the prewarm pool. In this way, when no reactive configuration is configured, an invoker always maintains the same number of prewarm containers. @@ -117,11 +117,11 @@ In this way, when no reactive configuration is configured, an invoker always mai With a reactive configuration, the number of prewarm containers is dynamically controlled, e.g. ``` { - "kind": "nodejs:14", + "kind": "nodejs:20", "default": true, "image": { "prefix": "openwhisk", - "name": "action-nodejs-v14", + "name": "action-nodejs-v20", "tag": "nightly" }, "deprecated": false, @@ -143,7 +143,7 @@ With a reactive configuration, the number of prewarm containers is dynamically c ] } ``` -In the above example, there is a reactive configuration for `nodejs:14` and there are 4 underlying configurations. +In the above example, there is a reactive configuration for `nodejs:20` and there are 4 underlying configurations. * `minCount`: the minimum number of prewarm containers. The number of prewarm containers can't be fewer than this value * `maxCount`: the maximum number of prewarm containers. The number of prewarm containers cannot exceed this value * `ttl`: the amount of time that prewarm containers can exist without any activation. If no activation for the prewarm container arrives in the given time, the prewarm container will be removed diff --git a/tests/dat/actions/echo.json b/tests/dat/actions/echo.json index 701c1f5009d..dda28e61923 100644 --- a/tests/dat/actions/echo.json +++ b/tests/dat/actions/echo.json @@ -3,7 +3,7 @@ "version": "0.0.1", "publish": false, "exec": { - "kind": "nodejs:14", + "kind": "nodejs:20", "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": [], diff --git a/tests/dat/actions/word_count.json b/tests/dat/actions/word_count.json index 62760e334f4..a73bc95f9b8 100644 --- a/tests/dat/actions/word_count.json +++ b/tests/dat/actions/word_count.json @@ -3,7 +3,7 @@ "version": "0.0.1", "publish": false, "exec": { - "kind": "nodejs:14", + "kind": "nodejs:20", "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": [], diff --git a/tests/src/test/scala/org/apache/openwhisk/core/admin/WskAdminTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/admin/WskAdminTests.scala index 64d5c82d9d8..ca55dd8ed98 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/admin/WskAdminTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/admin/WskAdminTests.scala @@ -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:14", "blackbox")) + wskadmin.cli(Seq("limits", "set", subject, "--allowedKinds", "nodejs:20", "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:14', u'blackbox']") or be( - "allowedKinds = ['nodejs:14', 'blackbox']")) + lines(0) should (be("allowedKinds = [u'nodejs:20', u'blackbox']") or be( + "allowedKinds = ['nodejs:20', 'blackbox']")) } finally { wskadmin.cli(Seq("limits", "delete", subject)).stdout should include("Limits deleted") } diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/DockerContainerFactoryTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/DockerContainerFactoryTests.scala index 754aa5c225a..baacd95c815 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/DockerContainerFactoryTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/docker/test/DockerContainerFactoryTests.scala @@ -68,7 +68,7 @@ class DockerContainerFactoryTests it should "set the docker run args based on ContainerArgsConfig" in { - val image = ExecManifest.runtimesManifest.manifests("nodejs:14").image + val image = ExecManifest.runtimesManifest.manifests("nodejs:20").image implicit val tid = TransactionId.testing val dockerApiStub = mock[DockerApiWithFileAccess] diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/EntitlementProviderTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/EntitlementProviderTests.scala index 5d48d42b1ae..48edcd45c96 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/EntitlementProviderTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/EntitlementProviderTests.scala @@ -53,7 +53,7 @@ class EntitlementProviderTests extends ControllerTestCommon with ScalaFutures { val adminUser = WhiskAuthHelpers.newIdentity(Subject("admin")) val guestUser = WhiskAuthHelpers.newIdentity(Subject("anonym")) - val allowedKinds = Set("nodejs:14", "python") + val allowedKinds = Set("nodejs:20", "python") val disallowedKinds = Set("golang", "blackbox") def getExec(kind: String): Exec = { diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/KindRestrictorTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/KindRestrictorTests.scala index 4a36bd416d0..4f29d370125 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/KindRestrictorTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/KindRestrictorTests.scala @@ -39,7 +39,7 @@ class KindRestrictorTests extends FlatSpec with Matchers with StreamLogging { behavior of "Kind Restrictor" - val allowedKinds = Set("nodejs:14", "python") + val allowedKinds = Set("nodejs:20", "python") val disallowedKinds = Set("golang", "blackbox") val allKinds = allowedKinds ++ disallowedKinds diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/ArtifactWithFileStorageActivationStoreTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/ArtifactWithFileStorageActivationStoreTests.scala index 90074ca49b9..56048d7d915 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/ArtifactWithFileStorageActivationStoreTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/ArtifactWithFileStorageActivationStoreTests.scala @@ -152,7 +152,7 @@ class ArtifactWithFileStorageActivationStoreTests() response = response, logs = logs, duration = Some(101L), - annotations = Parameters("kind", "nodejs:14") ++ Parameters( + annotations = Parameters("kind", "nodejs:20") ++ Parameters( "limits", ActionLimits(TimeLimit(60.second), MemoryLimit(256.MB), LogLimit(10.MB)).toJson) ++ Parameters("waitTime", 16.toJson) ++ @@ -203,7 +203,7 @@ class ArtifactWithFileStorageActivationStoreTests() response = response, logs = logs, duration = Some(101L), - annotations = Parameters("kind", "nodejs:14") ++ Parameters( + annotations = Parameters("kind", "nodejs:20") ++ Parameters( "limits", ActionLimits(TimeLimit(60.second), MemoryLimit(256.MB), LogLimit(10.MB)).toJson) ++ Parameters("waitTime", 16.toJson) ++ @@ -315,7 +315,7 @@ class ArtifactWithFileStorageActivationStoreTests() response = response, logs = logs, duration = Some(101L), - annotations = Parameters("kind", "nodejs:14") ++ Parameters( + annotations = Parameters("kind", "nodejs:20") ++ Parameters( "limits", ActionLimits(TimeLimit(60.second), MemoryLimit(256.MB), LogLimit(10.MB)).toJson) ++ Parameters("waitTime", 16.toJson) ++ diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/LimitsCommandTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/LimitsCommandTests.scala index 656b8ec25b7..e30cd409a04 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/LimitsCommandTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/LimitsCommandTests.scala @@ -50,7 +50,7 @@ class LimitsCommandTests extends FlatSpec with WhiskAdminCliTestBase { "--concurrentInvocations", "11", "--allowedKinds", - "nodejs:14", + "nodejs:20", "blackbox", "--storeActivations", "false", @@ -61,7 +61,7 @@ class LimitsCommandTests extends FlatSpec with WhiskAdminCliTestBase { invocationsPerMinute = Some(3), firesPerMinute = Some(7), concurrentInvocations = Some(11), - allowedKinds = Some(Set("nodejs:14", "blackbox")), + allowedKinds = Some(Set("nodejs:20", "blackbox")), storeActivations = Some(false)) resultOk("limits", "set", "--invocationsPerMinute", "13", ns) shouldBe CommandMessages.limitsSuccessfullyUpdated(ns) @@ -97,10 +97,10 @@ class LimitsCommandTests extends FlatSpec with WhiskAdminCliTestBase { it should "update existing allowedKind limit" in { val ns = newNamespace() - resultOk("limits", "set", "--allowedKinds", "nodejs:14", ns) - resultOk("limits", "get", ns) shouldBe "allowedKinds = nodejs:14" - resultOk("limits", "set", "--allowedKinds", "nodejs:14", "blackbox", "python", ns) - resultOk("limits", "get", ns) shouldBe "allowedKinds = nodejs:14, blackbox, python" + resultOk("limits", "set", "--allowedKinds", "nodejs:20", ns) + resultOk("limits", "get", ns) shouldBe "allowedKinds = nodejs:20" + resultOk("limits", "set", "--allowedKinds", "nodejs:20", "blackbox", "python", ns) + resultOk("limits", "get", ns) shouldBe "allowedKinds = nodejs:20, blackbox, python" //Delete resultOk("limits", "delete", ns) shouldBe CommandMessages.limitsDeleted diff --git a/tests/src/test/scala/org/apache/openwhisk/core/database/test/AttachmentCompatibilityTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/database/test/AttachmentCompatibilityTests.scala index 6965113b1c5..01fd303ff84 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/database/test/AttachmentCompatibilityTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/database/test/AttachmentCompatibilityTests.scala @@ -114,7 +114,7 @@ class AttachmentCompatibilityTests it should "read existing base64 encoded code string" in { implicit val tid: TransactionId = transid() val exec = """{ - | "kind": "nodejs:14", + | "kind": "nodejs:20", | "code": "SGVsbG8gT3BlbldoaXNr" |}""".stripMargin.parseJson.asJsObject val (id, action) = makeActionJson(namespace, aname(), exec) @@ -127,7 +127,7 @@ class AttachmentCompatibilityTests it should "read existing simple code string" in { implicit val tid: TransactionId = transid() val exec = """{ - | "kind": "nodejs:14", + | "kind": "nodejs:20", | "code": "while (true)" |}""".stripMargin.parseJson.asJsObject val (id, action) = makeActionJson(namespace, aname(), exec) diff --git a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecHelpers.scala b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecHelpers.scala index 6ada36a575c..7182741cf8f 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecHelpers.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecHelpers.scala @@ -35,7 +35,7 @@ trait ExecHelpers extends Matchers with WskActorSystem with StreamLogging { private val config = new WhiskConfig(ExecManifest.requiredProperties) ExecManifest.initialize(config) should be a 'success - protected val NODEJS = "nodejs:14" + protected val NODEJS = "nodejs:20" protected val SWIFT5 = "swift:5.3" protected val BLACKBOX = "blackbox" protected val JAVA_DEFAULT = "java:8" diff --git a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecManifestTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecManifestTests.scala index dce964e2180..35735ddc1ea 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecManifestTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecManifestTests.scala @@ -270,7 +270,7 @@ class ExecManifestTests extends FlatSpec with WskActorSystem with StreamLogging |{ "runtimes": { | "nodef": [ | { - | "kind": "nodejs:14", + | "kind": "nodejs:20", | "default": true, | "image": { | "name": "nodejsaction" @@ -322,7 +322,7 @@ class ExecManifestTests extends FlatSpec with WskActorSystem with StreamLogging |""".stripMargin.parseJson.asJsObject val js14 = RuntimeManifest( - "nodejs:14", + "nodejs:20", ImageName("nodejsaction"), default = Some(true), stemCells = Some(List(StemCell(1, 128.MB), StemCell(1, 256.MB)))) @@ -364,7 +364,7 @@ class ExecManifestTests extends FlatSpec with WskActorSystem with StreamLogging |{ "runtimes": { | "nodef": [ | { - | "kind": "nodejs:14", + | "kind": "nodejs:20", | "default": true, | "image": { | "name": "nodejsaction" @@ -445,7 +445,7 @@ class ExecManifestTests extends FlatSpec with WskActorSystem with StreamLogging val reactive = Some(ReactivePrewarmingConfig(1, 4, FiniteDuration(2, TimeUnit.MINUTES), 1, 1)) val js14 = RuntimeManifest( - "nodejs:14", + "nodejs:20", ImageName("nodejsaction"), default = Some(true), stemCells = Some(List(StemCell(1, 128.MB, reactive), StemCell(1, 256.MB, reactive)))) diff --git a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecTests.scala index dd25b7bdb11..09bed32aaee 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecTests.scala @@ -59,7 +59,7 @@ class ExecTests extends FlatSpec with Matchers with StreamLogging with BeforeAnd | "updated": 1533623651650, | "entityType": "action", | "exec": { - | "kind": "nodejs:14", + | "kind": "nodejs:20", | "code": "foo", | "binary": false | }, @@ -82,7 +82,7 @@ class ExecTests extends FlatSpec with Matchers with StreamLogging with BeforeAnd it should "properly determine binary property" in { val j1 = """{ - | "kind": "nodejs:14", + | "kind": "nodejs:20", | "code": "SGVsbG8gT3BlbldoaXNr", | "binary": false |}""".stripMargin.parseJson.asJsObject @@ -91,7 +91,7 @@ class ExecTests extends FlatSpec with Matchers with StreamLogging with BeforeAnd } val j2 = """{ - | "kind": "nodejs:14", + | "kind": "nodejs:20", | "code": "while (true)", | "binary": false |}""".stripMargin.parseJson.asJsObject @@ -101,7 +101,7 @@ class ExecTests extends FlatSpec with Matchers with StreamLogging with BeforeAnd //Defaults to binary val j3 = """{ - | "kind": "nodejs:14", + | "kind": "nodejs:20", | "code": "while (true)" |}""".stripMargin.parseJson.asJsObject Exec.serdes.read(j3) should matchPattern { @@ -128,7 +128,7 @@ class ExecTests extends FlatSpec with Matchers with StreamLogging with BeforeAnd it should "read code stored as jar property" in { val j1 = """{ - | "kind": "nodejs:14", + | "kind": "nodejs:20", | "jar": "SGVsbG8gT3BlbldoaXNr", | "binary": false |}""".stripMargin.parseJson.asJsObject @@ -143,7 +143,7 @@ class ExecTests extends FlatSpec with Matchers with StreamLogging with BeforeAnd | "runtimes": { | "nodejs": [ | { - | "kind": "nodejs:14", + | "kind": "nodejs:20", | "default": true, | "image": { | "prefix": "openwhisk", @@ -164,7 +164,7 @@ class ExecTests extends FlatSpec with Matchers with StreamLogging with BeforeAnd new TestConfig(Map(WhiskConfig.runtimesManifest -> oldManifestJson), ExecManifest.requiredProperties) ExecManifest.initialize(oldConfig) val j1 = """{ - | "kind": "nodejs:14", + | "kind": "nodejs:20", | "code": "SGVsbG8gT3BlbldoaXNr", | "binary": false |}""".stripMargin.parseJson.asJsObject diff --git a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/SchemaTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/SchemaTests.scala index dc2c8ef4ba9..c62d2bd6fff 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/SchemaTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/SchemaTests.scala @@ -492,18 +492,18 @@ class SchemaTests extends FlatSpec with BeforeAndAfter with ExecHelpers with Mat it should "initialize exec manifest" in { val runtimes = ExecManifest.runtimesManifest val kind = runtimes.resolveDefaultRuntime("nodejs:default").get.kind - Some(kind) should contain oneOf ("nodejs:12", "nodejs:14") + Some(kind) should contain oneOf ("nodejs:12", "nodejs:20") } it should "properly deserialize and reserialize JSON" in { val b64Body = """ZnVuY3Rpb24gbWFpbihhcmdzKSB7IHJldHVybiBhcmdzOyB9Cg==""" val json = Seq[JsObject]( - JsObject("kind" -> "nodejs:14".toJson, "code" -> "js1".toJson, "binary" -> false.toJson), - JsObject("kind" -> "nodejs:14".toJson, "code" -> "js2".toJson, "binary" -> false.toJson, "foo" -> "bar".toJson), + JsObject("kind" -> "nodejs:20".toJson, "code" -> "js1".toJson, "binary" -> false.toJson), + JsObject("kind" -> "nodejs:20".toJson, "code" -> "js2".toJson, "binary" -> false.toJson, "foo" -> "bar".toJson), JsObject("kind" -> "swift:5.3".toJson, "code" -> "swift1".toJson, "binary" -> false.toJson), JsObject("kind" -> "swift:5.3".toJson, "code" -> b64Body.toJson, "binary" -> true.toJson), - JsObject("kind" -> "nodejs:14".toJson, "code" -> b64Body.toJson, "binary" -> true.toJson)) + JsObject("kind" -> "nodejs:20".toJson, "code" -> b64Body.toJson, "binary" -> true.toJson)) val execs = json.map { e => Exec.serdes.read(e) @@ -636,8 +636,8 @@ class SchemaTests extends FlatSpec with BeforeAndAfter with ExecHelpers with Mat JsObject.empty, JsNull, JsObject("init" -> "zipfile".toJson), - JsObject("kind" -> "nodejs:14".toJson, "code" -> JsNumber(42)), - JsObject("kind" -> "nodejs:14".toJson, "init" -> "zipfile".toJson), + JsObject("kind" -> "nodejs:20".toJson, "code" -> JsNumber(42)), + JsObject("kind" -> "nodejs:20".toJson, "init" -> "zipfile".toJson), JsObject("kind" -> "turbopascal".toJson, "code" -> "BEGIN1".toJson), JsObject("kind" -> "blackbox".toJson, "code" -> "js".toJson), JsObject("kind" -> "swift".toJson, "swiftcode" -> "swift".toJson)) @@ -665,8 +665,8 @@ class SchemaTests extends FlatSpec with BeforeAndAfter with ExecHelpers with Mat it should "serialize to json" in { val execs = Seq(bb("container"), jsDefault("js"), jsDefault("js"), swift("swift")).map { _.asJson } assert(execs(0) == JsObject("kind" -> "blackbox".toJson, "image" -> "container".toJson, "binary" -> false.toJson)) - assert(execs(1) == JsObject("kind" -> "nodejs:14".toJson, "code" -> "js".toJson, "binary" -> false.toJson)) - assert(execs(2) == JsObject("kind" -> "nodejs:14".toJson, "code" -> "js".toJson, "binary" -> false.toJson)) + assert(execs(1) == JsObject("kind" -> "nodejs:20".toJson, "code" -> "js".toJson, "binary" -> false.toJson)) + assert(execs(2) == JsObject("kind" -> "nodejs:20".toJson, "code" -> "js".toJson, "binary" -> false.toJson)) assert(execs(3) == JsObject("kind" -> "swift:5.3".toJson, "code" -> "swift".toJson, "binary" -> false.toJson)) } diff --git a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/WhiskEntityTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/WhiskEntityTests.scala index 83e65d6b5ef..25bae832c62 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/WhiskEntityTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/WhiskEntityTests.scala @@ -177,7 +177,7 @@ class WhiskEntityTests extends FlatSpec with ExecHelpers with Matchers { | "version": "0.0.2", | "entityType": "action", | "exec": { - | "kind": "nodejs:14", + | "kind": "nodejs:20", | "code": "foo", | "binary": false | }, @@ -205,7 +205,7 @@ class WhiskEntityTests extends FlatSpec with ExecHelpers with Matchers { | "annotations": [], | "version": "0.0.1", | "exec": { - | "kind": "nodejs:14", + | "kind": "nodejs:20", | "code": "foo", | "binary": false | }, diff --git a/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/ContainerMessageConsumerTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/ContainerMessageConsumerTests.scala index aa2db7c2188..670b812b3f6 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/ContainerMessageConsumerTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/invoker/test/ContainerMessageConsumerTests.scala @@ -163,7 +163,7 @@ class ContainerMessageConsumerTests 500, sendAckToScheduler(producer)) - val exec = CodeExecAsString(RuntimeManifest("nodejs:14", ImageName("testImage")), "testCode", None) + val exec = CodeExecAsString(RuntimeManifest("nodejs:20", ImageName("testImage")), "testCode", None) val action = WhiskAction(EntityPath("testns"), EntityName("testAction"), exec, limits = ActionLimits(TimeLimit(1.minute))) put(entityStore, action) @@ -218,7 +218,7 @@ class ContainerMessageConsumerTests 500, sendAckToScheduler(ackConsumer.getProducer())) - val exec = CodeExecAsString(RuntimeManifest("nodejs:14", ImageName("testImage")), "testCode", None) + val exec = CodeExecAsString(RuntimeManifest("nodejs:20", ImageName("testImage")), "testCode", None) val whiskAction = WhiskAction(EntityPath("testns"), EntityName("testAction2"), exec, limits = ActionLimits(TimeLimit(1.minute))) val execMetadata = @@ -294,7 +294,7 @@ class ContainerMessageConsumerTests 500, sendAckToScheduler(producer)) - val exec = CodeExecAsString(RuntimeManifest("nodejs:14", ImageName("testImage")), "testCode", None) + val exec = CodeExecAsString(RuntimeManifest("nodejs:20", ImageName("testImage")), "testCode", None) val action = WhiskAction( WarmUp.warmUpAction.namespace.toPath, diff --git a/tests/src/test/scala/org/apache/openwhisk/core/limits/ActionLimitsTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/limits/ActionLimitsTests.scala index 7fe757428a1..0001e1225c1 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/limits/ActionLimitsTests.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/limits/ActionLimitsTests.scala @@ -75,7 +75,9 @@ class ActionLimitsTests extends TestHelpers with WskTestHelpers with WskActorSys // * With the introduction of Node.js 10, this was changed from "openFileLimit - 15" to // "openFileLimit - 20". // * With Docker 18.09.3, we observed test failures and changed to "openFileLimit - 24". - val minExpectedOpenFiles = openFileLimit - 24 + // * With the introduction of Node.js 20, this was changed from "openFileLimit - 24" to + // "openFileLimit - 30". + val minExpectedOpenFiles = openFileLimit - 30 behavior of "Action limits" diff --git a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/grpc/test/CommonVariable.scala b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/grpc/test/CommonVariable.scala index 04f0e818013..00076110df4 100644 --- a/tests/src/test/scala/org/apache/openwhisk/core/scheduler/grpc/test/CommonVariable.scala +++ b/tests/src/test/scala/org/apache/openwhisk/core/scheduler/grpc/test/CommonVariable.scala @@ -32,7 +32,7 @@ trait CommonVariable { val semVer = SemVer(0, 1, 1) val testVersion = Some(semVer) val testFQN = FullyQualifiedEntityName(testEntityPath, testEntityName, testVersion) - val testExec = CodeExecAsString(RuntimeManifest("nodejs:14", ImageName("testImage")), "testCode", None) + val testExec = CodeExecAsString(RuntimeManifest("nodejs:20", ImageName("testImage")), "testCode", None) val testExecMetadata = CodeExecMetaDataAsString(testExec.manifest, entryPoint = testExec.entryPoint) val testActionMetaData = diff --git a/tests/src/test/scala/system/rest/JsonSchemaTests.scala b/tests/src/test/scala/system/rest/JsonSchemaTests.scala index 482997dd454..86007af07e1 100644 --- a/tests/src/test/scala/system/rest/JsonSchemaTests.scala +++ b/tests/src/test/scala/system/rest/JsonSchemaTests.scala @@ -51,7 +51,7 @@ class JsonSchemaTests extends FlatSpec with Matchers with JsonSchema with RestUt | "name":"foo", | "version":"1.1.1", | "publish":false, - | "exec":{ "code": "foo", "kind": "nodejs:14" }, + | "exec":{ "code": "foo", "kind": "nodejs:20" }, | "parameters":["key1","value1"], | "limits":{ "timeout":1000, "memory":200 } }""".stripMargin assert(check(ACTION, schema))