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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
slapos
Commits
51f791cd
Commit
51f791cd
authored
Feb 03, 2023
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/ors-amarisoft: add amarisoft rf_info service
parent
e0f418c8
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
121 additions
and
3 deletions
+121
-3
software/ors-amarisoft/amarisoft-rf-info.jinja2.py
software/ors-amarisoft/amarisoft-rf-info.jinja2.py
+61
-0
software/ors-amarisoft/buildout.hash.cfg
software/ors-amarisoft/buildout.hash.cfg
+7
-3
software/ors-amarisoft/instance-enb.jinja2.cfg
software/ors-amarisoft/instance-enb.jinja2.cfg
+24
-0
software/ors-amarisoft/instance-gnb.jinja2.cfg
software/ors-amarisoft/instance-gnb.jinja2.cfg
+24
-0
software/ors-amarisoft/instance.cfg
software/ors-amarisoft/instance.cfg
+2
-0
software/ors-amarisoft/software.cfg
software/ors-amarisoft/software.cfg
+3
-0
No files found.
software/ors-amarisoft/amarisoft-rf-info.jinja2.py
0 → 100644
View file @
51f791cd
#!{{ python_path }}
import
json
import
logging
from
logging.handlers
import
RotatingFileHandler
import
time
from
websocket
import
create_connection
class
enbWebSocket
:
def
__init__
(
self
):
log_file
=
"{{ log_file }}"
self
.
logger
=
logging
.
getLogger
(
'logger'
)
self
.
logger
.
setLevel
(
logging
.
INFO
)
handler
=
RotatingFileHandler
(
log_file
,
maxBytes
=
30000
,
backupCount
=
2
)
formatter
=
logging
.
Formatter
(
'{"time": "%(asctime)s", "log_level": "%(levelname)s", "message": "%(message)s", "data": %(data)s}'
)
handler
.
setFormatter
(
formatter
)
self
.
logger
.
addHandler
(
handler
)
if
{{
testing
}}:
return
self
.
ws_url
=
"ws://127.0.1.2:9001"
self
.
ws
=
create_connection
(
self
.
ws_url
)
def
close
(
self
):
if
{{
testing
}}:
return
self
.
ws
.
close
()
def
send
(
self
,
msg
):
self
.
ws
.
send
(
json
.
dumps
(
msg
))
def
recv
(
self
,
message_type
):
for
i
in
range
(
1
,
20
):
r
=
json
.
loads
(
self
.
ws
.
recv
())
if
r
[
'message'
]
==
message_type
:
return
r
def
stats
(
self
):
if
{{
testing
}}:
r
=
{
'message'
:
'rf'
,
'rf_info'
:
"CPRI: x16 HW SW
\
n
"
}
else
:
self
.
send
({
"message"
:
"rf"
,
"rf_info"
:
True
})
r
=
self
.
recv
(
'rf'
)
self
.
logger
.
info
(
'RF info'
,
extra
=
{
'data'
:
r
})
if
__name__
==
'__main__'
:
ws
=
enbWebSocket
()
try
:
while
True
:
ws
.
stats
()
time
.
sleep
({{
stats_period
}})
finally
:
ws
.
close
()
software/ors-amarisoft/buildout.hash.cfg
View file @
51f791cd
...
@@ -16,12 +16,16 @@
...
@@ -16,12 +16,16 @@
[template]
[template]
filename = instance.cfg
filename = instance.cfg
md5sum =
d21dcca80b710df5ab459bd74edd0ac7
md5sum =
4af831f81760b37250fa50ad3812142a
[amarisoft-stats.jinja2.py]
[amarisoft-stats.jinja2.py]
_update_hash_filename_ = amarisoft-stats.jinja2.py
_update_hash_filename_ = amarisoft-stats.jinja2.py
md5sum = 6e0a052bd0ca08cc0c7b4880d3deffcc
md5sum = 6e0a052bd0ca08cc0c7b4880d3deffcc
[amarisoft-rf-info.jinja2.py]
_update_hash_filename_ = amarisoft-rf-info.jinja2.py
md5sum = c930c28365c685a6066f382c9b5d8893
[lopcomm-rrh-stats.jinja2.py]
[lopcomm-rrh-stats.jinja2.py]
_update_hash_filename_ = lopcomm-rrh-stats.jinja2.py
_update_hash_filename_ = lopcomm-rrh-stats.jinja2.py
md5sum = 39e191080722ac13ebc56b1e6350eb8f
md5sum = 39e191080722ac13ebc56b1e6350eb8f
...
@@ -32,7 +36,7 @@ md5sum = bb4435f433e100fede09ff921d42c927
...
@@ -32,7 +36,7 @@ md5sum = bb4435f433e100fede09ff921d42c927
[template-lte-enb]
[template-lte-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
_update_hash_filename_ = instance-enb.jinja2.cfg
md5sum =
9ccb99150a220a40158bb079691c83b8
md5sum =
c408287f84382f021365985a3a524675
[template-lte-gnb-epc]
[template-lte-gnb-epc]
_update_hash_filename_ = instance-gnb-epc.jinja2.cfg
_update_hash_filename_ = instance-gnb-epc.jinja2.cfg
...
@@ -44,7 +48,7 @@ md5sum = acc9176fd9abe1d04c60a08cdd520eee
...
@@ -44,7 +48,7 @@ md5sum = acc9176fd9abe1d04c60a08cdd520eee
[template-lte-gnb]
[template-lte-gnb]
_update_hash_filename_ = instance-gnb.jinja2.cfg
_update_hash_filename_ = instance-gnb.jinja2.cfg
md5sum =
1d161902801a6ac0c461dffdf78e98ac
md5sum =
90e260fea9d6794d41a52d1c07a6bf81
[template-lte-mme]
[template-lte-mme]
_update_hash_filename_ = instance-mme.jinja2.cfg
_update_hash_filename_ = instance-mme.jinja2.cfg
...
...
software/ors-amarisoft/instance-enb.jinja2.cfg
View file @
51f791cd
...
@@ -5,6 +5,7 @@ parts =
...
@@ -5,6 +5,7 @@ parts =
lte-enb-config
lte-enb-config
lte-enb-service
lte-enb-service
amarisoft-stats-service
amarisoft-stats-service
amarisoft-rf-info-service
{% if slapparameter_dict.get('rrh', '') == "Lopcomm ORAN" %}
{% if slapparameter_dict.get('rrh', '') == "Lopcomm ORAN" %}
lopcomm-rrh-stats-service
lopcomm-rrh-stats-service
check-lopcomm-vswr.py
check-lopcomm-vswr.py
...
@@ -127,6 +128,21 @@ mode = 0775
...
@@ -127,6 +128,21 @@ mode = 0775
url = {{ amarisoft_stats_template }}
url = {{ amarisoft_stats_template }}
output = ${directory:bin}/amarisoft-stats.py
output = ${directory:bin}/amarisoft-stats.py
[amarisoft-rf-info-template]
recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
log-output = ${directory:var}/log/amarisoft-rf-info.json.log
context =
section directory directory
key slapparameter_dict slap-configuration:configuration
key log_file :log-output
raw stats_period {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }}
raw testing {{ slapparameter_dict.get("testing", False) }}
raw python_path {{ buildout_directory}}/bin/pythonwitheggs
mode = 0775
url = {{ amarisoft_rf_info_template }}
output = ${directory:bin}/amarisoft-rf-info.py
[lopcomm-rrh-stats-template]
[lopcomm-rrh-stats-template]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
extensions = jinja2.ext.do
...
@@ -151,6 +167,14 @@ mode = 0775
...
@@ -151,6 +167,14 @@ mode = 0775
hash-files =
hash-files =
${amarisoft-stats-template:output}
${amarisoft-stats-template:output}
[amarisoft-rf-info-service]
recipe = slapos.cookbook:wrapper
command-line = ${amarisoft-rf-info-template:output}
wrapper-path = ${directory:service}/amarisoft-rf-info
mode = 0775
hash-files =
${amarisoft-rf-info-template:output}
[lopcomm-rrh-stats-service]
[lopcomm-rrh-stats-service]
recipe = slapos.cookbook:wrapper
recipe = slapos.cookbook:wrapper
command-line = ${lopcomm-rrh-stats-template:output}
command-line = ${lopcomm-rrh-stats-template:output}
...
...
software/ors-amarisoft/instance-gnb.jinja2.cfg
View file @
51f791cd
...
@@ -5,6 +5,7 @@ parts =
...
@@ -5,6 +5,7 @@ parts =
lte-gnb-config
lte-gnb-config
lte-enb-service
lte-enb-service
amarisoft-stats-service
amarisoft-stats-service
amarisoft-rf-info-service
{% if slapparameter_dict.get('rrh', '') == "Lopcomm ORAN" %}
{% if slapparameter_dict.get('rrh', '') == "Lopcomm ORAN" %}
lopcomm-rrh-stats-service
lopcomm-rrh-stats-service
check-lopcomm-vswr.py
check-lopcomm-vswr.py
...
@@ -130,6 +131,21 @@ mode = 0775
...
@@ -130,6 +131,21 @@ mode = 0775
url = {{ amarisoft_stats_template }}
url = {{ amarisoft_stats_template }}
output = ${directory:bin}/amarisoft-stats.py
output = ${directory:bin}/amarisoft-stats.py
[amarisoft-rf-info-template]
recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
log-output = ${directory:var}/log/amarisoft-rf-info.json.log
context =
section directory directory
key slapparameter_dict slap-configuration:configuration
key log_file :log-output
raw stats_period {{ slapparameter_dict.get("gnb_stats_fetch_period", 60) }}
raw testing {{ slapparameter_dict.get("testing", False) }}
raw python_path {{ buildout_directory}}/bin/pythonwitheggs
mode = 0775
url = {{ amarisoft_rf_info_template }}
output = ${directory:bin}/amarisoft-rf-info.py
[amarisoft-stats-service]
[amarisoft-stats-service]
recipe = slapos.cookbook:wrapper
recipe = slapos.cookbook:wrapper
command-line = ${amarisoft-stats-template:output}
command-line = ${amarisoft-stats-template:output}
...
@@ -138,6 +154,14 @@ mode = 0775
...
@@ -138,6 +154,14 @@ mode = 0775
hash-files =
hash-files =
${amarisoft-stats-template:output}
${amarisoft-stats-template:output}
[amarisoft-rf-info-service]
recipe = slapos.cookbook:wrapper
command-line = ${amarisoft-rf-info-template:output}
wrapper-path = ${directory:service}/amarisoft-rf-info
mode = 0775
hash-files =
${amarisoft-rf-info-template:output}
[config-base]
[config-base]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
extensions = jinja2.ext.do
...
...
software/ors-amarisoft/instance.cfg
View file @
51f791cd
...
@@ -110,6 +110,7 @@ extra-context =
...
@@ -110,6 +110,7 @@ extra-context =
raw sib23 ${sib23.asn:target}
raw sib23 ${sib23.asn:target}
raw ltelogs_template ${ltelogs.jinja2.sh:target}
raw ltelogs_template ${ltelogs.jinja2.sh:target}
raw amarisoft_stats_template ${amarisoft-stats.jinja2.py:target}
raw amarisoft_stats_template ${amarisoft-stats.jinja2.py:target}
raw amarisoft_rf_info_template ${amarisoft-rf-info.jinja2.py:target}
raw lopcomm_rrh_stats_template ${lopcomm-rrh-stats.jinja2.py:target}
raw lopcomm_rrh_stats_template ${lopcomm-rrh-stats.jinja2.py:target}
raw openssl_location ${openssl:location}
raw openssl_location ${openssl:location}
raw default_dl_earfcn ${default-params:default-dl-earfcn}
raw default_dl_earfcn ${default-params:default-dl-earfcn}
...
@@ -136,6 +137,7 @@ extra-context =
...
@@ -136,6 +137,7 @@ extra-context =
raw gnb_template ${gnb.jinja2.cfg:target}
raw gnb_template ${gnb.jinja2.cfg:target}
raw ltelogs_template ${ltelogs.jinja2.sh:target}
raw ltelogs_template ${ltelogs.jinja2.sh:target}
raw amarisoft_stats_template ${amarisoft-stats.jinja2.py:target}
raw amarisoft_stats_template ${amarisoft-stats.jinja2.py:target}
raw amarisoft_rf_info_template ${amarisoft-rf-info.jinja2.py:target}
raw openssl_location ${openssl:location}
raw openssl_location ${openssl:location}
raw default_dl_nr_arfcn ${default-params:default-dl-nr-arfcn}
raw default_dl_nr_arfcn ${default-params:default-dl-nr-arfcn}
raw default_nr_band ${default-params:default-nr-band}
raw default_nr_band ${default-params:default-nr-band}
...
...
software/ors-amarisoft/software.cfg
View file @
51f791cd
...
@@ -53,6 +53,9 @@ url = ${:_profile_base_location_}/${:_update_hash_filename_}
...
@@ -53,6 +53,9 @@ url = ${:_profile_base_location_}/${:_update_hash_filename_}
[amarisoft-stats.jinja2.py]
[amarisoft-stats.jinja2.py]
<= download-base
<= download-base
[amarisoft-rf-info.jinja2.py]
<= download-base
[lopcomm-rrh-stats.jinja2.py]
[lopcomm-rrh-stats.jinja2.py]
<= download-base
<= download-base
...
...
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