Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .asf.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +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.

github:
rulesets:
- name: "Default Branch Protection"
Expand Down
23 changes: 23 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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.
#

* text=auto eol=lf
*.sh text eol=lf
*.ps1 text eol=crlf
*.png binary
*.jpg binary
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ You can put it at work with the following procedure

1. clone everyting and open it in VSCode:
```
git clone https://github.com/francescotimperi/openserverless-controller --recurse-submodules
code nuvolaris
git clone https://github.com/apache/openserverless-build
code openserverless-build
```
It will open and show a pop-up asking if you want to `Reopen in Container`. Click on it.

2. When it has finished, open the `workspace.code-workspace` file and then open the workspace (there will be a button to do that, click on it).
3. Open the Metals plugin (click on the icon that looks like an 'm').
To import the project, click on `New Scala Project` (but do not create any project actually) then `import build`. This will activate the Metals plugin, it will import all the subprojects and make available all the features of the plugin.
Expand Down
79 changes: 41 additions & 38 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
version: '3'

dotenv:
dotenv:
- .env

vars:
Expand Down Expand Up @@ -52,7 +52,7 @@ vars:
sh: echo "$HOME/.ops/0.1.0/olaris/opsroot.json"
KIND_NODE: nuvolaris-control-plane
KUBE_NAMESPACE: nuvolaris
DOCKER_REGISTRY: registry.hub.docker.com/apache
DOCKER_REGISTRY: docker.io/apache
LOCAL_DOCKER_REGISTRY:
sh: echo "${LOCAL_DOCKER_REGISTRY:-localhost:5000/apache}"
LOCAL_REGISTRY_CONTAINER:
Expand All @@ -76,8 +76,8 @@ tasks:

default:
- task --list-all
setup:

setup:
silent: true

ensure-openwhisk:
Expand Down Expand Up @@ -125,7 +125,7 @@ tasks:
cmds:
- ./gradlew :core:scheduler:distTar
status:
- test -f core/scheduler/build/distributions/scheduler.tar
- test -f core/scheduler/build/distributions/scheduler.tar

compile:standalone:
dir: openwhisk
Expand All @@ -138,26 +138,26 @@ tasks:

native:standalone-libs:
deps:
- compile:standalone
- compile:standalone
dir: openwhisk
cmds:
- ./gradlew core:standalone:copyRuntimeLibs
- ./gradlew core:standalone:copyRuntimeLibs

