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
Labels
Merge Requests
104
Merge Requests
104
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
412a2ac8
Commit
412a2ac8
authored
Jan 08, 2024
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
a482fd1e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
35 deletions
+54
-35
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
+13
-8
software/ors-amarisoft/ru/libinstance.jinja2.cfg
software/ors-amarisoft/ru/libinstance.jinja2.cfg
+30
-19
software/ors-amarisoft/ru/xbuildout.py
software/ors-amarisoft/ru/xbuildout.py
+7
-4
software/ors-amarisoft/test/test.sh
software/ors-amarisoft/test/test.sh
+1
-1
No files found.
software/ors-amarisoft/buildout.hash.cfg
View file @
412a2ac8
...
...
@@ -28,7 +28,7 @@ md5sum = 8c044b28682940fbca62657c16613157
[ru_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/libinstance.jinja2.cfg
md5sum =
031805301916a7d17a6a8fb31914cbea
md5sum =
202c7efcb4d2387c0e542aed4aa1f2cf
[ru_sdr_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/sdr/libinstance.jinja2.cfg
...
...
@@ -80,7 +80,7 @@ md5sum = 2b8b57c5771b2a2203c0e7767e629e55
[ru_xbuildout.py]
_update_hash_filename_ = ru/xbuildout.py
md5sum = b9
7ec63d577f78d635d8995e236776fc
md5sum = b9
aa7356ebccfb1e9d2324106ad88485
[ru_capdo.c]
_update_hash_filename_ = ru/capdo.c
...
...
@@ -88,7 +88,7 @@ md5sum = 52da9fe3a569199e35ad89ae1a44c30e
[template-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
md5sum =
143f9b0e9866d37e6527e89f74b4ef1
c
md5sum =
fe0ecccc3be23a8fc5cf85d2278b6e8
c
[template-ors-enb]
_update_hash_filename_ = instance-ors-enb.jinja2.cfg
...
...
software/ors-amarisoft/instance-enb.jinja2.cfg
View file @
412a2ac8
# instance-enb implements eNB/gNB service.
{%- set Q = xbuildout.quote %}
[buildout]
parts =
...
...
@@ -200,14 +201,18 @@ url = ${enb-config-dl:target}
url = {{ enb_template }}
{% endif %}
output = ${directory:etc}/enb.cfg
extra-context =
json iru_dict {{ rulib.iru_dict | tojson }}
json icell_dict {{ rulib.icell_dict | tojson }}
json ipeer_dict {{ ipeer_dict | tojson }}
json ipeercell_dict {{ ipeercell_dict | tojson }}
import json_module json
import-list =
rawfile slaplte.jinja2 {{ slaplte_template }}
extra-context =
import json_module json
jsonkey iru_dict :jiru_dict
jsonkey icell_dict :jicell_dict
jsonkey ipeer_dict :jipeer_dict
jsonkey ipeercell_dict :jipeercell_dict
jiru_dict = {{ Q(rulib.iru_dict | tojson) }}
jicell_dict = {{ Q(rulib.icell_dict | tojson) }}
jipeer_dict = {{ Q(ipeer_dict | tojson) }}
jipeercell_dict = {{ Q(ipeercell_dict | tojson) }}
[publish-connection-information]
...
...
@@ -221,8 +226,8 @@ enb-ipv4 = {{ lan_ipv4 }}
amarisoft-version = {{ lte_version }}
license-expiration = {{ lte_expiration }}
monitor-gadget-url = ${:monitor-base-url}/gadget/software.cfg.html
ru-list = {{
rulib.iru_dict.keys() | sort | join(', '
) }}
cell-list = {{
rulib.icell_dict.keys() | sort | join(', '
) }}
ru-list = {{
Q(rulib.iru_dict.keys() | sort | tojson
) }}
cell-list = {{
Q(rulib.icell_dict.keys() | sort | tojson
) }}
# TODO peer-list peer-cell-list
peer-list = XXX
peer-cell-list = XXX
...
...
software/ors-amarisoft/ru/libinstance.jinja2.cfg
View file @
412a2ac8
...
...
@@ -26,6 +26,7 @@
{%- set testing = slapparameter_dict.get("testing", False) %}
{#- B(name) returns buildout-encoded form of name #}
{#- XXX Q #}
{%- set B = xbuildout.encode %}
{#- part emits new buildout section and registers it into buildout.parts #}
...
...
@@ -153,7 +154,8 @@ context =
import netaddr netaddr
section directory directory
section vtap_jdict vtap_jdict
json iru_dict {{ iru_dict | tojson }}
jsonkey iru_dict :jiru_dict
jiru_dict = {{ Q(iru_dict | tojson) }}
{{ part('dnsmasq-service') }}
recipe = slapos.cookbook:wrapper
...
...
@@ -185,7 +187,7 @@ hash-files =
{%- endif %}
{%- endfor %}
# {{
ru_ref
}} {{ ru.n_antenna_dl }}T{{ ru.n_antenna_ul }}R ({{ ru.ru_type }})
# {{
Q(ru_ref)
}} {{ ru.n_antenna_dl }}T{{ ru.n_antenna_ul }}R ({{ ru.ru_type }})
{%- if ru.ru_link_type == 'sdr' %}
{%- for (i, n) in enumerate(ru.sdr_dev_list) %}
{{ promise('%s-sdr-busy%s' % (ru_ref, '-%d' % (i+1) if i > 0 else '')) }}
...
...
@@ -229,13 +231,13 @@ config-max-rx-sample-db = {{ slapparameter_dict.get("max_rx_sample_db", 0) }}
{#- publish information about RU #}
{{ part('publish-%s' % ru_ref) }}
recipe = slapos.cookbook:publish.serialised
-slave-reference = {{
iru.slave_reference
}}
enb = {{ root
}}
-slave-reference = {{
Q(iru.slave_reference)
}}
{{ slap_configuration['slap-software-type'] }} = {{ Q(root)
}}
{%- set iru_icell_ref_list = [] %}
{%- for icell in iru_icell_list %}
{%- do iru_icell_ref_list.append(J(jref_of_shared(icell))) %}
{%- endfor %}
cell-list = {{
iru_icell_ref_list | join(', '
) }}
cell-list = {{
Q(iru_icell_ref_list | tojson
) }}
{%- if ru.ru_link_type == 'cpri' %}
ipv6 = ${vtap.{{ ru.cpri_link._tap }}:gateway}
{%- endif %}
...
...
@@ -255,30 +257,38 @@ ipv6 = ${vtap.{{ ru.cpri_link._tap }}:gateway}
{{ part('drb-config-%s' % cell_ref) }}
<= config-base
url = {{ {'lte': drb_lte_template, 'nr': drb_nr_template} [cell.cell_type] }}
output = ${directory:etc}/{{
cell_ref
}}-drb.cfg
output = ${directory:etc}/{{
B(cell_ref)
}}-drb.cfg
extra-context =
json cell_ref {{ cell_ref | tojson }}
json cell {{ cell | tojson }}
json ru_ref {{ ru_ref | tojson }}
json ru {{ ru | tojson }}
jsonkey cell_ref :jcell_ref
jsonkey cell :jcell
jsonkey ru_ref :jru_ref
jsonkey ru :jru
jcell_ref = {{ Q(cell_ref | tojson) }}
jcell = {{ Q(cell | tojson) }}
jru_ref = {{ Q(ru_ref | tojson) }}
jru = {{ Q(ru | tojson) }}
{{ part('sib23-config-%s' % cell_ref) }}
<= config-base
url = {{ sib23_template }}
output = ${directory:etc}/{{
cell_ref
}}-sib23.asn
output = ${directory:etc}/{{
B(cell_ref)
}}-sib23.asn
extra-context =
json cell_ref {{ cell_ref | tojson }}
json cell {{ cell | tojson }}
json ru_ref {{ ru_ref | tojson }}
json ru {{ ru | tojson }}
jsonkey cell_ref :jcell_ref
jsonkey cell :jcell
jsonkey ru_ref :jru_ref
jsonkey ru :jru
jcell_ref = {{ Q(cell_ref | tojson) }}
jcell = {{ Q(cell | tojson) }}
jru_ref = {{ Q(ru_ref | tojson) }}
jru = {{ Q(ru | tojson) }}
{%- endif %}
{#- publish information about the cell #}
{{ part('publish-%s' % cell_ref) }}
recipe = slapos.cookbook:publish.serialised
-slave-reference = {{
icell.slave_reference
}}
enb = {{ root
}}
ru = {{
ru_ref
}}
-slave-reference = {{
Q(icell.slave_reference)
}}
{{ slap_configuration['slap-software-type'] }} = {{ Q(root)
}}
ru = {{
Q(ru_ref)
}}
# XXX enb -> ue in case of uesim
# XXX +error
...
...
@@ -321,7 +331,8 @@ context =
raw stats_period {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }}
raw testing {{ testing }}
raw python_path {{ buildout_directory}}/bin/pythonwitheggs
json iru_dict {{ iru_dict | tojson }}
jsonkey iru_dict :jiru_dict
jiru_dict = {{ Q(iru_dict | tojson) }}
mode = 0775
url = {{ ru_amarisoft_stats_template }}
output = ${directory:bin}/amarisoft-stats.py
...
...
software/ors-amarisoft/ru/xbuildout.py
View file @
412a2ac8
...
...
@@ -87,7 +87,7 @@ def encode(s: str) -> str:
# decode provides reverse operation for encode.
def
decode
(
s
:
str
)
->
str
|
ValueError
:
def
decode
(
s
:
str
)
:
# -> str | ValueError
try
:
return
_decode
(
s
)
except
Exception
as
e
:
...
...
@@ -131,10 +131,13 @@ def _decode(s):
# quote converts string s into quoted form with all buildout control characters escaped... XXX
# XXX -> pyquote?
def
quote
(
s
:
str
)
->
str
:
r
=
repr
(
s
)
for
c
in
'$[]{}
\
n
'
:
assert
isinstance
(
s
,
str
),
type
(
s
)
r
=
str
.
__repr__
(
s
)
# both str and markupsafe.Markup go as regular str
for
c
in
'$[]
\
n
'
:
r
=
r
.
replace
(
c
,
r'\
x%
02x'
%
ord
(
c
))
return
r
if
r
[
1
:
-
1
]
==
s
:
return
s
# original string
return
'!py!'
+
r
# ----------------------------------------
...
...
software/ors-amarisoft/test/test.sh
View file @
412a2ac8
...
...
@@ -5,7 +5,7 @@
export
SLAPOS_TEST_DEBUG
=
1
export
SLAPOS_TEST_VERBOSE
=
1
export
SLAPOS_TEST_SKIP_SOFTWARE_CHECK
=
1
export
SLAPOS_TEST_SKIP_SOFTWARE_REBUILD
=
1
export
SLAPOS_TEST_SKIP_SOFTWARE_REBUILD
=
0
rm
-rf
snapshot
mkdir
snapshot
...
...
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