This is an automated email from the ASF dual-hosted git repository.

sciabarracom pushed a commit to branch 0.9.0
in repository https://gitbox.apache.org/repos/asf/openserverless-build.git


The following commit(s) were added to refs/heads/0.9.0 by this push:
     new 7c97989  ideppotent build
7c97989 is described below

commit 7c97989598e56be41fd5bb39e26b67183a5d210e
Author: Trustable User <[email protected]>
AuthorDate: Sun Jul 12 21:42:07 2026 +0200

    ideppotent build
---
 .devcontainer/Dockerfile        | 135 ++++++++++++++++++++++++++++++++++++++++
 .devcontainer/devcontainer.json |  43 +++++++++++++
 .gitignore                      |   1 -
 Taskfile.yml                    |  78 ++++++++++++-----------
 4 files changed, 218 insertions(+), 39 deletions(-)

diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
new file mode 100644
index 0000000..5ad6a18
--- /dev/null
+++ b/.devcontainer/Dockerfile
@@ -0,0 +1,135 @@
+# 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 ubuntu:22.04
+LABEL maintainer="Michele Sciabarra [email protected], Francesco Timperi 
Tiberi [email protected]"
+ARG TARGETPLATFORM
+
+# configure dpkg && timezone
+ENV TZ=Europe/London
+RUN echo 'debconf debconf/frontend select Noninteractive' | 
debconf-set-selections ;\
+    ln -snf /usr/share/zoneinfo/$TZ /etc/localtime ;\
+    echo $TZ > /etc/timezone
+# add docker and java (amazon corretto) repos
+RUN apt-get update && apt-get -y upgrade &&\
+    apt-get -y install \
+    software-properties-common apt-utils \
+    lsb-release ca-certificates \
+    curl wget gpg sudo \
+    socat telnet inetutils-ping \
+    unzip vim telnet less sudo git \
+    python3 python3-pip gcc g++ make \
+    silversearcher-ag zip lsof netcat
+# install java (amazon corretto) and libs
+RUN pip3 install --upgrade pip setuptools six 
+# python2 stuff
+RUN ln -sf /usr/bin/python3 /usr/bin/python ;\
+    curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py ;\
+    python get-pip.py ;\
+    python -m pip install docker==5.0.0 ansible==2.8.18 jinja2==3.0.1 
couchdb==1.2 httplib2==0.19.1 requests==2.25.1 six==1.16.0 flake8
+# docker
+RUN . /etc/os-release ;\
+    echo "deb [arch=$(dpkg --print-architecture) 
signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] 
https://download.docker.com/linux/ubuntu ${VERSION_CODENAME} stable" > 
/etc/apt/sources.list.d/docker.list ;\
+    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor > 
/usr/share/keyrings/docker-archive-keyring.gpg ;\
+    apt-get update && apt-get -y install docker-ce-cli docker-buildx-plugin
+# protobuf setup
+RUN apt-get -y install protobuf-compiler
+
+# install graalvm
+ENV GRAALVM_HOME=/opt/graalvm
+ENV PATH=$GRAALVM_HOME/bin:$PATH
+ENV GRAALVM_VERSION=jdk-17.0.9
+ENV WSK_VERSION=1.2.0
+
+
+#https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-17.0.9/graalvm-community-jdk-17.0.9_linux-aarch64_bin.tar.gz
+#https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-17.0.9/graalvm-community-jdk-17.0.9_linux-x64_bin.tar.gz
+
+RUN echo "TARGETPLATFORM is $TARGETPLATFORM"
+RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
+      wget 
https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-17.0.9/graalvm-community-jdk-17.0.9_linux-aarch64_bin.tar.gz
 -O /tmp/graalvm.tar.gz; \
+    elif [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
+      wget 
https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-17.0.9/graalvm-community-jdk-17.0.9_linux-x64_bin.tar.gz
 -O /tmp/graalvm.tar.gz; \
+    else \
+        echo "Unsupported platform: $TARGETPLATFORM"; \
+        exit 1; \      
+    fi && \
+    # Extract GraalVM
+    mkdir -p $GRAALVM_HOME && \
+    tar -xvzf /tmp/graalvm.tar.gz --strip-components=1 -C $GRAALVM_HOME && \
+    rm /tmp/graalvm.tar.gz && \
+    # Install Native Image
+    gu install native-image && \
+    # Clean up
+    apt-get clean
+
+# Set GraalVM as the default Java
+RUN update-alternatives --install /usr/bin/java java $GRAALVM_HOME/bin/java 1
+RUN update-alternatives --install /usr/bin/javac javac $GRAALVM_HOME/bin/javac 
1
+
+# Verify GraalVM and Native Image installation
+RUN java -version
+RUN native-image --version
+
+# OpenWhisk distDocker is built with JDK 11 in this branch. Keep GraalVM
+# available for native-image, but make Temurin 11 the default Java toolchain.
+ENV JAVA11_HOME=/opt/jdk-11
+RUN set -eux; \
+    case "$TARGETPLATFORM" in \
+      linux/amd64) 
JDK_URL="https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.17%2B8/OpenJDK11U-jdk_x64_linux_hotspot_11.0.17_8.tar.gz";
 ;; \
+      linux/arm64) 
JDK_URL="https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.17%2B8/OpenJDK11U-jdk_aarch64_linux_hotspot_11.0.17_8.tar.gz";
 ;; \
