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
0
Merge Requests
0
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
Kirill Smelkov
slapos
Commits
00d0b51a
Commit
00d0b51a
authored
Sep 25, 2023
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
2ddcf248
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
19 deletions
+92
-19
software/ors-amarisoft/k/krequest-ors.enb
software/ors-amarisoft/k/krequest-ors.enb
+83
-18
software/ors-amarisoft/k/kslap.py
software/ors-amarisoft/k/kslap.py
+9
-1
No files found.
software/ors-amarisoft/k/krequest-ors.enb
View file @
00d0b51a
...
@@ -7,12 +7,12 @@ from os.path import dirname
...
@@ -7,12 +7,12 @@ from os.path import dirname
sys.path.insert(0, dirname(__file__))
sys.path.insert(0, dirname(__file__))
import kslap
import kslap
import json
import json
, copy
from pprint import pprint
from pprint import pprint
ors = "/srv/slapgrid/slappart35/srv/project/slapos/software/ors-amarisoft/software.cfg"
ors = "/srv/slapgrid/slappart35/srv/project/slapos/software/ors-amarisoft/software.cfg"
enb = request(ors,
enb
1
= request(ors,
software_type="enb",
software_type="enb",
partition_reference="kenb",
partition_reference="kenb",
filter_kw={"computer_guid": "slaprunner"},
filter_kw={"computer_guid": "slaprunner"},
...
@@ -20,37 +20,43 @@ enb = request(ors,
...
@@ -20,37 +20,43 @@ enb = request(ors,
'testing': True,
'testing': True,
})})
})})
enb2 = request(ors,
software_type="enb",
partition_reference="kenb2",
filter_kw={"computer_guid": "slaprunner"},
partition_parameter_kw={"_": json.dumps({
'testing': True,
})})
print('enb:', enb)
print('enb1:', enb1)
print('ref(enb):', kslap.ref_of_instance(slap, enb))
print('ref(enb1):', kslap.ref_of_instance(slap, enb1))
print('enb1.slap_computer_partition_i:', enb1.slap_computer_partition_id)
#""" (not needed for now)
# enb -> enb_part to retrieve all information about instance state
# enb -> enb_part to retrieve all information about instance state
# (see about core_part in krequest_ors.core for details)
# (see about core_part in krequest_ors.core for details)
enb_part = slap.registerComputerPartition(enb
.slap_computer_id, enb
.slap_computer_partition_id)
enb_part = slap.registerComputerPartition(enb
1.slap_computer_id, enb1
.slap_computer_partition_id)
print('enb_part:', enb_part)
print('enb_part:', enb_part)
print('enb_part.getInstanceParameterDict:')
print('enb_part.getInstanceParameterDict:')
pprint(enb_part.getInstanceParameterDict())
pprint(enb_part.getInstanceParameterDict())
#"""
def request_ru(enb, **kw):
1/0
def request_cell(enb, cell_ref, kw):
# iENB adds to enb a shared instance with specified reference and parameters.
assert 'cell_type' in kw
def iENB(enb, ref, kw):
enb_ref = kslap.ref_of_instance(slap, enb)
enb_ref = kslap.ref_of_instance(slap, enb)
enb_guid = enb.getInstanceGuid()
enb_guid = enb.getInstanceGuid()
cell = request(ors,
cell = request(ors,
software_type="enb",
software_type="enb",
partition_reference=
cell_
ref,
partition_reference=ref,
shared=True,
shared=True,
filter_kw={"instance_guid": enb_guid},
filter_kw={"instance_guid": enb_guid},
partition_parameter_kw={"_": json.dumps(kw
partition_parameter_kw={"_": json.dumps(kw)})
)})
return cell
return cell
def request_peer(enb, **kw):
1/0
RU1 = {
RU1 = {
'ru_type': 'sdr',
'ru_type': 'sdr',
...
@@ -72,8 +78,7 @@ CELL1_a = {
...
@@ -72,8 +78,7 @@ CELL1_a = {
'ru': RU1, # RU definition embedded into CELL
'ru': RU1, # RU definition embedded into CELL
}
}
iCELL1_a = request_cell(enb, 'CELL1_a', CELL1_a)
iCELL1_a = iENB(enb1, 'CELL1_a', CELL1_a)
print('iCELL1_a:', iCELL1_a)
CELL1_b = {
CELL1_b = {
...
@@ -89,6 +94,66 @@ CELL1_b = {
...
@@ -89,6 +94,66 @@ CELL1_b = {
}
}
}
}
iCELL1_b = request_cell(enb, 'CELL1_b', CELL1_b)
iCELL1_b = iENB(enb1, 'CELL1_b', CELL1_b)
print('iCELL1_b:', iCELL1_b)
RU2_a = {
'ru_type': 'lopcomm',
'ru_link_type': 'cpri',
'mac_addr': 'XXX',
'cpri_link': {
'sdr_dev': 2,
'sfp_port': 0,
'mult': 8,
'mapping': 'standard',
'rx_delay': 10,
'tx_delay': 11,
'tx_dbm': 50
},
'n_antenna_dl': 2,
'n_antenna_ul': 1,
'tx_gain': -21,
'rx_gain': -22,
}
RU2_b = copy.deepcopy(RU2_a)
RU2_b['mac_addr'] = 'YYY'
RU2_b['cpri_link']['sfp_port'] = 1
RU2_b['tx_gain'] += 10
RU2_b['rx_gain'] += 10
iRU2_a = iENB(enb1, 'RU2_a', RU2_a)
iRU2_b = iENB(enb1, 'RU2_b', RU2_b)
iENB(enb1, 'CELL2_a', {
'cell_type': 'lte',
'rf_mode': 'fdd',
'bandwidth': '5 MHz',
'dl_earfcn': 3350, # 2680 MHz
'pci': 21,
'cell_id': '0x21',
'ru': { # CELL2_a links to RU2_a by its reference
'ru_type': 'ru_ref',
'ru_ref': 'RU2_a'
}
})
iENB(enb1, 'CELL2_b', {
'cell_type': 'nr',
'rf_mode': 'fdd',
'bandwidth': 5,
'dl_nr_arfcn': 537200, # 2686 MHz
'nr_band': 7,
'pci': 22,
'cell_id': '0x22',
'ru': {
'ru_type': 'ru_ref',
'ru_ref': 'RU2_b'
}
})
print('\n\n\n----\n\n\n')
kenb_ = kslap.instance_by_ref(slap, 'kenb')
print(kenb_)
pprint(kenb_)
software/ors-amarisoft/k/kslap.py
View file @
00d0b51a
# Module kslap provides utility routines for dealing with SlapOS.
# Module kslap provides utility routines for dealing with SlapOS.
# ref_of_instance returns reference an instance was requested with
# ref_of_instance returns reference an instance was requested with
.
def
ref_of_instance
(
slap
,
inst
):
def
ref_of_instance
(
slap
,
inst
):
i_comp_id
=
inst
.
slap_computer_id
i_comp_id
=
inst
.
slap_computer_id
i_part_id
=
inst
.
slap_computer_partition_id
i_part_id
=
inst
.
slap_computer_partition_id
...
@@ -9,3 +9,11 @@ def ref_of_instance(slap, inst):
...
@@ -9,3 +9,11 @@ def ref_of_instance(slap, inst):
x
.
_reference
==
i_part_id
:
x
.
_reference
==
i_part_id
:
return
x
.
_partition_reference
return
x
.
_partition_reference
raise
KeyError
(
'not found reference of instance_guid=%s-%s'
%
(
i_comp_id
,
i_part_id
))
raise
KeyError
(
'not found reference of instance_guid=%s-%s'
%
(
i_comp_id
,
i_part_id
))
# instance_by_ref returns instance corresponding to specified reference.
def
instance_by_ref
(
slap
,
ref
):
for
x
in
slap
.
getOpenOrderDict
().
values
():
# XXX linear search
if
x
.
_partition_reference
==
ref
:
return
x
raise
KeyError
(
'not found instance coresponding to reference %s'
%
ref
)
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