From be6ce6fb711b475b6c3451466e251b65a45ffad0 Mon Sep 17 00:00:00 2001 From: Trustable User Date: Sun, 3 May 2026 16:22:25 +0100 Subject: [PATCH 1/4] build from sources the operator --- README.md | 42 +++++++++++++++---------- Taskfile.yml | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++ test.sh | 25 +++++++++++++++ 3 files changed, 139 insertions(+), 17 deletions(-) create mode 100644 Taskfile.yml create mode 100755 test.sh diff --git a/README.md b/README.md index da673cb..540006b 100644 --- a/README.md +++ b/README.md @@ -8,39 +8,47 @@ Welcome to [Apache OpenServerless](https://openserverless.apache.org), an incu - If you want to **discuss** with us, join our mailing list sending an email to `dev-subscribe@openserverless.apache.org` - If you want to **locally install** open serverless from sources test or development, read on. -# Build from sources +# Build and test from sources ## Prerequisites - you need an Unix environment, either OSX, Linux or Windows WSL. -- you need docker availabe on the path +- you need docker docker on the path - you need go available on the path +- you need task (https://taskfile.dev) available in the path ## Procedure -Clone all the modules and submodules recursively: +### 1. Get the sources -1. `git clone https://github.com/apache/openserverless --recurse-submodules` +Clone all the modules and submodules recursively -2. build ops running `./build.sh` +`git clone https://github.com/apache/openserverless --recurse-submodules` -3. check ops works executing `./ops -info` +### 2. Build -verify that OPS_ROOT is equals to $PWD/olaris, so you can use the tasks from sources +First clean everything -then execute `./ops -t` +`task clean` -you should see somethin like this (files and version may vary) +then build: -``` -ensuring prerequisite coreutils 0.0.27 -ensuring prerequisite bun 1.2.5 -ensuring prerequisite kubectl 1.33.1 -``` +`task build` -4. install openserverless in docker with +This will +- build the cli +- build the operator image +TODO: build the runtimes + +3. Smoke est + +Execute a basic smoke test + +`bash smoke.sh` + +4. More tests + +TODO: execute locally the ful test suite under ./testing -`./ops setup mini` -If everything works you end up with a running openserverless in docker diff --git a/Taskfile.yml b/Taskfile.yml new file mode 100644 index 0000000..9b35192 --- /dev/null +++ b/Taskfile.yml @@ -0,0 +1,89 @@ +version: 3 + +vars: + + OPERATOR_IMG: + sh: awk -F= '/ARG OPERATOR_IMAGE_DEFAULT=/ { print $2 ; exit }' olaris-op/Dockerfile + + OPERATOR_TAG: + sh: git -C olaris-op rev-parse --short HEAD + + OPERATOR_SRC: "{{.OPERATOR_IMG}}:{{.OPERATOR_TAG}}" + + OPERATOR_TGT: + sh: | + B64="$(echo {{.OPERATOR_SRC}} | /usr/bin/base64 -w0 )" + echo ~/.ops/{{OS}}-{{ARCH}}/images/kind/$B64 + +tasks: + + default: task -l + + clean: + desc: clean the intermediate artifacts + cmds: + - rm -vf ./ops ~/.ops/{{OS}}-{{ARCH}}/images/kind/* + + build: + desc: build all + cmds: + - task: cli + - task: operator + - task: opsroot + + + image-save: + desc: save an a SRC image in the TGT file + requires: { vars: [SRC, TGT]} + cmds: + - docker save {{.SRC}} -o {{.TGT}} + + cli: + desc: build the cli + dir: cli + cmds: + - go build -o ../ops cmd/ops/main.go + status: + - ! test -e ../ops + + operator: + desc: build the operator + deps: + - cli + dir: olaris-op + cmds: + - echo Building {{.OPERATOR_SRC}} + - git tag -d $(git tag) && git tag {{.OPERATOR_TAG}} + - task b:build + - echo Saving {{.OPERATOR_TGT}} + - task: image-save + vars: + SRC: "{{.OPERATOR_SRC}}" + TGT: "{{.OPERATOR_TGT}}" + status: + - ! test -e "{{.OPERATOR_TGT}}" + + + opsroot: + desc: build current opsroot.json + dir: olaris + cmds: + - test -e opsroot.orig || jq . opsroot.orig + - > + jq opsroot.json ' + .config.images = {} | + .config.images.operator = "{{.OPERATOR_SRC}}" + ' + - diff opsroot.orig opsroot.json || true + + runtimes: + desc: build current runtimes.json + dir: olaris + cmds: + - test -e runtimes.orig || jq . runtimes.orig + - > + jq runtimes.json ' + .runtimes = {} | + .blackboxes = {} + ' + - diff runtimes.orig runtimes.json || true diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..ba7127c --- /dev/null +++ b/test.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +set -euo pipefail + +echo Checking prerequisites +test -e ./ops +which docker + +echo Cleaning everything +docker rm -f nuvolaris-control-plane + +echo Creating Kind Cluster +./ops setup docker create + +echo Checking Images +./ops util fr kind-list | grep apache/openserverless + +echo Deploying the operator + +./ops setup kubernetes permission +./ops setup kubernetes pre-deploy +./ops setup kubernetes operator + +echo Wait until the operator is up-and-running +./ops setup kubernetes wait OBJECT=po/nuvolaris-operator-0 COND=true From e682f21877a023cc0f4b15425c69a4c0248aea53 Mon Sep 17 00:00:00 2001 From: Trustable User Date: Sun, 3 May 2026 16:22:46 +0100 Subject: [PATCH 2/4] removed build.sh --- build.sh | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 build.sh diff --git a/build.sh b/build.sh deleted file mode 100644 index 20ad74d..0000000 --- a/build.sh +++ /dev/null @@ -1,3 +0,0 @@ -cd cli -go build -o ../ops cmd/ops/main.go -cd .. \ No newline at end of file From c5d2edf7ec7c488092360eb98f53b7bd5996a1ac Mon Sep 17 00:00:00 2001 From: Trustable User Date: Sun, 3 May 2026 16:25:33 +0100 Subject: [PATCH 3/4] chages --- CHANGES | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index f351a0d..cb16e5a 100644 --- a/CHANGES +++ b/CHANGES @@ -2,3 +2,7 @@ - archived old readme and dev environment files (moved in attic) - build from sources compiling the cli (updated the README.md) + +# sciabarracom 3 May 2026 +- `Taskfile.yml` for building the operator +- `test.sh` for a smoke test \ No newline at end of file From 066a9f031670a3bfbbfc2ffe14b2ff81e51aa8e9 Mon Sep 17 00:00:00 2001 From: Trustable User Date: Mon, 4 May 2026 09:15:04 +0100 Subject: [PATCH 4/4] fixed readme --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 540006b..34b1ac0 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Welcome to [Apache OpenServerless](https://openserverless.apache.org), an incu ## Prerequisites - you need an Unix environment, either OSX, Linux or Windows WSL. -- you need docker docker on the path +- you need docker on the path - you need go available on the path - you need task (https://taskfile.dev) available in the path @@ -40,7 +40,7 @@ This will - build the operator image TODO: build the runtimes -3. Smoke est +3. Smoke test Execute a basic smoke test @@ -48,7 +48,7 @@ Execute a basic smoke test 4. More tests -TODO: execute locally the ful test suite under ./testing +TODO: execute locally the full test suite under ./testing