diff --git a/ide/docopts.md b/ide/docopts.md index fa9126c..85821b6 100644 --- a/ide/docopts.md +++ b/ide/docopts.md @@ -25,8 +25,8 @@ OpenServerless Ide Development Utilities. ```text Usage: ide login [] [] [--pin] [--mode=] + ide deploy [|--packages|--web] [--dry-run] [--mode=] ide devel [--fast] [--dry-run] - ide deploy [|--packages|--web] [--dry-run] ide undeploy [] [--dry-run] ide clean ide setup diff --git a/ide/opsfile.yml b/ide/opsfile.yml index e48c20c..b820459 100644 --- a/ide/opsfile.yml +++ b/ide/opsfile.yml @@ -48,6 +48,7 @@ tasks: You can then use 'ops ide devel' and 'ops ide deploy'. You can also reopen the project with VSCode and use the command 'Reopen in Container'. cmds: + - test {{OS}} != "windows" || die '{{.MSG}}' - test "$(printf '%s\n' "$(bun -v)" "1.1.18" | sort -V | head -n 1)" = "1.1.18" || die "bun 1.1.18 or greater not available" - test -d "$OPS_PWD/packages" || die "no packages in current directory" - test -e ~/.wskprops || die "please run 'ops ide login' first" @@ -125,31 +126,17 @@ tasks: while ! test -e ~/.wskprops do $OPS ide login done - - | - echo "**************************************************************************************" - echo "*** Available Commands on Terminal:" - echo "*** 'deploy' (alias for 'ops ide deploy') to deploy your app to {{.API_HOST}}" - echo "*** 'devel' (alias for 'ops ide devel') to start incremental development mode" - echo "*** 'login' (alias for 'ops ide login') to login as a different user" - echo "*** 'ops ide' for more informations" - echo "*** https://openserverless.apache.org/ for online documentation" - echo "**************************************************************************************" login: silent: true desc: login in you OpenServerless host + dotenv: + - "{{.OPS_PWD}}/.env.{{.__mode}}" + - "{{.OPS_PWD}}/.env" cmds: + - echo "{{.OPS_PWD}}/.env" "{{.OPS_PWD}}/.env.{{.__mode}}" - | - set -a - if test -e "$OPS_PWD/.env" - then source "$OPS_PWD/.env" - fi - if [ -n "{{.__mode}}" ] && [ -e "$OPS_PWD/.env.{{.__mode}}" ] - then - echo "Loading .env.{{.__mode}}" - source "$OPS_PWD/.env.{{.__mode}}" - fi if test -n "$OPS_USERNAME" then echo "Please use OPS_USER, OPS_USERNAME is deprecated" fi @@ -187,7 +174,10 @@ tasks: if test -n "$OPS_PASSWORD" then export "OPS_PASSWORD" fi - if $OPS -login "$OPSDEV_APIHOST" "$OPSDEV_USERNAME" + # TO FIX: workaround to a problem on ops that ignores the paratemer if OPS_USER is set + export OPS_USER="$OPSDEV_USERNAME" + export OPS_APIHOST="$OPSDEV_APIHOST" + if ops -login then OPSDEV_HOST_PROT="$(echo "$OPSDEV_APIHOST" | awk -F '://' '{print $1}')" OPSDEV_HOST_URL="$(echo "$OPSDEV_APIHOST" | awk -F '://' '{print $2}')" @@ -234,16 +224,13 @@ tasks: silent: true interactive: true desc: deploy a project or a single action (with _action_=) + dotenv: + - "{{.OPS_PWD}}/.env.{{.__mode}}" + - "{{.OPS_PWD}}/packages/.env" + - "{{.OPS_PWD}}/.env" cmds: - task: prereq - | - set -a - if test -e $OPS_PWD/.env - then source $OPS_PWD/.env - fi - if test -e $OPS_PWD/packages/.env - then source $OPS_PWD/packages/.env - fi if test -n "$AUTH_CHECK" then if test "$AUTH_CHECK" != "$AUTH" then echo "WARNING: wrong deploy! You are logged in a different user than your pinned one and configured in .env as AUTH_CHECK" ; exit 1 @@ -329,16 +316,12 @@ tasks: interactive: true silent: true desc: start interactive development mode files + dotenv: + - "{{.OPS_PWD}}/.env" + - "{{.OPS_PWD}}/packages/.env" cmds: - task: prereq - | - set -a - if test -e $OPS_PWD/.env - then source $OPS_PWD/.env - fi - if test -e $OPS_PWD/packages/.env - then source $OPS_PWD/packages/.env - fi if test -n "$AUTH_CHECK" then if test "$AUTH_CHECK" != "$AUTH" then echo "WARNING: wrong deploy! You are logged in a different user than your configured AUTH_CHECK" ; exit 1 diff --git a/ide/python/opsfile.yml b/ide/python/opsfile.yml index 0617ed9..f400fe6 100644 --- a/ide/python/opsfile.yml +++ b/ide/python/opsfile.yml @@ -54,12 +54,11 @@ tasks: cli: silent: true desc: python cli + dotenv: + - "{{.OPS_PWD}}/.env" cmds: - | pip install ipython find "$OPS_PWD" -name requirements.txt -execdir pip install -r {} \; - if test -e "$OPS_PWD/.env" - then set -a ; source "$OPS_PWD/.env" - fi ipython -i init.ipy diff --git a/opsroot.json b/opsroot.json index fdf25f9..58727cd 100644 --- a/opsroot.json +++ b/opsroot.json @@ -6,7 +6,7 @@ }, "images": { "standalone": "ghcr.io/nuvolaris/openwhisk-controller:3.1.0-mastrogpt.2402101445", - "operator": "ghcr.io/nuvolaris/openserverless-operator:0.1.0-incubating.2603192226", + "operator": "docker.io/apache/openserverless-operator:0.1.0-incubating.2604091352", "controller": "ghcr.io/nuvolaris/openwhisk-controller:3.1.0-mastrogpt.2402101445", "invoker": "ghcr.io/nuvolaris/openwhisk-invoker:3.1.0-mastrogpt.2402101445", "streamer": "registry.hub.docker.com/apache/openserverless-streamer:0.1.0-incubating.2505031325", diff --git a/prereq.yml b/prereq.yml index 177006c..7fe931b 100644 --- a/prereq.yml +++ b/prereq.yml @@ -117,7 +117,7 @@ tasks: k3sup: desc: download k3sup vars: - VERSION: 0.13.6 + VERSION: 0.13.12 BASE: "https://github.com/alexellis/k3sup/releases/download/{{.VERSION}}" FILE: sh: | diff --git a/setup/docker/opsfile.yml b/setup/docker/opsfile.yml index 8c0a4c0..557468e 100644 --- a/setup/docker/opsfile.yml +++ b/setup/docker/opsfile.yml @@ -113,9 +113,9 @@ tasks: check-space: silent: true env: - REQUIRED_CPU: 4 - REQUIRED_MEM: 14 - REQUIRED_DISK: 60 + REQUIRED_CPU: '{{ or .REQUIRED_CPU "4" }}' + REQUIRED_MEM: '{{ or .REQUIRED_MEM "14" }}' + REQUIRED_DISK: '{{or .REQUIRED_DISK "60" }}' desc: check if the user has the minimum required disk space cmds: - bun run space.ts @@ -140,11 +140,11 @@ tasks: if kind get clusters | rg {{.CLUSTER}} then kind export kubeconfig --name {{.CLUSTER}} --kubeconfig "$OPS_TMP/kubeconfig" else - ops util freeze docker-load - ops util freeze kind-preload - ops setup docker cluster - ops util freeze kind-load - ops setup docker ingress + ops util freeze docker-load + test -n "{{.NO_KIND_PRELOAD}}" || ops util freeze kind-preload + ops setup docker cluster + ops util freeze kind-load + ops setup docker ingress fi - cp "$OPS_TMP/kubeconfig" "$OPS_TMP/kind-{{.CLUSTER}}.kubeconfig" diff --git a/setup/kubernetes/opsfile.yml b/setup/kubernetes/opsfile.yml index a09d817..65c7699 100644 --- a/setup/kubernetes/opsfile.yml +++ b/setup/kubernetes/opsfile.yml @@ -258,7 +258,7 @@ tasks: cmds: - | if test -z "$SECRET_OPENWHISK_NUVOLARIS" - then ops util secret + then ops -task -t "$OPS_ROOT/util/opsfile.yml" secrets else echo Reusing current secrets. fi @@ -442,4 +442,4 @@ tasks: kubectl apply -f _whisk.yaml - task: wait vars: - OBJECT: pod/controller-0 \ No newline at end of file + OBJECT: pod/controller-0 diff --git a/setup/kubernetes/roles/operator-roles.yaml b/setup/kubernetes/roles/operator-roles.yaml index 2dcb904..4d8803b 100644 --- a/setup/kubernetes/roles/operator-roles.yaml +++ b/setup/kubernetes/roles/operator-roles.yaml @@ -82,6 +82,10 @@ rules: resources: ["middlewares"] verbs: ["get","patch","list","update","watch","create","delete"] +- apiGroups: ["traefik.io"] + resources: ["middlewares"] + verbs: ["get","patch","list","update","watch","create","delete"] + # required for kubegres - apiGroups: ["kubegres.reactive-tech.io"] resources: ["kubegres","kubegres/finalizers","kubegres/status"] diff --git a/setup/nuvolaris/opsfile.yml b/setup/nuvolaris/opsfile.yml index b03be40..10ddfd4 100644 --- a/setup/nuvolaris/opsfile.yml +++ b/setup/nuvolaris/opsfile.yml @@ -126,7 +126,9 @@ tasks: echo Checking connection... retry -t 100 -m 600 ops -wsk {{.ETC}} --apihost "$OPSDEV_APIHOST" --auth "$AUTH" namespace list export OPS_PASSWORD=$(kubectl -n nuvolaris get wsk/controller -ojsonpath -ojsonpath='{.spec.nuvolaris.password}') - ops -login "$OPSDEV_APIHOST" "$OPSDEV_USERNAME" + export OPS_USER="$OPSDEV_USERNAME" + export OPS_APIHOST="$OPSDEV_APIHOST" + ops -login OPSDEV_HOST_PROT="$(echo "$OPSDEV_APIHOST" | awk -F '://' '{print $1}')" OPSDEV_HOST_URL="$(echo "$OPSDEV_APIHOST" | awk -F '://' '{print $2}')" config OPSDEV_APIHOST="$OPSDEV_APIHOST" @@ -281,6 +283,6 @@ tasks: retry ops ide login {{.USR}} "$APIHOST" - echo "{{.PSW}}" > ~/.ops/{{.USR}}.password - ops util upload "$(realpath web)" - - echo "Login with:" ops ide login {{.USR}} https://miniops.me + - echo "Login with:" ops ide login {{.USR}} "$APIHOST" - echo "Password is saved in:" ~/.ops/{{.USR}}.password - echo "Web URL is:" "$HOST" diff --git a/setup/opsfile.yml b/setup/opsfile.yml index df0bab0..2e0b1f3 100644 --- a/setup/opsfile.yml +++ b/setup/opsfile.yml @@ -113,10 +113,11 @@ tasks: echo "*** You can can uninstall and restart with: ops setup docker delete" exit 1 else - if ! kind get clusters | rg nuvolaris - then echo "*** Something is already running as a local webserver, please remove it before installing miniops." - exit 1 - fi + # in WSL something answer in localhost to it is not an error + #if ! kind get clusters | rg nuvolaris + #then echo "*** Something is already running as a local webserver, please remove it before installing miniops." + # exit 1 + #fi fi fi fi