Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zzha zzha
OpenXG-RAN
Commits
7fe823d1
Commit
7fe823d1
authored
1 year ago
by
Jaroslava Fiedlerova
Committed by
Reem Bahsoun
1 year ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modifs of cls_containerize
- use new ssh class - do proper logging from multiple services - use yaml dir
parent
031af9f3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
21 deletions
+20
-21
ci-scripts/cls_containerize.py
ci-scripts/cls_containerize.py
+20
-19
ci-scripts/xml_files/container_sa_aerial_quectel.xml
ci-scripts/xml_files/container_sa_aerial_quectel.xml
+0
-2
No files found.
ci-scripts/cls_containerize.py
View file @
7fe823d1
...
...
@@ -977,46 +977,46 @@ class Containerize():
HELP
.
GenericHelp
(
CONST
.
Version
)
sys
.
exit
(
'Insufficient Parameter'
)
logging
.
debug
(
'
\u001B
[1m Undeploying OAI Object from server: '
+
lIpAddr
+
'
\u001B
[0m'
)
mySSH
=
SSH
.
SSHConnection
()
mySSH
.
open
(
lIpAddr
,
lUserName
,
lPassWord
)
mySSH
.
command
(
'cd '
+
lSourcePath
+
'/'
+
self
.
yamlPath
[
self
.
eNB_instance
],
'\$'
,
5
)
copyin_res
=
0
mySSH
=
cls_cmd
.
getConnection
(
lIpAddr
)
yamlDir
=
f'
{
lSourcePath
}
/
{
self
.
yamlPath
[
self
.
eNB_instance
]
}
'
mySSH
.
run
(
f'cd
{
yamlDir
}
'
)
svcName
=
self
.
services
[
self
.
eNB_instance
]
forceDown
=
False
if
svcName
!=
''
:
logging
.
warning
(
f'service name given, but will stop all services in ci-docker-compose.yml!'
)
svcName
=
''
mySSH
.
command
(
f'docker-compose -f ci-docker-compose.yml config --services'
,
'\$'
,
5
)
mySSH
.
run
(
f'docker-compose -f
{
yamlDir
}
/ci-docker-compose.yml config --services'
)
# first line has command, last line has next command prompt
allServices
=
mySSH
.
getBefore
().
split
(
'
\
r\n
'
)[
1
:
-
1
]
allServices
=
mySSH
.
getBefore
().
split
(
'
\
n
'
)[:
]
services
=
[]
for
s
in
allServices
:
mySSH
.
command
(
f'docker-compose -f ci-docker-compose.yml ps --all --
{
s
}
'
,
'\$'
,
5
,
silent
=
False
)
running
=
mySSH
.
getBefore
().
split
(
'
\r\n
'
)[
2
:
-
1
]
mySSH
.
run
(
f'docker-compose -f
{
yamlDir
}
/ci-docker-compose.yml ps --all --
{
s
}
'
)
running
=
mySSH
.
getBefore
().
split
(
'
\r\n
'
)[
:
]
logging
.
debug
(
f'running services:
{
running
}
'
)
if
len
(
running
)
>
0
:
# something is running for that service
services
.
append
(
s
)
logging
.
info
(
f'stopping services
{
services
}
'
)
mySSH
.
command
(
f'docker-compose -f ci-docker-compose.yml stop -t3'
,
'\$'
,
30
)
mySSH
.
run
(
f'docker-compose -f
{
yamlDir
}
/ci-docker-compose.yml stop -t3'
)
time
.
sleep
(
5
)
# give some time to running containers to stop
for
svcName
in
s
ervices
:
for
svcName
in
allS
ervices
:
# head -n -1 suppresses the final "X exited with status code Y"
filename
=
f'
{
svcName
}
-
{
HTML
.
testCase_id
}
.log'
mySSH
.
command
(
f'docker-compose -f ci-docker-compose.yml logs --no-log-prefix --
{
svcName
}
&>
{
lSourcePath
}
/cmake_targets/log/
{
filename
}
'
,
'\$'
,
120
)
mySSH
.
run
(
f'docker-compose -f
{
yamlDir
}
/ci-docker-compose.yml logs --no-log-prefix --
{
svcName
}
&>
{
lSourcePath
}
/cmake_targets/log/
{
filename
}
'
)
copyin_res
=
mySSH
.
copyin
(
f'
{
lSourcePath
}
/cmake_targets/log/
{
filename
}
'
,
f'
{
filename
}
'
)
# when nv-cubb container is available, copy L1 pcap, OAI Aerial pipeline
if
'nv-cubb'
in
allServices
:
mySSH
.
copyin
(
f'/home/oaicicd/share/nvipc.pcap'
,
f'gnb_nvipc.pcap'
)
mySSH
.
run
(
f'cp /home/oaicicd/share/nvipc.pcap
{
lSourcePath
}
/cmake_targets/gnb_nvipc.pcap'
)
mySSH
.
command
(
'docker-compose -f ci-docker-compose.yml down -v'
,
'\$'
,
5
)
mySSH
.
close
()
mySSH
.
run
(
f'docker-compose -f
{
yamlDir
}
/ci-docker-compose.yml down -v'
)
# Analyzing log file!
files
=
','
.
join
([
f'
{
s
}
-
{
HTML
.
testCase_id
}
'
for
s
in
services
])
if
len
(
services
)
>
1
:
files
=
'{'
+
files
+
'}'
copyin_res
=
0
if
len
(
services
)
>
0
:
copyin_res
=
mySSH
.
copyin
(
lIpAddr
,
lUserName
,
lPassWord
,
f'
{
lSourcePath
}
/cmake_targets/log/
{
files
}
.log'
,
'.'
)
if
copyin_res
==
-
1
:
HTML
.
htmleNBFailureMsg
=
'Could not copy logfile to analyze it!'
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'KO'
,
CONST
.
ENB_PROCESS_NOLOGFILE_TO_ANALYZE
)
...
...
@@ -1024,7 +1024,7 @@ class Containerize():
# use function for UE log analysis, when oai-nr-ue container is used
elif
'oai-nr-ue'
in
services
or
'lte_ue0'
in
services
:
self
.
exitStatus
==
0
logging
.
debug
(
'
\u001B
[1m Analyzing UE logfile '
+
filename
+
'
\u001B
[0m
'
)
logging
.
debug
(
f'Analyzing UE logfile
{
filename
}
'
)
logStatus
=
cls_oaicitest
.
OaiCiTest
().
AnalyzeLogFile_UE
(
f'
{
filename
}
'
,
HTML
,
RAN
)
if
(
logStatus
<
0
):
fullStatus
=
False
...
...
@@ -1043,11 +1043,12 @@ class Containerize():
HTML
.
CreateHtmlTestRow
(
RAN
.
runtime_stats
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
# all the xNB run logs shall be on the server 0 for logCollecting
if
self
.
eNB_serverId
[
self
.
eNB_instance
]
!=
'0'
:
mySSH
.
copyout
(
self
.
eNBIPAddress
,
self
.
eNBUserName
,
self
.
eNBPassword
,
f'./
{
files
}
.log'
,
f'
{
self
.
eNBSourceCodePath
}
/cmake_targets/'
)
mySSH
.
copyout
(
f'./
{
files
}
.log'
,
f'
{
self
.
eNBSourceCodePath
}
/cmake_targets/'
)
if
self
.
exitStatus
==
0
:
logging
.
info
(
'
\u001B
[1m Undeploying OAI Object Pass
\u001B
[0m'
)
else
:
logging
.
error
(
'
\u001B
[1m Undeploying OAI Object Failed
\u001B
[0m'
)
mySSH
.
close
()
def
DeployGenObject
(
self
,
HTML
,
RAN
,
UE
):
self
.
exitStatus
=
0
...
...
This diff is collapsed.
Click to expand it.
ci-scripts/xml_files/container_sa_aerial_quectel.xml
View file @
7fe823d1
...
...
@@ -34,8 +34,6 @@
000111
100000
000011
000022
000033
000222
003333
222222
...
...
This diff is collapsed.
Click to expand it.
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