From b67a19049f719da021ba452a455100f5f860ae8d Mon Sep 17 00:00:00 2001 From: Michele Sciabarra <“msciabarra@apache.org”> Date: Tue, 9 Dec 2025 14:07:00 +0100 Subject: [PATCH 1/6] work-in-progress --- util/freeze/opsfile.yml | 26 ++++++++++++++++++++++++++ util/opsfile.yml | 3 +++ 2 files changed, 29 insertions(+) create mode 100644 util/freeze/opsfile.yml diff --git a/util/freeze/opsfile.yml b/util/freeze/opsfile.yml new file mode 100644 index 00000000..3ce2ad01 --- /dev/null +++ b/util/freeze/opsfile.yml @@ -0,0 +1,26 @@ +version: 3 + +vars: + KIND_CLUSTER: nuvolaris-control-plane + #KIND_CLUSTER: kind-control-plane + KIND_IMAGE: + sh: > + docker inspect {{.KIND_CLUSTER}} | jq -r '.[0].Config.Image' + +tasks: + + list-images: + desc: list images in kind + cmds: + - docker inspect {{.KIND_CLUSTER}} | jq -r '.[0].Config.Image' >_images.lst + - > + docker exec -it {{.KIND_CLUSTER}} crictl images 2>/dev/null + | awk 'NR > 1 && !/^(registry.k8s.io\/(kube-|coredns|etc|pause)|docker.io\/kindest\/)/ {print $1 ":" $2 }' + | tee -a _images.lst + + # | awk '!/^registry.k8s.io/ { print $1 ":" $2 }' + + save: + desc: save all current images + cmds: + - echo '{{.KIND_IMAGE}}' diff --git a/util/opsfile.yml b/util/opsfile.yml index 3a0f947f..44172641 100644 --- a/util/opsfile.yml +++ b/util/opsfile.yml @@ -306,3 +306,6 @@ tasks: fi + freeze: + desc: freeze util + From d40e727265ace26246416eea6dce9fe64d5baf54 Mon Sep 17 00:00:00 2001 From: Michele Sciabarra <“msciabarra@apache.org”> Date: Wed, 10 Dec 2025 12:30:03 +0100 Subject: [PATCH 2/6] offline images --- setup/docker/kind.yaml | 66 ++++++++++++++-------------- setup/docker/opsfile.yml | 37 +++++++++------- util/freeze/opsfile.yml | 92 +++++++++++++++++++++++++++++++++++----- util/opsfile.yml | 2 +- 4 files changed, 138 insertions(+), 59 deletions(-) diff --git a/setup/docker/kind.yaml b/setup/docker/kind.yaml index cc9d71c7..5e416f49 100644 --- a/setup/docker/kind.yaml +++ b/setup/docker/kind.yaml @@ -30,36 +30,36 @@ nodes: nodeRegistration: kubeletExtraArgs: node-labels: "ingress-ready=true,nuvolaris.io/kube=kind" - extraPortMappings: - - containerPort: 80 - hostPort: 80 - protocol: TCP - - containerPort: 443 - hostPort: 443 - protocol: TCP - - containerPort: 30222 - hostPort: 2222 - protocol: TCP - extraMounts: - - hostPath: "$DATADIR/data" - containerPath: /data - - hostPath: "$DATADIR/openwhisk/standalone" - containerPath: /openwhisk/standalone - - hostPath: $DATADIR/openwhisk/invoker - containerPath: /openwhisk/invoker - - hostPath: "$DATADIR/openwhisk/controller" - containerPath: /openwhisk/controller - - hostPath: "$DATADIR/couchdb" - containerPath: /couchdb - - hostPath: "$DATADIR/mongodb" - containerPath: /mongodb - - hostPath: "$DATADIR/redis" - containerPath: /redis - - hostPath: "$DATADIR/zookeper/data" - containerPath: /zookeeper/data - - hostPath: "$DATADIR/zookeeper/log" - containerPath: /zookeeper/log - - hostPath: "$DATADIR/kafka" - containerPath: /kafka - - hostPath: "$OPS_HOME/workspace" - containerPath: /workspace + #extraPortMappings: + #- containerPort: 80 + # hostPort: 80 + # protocol: TCP + #- containerPort: 443 + # hostPort: 443 + # protocol: TCP + #- containerPort: 30222 + # hostPort: 2222 + # protocol: TCP + #extraMounts: + #- hostPath: "$DATADIR/data" + # containerPath: /data + #- hostPath: "$DATADIR/openwhisk/standalone" + # containerPath: /openwhisk/standalone + #- hostPath: $DATADIR/openwhisk/invoker + # containerPath: /openwhisk/invoker + #- hostPath: "$DATADIR/openwhisk/controller" + # containerPath: /openwhisk/controller + #- hostPath: "$DATADIR/couchdb" + # containerPath: /couchdb + #- hostPath: "$DATADIR/mongodb" + # containerPath: /mongodb + #- hostPath: "$DATADIR/redis" + # containerPath: /redis + #- hostPath: "$DATADIR/zookeper/data" + # containerPath: /zookeeper/data + #- hostPath: "$DATADIR/zookeeper/log" + # containerPath: /zookeeper/log + #- hostPath: "$DATADIR/kafka" + # containerPath: /kafka + # - hostPath: "$OPS_HOME/workspace" + # containerPath: /workspace diff --git a/setup/docker/opsfile.yml b/setup/docker/opsfile.yml index 4850a1d0..d9cc960b 100644 --- a/setup/docker/opsfile.yml +++ b/setup/docker/opsfile.yml @@ -17,6 +17,7 @@ version: '3' vars: + CLUSTER: nuvolaris1 INGRESS: "https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml" env: @@ -24,8 +25,8 @@ env: sh: echo "$OPS_TMP/kind" WORKSPACE: sh: echo "$OPS_HOME/workspace" - KUBECONFIG: - sh: |- + KUBECONFIG: + sh: |- if test -e "$OPS_TMP/kubeconfig" then echo "$OPS_TMP/kubeconfig" else echo ~/.kube/config @@ -38,7 +39,7 @@ tasks: desc: status of the Apache OpenServerless cluster in Docker cmds: - | - if kind get clusters | rg nuvolaris + if kind get clusters | rg {{.CLUSTER}} then echo Cluster Apache OpenServerless up and running else echo Cluster Apache OpenServerless not found fi @@ -53,7 +54,7 @@ tasks: echo "=== Kind Version" kind version echo "=== Kind Clusters" - kind get clusters + kind get clusters if test -e $KUBECONFIG then echo "=== Nodes" kubectl get nodes @@ -67,6 +68,7 @@ tasks: - > kind create cluster --kubeconfig="$OPS_TMP/kubeconfig" +<<<<<<< HEAD --wait=1m --name=nuvolaris --config=_kind.yaml - | @@ -80,11 +82,16 @@ tasks: EOF' docker exec nuvolaris-control-plane systemctl restart containerd +======= + --wait=1m --name={{.CLUSTER}} + --config=_kind.yaml + +>>>>>>> 2afc1a6 (offline images) ingress: silent: true cmds: - - > - kubectl --kubeconfig="$OPS_TMP/kubeconfig" + - > + kubectl --kubeconfig="$OPS_TMP/kubeconfig" apply -f ingress-deploy.yaml check-space: @@ -101,11 +108,11 @@ tasks: - config SKIP_PRELOAD_IMAGES cmds: - | - for image in "$IMAGES_STREAMER" "$IMAGES_OPERATOR" "$IMAGES_CONTROLLER" + for image in "$IMAGES_STREAMER" "$IMAGES_OPERATOR" "$IMAGES_CONTROLLER" do docker pull "$image" --platform "linux/{{ARCH}}" - if ! kind load docker-image "$image" --name nuvolaris - then + 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." @@ -121,7 +128,7 @@ tasks: | rg apache/openserverless-runtime \ | while read -r image; do docker pull "$image" --platform "linux/{{ARCH}}" - kind load docker-image "$image" --name nuvolaris + kind load docker-image "$image" --name "{{.CLUSTER}}" docker rmi "$image" done @@ -133,7 +140,7 @@ tasks: - echo "Cleaning all docker images and containers" - docker ps -qa | while read a ; do docker rm -f "$a" ; done - docker images -qa | while read a ; do docker rmi -f "$a" ; done - - docker system prune -af + - docker system prune -af - docker volume prune -af - docker system df @@ -143,16 +150,16 @@ tasks: cmds: - task: cluster - task: ingress - - cp "$OPS_TMP/kubeconfig" "$OPS_TMP/kind.kubeconfig" + - cp "$OPS_TMP/kubeconfig" "$OPS_TMP/kind-{{.CLUSTER}}.kubeconfig" status: - - kind get clusters | rg nuvolaris + - kind get clusters | rg {{.CLUSTER}} delete: silent: true desc: destroy the Apache OpenServerless cluster in Docker cmds: - - kind delete clusters nuvolaris - - rm -f "$OPS_TMP/kubeconfig" "$OPS_TMP/kind.kubeconfig" + - kind delete clusters {{.CLUSTER}} + - rm -f "$OPS_TMP/kubeconfig" "$OPS_TMP/kind-{{.CLUSTER}}.kubeconfig" kubeconfig: desc: export kubeconfig diff --git a/util/freeze/opsfile.yml b/util/freeze/opsfile.yml index 3ce2ad01..80994133 100644 --- a/util/freeze/opsfile.yml +++ b/util/freeze/opsfile.yml @@ -9,18 +9,90 @@ vars: tasks: - list-images: - desc: list images in kind + docker-save: + silent: true + desc: save images in docker cmds: - - docker inspect {{.KIND_CLUSTER}} | jq -r '.[0].Config.Image' >_images.lst - - > - docker exec -it {{.KIND_CLUSTER}} crictl images 2>/dev/null - | awk 'NR > 1 && !/^(registry.k8s.io\/(kube-|coredns|etc|pause)|docker.io\/kindest\/)/ {print $1 ":" $2 }' - | tee -a _images.lst + - docker inspect {{.KIND_CLUSTER}} | jq -r '.[0].Config.Image' >_docker.lst + - mkdir -p ~/.ops/.images/docker + - | + cat _docker.lst | while read img + do + file=~/.ops/.images/docker/{{ARCH}}-$(base64 -e "$img") + if test -e "$file" + then echo "already saved $img.{{ARCH}} " + else echo ">>> Saving: $img" + if retry docker save "$img" -o "$file" + then echo "OK: save $file" + else echo "*** FAIL: save $file" + fi + fi + done - # | awk '!/^registry.k8s.io/ { print $1 ":" $2 }' + kind-save: + silent: false + desc: list images in kindes + env: + CLU: "{{.KIND_CLUSTER}}" + ARCH: "{{ARCH}}" + cmds: + - awk '/image:/ {print $2}' $OPS_ROOT/setup/docker/ingress-deploy.yaml > _kind.lst + - > + docker exec -it "$CLU" crictl images 2>/dev/null + | awk 'NR > 1 && !/^(registry.k8s.io\/(kube-|coredns|etc|pause|ingress-nginx)|docker.io\/kindest\/)/ {print $1 ":" $2 }' + >> _kind.lst + - mkdir -p ~/.ops/.images/kind + - | + cat _kind.lst | while read img + do + file=~/.ops/.images/kind/$ARCH-"$(base64 -e "$img")" + if test -e "$file" + then echo "already saved $img" + else echo ">>> Saving: $img" + if ! retry docker pull "$img" 2>/dev/null + then echo "*** FAIL pull $img" ; continue + fi + if ! retry docker save "$img" -o "$file" 2>/dev/null + then echo "*** FAIL save $file" ; continue + fi + echo "OK: save $file" + fi + done save: - desc: save all current images + desc: images cmds: - - echo '{{.KIND_IMAGE}}' + - task: docker-save + - task: kind-save + + list: + desc: list images + cmds: + - | + rm -f _docker.lst _kind.lst + for dir in docker kind + do for file in ~/.ops/.images/$dir/{{ARCH}}-* + do if test -e "$file" + then + b64=$(basename "$file") + img=$(base64 -d "${b64#*-}") + echo $dir/$img + echo img >>_$dir.lst + fi + done + done + + clean: + desc: clean images + cmds: + - rm -f -v ~/.ops/.images/docker/* + - rm -f -v ~/.ops/.images/kind/* + + + purge: + desc: remove and purge images + cmds: + - rm -v _docker.lst _kind.lst + - task: list + - cat _docker.lst _kind.lst + diff --git a/util/opsfile.yml b/util/opsfile.yml index 44172641..e938cd5d 100644 --- a/util/opsfile.yml +++ b/util/opsfile.yml @@ -48,7 +48,7 @@ tasks: - echo "{{OS}}-{{ARCH}}" apihost: - desc: current apihost`` + desc: current apihost silent: true cmds: - ops -wsk property get | awk '/whisk API host/{print $4}' From b06a1eaef92765d92f9968f3d30e275e0b3a0926 Mon Sep 17 00:00:00 2001 From: Michele Sciabarra Date: Thu, 11 Dec 2025 05:18:51 +0000 Subject: [PATCH 3/6] freezer and unfreezer --- setup/docker/kind.yaml | 1 + setup/docker/opsfile.yml | 5 ++- util/freeze/opsfile.yml | 82 +++++++++++++++++++++++++++++++--------- 3 files changed, 68 insertions(+), 20 deletions(-) diff --git a/setup/docker/kind.yaml b/setup/docker/kind.yaml index 5e416f49..94ef906d 100644 --- a/setup/docker/kind.yaml +++ b/setup/docker/kind.yaml @@ -24,6 +24,7 @@ containerdConfigPatches: nodes: - role: control-plane + image: kindest/node:v1.33.1 kubeadmConfigPatches: - | kind: InitConfiguration diff --git a/setup/docker/opsfile.yml b/setup/docker/opsfile.yml index d9cc960b..528c7078 100644 --- a/setup/docker/opsfile.yml +++ b/setup/docker/opsfile.yml @@ -17,7 +17,7 @@ version: '3' vars: - CLUSTER: nuvolaris1 + CLUSTER: nuvolaris INGRESS: "https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml" env: @@ -33,7 +33,6 @@ env: fi tasks: - status: silent: true desc: status of the Apache OpenServerless cluster in Docker @@ -148,7 +147,9 @@ 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: diff --git a/util/freeze/opsfile.yml b/util/freeze/opsfile.yml index 80994133..3f9015af 100644 --- a/util/freeze/opsfile.yml +++ b/util/freeze/opsfile.yml @@ -1,19 +1,25 @@ version: 3 vars: - KIND_CLUSTER: nuvolaris-control-plane - #KIND_CLUSTER: kind-control-plane + CLUSTER: nuvolaris + KIND_CLUSTER: '{{.CLUSTER}}-control-plane' KIND_IMAGE: sh: > docker inspect {{.KIND_CLUSTER}} | jq -r '.[0].Config.Image' tasks: + docker-list: + silent: true + desc: save images in docker + cmds: + - awk '/image:/{print $2}' $OPS_ROOT/setup/docker/kind.yaml | tee _docker.lst + docker-save: silent: true desc: save images in docker cmds: - - docker inspect {{.KIND_CLUSTER}} | jq -r '.[0].Config.Image' >_docker.lst + - task: docker-list - mkdir -p ~/.ops/.images/docker - | cat _docker.lst | while read img @@ -22,25 +28,35 @@ tasks: if test -e "$file" then echo "already saved $img.{{ARCH}} " else echo ">>> Saving: $img" - if retry docker save "$img" -o "$file" + if docker pull "$img" + then echo "OK: save $file" + else echo "*** FAIL: pull $img" + fi + if docker save "$img" -o "$file" then echo "OK: save $file" else echo "*** FAIL: save $file" fi fi done - kind-save: + kind-list: silent: false - desc: list images in kindes env: CLU: "{{.KIND_CLUSTER}}" - ARCH: "{{ARCH}}" + desc: list images in kindes cmds: - - awk '/image:/ {print $2}' $OPS_ROOT/setup/docker/ingress-deploy.yaml > _kind.lst + - awk '/image:/ {print $2}' $OPS_ROOT/setup/docker/ingress-deploy.yaml | tee _kind.lst - > docker exec -it "$CLU" crictl images 2>/dev/null | awk 'NR > 1 && !/^(registry.k8s.io\/(kube-|coredns|etc|pause|ingress-nginx)|docker.io\/kindest\/)/ {print $1 ":" $2 }' - >> _kind.lst + | tee _kind.lst + + kind-save: + silent: false + desc: list images in kindes + env: + CLU: "{{.KIND_CLUSTER}}" + cmds: - mkdir -p ~/.ops/.images/kind - | cat _kind.lst | while read img @@ -49,23 +65,24 @@ tasks: if test -e "$file" then echo "already saved $img" else echo ">>> Saving: $img" - if ! retry docker pull "$img" 2>/dev/null + if ! docker pull "$img" then echo "*** FAIL pull $img" ; continue fi - if ! retry docker save "$img" -o "$file" 2>/dev/null + if ! docker save "$img" -o "$file" then echo "*** FAIL save $file" ; continue fi echo "OK: save $file" fi done - save: + save-images: desc: images cmds: + - kind get clusters | grep {{.CLUSTER}} || die "please setup an ops cluster first" - task: docker-save - task: kind-save - list: + list-images: desc: list images cmds: - | @@ -77,22 +94,51 @@ tasks: b64=$(basename "$file") img=$(base64 -d "${b64#*-}") echo $dir/$img - echo img >>_$dir.lst + echo $img >>_$dir.lst fi done done - clean: + clean-images: desc: clean images cmds: - rm -f -v ~/.ops/.images/docker/* - rm -f -v ~/.ops/.images/kind/* - - purge: + purge-images: desc: remove and purge images cmds: - rm -v _docker.lst _kind.lst - task: list - - cat _docker.lst _kind.lst + - | + cat _docker.lst _kind.lst | while read img + do docker rmi -f $img + done + + docker-load: + silent: true + desc: load images + cmds: + - | + for file in ~/.ops/.images/docker/{{ARCH}}-* + do + b64=$(basename "$file") + img=$(base64 -d "${b64#*-}") + echo Docker: loading "$img" + docker load -i "$file" + #docker tag $(awk '{print $4}' _image) $img + docker tag ${img#*@} ${img%@*} + done + kind-load: + silent: true + desc: load images + cmds: + - | + for file in ~/.ops/.images/kind/{{ARCH}}-* + do + b64=$(basename "$file") + img=$(base64 -d "${b64#*-}") + echo Kind: loading $img + kind load image-archive "$file" -n {{.CLUSTER}} --nodes {{.CLUSTER}}-control-plane + done From 699b25153aed3f5ff0b5ccce53ba9085f8146c24 Mon Sep 17 00:00:00 2001 From: Michele Sciabarra Date: Fri, 12 Dec 2025 03:43:59 +0000 Subject: [PATCH 4/6] intall with preloaded images --- setup/docker/kind.yaml | 66 ++++++++++++------------ util/freeze/opsfile.yml | 109 ++++++++++++++++++++++++++-------------- 2 files changed, 105 insertions(+), 70 deletions(-) diff --git a/setup/docker/kind.yaml b/setup/docker/kind.yaml index 94ef906d..696eaa63 100644 --- a/setup/docker/kind.yaml +++ b/setup/docker/kind.yaml @@ -31,36 +31,36 @@ nodes: nodeRegistration: kubeletExtraArgs: node-labels: "ingress-ready=true,nuvolaris.io/kube=kind" - #extraPortMappings: - #- containerPort: 80 - # hostPort: 80 - # protocol: TCP - #- containerPort: 443 - # hostPort: 443 - # protocol: TCP - #- containerPort: 30222 - # hostPort: 2222 - # protocol: TCP - #extraMounts: - #- hostPath: "$DATADIR/data" - # containerPath: /data - #- hostPath: "$DATADIR/openwhisk/standalone" - # containerPath: /openwhisk/standalone - #- hostPath: $DATADIR/openwhisk/invoker - # containerPath: /openwhisk/invoker - #- hostPath: "$DATADIR/openwhisk/controller" - # containerPath: /openwhisk/controller - #- hostPath: "$DATADIR/couchdb" - # containerPath: /couchdb - #- hostPath: "$DATADIR/mongodb" - # containerPath: /mongodb - #- hostPath: "$DATADIR/redis" - # containerPath: /redis - #- hostPath: "$DATADIR/zookeper/data" - # containerPath: /zookeeper/data - #- hostPath: "$DATADIR/zookeeper/log" - # containerPath: /zookeeper/log - #- hostPath: "$DATADIR/kafka" - # containerPath: /kafka - # - hostPath: "$OPS_HOME/workspace" - # containerPath: /workspace + extraPortMappings: + - containerPort: 80 + hostPort: 80 + protocol: TCP + - containerPort: 443 + hostPort: 443 + protocol: TCP + - containerPort: 30222 + hostPort: 2222 + protocol: TCP + extraMounts: + - hostPath: "$DATADIR/data" + containerPath: /data + - hostPath: "$DATADIR/openwhisk/standalone" + containerPath: /openwhisk/standalone + - hostPath: $DATADIR/openwhisk/invoker + containerPath: /openwhisk/invoker + - hostPath: "$DATADIR/openwhisk/controller" + containerPath: /openwhisk/controller + - hostPath: "$DATADIR/couchdb" + containerPath: /couchdb + - hostPath: "$DATADIR/mongodb" + containerPath: /mongodb + - hostPath: "$DATADIR/redis" + containerPath: /redis + - hostPath: "$DATADIR/zookeper/data" + containerPath: /zookeeper/data + - hostPath: "$DATADIR/zookeeper/log" + containerPath: /zookeeper/log + - hostPath: "$DATADIR/kafka" + containerPath: /kafka + - hostPath: "$OPS_HOME/workspace" + containerPath: /workspace diff --git a/util/freeze/opsfile.yml b/util/freeze/opsfile.yml index 3f9015af..f7191313 100644 --- a/util/freeze/opsfile.yml +++ b/util/freeze/opsfile.yml @@ -5,15 +5,27 @@ vars: KIND_CLUSTER: '{{.CLUSTER}}-control-plane' KIND_IMAGE: sh: > - docker inspect {{.KIND_CLUSTER}} | jq -r '.[0].Config.Image' + awk '/image:/{print $2}' $OPS_ROOT/setup/docker/kind.yaml | tee _docker.lst tasks: docker-list: silent: true - desc: save images in docker + desc: list docker images cmds: - - awk '/image:/{print $2}' $OPS_ROOT/setup/docker/kind.yaml | tee _docker.lst + - docker inspect {{.KIND_CLUSTER}} 2>/dev/null | jq -r '.[0].Config.Image' + + kind-list: + silent: false + env: + CLU: "{{.KIND_CLUSTER}}" + desc: list images in kindes + cmds: + - awk '/image:/ {print $2}' $OPS_ROOT/setup/docker/ingress-deploy.yaml | tee _kind.lst + - > + docker exec -it "$CLU" crictl images 2>/dev/null + | awk 'NR > 1 && !/^(registry.k8s.io\/(kube-|coredns|etc|pause|ingress-nginx)|docker.io\/kindest\/)/ {print $1 ":" $2 }' + | tee _kind.lst docker-save: silent: true @@ -39,54 +51,44 @@ tasks: fi done - kind-list: - silent: false - env: - CLU: "{{.KIND_CLUSTER}}" - desc: list images in kindes - cmds: - - awk '/image:/ {print $2}' $OPS_ROOT/setup/docker/ingress-deploy.yaml | tee _kind.lst - - > - docker exec -it "$CLU" crictl images 2>/dev/null - | awk 'NR > 1 && !/^(registry.k8s.io\/(kube-|coredns|etc|pause|ingress-nginx)|docker.io\/kindest\/)/ {print $1 ":" $2 }' - | tee _kind.lst - kind-save: silent: false desc: list images in kindes env: CLU: "{{.KIND_CLUSTER}}" cmds: + - task: kind-list - mkdir -p ~/.ops/.images/kind - | cat _kind.lst | while read img do - file=~/.ops/.images/kind/$ARCH-"$(base64 -e "$img")" + file=~/.ops/.images/kind/{{ARCH}}-"$(base64 -e "$img")" if test -e "$file" then echo "already saved $img" else echo ">>> Saving: $img" - if ! docker pull "$img" + if ! docker pull "$img" then echo "*** FAIL pull $img" ; continue fi - if ! docker save "$img" -o "$file" + if ! docker save "$img" -o "$file" then echo "*** FAIL save $file" ; continue fi echo "OK: save $file" fi done - save-images: - desc: images + image-save: + desc: save images cmds: - kind get clusters | grep {{.CLUSTER}} || die "please setup an ops cluster first" - task: docker-save - task: kind-save - list-images: + image-list: + silent: true desc: list images cmds: + - rm -f _images.lst - | - rm -f _docker.lst _kind.lst for dir in docker kind do for file in ~/.ops/.images/$dir/{{ARCH}}-* do if test -e "$file" @@ -94,51 +96,84 @@ tasks: b64=$(basename "$file") img=$(base64 -d "${b64#*-}") echo $dir/$img - echo $img >>_$dir.lst + echo $img >>_images.lst fi done done - clean-images: + image-clean: + prompt: "are you sure you wnat to remote images fron disk" + silent: true desc: clean images cmds: - rm -f -v ~/.ops/.images/docker/* - rm -f -v ~/.ops/.images/kind/* - purge-images: - desc: remove and purge images + docker-clean: + silent: true + desc: remove images from docker cmds: - - rm -v _docker.lst _kind.lst - - task: list + - task: docker-list - | - cat _docker.lst _kind.lst | while read img + cat _docker.lst | while read img do docker rmi -f $img done docker-load: silent: true - desc: load images + desc: load disk images in docker cmds: - | for file in ~/.ops/.images/docker/{{ARCH}}-* - do + do b64=$(basename "$file") img=$(base64 -d "${b64#*-}") - echo Docker: loading "$img" + echo Docker: loading "$img" docker load -i "$file" #docker tag $(awk '{print $4}' _image) $img docker tag ${img#*@} ${img%@*} done + status: + - test -z "$(ls ~/.ops/.images/docker/{{ARCH}}-* 2>/dev/null)" kind-load: silent: true - desc: load images + desc: load disk images in kind cmds: - | + N=0 for file in ~/.ops/.images/kind/{{ARCH}}-* - do - b64=$(basename "$file") - img=$(base64 -d "${b64#*-}") - echo Kind: loading $img + do + N=$(($N+1)) + printf "\rKind: loading images: [$(seq 1 $N | awk '{printf "#"}')]" + #echo $file + b64="$(basename "$file")" + img="$(base64 -d "${b64#*-}")" kind load image-archive "$file" -n {{.CLUSTER}} --nodes {{.CLUSTER}}-control-plane done + status: + - test -z "$(ls ~/.ops/.images/kind/{{ARCH}}-* 2>/dev/null)" + + test-clean: + ignore_errors: true + cmds: + - task: docker-clean + - kind delete cluster --name=test + + test-compare: + - task: docker-list + - task: kind-list + - task: image-list + - cat _docker.lst _kind.lst | sort >_loaded.lst + - sort <_images.lst >_saved.lst + - echo "Comparing differences loaded and saved" + - diff _loaded.lst _saved.lst + + test: + - task: test-clean + - task: docker-load + - kind create cluster --name=test --image={{.KIND_IMAGE}} + - task: kind-load + - task: test-compare + - task: test-clean + From f7fd3f3c6f5b49b705adb2cfaace7dc6804beb41 Mon Sep 17 00:00:00 2001 From: Michele Sciabarra <“msciabarra@apache.org”> Date: Fri, 12 Dec 2025 12:28:17 +0100 Subject: [PATCH 5/6] use a differet folder --- update/opsfile.yml | 1 - util/freeze/opsfile.yml | 37 ++++++++++++++++++++++++++++++++++--- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/update/opsfile.yml b/update/opsfile.yml index 2dfdde77..24d7165a 100644 --- a/update/opsfile.yml +++ b/update/opsfile.yml @@ -33,7 +33,6 @@ env: fi tasks: - hi: echo hi cli: desc: update the cli diff --git a/util/freeze/opsfile.yml b/util/freeze/opsfile.yml index f7191313..f46a119d 100644 --- a/util/freeze/opsfile.yml +++ b/util/freeze/opsfile.yml @@ -3,6 +3,12 @@ version: 3 vars: CLUSTER: nuvolaris KIND_CLUSTER: '{{.CLUSTER}}-control-plane' +<<<<<<< HEAD +======= + IMAGES: + sh: > + echo ~/.ops/{{OS}}-{{ARCH}}/images +>>>>>>> 1e87124 (fixes) KIND_IMAGE: sh: > awk '/image:/{print $2}' $OPS_ROOT/setup/docker/kind.yaml | tee _docker.lst @@ -31,12 +37,17 @@ tasks: silent: true desc: save images in docker cmds: +<<<<<<< HEAD - task: docker-list - mkdir -p ~/.ops/.images/docker +======= + - docker inspect {{.KIND_CLUSTER}} | jq -r '.[0].Config.Image' >_docker.lst + - mkdir -p {{.IMAGES}}/docker +>>>>>>> 1e87124 (fixes) - | cat _docker.lst | while read img do - file=~/.ops/.images/docker/{{ARCH}}-$(base64 -e "$img") + file={{.IMAGES}}/docker/$(base64 -e "$img") if test -e "$file" then echo "already saved $img.{{ARCH}} " else echo ">>> Saving: $img" @@ -57,12 +68,25 @@ tasks: env: CLU: "{{.KIND_CLUSTER}}" cmds: +<<<<<<< HEAD - task: kind-list - mkdir -p ~/.ops/.images/kind - | cat _kind.lst | while read img do file=~/.ops/.images/kind/{{ARCH}}-"$(base64 -e "$img")" +======= + - awk '/image:/ {print $2}' $OPS_ROOT/setup/docker/ingress-deploy.yaml > _kind.lst + - > + docker exec -it "$CLU" crictl images 2>/dev/null + | awk 'NR > 1 && !/^(registry.k8s.io\/(kube-|coredns|etc|pause|ingress-nginx)|docker.io\/kindest\/)/ {print $1 ":" $2 }' + >> _kind.lst + - mkdir -p {{.IMAGES}}/kind + - | + cat _kind.lst | while read img + do + file={{.IMAGES}}/"$(base64 -e "$img")" +>>>>>>> 1e87124 (fixes) if test -e "$file" then echo "already saved $img" else echo ">>> Saving: $img" @@ -90,11 +114,11 @@ tasks: - rm -f _images.lst - | for dir in docker kind - do for file in ~/.ops/.images/$dir/{{ARCH}}-* + do for file in {{.IMAGES}}/$dir/* do if test -e "$file" then b64=$(basename "$file") - img=$(base64 -d "${b64#*-}") + img=$(base64 -d "${b64}") echo $dir/$img echo $img >>_images.lst fi @@ -106,12 +130,19 @@ tasks: silent: true desc: clean images cmds: +<<<<<<< HEAD - rm -f -v ~/.ops/.images/docker/* - rm -f -v ~/.ops/.images/kind/* docker-clean: silent: true desc: remove images from docker +======= + - rm -f -v {{.IMAGES}}/docker/* {{.IMAGES}}/kind/* + + purge: + desc: remove and purge images +>>>>>>> 1e87124 (fixes) cmds: - task: docker-list - | From d528a69f40f21752715cfa87dc6e07ce103ee2fc Mon Sep 17 00:00:00 2001 From: Michele Sciabarra Date: Sun, 14 Dec 2025 10:05:01 +0000 Subject: [PATCH 6/6] fixes to images --- setup/kubernetes/operator.yaml | 14 +++++----- util/freeze/opsfile.yml | 47 +++++----------------------------- 2 files changed, 13 insertions(+), 48 deletions(-) diff --git a/setup/kubernetes/operator.yaml b/setup/kubernetes/operator.yaml index c2a4a9fc..121296b5 100644 --- a/setup/kubernetes/operator.yaml +++ b/setup/kubernetes/operator.yaml @@ -19,8 +19,8 @@ apiVersion: apps/v1 kind: StatefulSet metadata: name: nuvolaris-operator - namespace: nuvolaris -spec: + namespace: nuvolaris +spec: replicas: 1 selector: matchLabels: @@ -67,18 +67,18 @@ spec: - key: "nuvolaris-role" operator: "Equal" value: core - effect: "NoSchedule" + effect: "NoSchedule" securityContext: runAsUser: 1001 - fsGroup: 1001 + fsGroup: 1001 volumes: - name: deploy persistentVolumeClaim: - claimName: nuvolaris-operator-deploy-pvc + claimName: nuvolaris-operator-deploy-pvc containers: - name: nuvolaris-operator image: ${IMAGES_OPERATOR} - imagePullPolicy: Always + imagePullPolicy: IfNotPresent command: ["./run.sh"] args: ["--verbose"] securityContext: @@ -87,4 +87,4 @@ spec: - ALL volumeMounts: - name: deploy - mountPath: "/home/nuvolaris/deploy" \ No newline at end of file + mountPath: "/home/nuvolaris/deploy" \ No newline at end of file diff --git a/util/freeze/opsfile.yml b/util/freeze/opsfile.yml index f46a119d..d23a31ef 100644 --- a/util/freeze/opsfile.yml +++ b/util/freeze/opsfile.yml @@ -3,12 +3,9 @@ version: 3 vars: CLUSTER: nuvolaris KIND_CLUSTER: '{{.CLUSTER}}-control-plane' -<<<<<<< HEAD -======= IMAGES: sh: > echo ~/.ops/{{OS}}-{{ARCH}}/images ->>>>>>> 1e87124 (fixes) KIND_IMAGE: sh: > awk '/image:/{print $2}' $OPS_ROOT/setup/docker/kind.yaml | tee _docker.lst @@ -22,7 +19,7 @@ tasks: - docker inspect {{.KIND_CLUSTER}} 2>/dev/null | jq -r '.[0].Config.Image' kind-list: - silent: false + silent: true env: CLU: "{{.KIND_CLUSTER}}" desc: list images in kindes @@ -37,13 +34,8 @@ tasks: silent: true desc: save images in docker cmds: -<<<<<<< HEAD - - task: docker-list - - mkdir -p ~/.ops/.images/docker -======= - docker inspect {{.KIND_CLUSTER}} | jq -r '.[0].Config.Image' >_docker.lst - mkdir -p {{.IMAGES}}/docker ->>>>>>> 1e87124 (fixes) - | cat _docker.lst | while read img do @@ -68,14 +60,6 @@ tasks: env: CLU: "{{.KIND_CLUSTER}}" cmds: -<<<<<<< HEAD - - task: kind-list - - mkdir -p ~/.ops/.images/kind - - | - cat _kind.lst | while read img - do - file=~/.ops/.images/kind/{{ARCH}}-"$(base64 -e "$img")" -======= - awk '/image:/ {print $2}' $OPS_ROOT/setup/docker/ingress-deploy.yaml > _kind.lst - > docker exec -it "$CLU" crictl images 2>/dev/null @@ -85,8 +69,7 @@ tasks: - | cat _kind.lst | while read img do - file={{.IMAGES}}/"$(base64 -e "$img")" ->>>>>>> 1e87124 (fixes) + file={{.IMAGES}}/kind/"$(base64 -e "$img")" if test -e "$file" then echo "already saved $img" else echo ">>> Saving: $img" @@ -130,32 +113,14 @@ tasks: silent: true desc: clean images cmds: -<<<<<<< HEAD - - rm -f -v ~/.ops/.images/docker/* - - rm -f -v ~/.ops/.images/kind/* - - docker-clean: - silent: true - desc: remove images from docker -======= - rm -f -v {{.IMAGES}}/docker/* {{.IMAGES}}/kind/* - purge: - desc: remove and purge images ->>>>>>> 1e87124 (fixes) - cmds: - - task: docker-list - - | - cat _docker.lst | while read img - do docker rmi -f $img - done - docker-load: silent: true desc: load disk images in docker cmds: - | - for file in ~/.ops/.images/docker/{{ARCH}}-* + for file in {{.IMAGES}}/docker/* do b64=$(basename "$file") img=$(base64 -d "${b64#*-}") @@ -165,7 +130,7 @@ tasks: docker tag ${img#*@} ${img%@*} done status: - - test -z "$(ls ~/.ops/.images/docker/{{ARCH}}-* 2>/dev/null)" + - test -z "$(ls {{.IMAGES}}/docker/* 2>/dev/null)" kind-load: silent: true @@ -173,7 +138,7 @@ tasks: cmds: - | N=0 - for file in ~/.ops/.images/kind/{{ARCH}}-* + for file in {{.IMAGES}}/kind/* do N=$(($N+1)) printf "\rKind: loading images: [$(seq 1 $N | awk '{printf "#"}')]" @@ -183,7 +148,7 @@ tasks: kind load image-archive "$file" -n {{.CLUSTER}} --nodes {{.CLUSTER}}-control-plane done status: - - test -z "$(ls ~/.ops/.images/kind/{{ARCH}}-* 2>/dev/null)" + - test -z "$(ls {{.IMAGES}}/kind/* 2>/dev/null)" test-clean: ignore_errors: true