Skip to content

Commit 6d2a63f

Browse files
skywalkeretwLuke Roy
andauthored
nodejs 18 initial commit (#220)
Co-authored-by: Luke Roy <lukeroy@Lukes-MacBook-Pro.local>
1 parent 431acd7 commit 6d2a63f

File tree

12 files changed

+273
-1
lines changed

12 files changed

+273
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ deploy:
4242
all_branches: true
4343
repo: apache/openwhisk-runtime-nodejs
4444
- provider: script
45-
script: "./tools/travis/publish.sh openwhisk nodejs14Action nightly && ./tools/travis/publish.sh openwhisk nodejs16Action nightly && ./tools/travis/publish.sh openwhisk typescript37Action nightly"
45+
script: "./tools/travis/publish.sh openwhisk nodejs14Action nightly && ./tools/travis/publish.sh openwhisk nodejs16Action nightly && ./tools/travis/publish.sh openwhisk nodejs18Action nightly && ./tools/travis/publish.sh openwhisk typescript37Action nightly"
4646
on:
4747
branch: master
4848
repo: apache/openwhisk-runtime-nodejs

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ The following Node.js runtime versions (with kind & image labels) are generated
2828

2929
- Node.js 14.19 (`nodejs:14` & `openwhisk/action-nodejs-v14`)
3030
- Node.js 16.15 (`nodejs:16` & `openwhisk/action-nodejs-v16`)
31+
- Node.js 18 (`nodejs:18` & `openwhisk/action-nodejs-v16`)
3132

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

core/nodejs18Action/.dockerignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
*.*~
2+
*.yaml
3+
*.tmpl
4+
*.gradle
5+
.dockerignore
6+
.project
7+
.settings
8+
build.xml
9+
Dockerfile
10+
logs
11+
node_modules
12+
package-lock.json
13+
test.js

core/nodejs18Action/CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!--
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one or more
4+
# contributor license agreements. See the NOTICE file distributed with
5+
# this work for additional information regarding copyright ownership.
6+
# The ASF licenses this file to You under the Apache License, Version 2.0
7+
# (the "License"); you may not use this file except in compliance with
8+
# the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
-->
19+
20+
# NodeJS 18 OpenWhisk Runtime Container
21+
22+
# Next Release
23+
- Initial release with support for Node.js v1.18
24+
25+
Node.js version = [18.4.0](https://nodejs.org/en/blog/release/v18.4.0/)
26+
OpenWhisk version = [OpenWhisk v3.21.6](https://www.npmjs.com/package/openwhisk)

core/nodejs18Action/Dockerfile

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
FROM node:18-bullseye
19+
20+
# Initial update and some basics.
21+
#
22+
RUN apt-get update && apt-get install -y \
23+
imagemagick \
24+
graphicsmagick \
25+
zip \
26+
unzip \
27+
&& rm -rf /var/lib/apt/lists/*
28+
29+
# Add sources and copy the package.json to root container,
30+
# so npm packages from user functions take precedence.
31+
#
32+
WORKDIR /nodejsAction
33+
ADD . /nodejsAction/
34+
COPY package.json /
35+
36+
# Customize runtime with additional packages.
37+
# Install package globally so user packages can override.
38+
#
39+
RUN cd / && npm install --no-package-lock --production \
40+
&& npm cache clean --force
41+
42+
EXPOSE 8080
43+
44+
CMD node --expose-gc app.js

core/nodejs18Action/build.gradle

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
apply plugin: 'eclipse'
19+
eclipse {
20+
project {
21+
natures 'org.eclipse.wst.jsdt.core.jsNature'
22+
buildCommand 'org.eclipse.wst.jsdt.core.javascriptValidator'
23+
}
24+
}
25+
26+
ext.dockerImageName = 'action-nodejs-v18'
27+
apply from: '../../gradle/docker.gradle'
28+
29+
distDocker.dependsOn 'copyPackageJson'
30+
distDocker.dependsOn 'copyProxy'
31+
distDocker.dependsOn 'copyRunner'
32+
distDocker.dependsOn 'copyService'
33+
distDocker.dependsOn 'copyPlatform'
34+
distDocker.dependsOn 'copyOpenWhisk'
35+
distDocker.dependsOn 'copyKnative'
36+
distDocker.dependsOn 'copyBuildTemplate'
37+
distDocker.finalizedBy('cleanup')
38+
39+
task copyPackageJson(type: Copy) {
40+
from '../nodejsActionBase/package.json'
41+
into '.'
42+
}
43+
44+
task copyProxy(type: Copy) {
45+
from '../nodejsActionBase/app.js'
46+
into '.'
47+
}
48+
49+
task copyRunner(type: Copy) {
50+
from '../nodejsActionBase/runner.js'
51+
into '.'
52+
}
53+
54+
task copyService(type: Copy) {
55+
from '../nodejsActionBase/src/service.js'
56+
into './src'
57+
}
58+
59+
task copyPlatform(type: Copy) {
60+
from '../nodejsActionBase/platform/platform.js'
61+
into './platform'
62+
}
63+
64+
task copyOpenWhisk(type: Copy) {
65+
from '../nodejsActionBase/platform/openwhisk.js'
66+
into './platform'
67+
}
68+
69+
task copyKnative(type: Copy) {
70+
from '../nodejsActionBase/platform/knative.js'
71+
into './platform'
72+
}
73+
74+
task copyBuildTemplate(type: Copy) {
75+
from '../nodejsActionBase/buildtemplate.yaml'
76+
into '.'
77+
}
78+
79+
task cleanup(type: Delete) {
80+
delete 'package.json'
81+
delete 'app.js'
82+
delete 'runner.js'
83+
delete 'src'
84+
delete 'platform'
85+
delete 'buildtemplate.yaml'
86+
}

settings.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ include 'tests'
2020
include 'core:nodejsActionBase'
2121
include 'core:nodejs14Action'
2222
include 'core:nodejs16Action'
23+
include 'core:nodejs18Action'
2324
include 'core:typescript37Action'
2425
include 'tests:dat:docker:nodejs14docker'
2526
include 'tests:dat:docker:nodejs16docker'
27+
include 'tests:dat:docker:nodejs18docker'
2628
include 'tests:dat:docker:typescript37docker'
2729

2830
rootProject.name = 'runtime-nodejs'
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
FROM action-nodejs-v18
18+
COPY package.json .
19+
RUN npm install --production
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
ext.dockerImageName = 'nodejs18docker'
19+
apply from: '../../../../gradle/docker.gradle'
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "testdocker",
3+
"version": "1.0.0",
4+
"main": "index.js",
5+
"dependencies": {
6+
"openwhisk": "2.0.0"
7+
}
8+
}

0 commit comments

Comments
 (0)