From 61f7fc287a90e34e1c7343364a6fd9347af57b20 Mon Sep 17 00:00:00 2001 From: Michele Sciabarra Date: Thu, 8 Jan 2026 01:47:52 +0000 Subject: [PATCH 1/7] select platform --- util/freeze/opsfile.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/freeze/opsfile.yml b/util/freeze/opsfile.yml index 4ab7731..2eede01 100644 --- a/util/freeze/opsfile.yml +++ b/util/freeze/opsfile.yml @@ -46,7 +46,7 @@ tasks: if test -e "$file" then echo "already saved $img.{{ARCH}} " else echo ">>> Saving: $img" - if docker pull "$img" + if docker pull --platform linux/{{ARCH}} "$img" then echo "OK: save $file" else echo "*** FAIL: pull $img" fi @@ -76,7 +76,7 @@ tasks: if test -e "$file" then echo "already saved $img" else echo ">>> Saving: $img" - if ! docker pull "$img" + if ! docker pull --platform linux/{{ARCH}} "$img" then echo "*** FAIL pull $img" ; continue fi if ! docker save "$img" -o "$file" From 5829808accada75b880e4baf6d3c14425d670940 Mon Sep 17 00:00:00 2001 From: Michele Sciabarra Date: Thu, 8 Jan 2026 08:00:29 +0000 Subject: [PATCH 2/7] added some checks --- setup/docker/opsfile.yml | 32 -------------------------------- setup/opsfile.yml | 5 +---- util/freeze/opsfile.yml | 4 ++-- util/kube/opsfile.yml | 24 +++++++++++++++--------- 4 files changed, 18 insertions(+), 47 deletions(-) diff --git a/setup/docker/opsfile.yml b/setup/docker/opsfile.yml index 1fb27a4..fae175b 100644 --- a/setup/docker/opsfile.yml +++ b/setup/docker/opsfile.yml @@ -93,38 +93,6 @@ tasks: cmds: - uv run space.py - preload: - silent: true - desc: preload the Apache OpenServerless images in docker to speed up the cluster creation - ignore_errors: true - status: - - config SKIP_PRELOAD_IMAGES - cmds: - - | - for image in "$IMAGES_STREAMER" "$IMAGES_OPERATOR" "$IMAGES_CONTROLLER" - do - docker pull "$image" --platform "linux/{{ARCH}}" - if ! kind load docker-image "$image" --name {{.CLUSTER}} - then - echo "*** Cannot preload images. You can disable preload with ops -config SKIP_PRELOAD_IMAGES=1" - echo "*** Workaround on Docker Desktop: disable 'Use containerd for pulling and storing images' on General" - echo "*** WARNING! If you skip preload, it can take a lot of time before the system starts. Be patient." - exit 1 - fi - docker rmi "$image" - done - - | - jq -r '.runtimes[][] - | select(.default == true) - | .image - | "\(.prefix)/\(.name):\(.tag)"' <$OPS_ROOT/runtimes.json \ - | rg apache/openserverless-runtime \ - | while read -r image; do - docker pull "$image" --platform "linux/{{ARCH}}" - kind load docker-image "$image" --name "{{.CLUSTER}}" - docker rmi "$image" - done - clean-all: silent: true desc: remove all images and containers from docker diff --git a/setup/opsfile.yml b/setup/opsfile.yml index eac7fa9..1cce159 100644 --- a/setup/opsfile.yml +++ b/setup/opsfile.yml @@ -144,10 +144,7 @@ tasks: task check-ports PORTS="{{ .PORTS }}" fi {{.RUN}} ops setup docker create - if test -z {{.__skip_preload_images}} - then - {{.RUN}} ops setup docker preload - fi + {{.RUN}} ops util kube waitinfo {{.RUN}} ops setup kubernetes create {{.RUN}} ops setup nuvolaris login config STATUS_LAST=devcluster diff --git a/util/freeze/opsfile.yml b/util/freeze/opsfile.yml index 2eede01..2ba8935 100644 --- a/util/freeze/opsfile.yml +++ b/util/freeze/opsfile.yml @@ -12,7 +12,6 @@ vars: sh: > awk '/image:/{print $2}' $OPS_ROOT/setup/docker/kind.yaml | tee _docker.lst - tasks: docker-list: @@ -148,7 +147,8 @@ tasks: #echo $file b64="$(basename "$file")" img="$(base64 -d "${b64#*-}")" - kind load image-archive "$file" -n {{.CLUSTER}} --nodes {{.CLUSTER}}-control-plane + docker load -i "$file" --platform "linux/{{ARCH}}" + kind load docker-image "$img" -n {{.CLUSTER}} --nodes {{.CLUSTER}}-control-plane done status: - test -z "$(ls {{.IMAGES}}/kind/* 2>/dev/null)" diff --git a/util/kube/opsfile.yml b/util/kube/opsfile.yml index 129f03c..2759dd2 100644 --- a/util/kube/opsfile.yml +++ b/util/kube/opsfile.yml @@ -32,8 +32,14 @@ env: tasks: + waitinfo: + silent: true + desc: get info on the cluster retrying until it is available + cmds: + - retry -t 100 -m 10 kubectl cluster-info + waitfor: - desc: wait for an object matching a condition + desc: wait for an object matching a condition silent: true cmds: - test -n "{{.OBJ}}" || die "use OBJ=" @@ -42,14 +48,14 @@ tasks: N=0 RES=false while [[ $N -lt {{.RETRY}} ]] - do + do if kubectl -n nuvolaris wait --for="{{.FOR}}" "{{.OBJ}}" --timeout="{{.TIMEOUT}}s" - then RES=true; break + then RES=true; break else echo "$((N++)) Waiting {{.OBJ}} for {{.FOR}}" sleep "{{.SLEEP}}s" fi done - $RES + $RES wait: desc: wait for a value matching the given jsonpath on the specific resources under the namespace nuvolaris @@ -61,17 +67,17 @@ tasks: N=0 RES=false while [[ $N -lt {{.RETRY}} ]] - do + do MATCHING_VALUE="$(kubectl -n nuvolaris get {{.OBJECT}} -o jsonpath='{{.JSONPATH}}')" if [[ -z "$MATCHING_VALUE" ]] - then + then echo "$((N++)) Waiting for {{.JSONPATH}} to be non empty value" sleep 5 - else + else RES=true; break fi done - $RES + $RES export: desc: exporting NAMEd kubeconfig to specified FILE @@ -80,7 +86,7 @@ tasks: - test -e "$OPS_TMP/{{.NAME}}.kubeconfig" || die "no {{.NAME}} kubeconfig" - | FILE="$(realpath {{.FILE}})" - cp "$OPS_TMP/kubeconfig" "$FILE" + cp "$OPS_TMP/kubeconfig" "$FILE" import: desc: importing FILE to the NAMEd kubeconfig From 06597a9caeb117bf10056bb9947f78ecf7751507 Mon Sep 17 00:00:00 2001 From: Michele Sciabarra Date: Thu, 8 Jan 2026 12:06:33 +0000 Subject: [PATCH 3/7] fixes to image load --- setup/docker/opsfile.yml | 21 ++++++++++++++------- util/freeze/opsfile.yml | 5 ++--- util/kube/opsfile.yml | 3 ++- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/setup/docker/opsfile.yml b/setup/docker/opsfile.yml index fae175b..1a1f1e5 100644 --- a/setup/docker/opsfile.yml +++ b/setup/docker/opsfile.yml @@ -79,6 +79,7 @@ tasks: skip_verify = true EOF' docker exec nuvolaris-control-plane systemctl restart containerd + retry kubectl --kubeconfig="$OPS_TMP/kubeconfig" cluster-info ingress: silent: true @@ -109,13 +110,19 @@ tasks: silent: true desc: create the Apache OpenServerless cluster in Docker cmds: - - ops util freeze docker-load - - task: cluster - - ops util freeze kind-load - - task: ingress - - cp "$OPS_TMP/kubeconfig" "$OPS_TMP/kind-{{.CLUSTER}}.kubeconfig" - status: - - kind get clusters | rg {{.CLUSTER}} + - | + if kind get clusters | rg {{.CLUSTER}} + then + kind export kubeconfig --name {{.CLUSTER}} --kubeconfig "$OPS_TMP/kubeconfig" + else + ops util freeze docker-load + ops setup docker cluster + ops util freeze kind-load + kind export kubeconfig --name {{.CLUSTER}} --kubeconfig "$OPS_TMP/kubeconfig" + ops setup docker ingress + fi + - ops util kube waitinfo + - cp "$OPS_TMP/kubeconfig" "$OPS_TMP/kind-{{.CLUSTER}}.kubeconfig" delete: silent: true diff --git a/util/freeze/opsfile.yml b/util/freeze/opsfile.yml index 2ba8935..20a0ef7 100644 --- a/util/freeze/opsfile.yml +++ b/util/freeze/opsfile.yml @@ -122,7 +122,7 @@ tasks: desc: load disk images in docker cmds: - | - for file in {{.IMAGES}}/docker/* + for file in {{.IMAGES}}/docker/* {{.IMAGES}}/kind/* do b64=$(basename "$file") img=$(base64 -d "${b64#*-}") @@ -147,8 +147,7 @@ tasks: #echo $file b64="$(basename "$file")" img="$(base64 -d "${b64#*-}")" - docker load -i "$file" --platform "linux/{{ARCH}}" - kind load docker-image "$img" -n {{.CLUSTER}} --nodes {{.CLUSTER}}-control-plane + kind load docker-image "$img" -n {{.CLUSTER}} --nodes {{.CLUSTER}}-control-plane 2>/dev/null done status: - test -z "$(ls {{.IMAGES}}/kind/* 2>/dev/null)" diff --git a/util/kube/opsfile.yml b/util/kube/opsfile.yml index 2759dd2..3ff17d1 100644 --- a/util/kube/opsfile.yml +++ b/util/kube/opsfile.yml @@ -36,7 +36,8 @@ tasks: silent: true desc: get info on the cluster retrying until it is available cmds: - - retry -t 100 -m 10 kubectl cluster-info + - echo KUBECONFIG=$KUBECONFIG + - retry kubectl cluster-info waitfor: desc: wait for an object matching a condition From 794c7eec0f2553b2ec31bbdef6f5463b410f235b Mon Sep 17 00:00:00 2001 From: Michele Sciabarra Date: Thu, 8 Jan 2026 17:43:35 +0000 Subject: [PATCH 4/7] opsfile --- setup/docker/opsfile.yml | 10 +++++----- setup/opsfile.yml | 1 - util/docopts.md | 2 -- util/kube/opsfile.yml | 7 ------- util/opsfile.yml | 27 --------------------------- 5 files changed, 5 insertions(+), 42 deletions(-) diff --git a/setup/docker/opsfile.yml b/setup/docker/opsfile.yml index 1a1f1e5..ce3c4bc 100644 --- a/setup/docker/opsfile.yml +++ b/setup/docker/opsfile.yml @@ -66,8 +66,7 @@ tasks: - envsubst -i kind.yaml -o _kind.yaml - > kind create cluster - --kubeconfig="$OPS_TMP/kubeconfig" - --wait=1m --name=nuvolaris + --wait=2m --name=nuvolaris --config=_kind.yaml - | docker exec nuvolaris-control-plane mkdir -p /etc/containerd/certs.d/127.0.0.1:32000 @@ -79,7 +78,10 @@ tasks: skip_verify = true EOF' docker exec nuvolaris-control-plane systemctl restart containerd - retry kubectl --kubeconfig="$OPS_TMP/kubeconfig" cluster-info + kind export kubeconfig -n nuvolaris --kubeconfig "$OPS_TMP/kubeconfig" + echo "waiting for kind ready..." + retry test -e $OPS_TMP/kubeconfig + retry kubectl --kubeconfig $OPS_TMP/kubeconfig cluster-info ingress: silent: true @@ -118,10 +120,8 @@ tasks: ops util freeze docker-load ops setup docker cluster ops util freeze kind-load - kind export kubeconfig --name {{.CLUSTER}} --kubeconfig "$OPS_TMP/kubeconfig" ops setup docker ingress fi - - ops util kube waitinfo - cp "$OPS_TMP/kubeconfig" "$OPS_TMP/kind-{{.CLUSTER}}.kubeconfig" delete: diff --git a/setup/opsfile.yml b/setup/opsfile.yml index 1cce159..f4bd7f2 100644 --- a/setup/opsfile.yml +++ b/setup/opsfile.yml @@ -144,7 +144,6 @@ tasks: task check-ports PORTS="{{ .PORTS }}" fi {{.RUN}} ops setup docker create - {{.RUN}} ops util kube waitinfo {{.RUN}} ops setup kubernetes create {{.RUN}} ops setup nuvolaris login config STATUS_LAST=devcluster diff --git a/util/docopts.md b/util/docopts.md index f2bff4c..1ab1629 100644 --- a/util/docopts.md +++ b/util/docopts.md @@ -44,7 +44,6 @@ Usage: util ingress-type util edit [] util link-plugin - util docker-proxy [] [] [--remove] ``` ## Commands @@ -70,7 +69,6 @@ Usage: - ingress-type return the ingress type - edit edit (with vscode) the current tasks or a plugin - link-plugin link the in current directory to the global list -- docker-proxy launch (or remove) in docker a proxy listening in public (default 8080) to the (default devel.miniops.me) ``` ## Options diff --git a/util/kube/opsfile.yml b/util/kube/opsfile.yml index 3ff17d1..5d16367 100644 --- a/util/kube/opsfile.yml +++ b/util/kube/opsfile.yml @@ -32,13 +32,6 @@ env: tasks: - waitinfo: - silent: true - desc: get info on the cluster retrying until it is available - cmds: - - echo KUBECONFIG=$KUBECONFIG - - retry kubectl cluster-info - waitfor: desc: wait for an object matching a condition silent: true diff --git a/util/opsfile.yml b/util/opsfile.yml index e938cd5..3d7e00e 100644 --- a/util/opsfile.yml +++ b/util/opsfile.yml @@ -279,33 +279,6 @@ tasks: exit 1 fi - docker-proxy: - desc: create in docker a proxy to expose miniops.me (or others) - silent: true - vars: - PORT: '{{or ._port_ "8080"}}' - HOST: '{{or ._host_ "devel.miniops.me"}}' - NGINX_CONF: > - server { - listen 80; - location / { - proxy_pass http://nuvolaris-control-plane:80; - proxy_set_header Host {{.HOST}}; - } - } - cmds: - - | - if {{.__remove}} - then docker rm docker-proxy-{{.PORT}} -f - else - if docker run -d --name docker-proxy-{{.PORT}} -p {{.PORT}}:80 --network kind nginx:alpine sh -c \ - "echo '{{.NGINX_CONF}}' > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'" - then echo "docker-proxy started on port {{.PORT}} to http://{{.HOST}}" - else echo "Cannot start docker-proxy-{{.PORT}} - either the port is busy or another instance is running, remove it" - fi - fi - - freeze: desc: freeze util From 8c880dcd9c0b57729681a9dd5ca61ab2d05f2788 Mon Sep 17 00:00:00 2001 From: Michele Sciabarra Date: Sat, 10 Jan 2026 17:00:20 +0000 Subject: [PATCH 5/7] fxes --- util/freeze/opsfile.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/util/freeze/opsfile.yml b/util/freeze/opsfile.yml index 20a0ef7..4ec1061 100644 --- a/util/freeze/opsfile.yml +++ b/util/freeze/opsfile.yml @@ -57,7 +57,7 @@ tasks: done kind-save: - silent: false + silent: true desc: list images in kindes env: CLU: "{{.KIND_CLUSTER}}" @@ -74,7 +74,7 @@ tasks: file={{.IMAGES}}/kind/"$(base64 -e "$img")" if test -e "$file" then echo "already saved $img" - else echo ">>> Saving: $img" + else echo ">>> Saving: {{ARCH}} $img" if ! docker pull --platform linux/{{ARCH}} "$img" then echo "*** FAIL pull $img" ; continue fi @@ -122,7 +122,7 @@ tasks: desc: load disk images in docker cmds: - | - for file in {{.IMAGES}}/docker/* {{.IMAGES}}/kind/* + for file in {{.IMAGES}}/docker/* do b64=$(basename "$file") img=$(base64 -d "${b64#*-}") @@ -139,16 +139,15 @@ tasks: desc: load disk images in kind cmds: - | - N=0 for file in {{.IMAGES}}/kind/* do - N=$(($N+1)) - printf "\rKind: loading images: [$(seq 1 $N | awk '{printf "#"}')]" - #echo $file b64="$(basename "$file")" img="$(base64 -d "${b64#*-}")" - kind load docker-image "$img" -n {{.CLUSTER}} --nodes {{.CLUSTER}}-control-plane 2>/dev/null + echo "Kind: loadging $img" + docker exec -i {{.CLUSTER}}-control-plane ctr --namespace=k8s.io images import --snapshotter=overlayfs - < "$file" done + echo 'Images loaded:' + - task: kind-list status: - test -z "$(ls {{.IMAGES}}/kind/* 2>/dev/null)" From 46d884cd87106c19a7747ff6a8138da1313c2f22 Mon Sep 17 00:00:00 2001 From: Michele Sciabarra Date: Sun, 11 Jan 2026 11:24:52 +0000 Subject: [PATCH 6/7] fixed typo --- util/freeze/opsfile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/freeze/opsfile.yml b/util/freeze/opsfile.yml index 4ec1061..5ebb6b4 100644 --- a/util/freeze/opsfile.yml +++ b/util/freeze/opsfile.yml @@ -143,7 +143,7 @@ tasks: do b64="$(basename "$file")" img="$(base64 -d "${b64#*-}")" - echo "Kind: loadging $img" + echo "Kind: loading $img" docker exec -i {{.CLUSTER}}-control-plane ctr --namespace=k8s.io images import --snapshotter=overlayfs - < "$file" done echo 'Images loaded:' From 1029ec0fff9e0c7c1ff27b82c3ee45fc4584adb3 Mon Sep 17 00:00:00 2001 From: Michele Sciabarra Date: Mon, 12 Jan 2026 10:42:28 +0000 Subject: [PATCH 7/7] race conditions in nginx ingrees --- setup/docker/opsfile.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/setup/docker/opsfile.yml b/setup/docker/opsfile.yml index ce3c4bc..e43b194 100644 --- a/setup/docker/opsfile.yml +++ b/setup/docker/opsfile.yml @@ -80,14 +80,14 @@ tasks: docker exec nuvolaris-control-plane systemctl restart containerd kind export kubeconfig -n nuvolaris --kubeconfig "$OPS_TMP/kubeconfig" echo "waiting for kind ready..." - retry test -e $OPS_TMP/kubeconfig + retry -t 100 -m 600 test -e $OPS_TMP/kubeconfig retry kubectl --kubeconfig $OPS_TMP/kubeconfig cluster-info ingress: silent: true cmds: - > - kubectl --kubeconfig="$OPS_TMP/kubeconfig" + retry kubectl --kubeconfig="$OPS_TMP/kubeconfig" apply -f ingress-deploy.yaml check-space: @@ -114,8 +114,7 @@ tasks: cmds: - | if kind get clusters | rg {{.CLUSTER}} - then - kind export kubeconfig --name {{.CLUSTER}} --kubeconfig "$OPS_TMP/kubeconfig" + then kind export kubeconfig --name {{.CLUSTER}} --kubeconfig "$OPS_TMP/kubeconfig" else ops util freeze docker-load ops setup docker cluster