Skip to content

Commit

Permalink
Rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiaxin Fan authored and Jiaxin Fan committed Jan 30, 2023
1 parent c2887b2 commit 8ed4daf
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 218 deletions.
105 changes: 105 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# 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.
#

name: Continuous Integration

on:
push:
branches: [ master ]
tags: [ '*' ]
pull_request:
branches: [ master ]
types: [ opened, synchronize, reopened ]
schedule:
- cron: '30 1 * * 1,3,5'

permissions: read-all

jobs:
ci:
runs-on: ubuntu-22.04
env:
PUSH_NIGHTLY: ${{ (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/master' }}
PUSH_RELEASE: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
steps:
# Checkout just this repo and run scanCode before we do anything else
- name: Checkout runtime repo
uses: actions/checkout@v3
with:
path: runtime
- name: Scan Code
uses: apache/openwhisk-utilities/scancode@master

# Install core OpenWhisk artifacts needed to build/test anything else
- name: Checkout OpenWhisk core repo
uses: actions/checkout@v3
with:
repository: apache/openwhisk
path: core
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Compile and Install Core OpenWhisk
working-directory: core
run: |
./gradlew :tests:compileTestScala
./gradlew install
# Build this repository
- name: Build Runtime
working-directory: runtime
run: |
./gradlew distDocker
# Test this repository
- name: Test Runtime
working-directory: runtime
run: |
./gradlew :tests:checkScalafmtAll
./gradlew :tests:test
# Conditionally publish runtime images to DockerHub
# Important: naming convention for release tags is runtime@version
- name: Docker Login
if: ${{ env.PUSH_NIGHTLY == 'true' || env.PUSH_RELEASE == 'true' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER_OPENWHISK }}
password: ${{ secrets.DOCKERHUB_TOKEN_OPENWHISK }}
- name: Push Nightly Images
if: ${{ env.PUSH_NIGHTLY == 'true' }}
working-directory: runtime
run: |
SHORT_COMMIT=$(git rev-parse --short "$GITHUB_SHA")
./gradlew :core:nodejs14Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=nightly
./gradlew :core:nodejs14Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=$SHORT_COMMIT
./gradlew :core:nodejs16Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=nightly
./gradlew :core:nodejs16Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=$SHORT_COMMIT
./gradlew :core:nodejs18Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=nightly
./gradlew :core:nodejs18Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=$SHORT_COMMIT
./gradlew :core:typescript37Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=nightly
./gradlew :core:typescript37Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=$SHORT_COMMIT
- name: Push Release Images
if: ${{ env.PUSH_RELEASE == 'true' }}
working-directory: runtime
run: |
RUNTIME_NAME=${GITHUB_REF_NAME%@*}
IMAGE_TAG=${GITHUB_REF_NAME##*@}
./gradlew :core:$RUNTIME_NAME:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=$IMAGE_TAG
53 changes: 0 additions & 53 deletions .travis.yml

This file was deleted.

14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
# Apache OpenWhisk runtimes for Node.js

[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![Build Status](https://travis-ci.com/apache/openwhisk-runtime-nodejs.svg?branch=master)](https://travis-ci.com/github/apache/openwhisk-runtime-nodejs)
[![Continuous Integration](https://github.com/apache/openwhisk-runtime-nodejs/actions/workflows/ci.yaml/badge.svg)](https://github.com/apache/openwhisk-runtime-nodejs/actions/workflows/ci.yaml)

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 14.19 (`nodejs:14` & `openwhisk/action-nodejs-v14`)
- Node.js 16.15 (`nodejs:16` & `openwhisk/action-nodejs-v16`)
- Node.js 18 (`nodejs:18` & `openwhisk/action-nodejs-v16`)
- Node.js 16 (`nodejs:16` & `openwhisk/action-nodejs-v16`)
- Node.js 18 (`nodejs:18` & `openwhisk/action-nodejs-v18`)

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

Expand Down Expand Up @@ -56,6 +56,7 @@ All the runtime images are published by the project to Docker Hub @ [https://hub

- [https://hub.docker.com/r/openwhisk/action-nodejs-v14](https://hub.docker.com/r/openwhisk/action-nodejs-v14)
- [https://hub.docker.com/r/openwhisk/action-nodejs-v16](https://hub.docker.com/r/openwhisk/action-nodejs-v16)
- [https://hub.docker.com/r/openwhisk/action-nodejs-v18](https://hub.docker.com/r/openwhisk/action-nodejs-v18)

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.

Expand Down Expand Up @@ -84,9 +85,10 @@ The `core/nodejsActionBase` folder contains the Node.js app server used to imple
```
./gradlew core:nodejs14Action:distDocker
./gradlew core:nodejs16Action:distDocker
./gradlew core:nodejs18Action:distDocker
```

This will return the following runtime images with the following names: `action-nodejs-v14` and `action-nodejs-v16`.
This will return the following runtime images with the following names: `action-nodejs-v14`, `action-nodejs-v16`, and `action-nodejs-v18`.

### Testing

Expand All @@ -104,11 +106,11 @@ This will return the following runtime images with the following names: `action-
```
./gradlew tests:dat:docker:nodejs14docker:distDocker
./gradlew tests:dat:docker:nodejs16docker:distDocker
./gradlew tests:dat:docker:nodejs18docker:distDocker
```

- Run the project tests.

```
./gradlew :tests:test
```
An update about the details of verifying a standalone container can be found [here](https://github.com/apache/openwhisk-runtime-nodejs/tree/master/docs/users)
```
45 changes: 0 additions & 45 deletions tools/travis/build.sh

This file was deleted.

50 changes: 0 additions & 50 deletions tools/travis/publish.sh

This file was deleted.

34 changes: 0 additions & 34 deletions tools/travis/setup.sh

This file was deleted.

30 changes: 0 additions & 30 deletions tools/travis/test.sh

This file was deleted.

0 comments on commit 8ed4daf

Please sign in to comment.