Commit 6be5f13b authored by Giorgos Korfiatis's avatar Giorgos Korfiatis Committed by Christos Stavrakakis
Browse files

deploy: Automate service registration

Use script snf-service-export to assist registering service definitions
in astakos. Remove call to resource-import; its usage is covered by
parent d48bae68
......@@ -522,14 +522,33 @@ def astakos_loaddata():
def astakos_register_components():
debug(, " * Register components in astakos...")
def astakos_register_services():
debug(, " * Register services in astakos...")
cyclades_base_url = "https://%s/cyclades/" % env.env.cyclades.fqdn
pithos_base_url = "https://%s/pithos/" % env.env.pithos.fqdn
astakos_base_url = "https://%s/astakos/" % env.env.accounts.fqdn
cmd = """
snf-manage component-add "home" https://{0} home-icon.png
snf-manage component-add "cyclades" https://{1}/cyclades/ui/
snf-manage component-add "pithos" https://{2}/pithos/ui/
snf-manage component-add "astakos" https://{3}/astakos/ui/
""".format(env.env.cms.fqdn, env.env.cyclades.fqdn, env.env.pithos.fqdn, env.env.accounts.fqdn)
snf-manage component-add "cyclades" {1}ui/
snf-manage component-add "pithos" {2}ui/
snf-manage component-add "astakos" {3}ui/
""".format(env.env.cms.fqdn, cyclades_base_url,
pithos.base_url, astakos_base_url)
import_service("astakos", astakos_base_url)
import_service("pithos", pithos_base_url)
import_service("cyclades", cyclades_base_url)
cmd = """
snf-manage resource-modify --limit 40G pithos.diskspace
snf-manage resource-modify --limit 2 astakos.pending_app
snf-manage resource-modify --limit 4 cyclades.vm
snf-manage resource-modify --limit 40G cyclades.disk
snf-manage resource-modify --limit 8G cyclades.ram
snf-manage resource-modify --limit 16 cyclades.cpu
snf-manage resource-modify --limit 4
......@@ -605,14 +624,11 @@ EOF
def import_service(service):
tmpl = "/tmp/%s.json" % service
replace = {
"DOMAIN": env.env.domain,
custom = customize_settings_from_tmpl(tmpl, replace)
put(custom, tmpl)
try_run("snf-manage service-import --json %s" % tmpl)
def import_service(service, base_url):
try_run("snf-service-export %s %s | snf-manage service-import -" %
(service, base_url))
def get_service_details(service="pithos"):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment