Commit bf3fdb22 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis Committed by Dimitris Aragiorgis
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
service-import.
parent b1c3710f
......@@ -522,14 +522,33 @@ def astakos_loaddata():
@roles("accounts")
def astakos_register_components():
debug(env.host, " * Register components in astakos...")
def astakos_register_services():
debug(env.host, " * 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)
try_run(cmd)
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 cyclades.network.private
"""
try_run(cmd)
......@@ -605,14 +624,11 @@ EOF
"""
try_run(cmd)
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))
@roles("accounts")
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