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
lizhongxiao
OpenXG-RAN
Commits
425bb149
Commit
425bb149
authored
Jan 19, 2022
by
Raphael Defosseux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(ci): better shutdown of container when using USRP
Signed-off-by:
Raphael Defosseux
<
raphael.defosseux@eurecom.fr
>
parent
edb87646
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
4 deletions
+21
-4
ci-scripts/cls_containerize.py
ci-scripts/cls_containerize.py
+19
-4
ci-scripts/epc.py
ci-scripts/epc.py
+2
-0
No files found.
ci-scripts/cls_containerize.py
View file @
425bb149
...
...
@@ -586,11 +586,20 @@ class Containerize():
mySSH
.
command
(
'cd '
+
lSourcePath
+
'/'
+
self
.
yamlPath
[
self
.
eNB_instance
],
'\$'
,
5
)
# Currently support only one
mySSH
.
command
(
'docker-compose --file ci-docker-compose.yml config'
,
'\$'
,
5
)
containerName
=
''
containerToKill
=
False
result
=
re
.
search
(
'container_name: (?P<container_name>[a-zA-Z0-9\-\_]+)'
,
mySSH
.
getBefore
())
if
self
.
eNB_logFile
[
self
.
eNB_instance
]
==
''
:
self
.
eNB_logFile
[
self
.
eNB_instance
]
=
'enb_'
+
HTML
.
testCase_id
+
'.log'
if
result
is
not
None
:
containerName
=
result
.
group
(
'container_name'
)
containerToKill
=
True
if
containerToKill
:
mySSH
.
command
(
'docker inspect '
+
containerName
,
'\$'
,
30
)
result
=
re
.
search
(
'Error: No such object: '
+
containerName
,
mySSH
.
getBefore
())
if
result
is
not
None
:
containerToKill
=
False
if
containerToKill
:
mySSH
.
command
(
'docker kill --signal INT '
+
containerName
,
'\$'
,
30
)
time
.
sleep
(
5
)
mySSH
.
command
(
'docker logs '
+
containerName
+
' > '
+
lSourcePath
+
'/cmake_targets/'
+
self
.
eNB_logFile
[
self
.
eNB_instance
],
'\$'
,
30
)
...
...
@@ -603,20 +612,26 @@ class Containerize():
mySSH
.
close
()
# Analyzing log file!
if
containerToKill
:
copyin_res
=
mySSH
.
copyin
(
lIpAddr
,
lUserName
,
lPassWord
,
lSourcePath
+
'/cmake_targets/'
+
self
.
eNB_logFile
[
self
.
eNB_instance
],
'.'
)
else
:
copyin_res
=
0
nodeB_prefix
=
'e'
if
(
copyin_res
==
-
1
):
HTML
.
htmleNBFailureMsg
=
'Could not copy '
+
nodeB_prefix
+
'NB logfile to analyze it!'
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'KO'
,
CONST
.
ENB_PROCESS_NOLOGFILE_TO_ANALYZE
)
else
:
if
containerToKill
:
logging
.
debug
(
'
\u001B
[1m Analyzing '
+
nodeB_prefix
+
'NB logfile
\u001B
[0m '
+
self
.
eNB_logFile
[
self
.
eNB_instance
])
logStatus
=
RAN
.
AnalyzeLogFile_eNB
(
self
.
eNB_logFile
[
self
.
eNB_instance
],
HTML
)
else
:
logStatus
=
0
if
(
logStatus
<
0
):
HTML
.
CreateHtmlTestRow
(
RAN
.
runtime_stats
,
'KO'
,
logStatus
)
else
:
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'
:
if
containerToKill
and
self
.
eNB_serverId
[
self
.
eNB_instance
]
!=
'0'
:
mySSH
.
copyout
(
self
.
eNBIPAddress
,
self
.
eNBUserName
,
self
.
eNBPassword
,
'./'
+
self
.
eNB_logFile
[
self
.
eNB_instance
],
self
.
eNBSourceCodePath
+
'/cmake_targets/'
)
logging
.
info
(
'
\u001B
[1m Undeploying OAI Object Pass
\u001B
[0m'
)
...
...
ci-scripts/epc.py
View file @
425bb149
...
...
@@ -532,6 +532,7 @@ class EPCManagement():
logging
.
debug
(
'Terminating OAI CN5G'
)
mySSH
.
command
(
'cd /opt/oai-cn5g-fed/docker-compose'
,
'\$'
,
5
)
mySSH
.
command
(
'./core-network.sh stop nrf spgwu'
,
'\$'
,
60
)
mySSH
.
command
(
'docker volume prune --force || true'
,
'\$'
,
60
)
time
.
sleep
(
2
)
mySSH
.
command
(
'tshark -r /tmp/oai-cn5g.pcap | egrep --colour=never "Tracking area update" '
,
'\$'
,
30
)
result
=
re
.
search
(
'Tracking area update request'
,
mySSH
.
getBefore
())
...
...
@@ -760,6 +761,7 @@ class EPCManagement():
nbContainers
+=
1
mySSH
.
command
(
'docker-compose down'
,
'\$'
,
60
)
mySSH
.
command
(
'docker volume prune --force || true'
,
'\$'
,
60
)
mySSH
.
command
(
'docker inspect --format=
\'
{{.State.Health.Status}}
\'
'
+
listOfContainers
,
'\$'
,
10
)
noMoreContainerNb
=
mySSH
.
getBefore
().
count
(
'No such object'
)
mySSH
.
command
(
'docker inspect --format=
\'
{{.Name}}
\'
prod-oai-public-net prod-oai-private-net'
,
'\$'
,
10
)
...
...
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