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
spbro
OpenXG-RAN
Commits
25f7f61d
Commit
25f7f61d
authored
Sep 23, 2024
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify GetContainerHealth(): we never use unhealthy count
parent
4bf7c45b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
13 deletions
+7
-13
ci-scripts/cls_containerize.py
ci-scripts/cls_containerize.py
+7
-13
No files found.
ci-scripts/cls_containerize.py
View file @
25f7f61d
...
...
@@ -200,24 +200,18 @@ def GetImageInfo(mySSH, containerName):
def
GetContainerHealth
(
mySSH
,
containerName
):
if
containerName
is
None
:
return
0
,
0
unhealthyNb
=
0
healthyNb
=
0
return
False
time
.
sleep
(
5
)
for
_
in
range
(
3
):
if
containerName
!=
'db_init'
:
result
=
mySSH
.
run
(
f'docker inspect --format="{{{{.State.Health.Status}}}}"
{
containerName
}
'
)
unhealthyNb
=
result
.
stdout
.
count
(
'unhealthy'
)
healthyNb
=
result
.
stdout
.
count
(
'healthy'
)
-
unhealthyNb
if
healthyNb
==
1
:
break
if
result
.
stdout
==
'healthy'
:
return
True
else
:
time
.
sleep
(
10
)
else
:
unhealthyNb
=
0
healthyNb
=
1
break
return
healthyNb
,
unhealthyNb
return
True
return
False
def
ReTagImages
(
mySSH
,
IMAGES
,
ranCommitID
,
ranBranch
,
ranAllowMerge
,
displayedNewTags
):
mySSH
.
run
(
'cp docker-compose.y*ml ci-docker-compose.yml'
,
5
)
...
...
@@ -1000,10 +994,10 @@ class Containerize():
imagesInfo
=
""
for
svcName
in
services_list
:
containerName
=
GetContainerName
(
mySSH
,
svcName
)
healthy
Nb
,
unhealthyNb
=
GetContainerHealth
(
mySSH
,
containerName
)
healthy
=
GetContainerHealth
(
mySSH
,
containerName
)
self
.
testCase_id
=
HTML
.
testCase_id
self
.
eNB_logFile
[
self
.
eNB_instance
]
=
f'
{
svcName
}
-
{
self
.
testCase_id
}
.log'
if
unhealthyNb
:
if
not
healthy
:
logging
.
warning
(
f"Deployment Failed: Trying to copy container logs
{
self
.
eNB_logFile
[
self
.
eNB_instance
]
}
"
)
CopyinContainerLog
(
mySSH
,
lSourcePath
,
self
.
yamlPath
[
0
].
split
(
'/'
),
containerName
,
self
.
eNB_logFile
[
self
.
eNB_instance
])
status
=
False
...
...
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