Skip to content

Commit 723eaaa

Browse files
authored
Merge pull request #11 from francescotimperi/main
GitHub action for native standalone build
2 parents 09f2cf1 + 7c78602 commit 723eaaa

9 files changed

Lines changed: 3700 additions & 1855 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
110110
fi
111111

112112
ENV HOME=/home/openserverless
113-
ENV ANSIBLE_CMD="ansible-playbook -i environments/local -e docker_image_prefix=testing -e container_pool_akka_client=false -e jmxremote_enabled=false -e elasticsearch.version=7.8.0"
113+
ENV ANSIBLE_CMD="ansible-playbook -i environments/local -e docker_image_prefix=testing -e container_pool_akka_client=false"
114114
ENV GRADLE_PROJS_SKIP=""
115115
WORKDIR /home/openserverless
116116
ENTRYPOINT [ "/usr/bin/socat","UNIX-LISTEN:/var/run/docker.sock,fork,mode=660,user=openserverless","UNIX-CONNECT:/var/run/docker-host.sock" ]

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
// under the License.
1717
{
1818
"name": "openserverless",
19-
"image": "ghcr.io/francescotimperi/devow:ops-jdk17.25060119",
19+
"image": "ghcr.io/francescotimperi/devow:ops-jdk17.25060220",
2020
//"build": { "dockerfile": "Dockerfile" },
2121
"mounts": [
2222
"source=/var/run/docker.sock,target=/var/run/docker-host.sock,type=bind",
2323
"type=bind,source=${env:HOME}/.ssh,target=/home/openserverless/.ssh",
24-
"source=/var/tmp/wskconf,target=/var/tmp/wskconf,type=bind"
24+
"source=/var/tmp,target=/var/tmp,type=bind"
2525
],
2626
"remoteUser": "openserverless",
2727
"overrideCommand": false,

.github/workflows/native.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with 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,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
19+
name: Build OpenServerless OpenWhisk 2 Standalone native executable
20+
21+
on:
22+
workflow_dispatch:
23+
inputs:
24+
tag:
25+
description: 'Release version (e.g., v1.2.3)'
26+
required: true
27+
jobs:
28+
build:
29+
runs-on: ${{ matrix.os }}
30+
strategy:
31+
matrix:
32+
include:
33+
- os: ubuntu-22.04
34+
target: linux
35+
extension: ''
36+
- os: macos-latest
37+
target: macos
38+
extension: ''
39+
40+
name: Build native for ${{ matrix.target }}
41+
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@v2
45+
with:
46+
submodules: recursive
47+
48+
- name: Setup CI
49+
run: bash .github/cisetup.sh
50+
shell: bash
51+
52+
- name: Set up JDK 17
53+
uses: actions/setup-java@v4
54+
with:
55+
distribution: 'graalvm'
56+
java-version: '17.0.9'
57+
58+
- name: Assign TAG from pull request
59+
if: ${{ github.event_name == 'pull_request' }}
60+
run: |
61+
echo "IMG_TAG=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV"
62+
shell: bash
63+
- name: Assign TAG from push
64+
if: ${{ github.event_name != 'pull_request' }}
65+
run: |
66+
echo "IMG_TAG=$(git describe --tags --abbrev=0)" >> "$GITHUB_ENV"
67+
shell: bash
68+
- name: Assign native standalone executable name
69+
run: |
70+
ARCH=$(echo "${{ runner.arch }}" | tr '[:upper:]' '[:lower:]')
71+
PLATFORM=$(echo "${{ matrix.target }}" | tr '[:upper:]' '[:lower:]')
72+
FILENAME="openwhisk-standalone-${PLATFORM}-${ARCH}-${IMG_TAG}${{ matrix.extension }}"
73+
echo "NATIVE_IMAGE_NAME=$FILENAME" >> $GITHUB_ENV
74+
shell: bash
75+
- name: Native Image
76+
run: task native:standalone-build
77+
shell: bash
78+
- name: Upload to GitHub Release
79+
uses: softprops/action-gh-release@v2
80+
with:
81+
files: standalone/dist/$NATIVE_IMAGE_NAME
82+
env:
83+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84+
85+
86+

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ openwhisk-*/
3636
*.tar
3737
playground.*
3838
.secrets
39+
.DS_Store
40+
standalone/dist/openwhisk*
41+
standalone/dist/reports

Taskfile.yml

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,37 +88,43 @@ tasks:
8888
- test -f ../standalone/lib/openwhisk-standalone.jar
8989

9090
native:standalone-libs:
91+
deps:
92+
- compile:standalone
9193
dir: openwhisk
9294
cmds:
9395
- ./gradlew core:standalone:copyRuntimeLibs
9496

9597
native:standalone-build:
9698
deps:
97-
- compile:standalone
9899
- native:standalone-libs
99100
dir: openwhisk/core/standalone
100101
cmds:
101102
- native-image
102-
--initialize-at-run-time=io.netty
103+
--initialize-at-run-time=io.netty,akka.protobufv3.internal.UnsafeUtil
103104
--no-fallback --report-unsupported-elements-at-runtime
104105
--trace-object-instantiation=ch.qos.logback.classic.Logger
105106
--enable-url-protocols=http,https
107+
-march=native
106108
-cp build/classes/scala/main:build/resources/main:build/dependency-libs/*
107-
-H:ConfigurationFileDirectories=/workspaces/openserverless-controller/standalone/graal-config
108-
-o /workspaces/openserverless-controller/standalone/exe/openwhisk-standalone.exe
109-
org.apache.openwhisk.standalone.StandaloneOpenWhisk
109+
-H:ConfigurationFileDirectories=$PWD/../../../standalone/graal-config
110+
-o $PWD/../../../standalone/dist/{{.EXEC_NAME}}
111+
org.apache.openwhisk.standalone.StandaloneOpenWhisk
112+
vars:
113+
EXEC_NAME: "${NATIVE_IMAGE_NAME:-openwhisk-standalone}"
110114

111115
native:standalone-run:
112-
dir: standalone/exe
116+
dir: standalone/dist
113117
cmds:
114-
- ./openwhisk-standalone.exe -Dwhisk.standalone.host.name="0.0.0.0" -Dwhisk.standalone.host.internal="$(hostname -f)" --no-browser --disable-color-logging
118+
- ./openwhisk-standalone -Xmx2g -Dwhisk.standalone.host.name="0.0.0.0" -Dwhisk.standalone.host.internal="$(hostname -f)" -Dkamon.auto-start=no --no-browser
119+
env:
120+
KAMON_ENABLED: false
115121

116122
native:standalone-config:
117123
deps:
118124
- compile:standalone
119125
dir: openwhisk/core/standalone
120126
cmds:
121-
- java -agentlib:native-image-agent=config-output-dir=../../standalone/graal-config
127+
- java -agentlib:native-image-agent=config-output-dir=../../../standalone/graal-config
122128
-cp build/classes/scala/main:build/resources/main:build/dependency-libs/*
123129
-Dwhisk.standalone.host.name="0.0.0.0"
124130
-Dwhisk.standalone.host.internal="$(hostname -f)"
@@ -277,3 +283,22 @@ tasks:
277283
dir: openwhisk
278284
cmds:
279285
- ./gradlew distDocker -PdockerMultiArchBuild=true -PdockerRegistry={{.DOCKER_REGISTRY}} -PdockerImagePrefix=openwhisk2 -PdockerImageTag={{.TAG}}
286+
287+
run:standalone-docker:
288+
cmds:
289+
- >
290+
docker run -ti
291+
-p 3232:3232 -p 3233:3233
292+
-v /var/run/docker.sock:/var/run/docker.sock
293+
{{.DOCKER_REGISTRY}}/openwhisk2/standalone:{{.TAG}}
294+
interactive: true
295+
296+
run:standalone:
297+
deps:
298+
- native:standalone-libs
299+
dir: openwhisk/core/standalone
300+
cmds:
301+
- java -cp build/classes/scala/main:build/resources/main:build/dependency-libs/*
302+
-Dwhisk.standalone.host.name="0.0.0.0"
303+
-Dwhisk.standalone.host.internal="$(hostname -f)"
304+
org.apache.openwhisk.standalone.StandaloneOpenWhisk --no-browser

standalone/dist/dummy.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Simple placeholder to ensure that this foler is being created into Github

0 commit comments

Comments
 (0)