Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhifan huang
slapos
Commits
21a199f4
Commit
21a199f4
authored
Dec 16, 2021
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Plain Diff
Update Release Candidate
parents
07d8873b
9da0377d
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
67 additions
and
49 deletions
+67
-49
software/ors-amarisoft/buildout.hash.cfg
software/ors-amarisoft/buildout.hash.cfg
+3
-3
software/ors-amarisoft/instance-enb.jinja2.cfg
software/ors-amarisoft/instance-enb.jinja2.cfg
+2
-0
software/ors-amarisoft/instance-epc.jinja2.cfg
software/ors-amarisoft/instance-epc.jinja2.cfg
+1
-1
software/ors-amarisoft/instance-gnb.jinja2.cfg
software/ors-amarisoft/instance-gnb.jinja2.cfg
+2
-0
software/theia/buildout.hash.cfg
software/theia/buildout.hash.cfg
+2
-2
software/theia/instance-theia.cfg.jinja.in
software/theia/instance-theia.cfg.jinja.in
+35
-14
software/theia/instance.cfg.in
software/theia/instance.cfg.in
+3
-1
software/theia/software.cfg
software/theia/software.cfg
+10
-22
software/theia/test/test.py
software/theia/test/test.py
+8
-5
stack/slapos.cfg
stack/slapos.cfg
+1
-1
No files found.
software/ors-amarisoft/buildout.hash.cfg
View file @
21a199f4
...
...
@@ -24,7 +24,7 @@ md5sum = 762d55291e75e8b61e35f9f28d29915a
[template-lte-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
md5sum =
77024b4bc87903f1a2ed86245e691800
md5sum =
83c37b43d7b70584bf71aed9289ea13c
[template-lte-gnb-epc]
_update_hash_filename_ = instance-gnb-epc.jinja2.cfg
...
...
@@ -32,11 +32,11 @@ md5sum = e43a726dd3023a4bbaa474bb2d7a6ebe
[template-lte-gnb]
_update_hash_filename_ = instance-gnb.jinja2.cfg
md5sum =
9ac219ea7c331bfc0e5ed3fd4c9991e2
md5sum =
fc59d15a7f7f942951f9e38d7a1cca2c
[template-lte-epc]
_update_hash_filename_ = instance-epc.jinja2.cfg
md5sum = a
f285212bf8e15402416b58a65d103f8
md5sum = a
4bb020da807666668193cffcb7884d6
[ue_db.jinja2.cfg]
filename = config/ue_db.jinja2.cfg
...
...
software/ors-amarisoft/instance-enb.jinja2.cfg
View file @
21a199f4
...
...
@@ -4,6 +4,8 @@ parts =
ltelogs
lte-enb-config
lte-enb-service
# Temporarily extend monitor-base until promises are added
monitor-base
publish-connection-information
extends = {{ monitor_template }}
...
...
software/ors-amarisoft/instance-epc.jinja2.cfg
View file @
21a199f4
[buildout]
parts =
directory
# publish-connection-parameter
ltelogs
lte-mme-config
lte-mme-service
lte-ims-config
lte-ims-service
# Temporarily extend monitor-base until promises are added
monitor-base
publish-connection-information
...
...
software/ors-amarisoft/instance-gnb.jinja2.cfg
View file @
21a199f4
...
...
@@ -4,6 +4,8 @@ parts =
ltelogs
lte-gnb-config
lte-enb-service
# Temporarily extend monitor-base until promises are added
monitor-base
publish-connection-information
extends = {{ monitor_template }}
...
...
software/theia/buildout.hash.cfg
View file @
21a199f4
...
...
@@ -15,11 +15,11 @@
[instance-theia]
_update_hash_filename_ = instance-theia.cfg.jinja.in
md5sum = 7
76d9275483b7378d13c5cf43a0ad886
md5sum = 7
8c99ef4799063dc5b67e76b8dba2112
[instance]
_update_hash_filename_ = instance.cfg.in
md5sum =
4d8d3a351f17c45048fd3ffaee978875
md5sum =
94703df1104405a5a73aa1bc980ea370
[instance-import]
_update_hash_filename_ = instance-import.cfg.jinja.in
...
...
software/theia/instance-theia.cfg.jinja.in
View file @
21a199f4
...
...
@@ -444,6 +444,39 @@ command =
${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
# -----------------
...
...
@@ -488,12 +521,8 @@ template =
$${slapos-standalone-config:port} \
$${slapos-standalone-config:local-software-release-root} \
$${slapos-standalone-config:computer-id} \
{%- if parameter_dict.get('embedded-sr') %}
--sr='{{ parameter_dict['embedded-sr'] }}' \
{%- if parameter_dict.get('embedded-sr-type') %}
--srtype='{{ parameter_dict['embedded-sr-type'] }}' \
{%- endif %}
--srparams='$${embedded-instance-parameters:rendered}' \
{%- if embedded_sr %}
--slapos_script=$${request-embedded-instance-script:rendered} \
{%- endif %}
$${slap-connection:server-url} \
$${slap-connection:computer-id} \
...
...
@@ -622,14 +651,6 @@ recipe = slapos.cookbook:symbolic.link
target-directory = $${directory:project}
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]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:project}/$${:_buildout_section_name_}.sh
...
...
software/theia/instance.cfg.in
View file @
21a199f4
...
...
@@ -36,14 +36,16 @@ context =
jsonkey default_parameter_dict :default-parameters
key parameter_dict slap-configuration:configuration
key root_title slap-configuration:root-instance-title
key partition_root_path buildout:directory
key ipv6_random slap-configuration:ipv6-random
key ipv4_random slap-configuration:ipv4-random
import os_module os
default-parameters =
{
"autorun": "running",
"embedded-sr": null,
"embedded-sr-type": null,
"embedded-instance-parameters":
"null"
,
"embedded-instance-parameters":
null
,
"frontend-name": "Theia Frontend",
"frontend-sr": "$${:frontend-sr}",
"frontend-sr-type": "RootSoftwareInstance",
...
...
software/theia/software.cfg
View file @
21a199f4
...
...
@@ -62,6 +62,7 @@ initialization =
import os
import signal
import socket
import subprocess
import sys
import time
...
...
@@ -74,9 +75,7 @@ initialization =
parser.add_argument('server_port', type=int)
parser.add_argument('local_software_release_root')
parser.add_argument('computer_id')
parser.add_argument('--sr')
parser.add_argument('--srtype')
parser.add_argument('--srparams')
parser.add_argument('--slapos_script')
forwarded_arguments = parser.add_argument_group('forwarded')
forwarded_arguments.add_argument('master_url')
forwarded_arguments.add_argument('computer')
...
...
@@ -130,25 +129,14 @@ initialization =
except slapos.slap.standalone.SlapOSNodeCommandError as e:
print("Error instanciating: {}".format(e))
if args.sr:
try:
with open(args.srparams) as f:
params = json.load(f)
except Exception:
params = None
if not isinstance(params, dict):
params = None
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,
)
if args.slapos_script:
print("Running SlapOS script {}".format(args.slapos_script))
slapos_env = {
'PATH': os.path.dirname(standalone._slapos_bin),
'SLAPOS_CONFIGURATION': standalone._slapos_config,
'SLAPOS_CLIENT_CONFIGURATION': standalone._slapos_config
}
subprocess.call((args.slapos_script,), env=slapos_env)
s = socket.socket(socket.AF_UNIX)
s.bind('\0' + os.path.join(args.base_directory, 'standalone_ready'))
...
...
software/theia/test/test.py
View file @
21a199f4
...
...
@@ -230,9 +230,9 @@ class TestTheiaEmbeddedSlapOSShutdown(TheiaTestCase):
class
TestTheiaWithSR
(
TheiaTestCase
):
sr_url
=
'bogus/software.cfg'
sr_url
=
'
~/
bogus/software.cfg'
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
def
getInstanceParameterDict
(
cls
):
...
...
@@ -243,15 +243,18 @@ class TestTheiaWithSR(TheiaTestCase):
}
def
test
(
self
):
home
=
self
.
computer_partition_root_path
bogus_sr
=
os
.
path
.
join
(
home
,
self
.
sr_url
[
2
:])
slapos
=
self
.
_getSlapos
()
info
=
subprocess
.
check_output
((
slapos
,
'proxy'
,
'show'
),
universal_newlines
=
True
)
instance_name
=
"Embedded Instance"
self
.
assertIsNotNone
(
re
.
search
(
r"%s\
s+sl
aprunner\
s+
available"
%
(
self
.
sr_url
,),
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+sl
aprunner\
s+
available"
%
(
bogus_sr
,),
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
)
self
.
assertIn
(
"{'bogus_param': 'bogus_value'}"
,
service_info
)
self
.
assertIn
(
"{'bogus_param': 'bogus_value'
, 'bogus_param2': 'bogus_value2'
}"
,
service_info
)
class
TestTheiaFrontend
(
TheiaTestCase
):
...
...
stack/slapos.cfg
View file @
21a199f4
...
...
@@ -189,7 +189,7 @@ setuptools-dso = 1.7
rubygemsrecipe = 0.4.3
six = 1.12.0
slapos.cookbook = 1.0.220
slapos.core = 1.7.
1
slapos.core = 1.7.
2
slapos.extension.strip = 0.4
slapos.extension.shared = 1.0
slapos.libnetworkcache = 0.22
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment