Commit b160acff authored by Daniele Venzano's avatar Daniele Venzano

A few more renames missed in the previous commit

parent 6d66b8de
......@@ -31,6 +31,7 @@ from zoe_lib.executions import ZoeExecutionsAPI
from zoe_lib.predefined_apps import hadoop, spark, lab_spark, test_sleep, copier
from zoe_lib.query import ZoeQueryAPI
from zoe_lib.users import ZoeUserAPI
from zoe_lib.applications import app_validate
PREDEFINED_APPS = {}
for mod in [hadoop, spark, lab_spark, test_sleep, copier]:
......@@ -127,6 +128,7 @@ def exec_list_cmd(_):
def exec_start_cmd(args):
app_descr = json.load(args.jsonfile)
app_validate(app_descr)
exec_api = ZoeExecutionsAPI(utils.zoe_url(), utils.zoe_user(), utils.zoe_pass())
ret = exec_api.execution_start(args.name, app_descr)
print("Application scheduled successfully with ID {}, use the exec-get command to check its status".format(ret))
......@@ -146,10 +148,10 @@ def exec_get_cmd(args):
print('Time finished: {}'.format(execution['time_finished']))
app = execution['application']
print('Application name: {}'.format(app['name']))
for c_id in execution['containers']:
for c_id in execution['services']:
c = cont_api.get(c_id)
ip = list(c['ip_address'].values())[0] # FIXME how to decide which network is the right one?
print('Container {} (ID: {})'.format(c['name'], c['id']))
print('Service {} (ID: {})'.format(c['name'], c['id']))
for p in c['ports']:
print(' - {}: {}://{}:{}{}'.format(p['name'], p['protocol'], ip, p['port_number'], p['path']))
......
......@@ -33,7 +33,7 @@ def load_configuration():
argparser.add_argument('--debug', action='store_true', help='Enable debug output')
argparser.add_argument('--listen-address', type=str, help='Address to listen to for incoming connections', default="0.0.0.0")
argparser.add_argument('--listen-port', type=int, help='Port to listen to for incoming connections', default=5001)
argparser.add_argument('--zoe-url', help='URL of the Zoe master process', default='http://127.0.0.1:4850')
argparser.add_argument('--master-url', help='URL of the Zoe master process', default='http://127.0.0.1:4850')
argparser.add_argument('--cookie-secret', help='key used to encrypt cookies', default="hr4h3H'kmn F8fz/;CJN5a!")
opts = argparser.parse_args()
......
......@@ -48,7 +48,7 @@ def home_guest():
if match is None:
return missing_auth()
query_api = ZoeQueryAPI(get_conf().zoe_url, guest_identifier, guest_password)
query_api = ZoeQueryAPI(get_conf().master_url, guest_identifier, guest_password)
template_vars = {
'refresh': randint(2, 8),
......@@ -68,7 +68,7 @@ def home_guest():
user = user[0]
template_vars['user_gateway'] = user['gateway_urls'][0]
template_vars['gateway_ip'] = user['gateway_urls'][0].split('/')[2].split(':')[0]
exec_api = ZoeExecutionsAPI(get_conf().zoe_url, guest_identifier, guest_password)
exec_api = ZoeExecutionsAPI(get_conf().master_url, guest_identifier, guest_password)
app_descr = spark_jupyter_notebook_lab_app()
execution = query_api.query('execution', name='guest-lab-{}'.format(guest_identifier))
if len(execution) == 0 or execution[0]['status'] == 'terminated':
......@@ -82,9 +82,9 @@ def home_guest():
return render_template('home_guest.html', **template_vars)
else:
template_vars['refresh'] = -1
cont_api = ZoeServiceAPI(get_conf().zoe_url, guest_identifier, guest_password)
cont_api = ZoeServiceAPI(get_conf().master_url, guest_identifier, guest_password)
template_vars['execution_status'] = execution['status']
for c_id in execution['containers']:
for c_id in execution['services']:
c = cont_api.get(c_id)
ip = list(c['ip_address'].values())[0] # FIXME how to decide which network is the right one?
for p in c['ports']:
......@@ -101,7 +101,7 @@ def home_user():
guest_identifier = auth.username
guest_password = auth.password
query_api = ZoeQueryAPI(get_conf().zoe_url, guest_identifier, guest_password)
query_api = ZoeQueryAPI(get_conf().master_url, guest_identifier, guest_password)
try:
user = query_api.query('user', name=guest_identifier)
......@@ -132,7 +132,7 @@ def home_admin():
guest_identifier = auth.username
guest_password = auth.password
query_api = ZoeQueryAPI(get_conf().zoe_url, guest_identifier, guest_password)
query_api = ZoeQueryAPI(get_conf().master_url, guest_identifier, guest_password)
try:
user = query_api.query('user', name=guest_identifier)
......
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