native:standalone-build:
deps:
- native:standalone-libs
- native:standalone-libs
dir: openwhisk/core/standalone
cmds:
- native-image
--initialize-at-run-time=io.netty,akka.protobufv3.internal.UnsafeUtil
--initialize-at-run-time=io.netty,akka.protobufv3.internal.UnsafeUtil
--no-fallback --report-unsupported-elements-at-runtime
--trace-object-instantiation=ch.qos.logback.classic.Logger
--enable-url-protocols=http,https
-march=native
-cp build/classes/scala/main:build/resources/main:build/dependency-libs/*
-H:ConfigurationFileDirectories=$PWD/../../../standalone/graal-config
-o $PWD/../../../standalone/dist/{{.EXEC_NAME}}
org.apache.openwhisk.standalone.StandaloneOpenWhisk
org.apache.openwhisk.standalone.StandaloneOpenWhisk
vars:
EXEC_NAME: "${NATIVE_IMAGE_NAME:-openwhisk-standalone}"

Expand All @@ -170,14 +170,14 @@ tasks:

native:standalone-config:
deps:
- compile:standalone
- compile:standalone
dir: openwhisk/core/standalone
cmds:
- java -agentlib:native-image-agent=config-output-dir=../../../standalone/graal-config
-cp build/classes/scala/main:build/resources/main:build/dependency-libs/*
- java -agentlib:native-image-agent=config-output-dir=../../../standalone/graal-config
-cp build/classes/scala/main:build/resources/main:build/dependency-libs/*
-Dwhisk.standalone.host.name="0.0.0.0"
-Dwhisk.standalone.host.internal="$(hostname -f)"
org.apache.openwhisk.standalone.StandaloneOpenWhisk
-Dwhisk.standalone.host.internal="$(hostname -f)"
org.apache.openwhisk.standalone.StandaloneOpenWhisk

clean:
ignore_error: true
Expand Down Expand Up @@ -223,19 +223,19 @@ tasks:
(build)
docker build {{.DIR}} -t {{.IMG}} --build-arg BASE={{.BASE}}
;;
(buildx)
(buildx)
docker buildx build --platform linux/amd64,linux/arm64 --build-arg BASE={{.BASE}} -t {{.IMG}} {{.DIR}}
;;
(buildx-local)
docker buildx build --platform linux/amd64,linux/arm64 --build-arg BASE={{.BASE}} -t {{.IMG}} {{.DIR}} --push
;;
(buildx-push)
docker buildx build --platform linux/amd64,linux/arm64 --build-arg BASE={{.BASE}} -t {{.IMG}} {{.DIR}} --push
(buildx-push)
docker buildx build --platform linux/amd64,linux/arm64 --build-arg BASE={{.BASE}} -t {{.IMG}} {{.DIR}} --push
;;
(*) echo ACT must be "build|buildx|buildx-local|buildx-push"
esac

# this requires ACT IMG OPENWHISK_JAR and DIR parameters to be passed
# this requires ACT IMG OPENWHISK_JAR and DIR parameters to be passed
docker-build-standalone:
silent: true
cmds:
Expand All @@ -245,25 +245,25 @@ tasks:
(build)
docker build {{.DIR}} -t {{.IMG}} --build-arg BASE={{.BASE}} --build-arg OPENWHISK_JAR={{.OPENWHISK_JAR}}
;;
(buildx)
(buildx)
docker buildx build --platform linux/amd64,linux/arm64 --build-arg BASE={{.BASE}} --build-arg OPENWHISK_JAR={{.OPENWHISK_JAR}} -t {{.IMG}} {{.DIR}}
;;
(buildx-local)
docker buildx build --platform linux/amd64,linux/arm64 --build-arg BASE={{.BASE}} --build-arg OPENWHISK_JAR={{.OPENWHISK_JAR}} -t {{.IMG}} {{.DIR}} --push
;;
(buildx-push)
docker buildx build --platform linux/amd64,linux/arm64 --build-arg BASE={{.BASE}} --build-arg OPENWHISK_JAR={{.OPENWHISK_JAR}} -t {{.IMG}} {{.DIR}} --push
(buildx-push)
docker buildx build --platform linux/amd64,linux/arm64 --build-arg BASE={{.BASE}} --build-arg OPENWHISK_JAR={{.OPENWHISK_JAR}} -t {{.IMG}} {{.DIR}} --push
;;
(*) echo ACT must be "build|buildx|buildx-local|buildx-push"
esac
esac

build:scala:
cmds:
- task: docker-build
vars:
DIR: openwhisk/common/scala
IMG: "{{.DOCKER_REGISTRY}}/{{.COMMON_IMAGE}}:{{.TAG}}"
ACT: '{{.ACT}}'
IMG: "{{.DOCKER_REGISTRY}}/{{.COMMON_IMAGE}}:{{.TAG}}"
ACT: '{{.ACT}}'

build:controller:
deps:
Expand All @@ -275,7 +275,7 @@ tasks:
IMG: "{{.DOCKER_REGISTRY}}/${MY_CONTROLLER_IMAGE:-{{.CONTROLLER_IMAGE}}}:{{.TAG}}"
ACT: '{{.ACT}}'
BASE: "{{.DOCKER_REGISTRY}}/{{.COMMON_IMAGE}}:{{.TAG}}"

build:invoker:
deps:
- compile:invoker
Expand All @@ -296,8 +296,8 @@ tasks:
DIR: openwhisk/core/scheduler
IMG: "{{.DOCKER_REGISTRY}}/${MY_SCHEDULER_IMAGE:-{{.SCHEDULER_IMAGE}}}:{{.TAG}}"
ACT: '{{.ACT}}'
BASE: "{{.DOCKER_REGISTRY}}/{{.COMMON_IMAGE}}:{{.TAG}}"
BASE: "{{.DOCKER_REGISTRY}}/{{.COMMON_IMAGE}}:{{.TAG}}"

build:standalone:
deps:
- compile:standalone
Expand All @@ -309,7 +309,7 @@ tasks:
ACT: '{{.ACT}}'
BASE: "{{.DOCKER_REGISTRY}}/{{.COMMON_IMAGE}}:{{.TAG}}"
OPENWHISK_JAR: "build/libs/openwhisk-standalone-1.0.0-SNAPSHOT.jar"

build-all:
cmds:
- |
Expand All @@ -324,16 +324,16 @@ tasks:
- task: ensure-openwhisk
- task: build:scala
vars:
ACT: "build"
ACT: "build"
- task: build:controller
vars:
ACT: "build"
ACT: "build"
- task: build:invoker
vars:
ACT: "build"
- task: build:scheduler
vars:
ACT: "build"
ACT: "build"
- task: build:standalone
vars:
ACT: "build"
Expand All @@ -345,6 +345,9 @@ tasks:
if test "${OPENWHISK_BUILDCONTAINER:-}" = "1"; then
task buildx-all:local
else
if docker ps | grep vsc-build
then docker rm -f $(docker ps | awk '/vsc-build/{print $1}')
fi
printf '%s\n' 'mkdir -p /tmp/openserverless-docker-config && printf "{}\n" >/tmp/openserverless-docker-config/config.json && OPENWHISK_BUILDCONTAINER=1 DOCKER_CONFIG=/tmp/openserverless-docker-config TAG="{{.TAG}}" task buildx-all:local' | ops ide devcontainer
fi

Expand Down Expand Up @@ -458,16 +461,16 @@ tasks:
- task: docker-setup
- task: build:scala
vars:
ACT: "buildx-push"
ACT: "buildx-push"
- task: build:controller
vars:
ACT: "buildx-push"
ACT: "buildx-push"
- task: build:invoker
vars:
ACT: "buildx-push"
- task: build:scheduler
vars:
ACT: "buildx-push"
ACT: "buildx-push"
- task: build:standalone
vars:
ACT: "buildx-push"
Expand Down Expand Up @@ -495,14 +498,14 @@ tasks:
-p 3232:3232 -p 3233:3233
-v /var/run/docker.sock:/var/run/docker.sock
{{.DOCKER_REGISTRY}}/openwhisk2/standalone:{{.TAG}}
interactive: true
interactive: true

run:standalone:
deps:
- native:standalone-libs
- native:standalone-libs
dir: openwhisk/core/standalone
cmds:
- java -cp build/classes/scala/main:build/resources/main:build/dependency-libs/*
- java -cp build/classes/scala/main:build/resources/main:build/dependency-libs/*
-Dwhisk.standalone.host.name="0.0.0.0"
-Dwhisk.standalone.host.internal="$(hostname -f)"
org.apache.openwhisk.standalone.StandaloneOpenWhisk --no-browser
Binary file modified healthy-import.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions scripts/kind-local.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* 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.
*/

#!/usr/bin/env bun

import { existsSync, readFileSync, writeFileSync } from "fs";
Expand Down
Loading