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
133c8da4
Commit
133c8da4
authored
Sep 25, 2023
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
74f6bcda
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
7 deletions
+40
-7
software/ors-amarisoft/k/krequest-ors.core
software/ors-amarisoft/k/krequest-ors.core
+9
-4
software/ors-amarisoft/k/krequest-ors.enb
software/ors-amarisoft/k/krequest-ors.enb
+30
-2
software/ors-amarisoft/k/kslap.py
software/ors-amarisoft/k/kslap.py
+1
-1
No files found.
software/ors-amarisoft/k/krequest-ors.core
View file @
133c8da4
#!/usr/bin/env -S slapos console
"""request ors/core for kirr"""
import sys, json
from pprint import pprint
# XXX workaround for `slapos console` not setting up sys.path the same way as std python does
import sys
from os.path import dirname
sys.path.insert(0, dirname(__file__))
import kslap
import json
from pprint import pprint
"""
x =slap.getOpenOrderDict()
...
...
@@ -29,7 +34,7 @@ core = request(ors,
})})
print("core:", core)
print("ref(core):", kslap.ref_of_instance(core))
print("ref(core):", kslap.ref_of_instance(
slap,
core))
print("core.getInstanceParameterDict:")
pprint(core.getInstanceParameterDict())
print()
...
...
@@ -74,7 +79,7 @@ for x in '_computer_id', '_instance_guid', '_parameter_dict', '_partition_id', '
def request_sim(core, sim_n):
core_ref = kslap.ref_of_instance(core)
core_ref = kslap.ref_of_instance(
slap,
core)
core_guid = core.getInstanceGuid()
sim = request(ors,
software_type="core-network",
...
...
software/ors-amarisoft/k/krequest-ors.enb
View file @
133c8da4
#!/usr/bin/env -S slapos console
"""request ors/enb for kirr"""
# XXX workaround for `slapos console` not setting up sys.path the same way as std python does
import sys
from os.path import dirname
sys.path.insert(0, dirname(__file__))
import kslap
import json
from pprint import pprint
ors = "/srv/slapgrid/slappart35/srv/project/slapos/software/ors-amarisoft/software.cfg"
en
v
= request(ors,
en
b
= request(ors,
software_type="enb",
partition_reference="kenb",
filter_kw={"computer_guid": "slaprunner"},
partition_parameter_kw={"_": json.dumps({
'testing': True,
'core_network_plmn': '31415',
})})
print('enb:', enb)
print('ref(enb):', kslap.ref_of_instance(slap, enb))
# enb -> enb_part to retrieve all information about instance state
# (see about core_part in krequest_ors.core for details)
enb_part = slap.registerComputerPartition(enb.slap_computer_id, enb.slap_computer_partition_id)
print('enb_part:', enb_part)
print('enb_part.getInstanceParameterDict:')
pprint(enb_part.getInstanceParameterDict())
def request_ru(enb, **kw):
1/0
def request_cell(enb, **kw):
1/0
def request_peer(enb, **kw):
1/0
software/ors-amarisoft/k/kslap.py
View file @
133c8da4
# Module kslap provides utility routines for dealing with SlapOS.
# ref_of_instance returns reference an instance was requested with
def
ref_of_instance
(
inst
):
def
ref_of_instance
(
slap
,
inst
):
i_comp_id
=
inst
.
slap_computer_id
i_part_id
=
inst
.
slap_computer_partition_id
for
x
in
slap
.
getOpenOrderDict
().
values
():
# XXX linear search
...
...
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