You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openserverless.apache.org by ms...@apache.org on 2025/08/18 10:28:41 UTC
(openserverless-task) branch ops-and-uv updated: SKIP_OPERATOR support
This is an automated email from the ASF dual-hosted git repository.
msciabarra pushed a commit to branch ops-and-uv
in repository https://gitbox.apache.org/repos/asf/openserverless-task.git
The following commit(s) were added to refs/heads/ops-and-uv by this push:
new 5c88cd8 SKIP_OPERATOR support
5c88cd8 is described below
commit 5c88cd8391cccac9d24b54c83e63eb7d4d824d28
Author: Michele Sciabarra <ms...@apache.org>
AuthorDate: Mon Aug 18 12:28:23 2025 +0200
SKIP_OPERATOR support
---
cloud/aws/opsfile.yml | 2 +-
cloud/eks/opsfile.yml | 2 +-
debug/runtime/opsfile.yml | 4 +-
ide/nodejs/opsfile.yml | 4 +-
setup/kubernetes/opsfile.yml | 90 +++++++++++++++++++++++++++++++++++---------
5 files changed, 79 insertions(+), 23 deletions(-)
diff --git a/cloud/aws/opsfile.yml b/cloud/aws/opsfile.yml
index f9963b1..134be32 100644
--- a/cloud/aws/opsfile.yml
+++ b/cloud/aws/opsfile.yml
@@ -84,7 +84,7 @@ tasks:
- cat _vm-ip
vm-kubeconfig:
- silent: false
+ silent: true
cmds:
- task: prereq
- echo "*** Getting kubeconfig (if available) for:"
diff --git a/cloud/eks/opsfile.yml b/cloud/eks/opsfile.yml
index cf9474f..6c4877f 100644
--- a/cloud/eks/opsfile.yml
+++ b/cloud/eks/opsfile.yml
@@ -32,7 +32,7 @@ env:
tasks:
prereq:
desc: check prerequisites
- silent: false
+ silent: true
cmds:
- test -n "$EKS_NAME" || die 'Please, configure EKS with "ops config eks"'
- "aws --version || die 'You need to install aws cli from : https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html'"
diff --git a/debug/runtime/opsfile.yml b/debug/runtime/opsfile.yml
index 2cc51f0..f642c4b 100644
--- a/debug/runtime/opsfile.yml
+++ b/debug/runtime/opsfile.yml
@@ -22,7 +22,7 @@ tasks:
init:
desc: init a runtime running in localhost:8080 (with A=<dir-or-file>)
requires: {vars: [A]}
- silent: false
+ silent: true
cmds:
- |
if test -d "$OPS_PWD/packages/{{.A}}"
@@ -37,7 +37,7 @@ tasks:
run:
desc: run a runtime running in localhost:8080 with A=<dir-or-file> J=<json-payload>
- silent: false
+ silent: true
cmds:
- python3 invoke.py run '{{.J}}'
diff --git a/ide/nodejs/opsfile.yml b/ide/nodejs/opsfile.yml
index 775ae20..87c4988 100644
--- a/ide/nodejs/opsfile.yml
+++ b/ide/nodejs/opsfile.yml
@@ -20,7 +20,7 @@ version: '3'
tasks:
clean:
- silent: false
+ silent: true
desc: clean
requires: {var: [DIR]}
cmds:
@@ -43,7 +43,7 @@ tasks:
- "{{.DIR}}/node_modules/.package-lock.json"
action:
- silent: false
+ silent: true
desc: build the action updating the zip
requires: {var: [DIR]}
dir: "{{.DIR}}"
diff --git a/setup/kubernetes/opsfile.yml b/setup/kubernetes/opsfile.yml
index fe22f90..b894aa4 100644
--- a/setup/kubernetes/opsfile.yml
+++ b/setup/kubernetes/opsfile.yml
@@ -155,6 +155,34 @@ tasks:
printf "\n"
$RES
+ wait-pod:
+ desc: wait for a pod to be available - leave the result in FILE
+ silent: true
+ status:
+ - test "{{.COND}}" != "true"
+ requires:
+ vars:
+ - SELECTOR
+ - COND
+ - FILE
+ env:
+ BAR:
+ sh: printf "%*s" {{.RETRY}} "" | tr ' ' '#'
+ cmds:
+ - |
+ rm -f "{{.FILE}}"
+ N=0
+ RES=false
+ while [[ $N -lt {{.RETRY}} ]]
+ do printf "\rwaiting for pod {{.SELECTOR}}: [${BAR:0:$((N++))}]"
+ if kubectl -n nuvolaris get po {{.SELECTOR}} -o jsonpath='{.items[0].metadata.name}' >{{.FILE}} 2>/dev/null
+ then RES=true ; break
+ fi
+ sleep {{.TIMEOUT}}
+ done
+ printf "\n"
+ $RES
+
context:
desc: select the context to use
silent: true
@@ -212,7 +240,8 @@ tasks:
operator:
#desc: deploy operator
silent: true
-
+ status:
+ - config SKIP_OPERATOR_LAUNCH
cmds:
- |
eval $(task storageclass-env)
@@ -225,13 +254,6 @@ tasks:
OBJECT: pod/nuvolaris-operator-0
COND: trues
- whiskcrd:
- silent: true
- #desc: generate configuration
- cmds:
- - envsubst -i whisk.yaml -o _whisk.yaml
- #- cat _whisk.yaml
-
secrets:
silent: true
cmds:
@@ -242,13 +264,21 @@ tasks:
fi
instance:
- #desc: deploy instance
+ desc: deploy operator instance
silent: true
cmds:
- - ops setup kubernetes whiskcrd
+ - envsubst -i whisk.yaml -o _whisk.yaml
#- cat _whisk.yaml
- - |
- kubectl apply -f _whisk.yaml
+ - kubectl apply -f _whisk.yaml
+ - task: wait-openwhisk
+
+ wait-openwhisk:
+ silent: true
+ desc: wait for openwhisk start
+ status:
+ - config SKIP_OPERATOR_LAUNCH
+ cmds:
+ - echo "Checking OpenWhisk is ready..."
- task: wait
vars:
OBJECT: pod/couchdb-0
@@ -259,9 +289,11 @@ tasks:
COND: true
- services:
+ wait-services:
silent: true
desc: wait for active services
+ status:
+ - config SKIP_OPERATOR_LAUNCH
cmds:
- echo "Check for active services...."
- task: wait
@@ -274,18 +306,36 @@ tasks:
OBJECT: po/nuvolaris-mongodb-0
COND:
sh: echo "$OPERATOR_COMPONENT_MONGODB"
- - kubectl -n nuvolaris get po -l app=minio -o jsonpath='{.items[0].metadata.name}' >_minio
+ - task: wait
+ vars:
+ OBJECT: pod/nuvolaris-postgres-1-0
+ COND:
+ sh: echo "$OPERATOR_COMPONENT_POSTGRES"
+ - task: wait-pod
+ vars:
+ SELECTOR: "-l app=minio"
+ COND:
+ sh: echo "$OPERATOR_COMPONENT_MINIO"
+ FILE: _minio
- task: wait
vars:
OBJECT:
sh: echo "pod/$(cat _minio)"
COND:
sh: echo "$OPERATOR_COMPONENT_MINIO"
+ - task: wait-pod
+ vars:
+ SELECTOR: "-l name=nuvolaris-milvus"
+ COND:
+ sh: echo "$OPERATOR_COMPONENT_MILVUS"
+ FILE: _milvus
- task: wait
vars:
- OBJECT: pod/nuvolaris-postgres-1-0
+ OBJECT:
+ sh: echo "pod/$(cat _milvus)"
COND:
- sh: echo "$OPERATOR_COMPONENT_POSTGRES"
+ sh: echo "$OPERATOR_COMPONENT_MILVUS"
+
create:
silent: true
@@ -302,6 +352,7 @@ tasks:
- task: prepare
deploy:
+ silent: true
desc: deploy in namespace (use namespace admin)
cmds:
- task: context
@@ -309,7 +360,12 @@ tasks:
- task: runtimes
- task: operator
- task: instance
- - task: services
+ - task: wait-openwhisk
+ - task: wait-services
+ - |
+ if config SKIP_OPERATOR_LAUNCH 2>/dev/null
+ then echo -e "***\n*** Warning: skipping operator launch\n*** re-enable it with ops -config -r SKIP_OPERATOR_LAUNCH\n***"
+ fi
delete:
silent: true