This is an automated email from the ASF dual-hosted git repository. rabbah pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/openwhisk-runtime-nodejs.git
commit d30bb021f6b12917066ef5a252aebf95fcb1646e Author: Ben Sooraj <[email protected]> AuthorDate: Mon May 11 23:53:32 2020 +0530 support for Node.js v14 --- core/nodejs14Action/.dockerignore | 8 ++++ core/nodejs14Action/CHANGELOG.md | 20 ++++++++++ core/nodejs14Action/Dockerfile | 32 ++++++++++++++++ core/nodejs14Action/build.gradle | 79 +++++++++++++++++++++++++++++++++++++++ core/nodejs14Action/package.json | 18 +++++++++ 5 files changed, 157 insertions(+) diff --git a/core/nodejs14Action/.dockerignore b/core/nodejs14Action/.dockerignore new file mode 100644 index 0000000..3081e3e --- /dev/null +++ b/core/nodejs14Action/.dockerignore @@ -0,0 +1,8 @@ +node_modules +package-lock.json +Dockerfile +build.gradle +.project +.settings +build.xml +logs \ No newline at end of file diff --git a/core/nodejs14Action/CHANGELOG.md b/core/nodejs14Action/CHANGELOG.md new file mode 100644 index 0000000..7d2ae4e --- /dev/null +++ b/core/nodejs14Action/CHANGELOG.md @@ -0,0 +1,20 @@ +<!-- +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +--> + +# NodeJS 14 OpenWhisk Runtime Container diff --git a/core/nodejs14Action/Dockerfile b/core/nodejs14Action/Dockerfile new file mode 100644 index 0000000..f0262f0 --- /dev/null +++ b/core/nodejs14Action/Dockerfile @@ -0,0 +1,32 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +FROM node:14.2.0-stretch +RUN apt-get update && apt-get install -y \ + imagemagick \ + graphicsmagick \ + unzip \ + && rm -rf /var/lib/apt/lists/* +WORKDIR /nodejsAction +COPY . . +# COPY the package.json to root container, so we can install npm packages a level up from user's packages, so user's packages take precedence +COPY ./package.json / +RUN cd / && npm install --no-package-lock \ + && npm cache clean --force +EXPOSE 8080 + +CMD node --expose-gc app.js diff --git a/core/nodejs14Action/build.gradle b/core/nodejs14Action/build.gradle new file mode 100644 index 0000000..da173e2 --- /dev/null +++ b/core/nodejs14Action/build.gradle @@ -0,0 +1,79 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +apply plugin: 'eclipse' +eclipse { + project { + natures 'org.eclipse.wst.jsdt.core.jsNature' + buildCommand 'org.eclipse.wst.jsdt.core.javascriptValidator' + } +} + +ext.dockerImageName = 'action-nodejs-v14' +apply from: '../../gradle/docker.gradle' + +distDocker.dependsOn 'copyProxy' +distDocker.dependsOn 'copyRunner' +distDocker.dependsOn 'copyService' +distDocker.dependsOn 'copyPlatform' +distDocker.dependsOn 'copyOpenWhisk' +distDocker.dependsOn 'copyKnative' +distDocker.dependsOn 'copyBuildTemplate' +distDocker.finalizedBy('cleanup') + +task copyProxy(type: Copy) { + from '../nodejsActionBase/app.js' + into '.' +} + +task copyRunner(type: Copy) { + from '../nodejsActionBase/runner.js' + into '.' +} + +task copyService(type: Copy) { + from '../nodejsActionBase/src/service.js' + into './src' +} + +task copyPlatform(type: Copy) { + from '../nodejsActionBase/platform/platform.js' + into './platform' +} + +task copyOpenWhisk(type: Copy) { + from '../nodejsActionBase/platform/openwhisk.js' + into './platform' +} + +task copyKnative(type: Copy) { + from '../nodejsActionBase/platform/knative.js' + into './platform' +} + +task copyBuildTemplate(type: Copy) { + from '../nodejsActionBase/buildtemplate.yaml' + into '.' +} + +task cleanup(type: Delete) { + delete 'app.js' + delete 'runner.js' + delete 'src' + delete 'platform' + delete 'buildtemplate.yaml' +} diff --git a/core/nodejs14Action/package.json b/core/nodejs14Action/package.json new file mode 100644 index 0000000..375859b --- /dev/null +++ b/core/nodejs14Action/package.json @@ -0,0 +1,18 @@ +{ + "name": "action-nodejs-v14", + "version": "1.0.0", + "description": "Apache OpenWhisk NodeJS Runtime", + "repository": { + "type": "git", + "url": "[email protected]:apache/openwhisk-runtime-nodejs.git" + }, + "license": "Apache-2.0", + "dependencies": { + "openwhisk": "3.21.1", + "body-parser": "1.18.3", + "express": "4.16.4", + "serialize-error": "3.0.0", + "redis": "2.8.0", + "uuid": "3.3.0" + } +}
