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
a1f1d654
Commit
a1f1d654
authored
Oct 18, 2022
by
Raphael Defosseux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ci): adding used image info to HTML report
Signed-off-by:
Raphael Defosseux
<
raphael.defosseux@eurecom.fr
>
parent
7b3dcc8c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
5 deletions
+22
-5
ci-scripts/cls_containerize.py
ci-scripts/cls_containerize.py
+22
-5
No files found.
ci-scripts/cls_containerize.py
View file @
a1f1d654
...
@@ -603,9 +603,7 @@ class Containerize():
...
@@ -603,9 +603,7 @@ class Containerize():
mySSH
.
close
()
mySSH
.
close
()
HTML
.
CreateHtmlTestRow
(
msg
,
'KO'
,
CONST
.
ALL_PROCESSES_OK
)
HTML
.
CreateHtmlTestRow
(
msg
,
'KO'
,
CONST
.
ALL_PROCESSES_OK
)
return
False
return
False
# TODO: once we are done migrating all types of tests, rmi also {image}:{orgTag}
mySSH
.
command
(
f'docker rmi
{
tagToUse
}
{
image
}
:
{
orgTag
}
'
,
'\$'
,
30
)
# so when we pull on builder as a test server, it will really pull
mySSH
.
command
(
f'docker rmi
{
tagToUse
}
'
,
'\$'
,
5
)
mySSH
.
command
(
'docker logout porcepix.sboai.cs.eurecom.fr'
,
'\$'
,
5
)
mySSH
.
command
(
'docker logout porcepix.sboai.cs.eurecom.fr'
,
'\$'
,
5
)
if
re
.
search
(
'Removing login credentials'
,
mySSH
.
getBefore
())
is
None
:
if
re
.
search
(
'Removing login credentials'
,
mySSH
.
getBefore
())
is
None
:
...
@@ -796,6 +794,8 @@ class Containerize():
...
@@ -796,6 +794,8 @@ class Containerize():
healthyNb
=
0
healthyNb
=
0
startingNb
=
0
startingNb
=
0
containerName
=
''
containerName
=
''
usedImage
=
''
imageInfo
=
''
if
result
is
not
None
:
if
result
is
not
None
:
containerName
=
result
.
group
(
'container_name'
)
containerName
=
result
.
group
(
'container_name'
)
time
.
sleep
(
5
)
time
.
sleep
(
5
)
...
@@ -810,6 +810,10 @@ class Containerize():
...
@@ -810,6 +810,10 @@ class Containerize():
else
:
else
:
time
.
sleep
(
10
)
time
.
sleep
(
10
)
cnt
+=
1
cnt
+=
1
mySSH
.
command
(
f'docker inspect -f "{{.Config.Image}}"
{
containerName
}
'
,
'\$'
,
5
)
usedImage
=
str
(
mySSH
.
getBefore
()).
strip
()
mySSH
.
command
(
f'docker image inspect --format "* Size = {{.Size}} bytes
\n
* Creation = {{.Created}}
\n
* Id = {{.Id}}"
{
usedImage
}
'
,
'\$'
,
5
)
imageInfo
=
str
(
mySSH
.
getBefore
())
logging
.
debug
(
' -- '
+
str
(
healthyNb
)
+
' healthy container(s)'
)
logging
.
debug
(
' -- '
+
str
(
healthyNb
)
+
' healthy container(s)'
)
logging
.
debug
(
' -- '
+
str
(
unhealthyNb
)
+
' unhealthy container(s)'
)
logging
.
debug
(
' -- '
+
str
(
unhealthyNb
)
+
' unhealthy container(s)'
)
logging
.
debug
(
' -- '
+
str
(
startingNb
)
+
' still starting container(s)'
)
logging
.
debug
(
' -- '
+
str
(
startingNb
)
+
' still starting container(s)'
)
...
@@ -839,11 +843,24 @@ class Containerize():
...
@@ -839,11 +843,24 @@ class Containerize():
mySSH
.
copyin
(
lIpAddr
,
lUserName
,
lPassWord
,
logfilename
,
'.'
)
mySSH
.
copyin
(
lIpAddr
,
lUserName
,
lPassWord
,
logfilename
,
'.'
)
mySSH
.
close
()
mySSH
.
close
()
html_queue
=
SimpleQueue
()
html_cell
=
'<pre style="background-color:white">
\n
'
if
usedImage
!=
''
:
html_cell
+=
f'Used Image =
{
usedImage
}
:
\n
'
html_cell
+=
imageInfo
else
:
html_cell
+=
'Could not retrieve used image info!
\n
'
if
status
:
if
status
:
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
html_cell
+=
'
\n
Healthy deployment!
\n
'
else
:
html_cell
+=
'
\n
Unhealthy deployment! -- Check logs for reason!
\n
'
html_cell
+=
'</pre>'
html_queue
.
put
(
html_cell
)
if
status
:
HTML
.
CreateHtmlTestRowQueue
(
'N/A'
,
'OK'
,
CONST
.
ENB_PROCESS_OK
,
html_queue
)
else
:
else
:
self
.
exitStatus
=
1
self
.
exitStatus
=
1
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'KO'
,
CONST
.
ALL_PROCESSES_OK
)
HTML
.
CreateHtmlTestRow
Queue
(
'N/A'
,
'KO'
,
CONST
.
ENB_PROCESS_OK
,
html_queue
)
def
UndeployObject
(
self
,
HTML
,
RAN
):
def
UndeployObject
(
self
,
HTML
,
RAN
):
...
...
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