Commit 21a199f4 authored by Joanne Hugé's avatar Joanne Hugé

Update Release Candidate

parents 07d8873b 9da0377d
...@@ -24,7 +24,7 @@ md5sum = 762d55291e75e8b61e35f9f28d29915a ...@@ -24,7 +24,7 @@ md5sum = 762d55291e75e8b61e35f9f28d29915a
[template-lte-enb] [template-lte-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg _update_hash_filename_ = instance-enb.jinja2.cfg
md5sum = 77024b4bc87903f1a2ed86245e691800 md5sum = 83c37b43d7b70584bf71aed9289ea13c
[template-lte-gnb-epc] [template-lte-gnb-epc]
_update_hash_filename_ = instance-gnb-epc.jinja2.cfg _update_hash_filename_ = instance-gnb-epc.jinja2.cfg
...@@ -32,11 +32,11 @@ md5sum = e43a726dd3023a4bbaa474bb2d7a6ebe ...@@ -32,11 +32,11 @@ md5sum = e43a726dd3023a4bbaa474bb2d7a6ebe
[template-lte-gnb] [template-lte-gnb]
_update_hash_filename_ = instance-gnb.jinja2.cfg _update_hash_filename_ = instance-gnb.jinja2.cfg
md5sum = 9ac219ea7c331bfc0e5ed3fd4c9991e2 md5sum = fc59d15a7f7f942951f9e38d7a1cca2c
[template-lte-epc] [template-lte-epc]
_update_hash_filename_ = instance-epc.jinja2.cfg _update_hash_filename_ = instance-epc.jinja2.cfg
md5sum = af285212bf8e15402416b58a65d103f8 md5sum = a4bb020da807666668193cffcb7884d6
[ue_db.jinja2.cfg] [ue_db.jinja2.cfg]
filename = config/ue_db.jinja2.cfg filename = config/ue_db.jinja2.cfg
......
...@@ -4,6 +4,8 @@ parts = ...@@ -4,6 +4,8 @@ parts =
ltelogs ltelogs
lte-enb-config lte-enb-config
lte-enb-service lte-enb-service
# Temporarily extend monitor-base until promises are added
monitor-base
publish-connection-information publish-connection-information
extends = {{ monitor_template }} extends = {{ monitor_template }}
......
[buildout] [buildout]
parts = parts =
directory directory
# publish-connection-parameter
ltelogs ltelogs
lte-mme-config lte-mme-config
lte-mme-service lte-mme-service
lte-ims-config lte-ims-config
lte-ims-service lte-ims-service
# Temporarily extend monitor-base until promises are added
monitor-base monitor-base
publish-connection-information publish-connection-information
......
...@@ -4,6 +4,8 @@ parts = ...@@ -4,6 +4,8 @@ parts =
ltelogs ltelogs
lte-gnb-config lte-gnb-config
lte-enb-service lte-enb-service
# Temporarily extend monitor-base until promises are added
monitor-base
publish-connection-information publish-connection-information
extends = {{ monitor_template }} extends = {{ monitor_template }}
......
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
[instance-theia] [instance-theia]
_update_hash_filename_ = instance-theia.cfg.jinja.in _update_hash_filename_ = instance-theia.cfg.jinja.in
md5sum = 776d9275483b7378d13c5cf43a0ad886 md5sum = 78c99ef4799063dc5b67e76b8dba2112
[instance] [instance]
_update_hash_filename_ = instance.cfg.in _update_hash_filename_ = instance.cfg.in
md5sum = 4d8d3a351f17c45048fd3ffaee978875 md5sum = 94703df1104405a5a73aa1bc980ea370
[instance-import] [instance-import]
_update_hash_filename_ = instance-import.cfg.jinja.in _update_hash_filename_ = instance-import.cfg.jinja.in
......
...@@ -444,6 +444,39 @@ command = ...@@ -444,6 +444,39 @@ command =
${buildout:bin-directory}/slapos complete --shell fish > $${directory:fish-completions}/slapos.fish ${buildout:bin-directory}/slapos complete --shell fish > $${directory:fish-completions}/slapos.fish
# Embedded Instance
# -----------------
{%- set embedded_sr = parameter_dict['embedded-sr'] %}
{%- set embedded_sr_type = parameter_dict['embedded-sr-type'] %}
{%- set embedded_instance_parameters = parameter_dict['embedded-instance-parameters'] %}
{%- if embedded_sr %}
{%- if embedded_sr.startswith('~/') %}
{%- set embedded_sr = os_module.path.join(partition_root_path, embedded_sr[2:]) %}
{%- set embedded_sr = os_module.path.normpath(embedded_sr) %}
{%- endif %}
[request-embedded-instance-script]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:project}/request_embedded.sh
mode = 0700
template =
inline:#!/bin/sh
slapos supply {{ embedded_sr }} slaprunner
slapos request "Embedded Instance" {{ embedded_sr }}
{%- if embedded_sr_type %} --type {{ embedded_sr_type }} {%- endif %}
{%- if embedded_instance_parameters %} --parameters-file $${embedded-instance-parameters:rendered}
[embedded-instance-parameters]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:project}/$${:_buildout_section_name_}.json
template =
inline:{{ embedded_instance_parameters | indent(2) }}
{%- endif %}
{%- endif %}
# SlapOS Standalone # SlapOS Standalone
# ----------------- # -----------------
...@@ -488,12 +521,8 @@ template = ...@@ -488,12 +521,8 @@ template =
$${slapos-standalone-config:port} \ $${slapos-standalone-config:port} \
$${slapos-standalone-config:local-software-release-root} \ $${slapos-standalone-config:local-software-release-root} \
$${slapos-standalone-config:computer-id} \ $${slapos-standalone-config:computer-id} \
{%- if parameter_dict.get('embedded-sr') %} {%- if embedded_sr %}
--sr='{{ parameter_dict['embedded-sr'] }}' \ --slapos_script=$${request-embedded-instance-script:rendered} \
{%- if parameter_dict.get('embedded-sr-type') %}
--srtype='{{ parameter_dict['embedded-sr-type'] }}' \
{%- endif %}
--srparams='$${embedded-instance-parameters:rendered}' \
{%- endif %} {%- endif %}
$${slap-connection:server-url} \ $${slap-connection:server-url} \
$${slap-connection:computer-id} \ $${slap-connection:computer-id} \
...@@ -622,14 +651,6 @@ recipe = slapos.cookbook:symbolic.link ...@@ -622,14 +651,6 @@ recipe = slapos.cookbook:symbolic.link
target-directory = $${directory:project} target-directory = $${directory:project}
link-binary = $${directory:runner} link-binary = $${directory:runner}
{% if parameter_dict.get('embedded-sr') -%}
[embedded-instance-parameters]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:etc}/$${:_buildout_section_name_}.json
template =
inline:{{ parameter_dict['embedded-instance-parameters'] | indent(2) }}
{%- endif %}
[request-script-template] [request-script-template]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
rendered = $${directory:project}/$${:_buildout_section_name_}.sh rendered = $${directory:project}/$${:_buildout_section_name_}.sh
......
...@@ -36,14 +36,16 @@ context = ...@@ -36,14 +36,16 @@ context =
jsonkey default_parameter_dict :default-parameters jsonkey default_parameter_dict :default-parameters
key parameter_dict slap-configuration:configuration key parameter_dict slap-configuration:configuration
key root_title slap-configuration:root-instance-title key root_title slap-configuration:root-instance-title
key partition_root_path buildout:directory
key ipv6_random slap-configuration:ipv6-random key ipv6_random slap-configuration:ipv6-random
key ipv4_random slap-configuration:ipv4-random key ipv4_random slap-configuration:ipv4-random
import os_module os
default-parameters = default-parameters =
{ {
"autorun": "running", "autorun": "running",
"embedded-sr": null, "embedded-sr": null,
"embedded-sr-type": null, "embedded-sr-type": null,
"embedded-instance-parameters": "null", "embedded-instance-parameters": null,
"frontend-name": "Theia Frontend", "frontend-name": "Theia Frontend",
"frontend-sr": "$${:frontend-sr}", "frontend-sr": "$${:frontend-sr}",
"frontend-sr-type": "RootSoftwareInstance", "frontend-sr-type": "RootSoftwareInstance",
......
...@@ -62,6 +62,7 @@ initialization = ...@@ -62,6 +62,7 @@ initialization =
import os import os
import signal import signal
import socket import socket
import subprocess
import sys import sys
import time import time
...@@ -74,9 +75,7 @@ initialization = ...@@ -74,9 +75,7 @@ initialization =
parser.add_argument('server_port', type=int) parser.add_argument('server_port', type=int)
parser.add_argument('local_software_release_root') parser.add_argument('local_software_release_root')
parser.add_argument('computer_id') parser.add_argument('computer_id')
parser.add_argument('--sr') parser.add_argument('--slapos_script')
parser.add_argument('--srtype')
parser.add_argument('--srparams')
forwarded_arguments = parser.add_argument_group('forwarded') forwarded_arguments = parser.add_argument_group('forwarded')
forwarded_arguments.add_argument('master_url') forwarded_arguments.add_argument('master_url')
forwarded_arguments.add_argument('computer') forwarded_arguments.add_argument('computer')
...@@ -130,25 +129,14 @@ initialization = ...@@ -130,25 +129,14 @@ initialization =
except slapos.slap.standalone.SlapOSNodeCommandError as e: except slapos.slap.standalone.SlapOSNodeCommandError as e:
print("Error instanciating: {}".format(e)) print("Error instanciating: {}".format(e))
if args.sr: if args.slapos_script:
try: print("Running SlapOS script {}".format(args.slapos_script))
with open(args.srparams) as f: slapos_env = {
params = json.load(f) 'PATH': os.path.dirname(standalone._slapos_bin),
except Exception: 'SLAPOS_CONFIGURATION': standalone._slapos_config,
params = None 'SLAPOS_CLIENT_CONFIGURATION': standalone._slapos_config
if not isinstance(params, dict): }
params = None subprocess.call((args.slapos_script,), env=slapos_env)
print("Supplying and Requesting Embedded Software {sr} with type {srtype}".format(
sr=args.sr, srtype=args.srtype))
print("With parameters {param_dict} parsed from '{srparams}'".format(
param_dict=params, srparams=args.srparams))
standalone.supply(args.sr)
standalone.request(
args.sr,
"Embedded Instance",
args.srtype,
partition_parameter_kw=params,
)
s = socket.socket(socket.AF_UNIX) s = socket.socket(socket.AF_UNIX)
s.bind('\0' + os.path.join(args.base_directory, 'standalone_ready')) s.bind('\0' + os.path.join(args.base_directory, 'standalone_ready'))
......
...@@ -230,9 +230,9 @@ class TestTheiaEmbeddedSlapOSShutdown(TheiaTestCase): ...@@ -230,9 +230,9 @@ class TestTheiaEmbeddedSlapOSShutdown(TheiaTestCase):
class TestTheiaWithSR(TheiaTestCase): class TestTheiaWithSR(TheiaTestCase):
sr_url = 'bogus/software.cfg' sr_url = '~/bogus/software.cfg'
sr_type = 'bogus_type' sr_type = 'bogus_type'
instance_parameters = '{\n"bogus_param": "bogus_value"\n}' instance_parameters = '{\n"bogus_param": "bogus_value",\n"bogus_param2": "bogus_value2"\n}'
@classmethod @classmethod
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
...@@ -243,15 +243,18 @@ class TestTheiaWithSR(TheiaTestCase): ...@@ -243,15 +243,18 @@ class TestTheiaWithSR(TheiaTestCase):
} }
def test(self): def test(self):
home = self.computer_partition_root_path
bogus_sr = os.path.join(home, self.sr_url[2:])
slapos = self._getSlapos() slapos = self._getSlapos()
info = subprocess.check_output((slapos, 'proxy', 'show'), universal_newlines=True) info = subprocess.check_output((slapos, 'proxy', 'show'), universal_newlines=True)
instance_name = "Embedded Instance" instance_name = "Embedded Instance"
self.assertIsNotNone(re.search(r"%s\s+slaprunner\s+available" % (self.sr_url,), info), info) self.assertIsNotNone(re.search(r"%s\s+slaprunner\s+available" % (bogus_sr,), info), info)
self.assertIsNotNone(re.search(r"%s\s+%s\s+%s" % (self.sr_url, self.sr_type, instance_name), info), info) self.assertIsNotNone(re.search(r"%s\s+%s\s+%s" % (bogus_sr, self.sr_type, instance_name), info), info)
service_info = subprocess.check_output((slapos, 'service', 'info', instance_name), universal_newlines=True) service_info = subprocess.check_output((slapos, 'service', 'info', instance_name), universal_newlines=True)
self.assertIn("{'bogus_param': 'bogus_value'}", service_info) self.assertIn("{'bogus_param': 'bogus_value', 'bogus_param2': 'bogus_value2'}", service_info)
class TestTheiaFrontend(TheiaTestCase): class TestTheiaFrontend(TheiaTestCase):
......
...@@ -189,7 +189,7 @@ setuptools-dso = 1.7 ...@@ -189,7 +189,7 @@ setuptools-dso = 1.7
rubygemsrecipe = 0.4.3 rubygemsrecipe = 0.4.3
six = 1.12.0 six = 1.12.0
slapos.cookbook = 1.0.220 slapos.cookbook = 1.0.220
slapos.core = 1.7.1 slapos.core = 1.7.2
slapos.extension.strip = 0.4 slapos.extension.strip = 0.4
slapos.extension.shared = 1.0 slapos.extension.shared = 1.0
slapos.libnetworkcache = 0.22 slapos.libnetworkcache = 0.22
......
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