+      *) echo "Unsupported platform: $TARGETPLATFORM" >&2; exit 1 ;; \
+    esac; \
+    curl -fsSL "$JDK_URL" | tar xz -C /opt; \
+    mv /opt/jdk-11.0.17+8 "$JAVA11_HOME"; \
+    update-alternatives --install /usr/bin/java java "$JAVA11_HOME/bin/java" 
2; \
+    update-alternatives --install /usr/bin/javac javac 
"$JAVA11_HOME/bin/javac" 2
+
+ENV JAVA_HOME=$JAVA11_HOME
+ENV PATH=$JAVA_HOME/bin:$GRAALVM_HOME/bin:$PATH
+RUN java -version && javac -version && native-image --version
+    
+RUN useradd -m openserverless -s /bin/bash ;\
+    echo "openserverless ALL=(ALL:ALL) NOPASSWD: ALL" >>/etc/sudoers
+# node
+RUN curl -sL https://deb.nodesource.com/setup_22.x | bash ;\
+    apt-get install -y nodejs ;\
+    curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee 
/usr/share/keyrings/yarnkey.gpg >/dev/null ;\
+    echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] 
https://dl.yarnpkg.com/debian stable main" | tee 
/etc/apt/sources.list.d/yarn.list ;\
+    apt-get update && sudo apt-get install yarn
+# task
+RUN sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b 
/usr/local/bin
+# act github actions verifier
+RUN curl --proto '=https' --tlsv1.2 -sSf 
https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
+
+RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
+      curl -sL 
https://github.com/apache/openwhisk-cli/releases/download/${WSK_VERSION}/OpenWhisk_CLI-${WSK_VERSION}-linux-arm64.tgz
 \
+      | tar xzvf - -C /usr/bin wsk; \
+    elif [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
+      curl -sL 
https://github.com/apache/openwhisk-cli/releases/download/${WSK_VERSION}/OpenWhisk_CLI-${WSK_VERSION}-linux-amd64.tgz
 \
+      | tar xzvf - -C /usr/bin wsk; \
+    else \
+        echo "Unsupported platform: $TARGETPLATFORM"; \
+        exit 1; \
+    fi
+
+ENV HOME=/home/openserverless
+ENV ANSIBLE_CMD="ansible-playbook -i environments/local -e 
docker_image_prefix=testing -e container_pool_akka_client=false"
+ENV GRADLE_PROJS_SKIP=""
+WORKDIR /home/openserverless
+ENTRYPOINT [ 
"/usr/bin/socat","UNIX-LISTEN:/var/run/docker.sock,fork,mode=660,user=openserverless","UNIX-CONNECT:/var/run/docker-host.sock"
 ]    
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
new file mode 100644
index 0000000..e5b56f8
--- /dev/null
+++ b/.devcontainer/devcontainer.json
@@ -0,0 +1,43 @@
+//  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": "openserverless",
+       "build": { "dockerfile": "Dockerfile" },
+       "mounts": [
+               
"source=/var/run/docker.sock,target=/var/run/docker-host.sock,type=bind",
+               
"type=bind,source=${env:HOME}/.ssh,target=/home/openserverless/.ssh",
+               "source=/var/tmp,target=/var/tmp,type=bind"
+       ],
+       "remoteUser": "openserverless",
+       "overrideCommand": false,
+       "customizations": {
+               "vscode": {
+                       "extensions": [
+                               "stuart.unique-window-colors",
+                               "oderwat.indent-rainbow",
+                               "eamodio.gitlens",
+                               "mhutchie.git-graph",
+                               "scalameta.metals", 
+                               "vscjava.vscode-java-test"
+                       ]
+               }
+       },
+       "runArgs": [
+                       "--network", "host",
+                       "--add-host", "host.docker.internal:127.0.0.1"
+       ]
+}
diff --git a/.gitignore b/.gitignore
index 3e94ebf..73b170a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -39,4 +39,3 @@ playground.*
 .DS_Store
 standalone/dist/openwhisk*
 standalone/dist/reports
-.devcontainer/
diff --git a/Taskfile.yml b/Taskfile.yml
index 632b450..5c26ac5 100644
--- a/Taskfile.yml
+++ b/Taskfile.yml
@@ -17,7 +17,7 @@
 #
 version: '3'
 
-dotenv: 
+dotenv:
   - .env
 
 vars:
@@ -76,8 +76,8 @@ tasks:
 
   default:
     - task --list-all
-  
-  setup: 
+
+  setup:
     silent: true
 
   ensure-openwhisk:
@@ -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
@@ -138,18 +138,18 @@ 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
@@ -157,7 +157,7 @@ tasks:
       -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}"
 
@@ -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
@@ -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:
@@ -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:
@@ -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
@@ -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
@@ -309,14 +309,13 @@ tasks:
           ACT: '{{.ACT}}'
           BASE: "{{.DOCKER_REGISTRY}}/{{.COMMON_IMAGE}}:{{.TAG}}"
           OPENWHISK_JAR: "build/libs/openwhisk-standalone-1.0.0-SNAPSHOT.jar"
-  
+
   build-all:
     cmds:
     - |
       if test "${OPENWHISK_BUILDCONTAINER:-}" = "1"; then
         task build-all:local
       else
-        rm -Rvf .devcontainer
         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 build-all:local' | ops ide devcontainer
       fi
 
@@ -325,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"
@@ -346,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
 
@@ -459,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"
@@ -496,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

Reply via email to