Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rapid space slapos #1

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
__pycache__/indexes.cpython-39.pyc
__pycache__/measurements.cpython-39.pyc
chromedriver_linux64
*.log
*.txt
4 changes: 4 additions & 0 deletions ORS_status_Hyd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ ui-bar ui-corner-all first-child ui-btn-color-white
ui-bar ui-corner-all first-child ui-btn-color-white
ui-bar ui-corner-all first-child ui-btn-color-white
ui-bar ui-corner-all first-child ui-btn-color-white
ui-bar ui-corner-all first-child ui-btn-color-white
ui-bar ui-corner-all first-child ui-btn-color-white
ui-bar ui-corner-all first-child ui-btn-color-white
ui-bar ui-corner-all first-child ui-btn-color-white
4 changes: 4 additions & 0 deletions ORS_status_US.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
ui-bar ui-corner-all first-child ui-btn-ok
ui-bar ui-corner-all first-child ui-btn-ok
ui-bar ui-corner-all first-child ui-btn-ok
ui-bar ui-corner-all first-child ui-btn-ok
ui-bar ui-corner-all first-child ui-btn-ok
ui-bar ui-corner-all first-child ui-btn-ok
258,360 changes: 258,360 additions & 0 deletions amf1.log

Large diffs are not rendered by default.

423 changes: 0 additions & 423 deletions gnb.log

This file was deleted.

22 changes: 7 additions & 15 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class Device_options(str, Enum):

class RAN_Parameters(BaseModel):
Band: Optional[str] = '78'
AMF_IP:Optional[str] = '192.168.71.132'
AMF_IP:Optional[str] = '10.2.50.115'#192.168.71.132'
MCC: Optional[str] = '001'
MNC: Optional[str] = '01'
TAC: Optional[str] = '1'
Expand Down Expand Up @@ -813,24 +813,16 @@ def RAN_Deploy(params=Depends(RAN_Parameters)):
Sel_Gain = 80
write_var_to_file(config_file="start_stop.py", variable_name="nr_band", variable_content=params.Band)
write_var_to_file(config_file="start_stop.py", variable_name="tx_gain", variable_content=str(Sel_Gain))
#write_var_to_file(config_file="gnb_5fi_b210.conf", variable_name="ipv4", variable_content=AMF_IPc)

write_var_to_file(config_file="start_stop.py", variable_name="epc_plmn", variable_content=plmn_id)
#write_var_to_file(config_file="start_stop.py", variable_name="mnc", variable_content=params.MNC)
#write_var_to_file(config_file="start_stop.py", variable_name="tracking_area_code", variable_content=params.TAC)
#write_var_to_file(config_file="start_stop.py", variable_name="sst", variable_content=params.SST)
write_var_to_file(config_file="start_stop.py", variable_name="state1", variable_content=f'"{"started"}"')

#command = 'sudo su'
print(subprocess.check_output('pwd'))
#cmd1 = subprocess.Popen(['echo',sudo_password], stdout=subprocess.PIPE)
# popen = subprocess.Popen(['sudo','-S'] + args, stdin=cmd1.stdout, stdout=subprocess.PIPE)

#process = subprocess.Popen(command,stdout=subprocess.PIPE,preexec_fn=os.setpgrp)
#os.system(command)
cmd = 'su root -c' + f'{"slapos console --cfg ~/.slapos/slapos-client.cfg /home/dolcera/5Fi_APIs/Deploy-APIs/start_stop.py"}'
res = os.system(cmd)
print(res)

command = "sudo su -c 'slapos console --cfg ~/.slapos/slapos-client.cfg /home/dolcera/5Fi_APIs/Deploy-APIs/start_stop.py'"

ret = os.system(command)#subprocess.run(command, capture_output=True, shell=True)

print(ret)
result = f'Deployed Sucessfully with Gain {Sel_Gain}'
#result = "Deployed Sucessfully"
return result #templates.TemplateResponse('index.html', context={'request': request, 'result': result})
Expand Down
4 changes: 2 additions & 2 deletions start_stop.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
epc_plmn = "00101"
tx_gain = 80
nr_band = 78
dl_nr_arfcn = 519000
obj = {"epc_plmn": epc_plmn, "tx_gain": tx_gain, "rx_gain": 35, "dl_nr_arfcn": dl_nr_arfcn, "nr_band": nr_band, "use_ipv4": True}
dl_nr_arfcn = 646666
obj = {"epc_plmn": epc_plmn, "tx_gain": tx_gain, "rx_gain": 70, "dl_nr_arfcn": dl_nr_arfcn, "nr_band": nr_band, "use_ipv4": True}
state1 = "started"


Expand Down