Skip to content
Open
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
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -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
42 changes: 25 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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 test

Execute a basic smoke test

`bash smoke.sh`

4. More tests

TODO: execute locally the full test suite under ./testing

`./ops setup mini`

If everything works you end up with a running openserverless in docker

89 changes: 89 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -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.json >opsroot.orig
- >
jq <opsroot.orig >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.json >runtimes.orig
- >
jq <runtimes.orig >runtimes.json '
.runtimes = {} |
.blackboxes = {}
'
- diff runtimes.orig runtimes.json || true
3 changes: 0 additions & 3 deletions build.sh

This file was deleted.

25 changes: 25 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -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