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
db1f2649
Commit
db1f2649
authored
Aug 22, 2024
by
Bipin
Committed by
Raphael Defosseux
Sep 04, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Used Image Info in HTML
parent
6053e226
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
ci-scripts/cls_containerize.py
ci-scripts/cls_containerize.py
+9
-8
No files found.
ci-scripts/cls_containerize.py
View file @
db1f2649
...
...
@@ -189,16 +189,15 @@ def GetContainerName(mySSH, svcName):
def
GetImageInfo
(
mySSH
,
containerName
):
usedImage
=
''
ret
=
mySSH
.
run
(
'docker inspect --format="ImageUsed: {{.Config.Image}}" '
+
containerName
)
if
ret
.
stdout
.
count
(
'ImageUsed: oai-ci'
):
usedImage
=
ret
.
stdout
.
replace
(
'ImageUsed: oai-ci'
,
'oai-ci'
).
strip
()
logging
.
debug
(
'Used image is '
+
usedImage
)
if
usedImage
!=
''
:
ret
=
mySSH
.
run
(
'docker inspect --format="{{.Config.Image}}" '
+
containerName
)
usedImage
=
ret
.
stdout
.
strip
()
logging
.
debug
(
'Used image is: '
+
usedImage
)
if
usedImage
:
ret
=
mySSH
.
run
(
'docker image inspect --format "* Size = {{.Size}} bytes
\n
* Creation = {{.Created}}
\n
* Id = {{.Id}}" '
+
usedImage
)
imageInfo
=
f"Used image is
{
usedImage
}
\n
{
ret
.
stdout
}
"
imageInfo
=
f"Used image is
{
usedImage
}
\n
{
ret
.
stdout
}
\n
"
return
imageInfo
else
:
return
"Could not retrieve used image info
!
\n
"
return
f"Could not retrieve used image info for
{
containerName
}
!
\n
"
def
GetContainerHealth
(
mySSH
,
containerName
):
if
containerName
is
None
:
...
...
@@ -1023,6 +1022,7 @@ class Containerize():
return
services_list
=
allServices
if
self
.
services
[
self
.
eNB_instance
].
split
()
==
[]
else
self
.
services
[
self
.
eNB_instance
].
split
()
status
=
True
imagesInfo
=
""
for
svcName
in
services_list
:
containerName
=
GetContainerName
(
mySSH
,
svcName
)
healthyNb
,
unhealthyNb
=
GetContainerHealth
(
mySSH
,
containerName
)
...
...
@@ -1032,8 +1032,9 @@ class Containerize():
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
HTML
.
CreateHtmlTestRowQueue
(
'N/A'
,
'OK'
,
[(
GetImageInfo
(
mySSH
,
containerName
))]
)
imagesInfo
+=
(
GetImageInfo
(
mySSH
,
containerName
)
)
mySSH
.
close
()
HTML
.
CreateHtmlTestRowQueue
(
'N/A'
,
'OK'
,
[(
imagesInfo
)])
if
status
:
HTML
.
CreateHtmlTestRowQueue
(
'N/A'
,
'OK'
,
[
'Healthy deployment!'
])
else
:
...
...
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