Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
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
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
slapos
Commits
8a62834e
Commit
8a62834e
authored
Feb 22, 2023
by
Lu Xu
👀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/ors-amarisoft: add carrier configuration for lopcomm RRH
parent
fcb7b7ee
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
151 additions
and
5 deletions
+151
-5
software/ors-amarisoft/buildout.hash.cfg
software/ors-amarisoft/buildout.hash.cfg
+15
-3
software/ors-amarisoft/instance-enb.jinja2.cfg
software/ors-amarisoft/instance-enb.jinja2.cfg
+25
-0
software/ors-amarisoft/instance.cfg
software/ors-amarisoft/instance.cfg
+3
-0
software/ors-amarisoft/lopcomm-rrh-config.jinja2.py
software/ors-amarisoft/lopcomm-rrh-config.jinja2.py
+78
-0
software/ors-amarisoft/lopcomm-rrh-stats.jinja2.py
software/ors-amarisoft/lopcomm-rrh-stats.jinja2.py
+14
-2
software/ors-amarisoft/software.cfg
software/ors-amarisoft/software.cfg
+16
-0
No files found.
software/ors-amarisoft/buildout.hash.cfg
View file @
8a62834e
...
...
@@ -16,7 +16,7 @@
[template]
filename = instance.cfg
md5sum =
4af831f81760b37250fa50ad3812142a
md5sum =
3f982f31a642ba9d6a1613f49e1c0d10
[amarisoft-stats.jinja2.py]
_update_hash_filename_ = amarisoft-stats.jinja2.py
...
...
@@ -28,7 +28,11 @@ md5sum = c930c28365c685a6066f382c9b5d8893
[lopcomm-rrh-stats.jinja2.py]
_update_hash_filename_ = lopcomm-rrh-stats.jinja2.py
md5sum = 39e191080722ac13ebc56b1e6350eb8f
md5sum = 6339dd6c5dcbef95b58ed52a9fadc9a4
[lopcomm-rrh-config.jinja2.py]
_update_hash_filename_ = lopcomm-rrh-config.jinja2.py
md5sum = e0b68a87238282568e0e04c792ec7288
[template-lte-enb-epc]
_update_hash_filename_ = instance-enb-epc.jinja2.cfg
...
...
@@ -36,7 +40,7 @@ md5sum = bb4435f433e100fede09ff921d42c927
[template-lte-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
md5sum =
31707b64ab531c60fc99287238130c5b
md5sum =
49f8628e616c1fa09608b58a7f9ac34e
[template-lte-gnb-epc]
_update_hash_filename_ = instance-gnb-epc.jinja2.cfg
...
...
@@ -97,3 +101,11 @@ md5sum = 31c166f0a1b6d664f92b8f318b233d9a
[ue-nr.jinja2.cfg]
filename = config/ue-nr.jinja2.cfg
md5sum = b3078deab008d7e81ddd88ac02b8b698
[CreateProcessingEle.jinja2.xml]
filename = netconf/CreateProcessingEle.jinja2.xml
md5sum = e435990eb0a0d4be41efa9bd16dce09b
[cu_config.jinja2.xml]
filename = netconf/cu_config.jinja2.xml
md5sum = 50b8f86cf4ed87be179f6a62284c56d7
software/ors-amarisoft/instance-enb.jinja2.cfg
View file @
8a62834e
...
...
@@ -8,6 +8,8 @@ parts =
amarisoft-rf-info-service
{% if slapparameter_dict.get('rrh', '') == "Lopcomm ORAN" %}
lopcomm-rrh-stats-service
lopcomm-rrh-config-template
lopcomm-cu-config
check-lopcomm-vswr.py
check-lopcomm-lof.py
check-lopcomm-rssi.py
...
...
@@ -151,17 +153,40 @@ recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
log-output = ${directory:var}/log/lopcomm-rrh-stats.log
json-log-output = ${directory:var}/log/lopcomm-rrh-stats.json.log
cfg-json-log-output = ${directory:var}/log/lopcomm-rrh-config.json.log
context =
section directory directory
key slapparameter_dict slap-configuration:configuration
key log_file :log-output
key json_log_file :json-log-output
key cfg_json_log_file :cfg-json-log-output
raw testing {{ slapparameter_dict.get("testing", False) }}
raw python_path {{ buildout_directory}}/bin/pythonwitheggs
mode = 0775
url = {{ lopcomm_rrh_stats_template }}
output = ${directory:bin}/lopcomm-rrh-stats.py
[lopcomm-cu-config]
<= config-base
url = {{ cu_config_template }}
output = ${directory:etc}/cu_config.xml
[lopcomm-rrh-config-template]
recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
log-output = ${directory:var}/log/lopcomm-rrh-config.log
context =
section directory directory
key slapparameter_dict slap-configuration:configuration
key log_file :log-output
raw testing {{ slapparameter_dict.get("testing", False) }}
raw python_path {{ buildout_directory}}/bin/pythonwitheggs
raw CreateProcessingEle_template {{ CreateProcessingEle_template }}
key cu_config_template lopcomm-cu-config:output
mode = 0775
url = {{ lopcomm_rrh_config_template }}
output = ${directory:script}/lopcomm-rrh-config.py
[amarisoft-stats-service]
recipe = slapos.cookbook:wrapper
command-line = ${amarisoft-stats-template:output}
...
...
software/ors-amarisoft/instance.cfg
View file @
8a62834e
...
...
@@ -112,6 +112,9 @@ extra-context =
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_config_template ${lopcomm-rrh-config.jinja2.py:target}
raw CreateProcessingEle_template ${CreateProcessingEle.jinja2.xml:target}
raw cu_config_template ${cu_config.jinja2.xml:target}
raw openssl_location ${openssl:location}
raw default_dl_earfcn ${default-params:default-dl-earfcn}
raw default_lte_dl_freq ${default-params:default-lte-dl-freq}
...
...
software/ors-amarisoft/lopcomm-rrh-config.jinja2.py
0 → 100644
View file @
8a62834e
#!{{ python_path }}
import
logging
import
time
import
xmltodict
from
logging.handlers
import
RotatingFileHandler
from
ncclient
import
manager
from
ncclient.operations
import
RPCError
from
ncclient.xml_
import
*
from
ncclient.devices.default
import
DefaultDeviceHandler
class
LopcommNetconfClient
:
def
__init__
(
self
):
log_file
=
"{{ log_file }}"
self
.
logger
=
logging
.
getLogger
(
'logger'
)
self
.
logger
.
setLevel
(
logging
.
DEBUG
)
handler
=
RotatingFileHandler
(
log_file
,
maxBytes
=
100000
,
backupCount
=
5
)
self
.
logger
.
addHandler
(
handler
)
formatter
=
logging
.
Formatter
(
"%(asctime)s [%(levelname)s] %(message)s"
)
handler
.
setFormatter
(
formatter
)
if
{{
testing
}}:
return
def
connect
(
self
,
host
,
port
,
user
,
password
):
if
{{
testing
}}:
return
self
.
address
=
(
host
,
port
)
self
.
logger
.
info
(
'Connecting to %s, user %s...'
%
(
self
.
address
,
user
))
self
.
conn
=
manager
.
connect
(
host
=
host
,
port
=
port
,
username
=
user
,
password
=
password
,
timeout
=
1800
,
device_params
=
{
'name'
:
'default'
},
hostkey_verify
=
False
)
self
.
logger
.
info
(
'Connection to %s successful'
%
(
self
.
address
,))
def
edit_config
(
self
,
config_files
):
for
config_file
in
config_files
:
with
open
(
config_file
)
as
f
:
config_xml
=
f
.
read
()
try
:
self
.
logger
.
info
(
'Sending edit-config RPC request...'
)
self
.
conn
.
edit_config
(
target
=
'running'
,
config
=
config_xml
)
self
.
logger
.
info
(
'Edit-config RPC request sent successfully'
)
except
RPCError
as
e
:
self
.
logger
.
error
(
'Error sending edit-config RPC request: %s'
%
e
)
def
close
(
self
):
# Close not compatible between ncclient and netconf server
#self.conn.close()
pass
if
__name__
==
'__main__'
:
nc
=
LopcommNetconfClient
()
while
True
:
try
:
nc
.
connect
(
"192.168.0.210"
,
830
,
"oranuser"
,
"oranpassword"
)
nc
.
edit_config
([
"{{ CreateProcessingEle_template }}"
,
"{{ cu_config_template }}"
])
break
except
Exception
as
e
:
nc
.
logger
.
debug
(
'Got exception, waiting 10 seconds before reconnecting...'
)
nc
.
logger
.
debug
(
e
)
time
.
sleep
(
10
)
finally
:
nc
.
close
()
software/ors-amarisoft/lopcomm-rrh-stats.jinja2.py
View file @
8a62834e
...
...
@@ -14,17 +14,25 @@ class LopcommNetconfClient:
log_file
=
"{{ log_file }}"
json_log_file
=
"{{ json_log_file }}"
cfg_json_log_file
=
"{{ cfg_json_log_file }}"
self
.
logger
=
logging
.
getLogger
(
'logger'
)
self
.
json_logger
=
logging
.
getLogger
(
'json_logger'
)
self
.
cfg_json_logger
=
logging
.
getLogger
(
'cfg_json_logger'
)
self
.
logger
.
setLevel
(
logging
.
DEBUG
)
self
.
json_logger
.
setLevel
(
logging
.
DEBUG
)
self
.
cfg_json_logger
.
setLevel
(
logging
.
DEBUG
)
json_handler
=
RotatingFileHandler
(
json_log_file
,
maxBytes
=
100000
,
backupCount
=
5
)
json_formatter
=
logging
.
Formatter
(
'{"time": "%(asctime)s", "log_level": "%(levelname)s", "message": "%(message)s", "data": %(data)s}'
)
json_handler
.
setFormatter
(
json_formatter
)
self
.
json_logger
.
addHandler
(
json_handler
)
cfg_json_handler
=
RotatingFileHandler
(
cfg_json_log_file
,
maxBytes
=
100000
,
backupCount
=
5
)
cfg_json_formatter
=
logging
.
Formatter
(
'{"time": "%(asctime)s", "log_level": "%(levelname)s", "message": "%(message)s", "data": %(data)s}'
)
cfg_json_handler
.
setFormatter
(
cfg_json_formatter
)
self
.
cfg_json_logger
.
addHandler
(
cfg_json_handler
)
handler
=
RotatingFileHandler
(
log_file
,
maxBytes
=
100000
,
backupCount
=
5
)
self
.
logger
.
addHandler
(
handler
)
formatter
=
logging
.
Formatter
(
"%(asctime)s [%(levelname)s] %(message)s"
)
...
...
@@ -48,7 +56,7 @@ class LopcommNetconfClient:
password
=
password
,
timeout
=
1800
,
device_params
=
{
'name'
:
'
huawei
'
'name'
:
'
default
'
},
hostkey_verify
=
False
)
...
...
@@ -71,7 +79,11 @@ class LopcommNetconfClient:
self
.
logger
.
debug
(
'Got new notification from %s...'
%
(
self
.
address
,))
result_in_xml
=
result
.
_raw
data_dict
=
xmltodict
.
parse
(
result_in_xml
)
self
.
json_logger
.
info
(
''
,
extra
=
{
'data'
:
data_dict
})
if
'alarm-notif'
in
data_dict
[
'notification'
]:
self
.
json_logger
.
info
(
''
,
extra
=
{
'data'
:
data_dict
})
else
:
self
.
cfg_json_logger
.
info
(
''
,
extra
=
{
'data'
:
data_dict
})
def
close
(
self
):
# Close not compatible between ncclient and netconf server
...
...
software/ors-amarisoft/software.cfg
View file @
8a62834e
...
...
@@ -22,6 +22,8 @@ parts +=
ue_db.jinja2.cfg
ue-lte.jinja2.cfg
ue-nr.jinja2.cfg
CreateProcessingEle.jinja2.xml
cu_config.jinja2.xml
sib23.asn
iperf3
eggs
...
...
@@ -47,6 +49,9 @@ url = ${:_profile_base_location_}/${:_update_hash_filename_}
[lopcomm-rrh-stats.jinja2.py]
<= download-base
[lopcomm-rrh-config.jinja2.py]
<= download-base
[template-lte-enb-epc]
<= download-base
...
...
@@ -79,6 +84,10 @@ url = ${:_profile_base_location_}/${:_buildout_section_name_}
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/config/${:_buildout_section_name_}
[copy-netconf-to-instance]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/netconf/${:_buildout_section_name_}
[enb.jinja2.cfg]
<= copy-config-to-instance
filename = enb.jinja2.cfg
...
...
@@ -107,6 +116,13 @@ filename = ue-lte.jinja2.cfg
<= copy-config-to-instance
filename = ue-nr.jinja2.cfg
[CreateProcessingEle.jinja2.xml]
<= copy-netconf-to-instance
filename = CreateProcessingEle.jinja2.xml
[cu_config.jinja2.xml]
<= copy-netconf-to-instance
filename = cu_config.jinja2.xml
[eggs]
recipe = zc.recipe.egg
eggs =
...
...
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