Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
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
Michael Black
OpenXG UE
Commits
371dd1aa
Commit
371dd1aa
authored
Jan 19, 2022
by
Raphael Defosseux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ci): adding RAN containers analysis
Signed-off-by:
Raphael Defosseux
<
raphael.defosseux@eurecom.fr
>
parent
67121296
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
10 deletions
+29
-10
ci-scripts/cls_containerize.py
ci-scripts/cls_containerize.py
+29
-10
No files found.
ci-scripts/cls_containerize.py
View file @
371dd1aa
...
@@ -730,17 +730,31 @@ class Containerize():
...
@@ -730,17 +730,31 @@ class Containerize():
cmd
=
'cd '
+
self
.
yamlPath
[
0
]
+
' && docker logs '
+
cName
+
' > '
+
cName
+
'.log 2>&1'
cmd
=
'cd '
+
self
.
yamlPath
[
0
]
+
' && docker logs '
+
cName
+
' > '
+
cName
+
'.log 2>&1'
logging
.
debug
(
cmd
)
logging
.
debug
(
cmd
)
deployStatus
=
subprocess
.
check_output
(
cmd
,
shell
=
True
,
stderr
=
subprocess
.
STDOUT
,
universal_newlines
=
True
,
timeout
=
30
)
deployStatus
=
subprocess
.
check_output
(
cmd
,
shell
=
True
,
stderr
=
subprocess
.
STDOUT
,
universal_newlines
=
True
,
timeout
=
30
)
fullStatus
=
True
if
anyLogs
:
if
anyLogs
:
cmd
=
'mkdir -p '
+
logPath
+
' && cp '
+
self
.
yamlPath
[
0
]
+
'/*.log '
+
logPath
cmd
=
'mkdir -p '
+
logPath
+
' && cp '
+
self
.
yamlPath
[
0
]
+
'/*.log '
+
logPath
logging
.
debug
(
cmd
)
logging
.
debug
(
cmd
)
deployStatus
=
subprocess
.
check_output
(
cmd
,
shell
=
True
,
stderr
=
subprocess
.
STDOUT
,
universal_newlines
=
True
,
timeout
=
10
)
deployStatus
=
subprocess
.
check_output
(
cmd
,
shell
=
True
,
stderr
=
subprocess
.
STDOUT
,
universal_newlines
=
True
,
timeout
=
10
)
# Analyzing log file!
# Analyzing log file!
filename
=
self
.
yamlPath
[
0
]
+
'/rfsim?g-oai-*.log'
# 4g/enb, 5g/gnb, 5g/-du/-cu
listOfPossibleRanContainers
=
[
'enb'
,
'gnb'
,
'cu'
,
'du'
]
logging
.
debug
(
'
\u001B
[1m Analyzing xNB logfile
\u001B
[0m '
+
filename
)
for
container
in
listOfPossibleRanContainers
:
filename
=
self
.
yamlPath
[
0
]
+
'/rfsim?g-oai-'
+
container
+
'.log'
cmd
=
'ls '
+
filename
containerStatus
=
True
try
:
lsStatus
=
subprocess
.
check_output
(
cmd
,
shell
=
True
,
stderr
=
subprocess
.
STDOUT
,
universal_newlines
=
True
,
timeout
=
10
)
filename
=
str
(
lsStatus
).
strip
()
except
:
containerStatus
=
False
if
not
containerStatus
:
continue
logging
.
debug
(
'
\u001B
[1m Analyzing xNB logfile '
+
filename
+
'
\u001B
[0m'
)
# For the moment just assume this exists
# For the moment just assume this exists
logStatus
=
RAN
.
AnalyzeLogFile_eNB
(
filename
,
HTML
)
logStatus
=
RAN
.
AnalyzeLogFile_eNB
(
filename
,
HTML
)
if
(
logStatus
<
0
):
if
(
logStatus
<
0
):
fullStatus
=
False
HTML
.
CreateHtmlTestRow
(
RAN
.
runtime_stats
,
'KO'
,
logStatus
)
HTML
.
CreateHtmlTestRow
(
RAN
.
runtime_stats
,
'KO'
,
logStatus
)
else
:
else
:
HTML
.
CreateHtmlTestRow
(
RAN
.
runtime_stats
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
HTML
.
CreateHtmlTestRow
(
RAN
.
runtime_stats
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
...
@@ -761,6 +775,7 @@ class Containerize():
...
@@ -761,6 +775,7 @@ class Containerize():
logging
.
debug
(
cmd
)
logging
.
debug
(
cmd
)
copyStatus
=
subprocess
.
check_output
(
cmd
,
shell
=
True
,
stderr
=
subprocess
.
STDOUT
,
universal_newlines
=
True
,
timeout
=
10
)
copyStatus
=
subprocess
.
check_output
(
cmd
,
shell
=
True
,
stderr
=
subprocess
.
STDOUT
,
universal_newlines
=
True
,
timeout
=
10
)
logging
.
debug
(
'
\u001B
[1m Undeploying
\u001B
[0m'
)
cmd
=
'cd '
+
self
.
yamlPath
[
0
]
+
' && docker-compose -f docker-compose-ci.yml down'
cmd
=
'cd '
+
self
.
yamlPath
[
0
]
+
' && docker-compose -f docker-compose-ci.yml down'
logging
.
debug
(
cmd
)
logging
.
debug
(
cmd
)
try
:
try
:
...
@@ -777,8 +792,12 @@ class Containerize():
...
@@ -777,8 +792,12 @@ class Containerize():
logging
.
debug
(
cmd
)
logging
.
debug
(
cmd
)
deployStatus
=
subprocess
.
check_output
(
cmd
,
shell
=
True
,
stderr
=
subprocess
.
STDOUT
,
universal_newlines
=
True
,
timeout
=
100
)
deployStatus
=
subprocess
.
check_output
(
cmd
,
shell
=
True
,
stderr
=
subprocess
.
STDOUT
,
universal_newlines
=
True
,
timeout
=
100
)
if
fullStatus
:
HTML
.
CreateHtmlTestRow
(
'n/a'
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
HTML
.
CreateHtmlTestRow
(
'n/a'
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
logging
.
info
(
'
\u001B
[1m Undeploying OAI Object(s) PASS
\u001B
[0m'
)
logging
.
info
(
'
\u001B
[1m Undeploying OAI Object(s) PASS
\u001B
[0m'
)
else
:
HTML
.
CreateHtmlTestRow
(
'n/a'
,
'KO'
,
CONST
.
ALL_PROCESSES_OK
)
logging
.
info
(
'
\u001B
[1m Undeploying OAI Object(s) FAIL
\u001B
[0m'
)
def
PingFromContainer
(
self
,
HTML
):
def
PingFromContainer
(
self
,
HTML
):
self
.
exitStatus
=
0
self
.
exitStatus
=
0
...
...
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