Skip to content
Merged
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: 2 additions & 4 deletions setup/docopts.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,25 @@ Manage installation

```text
Usage:
setup mini
setup mini [<apihost>]
setup devcluster [--uninstall|--status|[--skip-check-ports] [--skip-preload-images]]
setup cluster [<context>] [--uninstall|--status]
setup server <server> [<user>] [--uninstall|--status]
setup status
setup uninstall
setup prereq
```

## Commands

```
setup mini deploy mini Apache OpenServerless, slim local installation available as http://devel.miniops.me
setup mini deploy mini Apache OpenServerless, slim local installation available as http://devel.miniops.me (or your local domain)
setup cluster deploy Apache OpenServerless in the Kubernetes cluster using the <context>, default the current
setup devcluster deploy Apache OpenServerless in a devcluster created locally
you need Docker Desktop available with at least 6G of memory assigned
setup server create a Kubernetes in server <server> and deploy Apache OpenServerless
the server must be accessible with ssh using the <user> with sudo power, default root
setup status show the status of the last installation
setup uninstall uninstall the last installation
setup prereq validate current configuration
```

## Options
Expand Down
12 changes: 6 additions & 6 deletions setup/nuvolaris/system-api/opsfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ env:
SYS_API_CDB_HOST: couchdb

SYS_API_CDB_USER:
sh: kubectl -n nuvolaris get wsk/controller -o jsonpath='{.spec.couchdb.admin.user}'
sh: ops util kubectl -- -n nuvolaris get wsk/controller -o jsonpath='{.spec.couchdb.admin.user}'

SYS_API_CDB_PASSWORD:
sh: kubectl -n nuvolaris get wsk/controller -o jsonpath='{.spec.couchdb.admin.password}'
sh: ops util kubectl -- -n nuvolaris get wsk/controller -o jsonpath='{.spec.couchdb.admin.password}'

SYS_API_HOSTNAME:
sh: kubectl -n nuvolaris get ingress/apihost -o jsonpath='{.spec.rules[0].host}'
sh: ops util kubectl -- -n nuvolaris get ingress/apihost -o jsonpath='{.spec.rules[0].host}'

REGISTRY_PASS:
sh: ops util kubectl -- -n nuvolaris get cm/config -o jsonpath='{.metadata.annotations.registry_password}'

INGRESS_TYPE:
sh: ops util ingress-type

REGISTRY_PASS:
sh: kubectl -n nuvolaris get cm/config -o jsonpath='{.metadata.annotations.registry_password}'

tasks:
install-toml:
Expand Down
30 changes: 21 additions & 9 deletions setup/opsfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,26 +76,38 @@ tasks:
done
{{end}}

prereq:
silent: true
cmds:
- exit 0

mini:
silent: true
desc: install miniops
vars:
APIHOST: '{{or ._apihost_ "http://miniops.me"}}'
cmds:
- echo '{{.APIHOST}}' | rg 'https?://(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]+/?' >/dev/null || die "please spefify an accessibile http://host"
- task: _mini
vars:
APIHOST: '{{.APIHOST}}'
PROTO:
sh: echo '{{.APIHOST}}' | rg -o '(https?)://' -r '$1'
DOMAIN:
sh: echo '{{.APIHOST}}' | rg -o 'https?://((?:[a-zA-Z0-9-]+\.)+[a-zA-Z]+)/?' -r '$1'

_mini:
silent: true
cmds:
- echo APIHOST={{.APIHOST}}
- echo PROTO={{.PROTO}}
- echo DOMAIN={{.DOMAIN}}
- docker -v || die "Docker is not installed. Please install Docker Desktop first."
- docker info 2>/dev/null >/dev/null || die "Docker is not running. Please start Docker Desktop first."
- |
if test -z {{.__skip_check_cluster}}
then
if curl -sL http://miniops.me >/dev/null 2>/dev/null
if curl -sL {{.APIHOST}} >/dev/null 2>/dev/null
then
if curl -sL http://miniops.me/api/info 2>/dev/null | jq -r .description 2>/dev/null | rg OpenWhisk >/dev/null 2>/dev/null
if curl -sL {{.APIHOST}}/api/info 2>/dev/null | jq -r .description 2>/dev/null | rg OpenWhisk >/dev/null 2>/dev/null
then
echo "*** Apache OpenServerless mini is already installed."
echo "*** Login with: ops ide login devel http://miniops.me"
echo "*** Login with: ops ide login devel {{.APIHOST}}"
echo "*** You can find the password in .ops/devel.password in your home directory"
echo "*** You can can uninstall and restart with: ops setup docker delete"
exit 1
Expand All @@ -109,7 +121,7 @@ tasks:
fi
- ops setup docker check-space
- ops config slim
- ops config apihost miniops.me --protocol=http
- ops config apihost '{{.DOMAIN}}' --protocol={{.PROTO}}
- ops setup devcluster
- ops setup nuvolaris streamer deploy
- ops setup nuvolaris system-api deploy
Expand Down