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
105
Merge Requests
105
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
69ca8977
Commit
69ca8977
authored
Oct 31, 2023
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
2a29e7dc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
30 deletions
+31
-30
software/ors-amarisoft/amari/lte.jinja2
software/ors-amarisoft/amari/lte.jinja2
+1
-1
software/ors-amarisoft/amari/slap.jinja2
software/ors-amarisoft/amari/slap.jinja2
+30
-29
No files found.
software/ors-amarisoft/amari/lte.jinja2
View file @
69ca8977
{#- Package amari/lte provides helpers for configuring Amarisoft LTE services.
{#- Package amari/lte provides helpers for configuring Amarisoft LTE services
in SlapOS
.
- ru_config emits RF driver configutation for specified Radio Units.
- ru_config emits RF driver configutation for specified Radio Units.
- cell_tdd_config and nr_cell_tdd_config return TDD configutation for LTE
- cell_tdd_config and nr_cell_tdd_config return TDD configutation for LTE
...
...
software/ors-amarisoft/amari/slap.jinja2
View file @
69ca8977
...
@@ -53,10 +53,27 @@
...
@@ -53,10 +53,27 @@
}
}
%}
%}
{#- J is used around macro calls to retrieve returned objects.
It is needed to workaround jinja2 limitation that macro can return only
strings - not arbitrary objects: we return objects as JSON-encoded string
and J decodes them.
By convention macros that return JSON-encoded objects start with "j" prefix.
Usage example:
set obj = J(jmymacro(...))
#}
{%- set J = json_module.loads %}
{#- jdefault_ul_earfcn returns default UL EARFCN corresponding to DL EARFCN #}
{%- macro jdefault_ul_earfcn(dl_earfcn) %}
{%- macro jdefault_ul_earfcn(dl_earfcn) %}
{{- earfcn_module.dl2ul(dl_earfcn) | tojson }}
{{- earfcn_module.dl2ul(dl_earfcn) | tojson }}
{%- endmacro %}
{%- endmacro %}
{#- jdefault_ul_nr_arfcn returns default UL NR ARFCN corresponding to DL NR ARFCN #}
{%- macro jdefault_ul_nr_arfcn(dl_nr_arfcn, nr_band) %}
{%- macro jdefault_ul_nr_arfcn(dl_nr_arfcn, nr_band) %}
{%- set nr = nrarfcn_module %}
{%- set nr = nrarfcn_module %}
{%- set dl_lo, dl_hi = nr.get_nrarfcn_range(nr_band, 'dl') %}
{%- set dl_lo, dl_hi = nr.get_nrarfcn_range(nr_band, 'dl') %}
...
@@ -64,6 +81,7 @@
...
@@ -64,6 +81,7 @@
{{- (ul_lo + (dl_nr_arfcn - dl_lo)) | tojson }}
{{- (ul_lo + (dl_nr_arfcn - dl_lo)) | tojson }}
{%- endmacro %}
{%- endmacro %}
{#- jdefault_ssb_nr_arfcn returns default SSB NR ARFCN corresponding to DL NR ARFCN #}
{%- macro jdefault_ssb_nr_arfcn(dl_nr_arfcn) %}
{%- macro jdefault_ssb_nr_arfcn(dl_nr_arfcn) %}
{#- NOTE: computations rechecked wrt https://tech-academy.amarisoft.com/OutOfBox_UEsim_SA.html#Tips_SSB_Frequency #}
{#- NOTE: computations rechecked wrt https://tech-academy.amarisoft.com/OutOfBox_UEsim_SA.html#Tips_SSB_Frequency #}
{%- set nr = nrarfcn_module %}
{%- set nr = nrarfcn_module %}
...
@@ -83,29 +101,14 @@
...
@@ -83,29 +101,14 @@
{{- slapparameter_dict.get(name, defaults.get(name)) }}
{{- slapparameter_dict.get(name, defaults.get(name)) }}
{%- endmacro %}
{%- endmacro %}
{#- tap indicates tap interface
that slapos told us to use.
{#- tap indicates tap interface
, that slapos told us to use,
or 'xxx-notap-xxx' if slapos provided us nothing or empty string. #}
or 'xxx-notap-xxx' if slapos provided us
either
nothing or empty string. #}
{%- set tap = slap_configuration.get('tap-name', '') %}
{%- set tap = slap_configuration.get('tap-name', '') %}
{%- if tap == '' %}
{%- if tap == '' %}
{%- set tap = 'xxx-notap-xxx' %}
{%- set tap = 'xxx-notap-xxx' %}
{%- endif %}
{%- endif %}
{#- J is used around macro calls to retrieve returned objects.
It is needed to workaround jinja2 limitation that macro can return only
strings - not arbitrary objects: we return objects as JSON-encoded string
and J decodes them.
By convention macros that return JSON-encoded objects start with "j" prefix.
Usage example:
set obj = J(jmymacro(...))
#}
{%- set J = json_module.loads %}
{#- bug indicates an error in template logic.
{#- bug indicates an error in template logic.
it should not happen. #}
it should not happen. #}
{%- macro bug(msg) %}
{%- macro bug(msg) %}
...
@@ -214,7 +217,6 @@
...
@@ -214,7 +217,6 @@
{#- do print('\n>>> iru_dict:'), pprint(iru_dict) #}
{#- do print('\n>>> iru_dict:'), pprint(iru_dict) #}
{#- do print('\n>>> icell_dict:'), pprint(icell_dict) #}
{#- do print('\n>>> icell_dict:'), pprint(icell_dict) #}
{#- XXX verify cell_type = lte|nr XXX no - this should be verified by json-schema #}
{#- verify that there is no dangling cell->ru references #}
{#- verify that there is no dangling cell->ru references #}
{#- XXX also verify that there is no dangling cell -> cell refs in ruincell_ref #}
{#- XXX also verify that there is no dangling cell -> cell refs in ruincell_ref #}
...
@@ -316,7 +318,6 @@
...
@@ -316,7 +318,6 @@
{%- set _ = ishared['_'] %}
{%- set _ = ishared['_'] %}
{%- if 'ue_type' in _ %}
{%- if 'ue_type' in _ %}
{%- set iue = ishared %}
{%- set iue = ishared %}
{#- XXX verify ue.ue_type in lte|nr #}
{%- for k, v in defaults['ue'].items() %}
{%- for k, v in defaults['ue'].items() %}
{%- do _.setdefault(k, v) %}
{%- do _.setdefault(k, v) %}
{%- endfor %}
{%- endfor %}
...
...
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