Skip to content
Draft
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
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@
path = devcontainer
url = https://github.com/apache/openserverless-devcontainer
branch = main
[submodule "streamer"]
path = streamer
url = git@github.com:apache/openserverless-streamer
[submodule "admin-api"]
path = admin-api
url = git@github.com:apache/openserverless-admin-api
77 changes: 56 additions & 21 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,18 @@ 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}}"

RUNTIMES_TAG:
sh: git -C runtimes rev-parse --short HEAD
STREAMER_TAG: "{{.OPERATOR_TAG}}"
STREAMER_SRC: "registry.hub.docker.com/apache/openserverless-streamer:{{.STREAMER_TAG}}"

ADMIN_API_TAG: "{{.OPERATOR_TAG}}"
ADMIN_API_SRC: "registry.hub.docker.com/apache/openserverless-admin-api:{{.ADMIN_API_TAG}}"

OPERATOR_SRC: "{{.OPERATOR_IMG}}:{{.OPERATOR_TAG}}"
RUNTIMES_TAG: "{{.OPERATOR_TAG}}"

OPERATOR_TGT:
sh: |
B64="$(echo {{.OPERATOR_SRC}} | /usr/bin/base64 -w0 )"
echo ~/.ops/{{OS}}-{{ARCH}}/images/kind/$B64

tasks:

Expand All @@ -27,14 +25,22 @@ tasks:
desc: clean the intermediate artifacts
cmds:
- rm -vf ./ops ~/.ops/{{OS}}-{{ARCH}}/images/kind/*
- rm -vf ./ops

image-save:
desc: save an a SRC image in the TGT file
requires: { vars: [SRC, TGT]}
requires: { vars: [SRC]}
env:
TGT:
sh: |
B64="$(echo {{.SRC}} | /usr/bin/base64 -w0 )"
echo ~/.ops/{{OS}}-{{ARCH}}/images/kind/$B64
cmds:
- mkdir -p "{{ dir .TGT}}"
- docker save {{.SRC}} -o {{.TGT}}

- echo Saving {{.SRC}} in "$TGT"
- mkdir -p "$(dirname $TGT)"
- docker save {{.SRC}} -o "$TGT"
status:
- ! test -e "$TGT"

cli:
desc: build the cli
Expand All @@ -53,13 +59,38 @@ tasks:
- 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}}"

streamer:
desc: build the streamer
deps:
- cli
dir: streamer
cmds:
- echo Building {{.STREAMER_SRC}}
- git tag -d $(git tag) && git tag {{.STREAMER_TAG}}
- echo -e "NAMESPACE=apache\nREGISTRY=apache\n" >.env
- task buildx
- task: image-save
vars:
SRC: "{{.STREAMER_SRC}}"


admin-api:
desc: build the admin-api
deps:
- cli
dir: admin-api
cmds:
- echo Building {{.ADMIN_API_SRC}}
- git tag -d $(git tag) && git tag {{.STREAMER_TAG}}
- echo -e "NAMESPACE=apache\nREGISTRY=apache\n" >.env
- task buildx
- task: image-save
vars:
SRC: "{{.ADMIN_API_SRC}}"

opsroot:
desc: build current opsroot.json
Expand All @@ -68,8 +99,9 @@ tasks:
- test -e opsroot.orig || jq . <opsroot.json >opsroot.orig
- >
jq <opsroot.orig >opsroot.json '
.config.images = {} |
.config.images.operator = "{{.OPERATOR_SRC}}"
.config.images.operator = "{{.OPERATOR_SRC}}" |
.config.images.streamer = "{{.STREAMER_SRC}}" |
.config.images.systemapi = "{{.ADMIN_API_SRC}}"
'
- diff opsroot.orig opsroot.json || true

Expand All @@ -83,8 +115,8 @@ tasks:
- task render-runtimes
- cp runtimes.json ../olaris/runtimes.json
- task: runtimes-save
runtimes-save:

runtimes-json:
desc: save runtimes images
dir: runtimes
vars:
Expand All @@ -103,5 +135,8 @@ tasks:
cmds:
- task: cli
- task: operator
- task: opsroot
- task: runtimes
- task: streamer
- task: admin-api
- task: opsroot
- task: runtimes-json
1 change: 1 addition & 0 deletions admin-api
Submodule admin-api added at ad94c4
1 change: 1 addition & 0 deletions streamer
Submodule streamer added at 57dd32