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
wangjie
OpenXG-RAN
Commits
285650d3
Commit
285650d3
authored
Apr 28, 2021
by
Raphael Defosseux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CI: Adding missing reason for image build failure
Signed-off-by:
Raphael Defosseux
<
raphael.defosseux@eurecom.fr
>
parent
1041a6d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
10 deletions
+43
-10
ci-scripts/cls_containerize.py
ci-scripts/cls_containerize.py
+26
-0
ci-scripts/html.py
ci-scripts/html.py
+17
-10
No files found.
ci-scripts/cls_containerize.py
View file @
285650d3
...
...
@@ -88,6 +88,7 @@ class Containerize():
self
.
host
=
''
self
.
allImagesSize
=
{}
self
.
collectInfo
=
{}
#-----------------------------------------------------------
# Container management functions
#-----------------------------------------------------------
...
...
@@ -335,6 +336,31 @@ class Containerize():
errorandwarnings
[
'warnings'
]
=
warningsNo
errorandwarnings
[
'status'
]
=
status
files
[
fil
]
=
errorandwarnings
# Let analyze the target image creation part
if
os
.
path
.
isfile
(
'build_log_{}/{}.log'
.
format
(
self
.
testCase_id
,
image
)):
errorandwarnings
=
{}
with
open
(
'build_log_{}/{}.log'
.
format
(
self
.
testCase_id
,
image
),
mode
=
'r'
)
as
inputfile
:
startOfTargetImageCreation
=
False
buildStatus
=
False
for
line
in
inputfile
:
result
=
re
.
search
(
'FROM .* as '
+
image
+
'$'
,
str
(
line
))
if
result
is
not
None
:
startOfTargetImageCreation
=
True
if
startOfTargetImageCreation
:
result
=
re
.
search
(
'Successfully tagged '
+
image
+
':'
,
str
(
line
))
if
result
is
not
None
:
buildStatus
=
True
result
=
re
.
search
(
'COMMIT '
+
image
+
':'
,
str
(
line
))
if
result
is
not
None
:
buildStatus
=
True
inputfile
.
close
()
if
buildStatus
:
errorandwarnings
[
'errors'
]
=
0
else
:
errorandwarnings
[
'errors'
]
=
1
errorandwarnings
[
'warnings'
]
=
0
errorandwarnings
[
'status'
]
=
buildStatus
files
[
'Target Image Creation'
]
=
errorandwarnings
self
.
collectInfo
[
image
]
=
files
if
status
:
...
...
ci-scripts/html.py
View file @
285650d3
...
...
@@ -47,7 +47,7 @@ import constants as CONST
class
HTMLManagement
():
def
__init__
(
self
):
self
.
htmlFile
=
''
self
.
htmlHeaderCreated
=
False
self
.
htmlFooterCreated
=
False
...
...
@@ -86,13 +86,13 @@ class HTMLManagement():
#-----------------------------------------------------------
# Setters and Getters
#-----------------------------------------------------------
def
SethtmlUEConnected
(
self
,
nbUEs
):
if
nbUEs
>
0
:
self
.
htmlUEConnected
=
nbUEs
else
:
self
.
htmlUEConnected
=
1
#-----------------------------------------------------------
...
...
@@ -412,7 +412,12 @@ class HTMLManagement():
for
image
in
collectInfo
:
files
=
collectInfo
[
image
]
# TabHeader for image logs on built shared and target images
self
.
htmlFile
.
write
(
' <tr bgcolor = "#F0F0F0" >
\n
'
)
if
allImagesSize
[
image
].
count
(
'unknown'
)
>
0
:
self
.
htmlFile
.
write
(
' <tr bgcolor = "orange" >
\n
'
)
elif
allImagesSize
[
image
].
count
(
'Build Failed'
)
>
0
:
self
.
htmlFile
.
write
(
' <tr bgcolor = "red" >
\n
'
)
else
:
self
.
htmlFile
.
write
(
' <tr bgcolor = "#F0F0F0" >
\n
'
)
self
.
htmlFile
.
write
(
' <td colspan='
+
str
(
5
+
self
.
htmlUEConnected
)
+
'><b> ---- '
+
image
+
' IMAGE STATUS ----> Size '
+
allImagesSize
[
image
]
+
' </b></td>
\n
'
)
self
.
htmlFile
.
write
(
' </tr>
\n
'
)
self
.
htmlFile
.
write
(
' <tr bgcolor = "#33CCFF" >
\n
'
)
...
...
@@ -431,18 +436,20 @@ class HTMLManagement():
self
.
htmlFile
.
write
(
' <td bgcolor = "green" >'
+
str
(
parameters
[
'errors'
])
+
'</td>
\n
'
)
else
:
self
.
htmlFile
.
write
(
' <td bgcolor = "red" >'
+
str
(
parameters
[
'errors'
])
+
'</td>
\n
'
)
if
(
parameters
[
'warnings'
]
==
0
):
if
(
parameters
[
'errors'
]
>
0
):
self
.
htmlFile
.
write
(
' <td bgcolor = "red" >'
+
str
(
parameters
[
'warnings'
])
+
'</td>
\n
'
)
elif
(
parameters
[
'warnings'
]
==
0
):
self
.
htmlFile
.
write
(
' <td bgcolor = "green" >'
+
str
(
parameters
[
'warnings'
])
+
'</td>
\n
'
)
elif
((
parameters
[
'warnings'
]
>
0
)
and
(
parameters
[
'warnings'
]
<=
20
)):
self
.
htmlFile
.
write
(
' <td bgcolor = "orange" >'
+
str
(
parameters
[
'warnings'
])
+
'</td>
\n
'
)
else
:
self
.
htmlFile
.
write
(
' <td bgcolor = "red" >'
+
str
(
parameters
[
'warnings'
])
+
'</td>
\n
'
)
self
.
htmlFile
.
write
(
' <td bgcolor = "red" >'
+
str
(
parameters
[
'warnings'
])
+
'</td>
\n
'
)
if
(
parameters
[
'errors'
]
==
0
)
and
(
parameters
[
'warnings'
]
==
0
):
self
.
htmlFile
.
write
(
' <th colspan='
+
str
(
1
+
self
.
htmlUEConnected
)
+
' bgcolor = "green" ><font color="white">OK </font></th>
\n
'
)
elif
(
parameters
[
'errors'
]
==
0
)
and
((
parameters
[
'warnings'
]
>
0
)
and
(
parameters
[
'warnings'
]
<=
20
)):
self
.
htmlFile
.
write
(
' <th colspan='
+
str
(
1
+
self
.
htmlUEConnected
)
+
' bgcolor = "orange" ><font color="white">OK </font></th>
\n
'
)
else
:
self
.
htmlFile
.
write
(
' <th colspan='
+
str
(
1
+
self
.
htmlUEConnected
)
+
' bgcolor = "red" > NOT OK </th>
\n
'
)
self
.
htmlFile
.
write
(
' <th colspan='
+
str
(
1
+
self
.
htmlUEConnected
)
+
' bgcolor = "red" > NOT OK </th>
\n
'
)
self
.
htmlFile
.
write
(
' </tr>
\n
'
)
self
.
htmlFile
.
close
()
...
...
@@ -613,6 +620,6 @@ class HTMLManagement():
if
'PASS'
in
value
:
self
.
htmlFile
.
write
(
' <td colspan='
+
str
(
1
+
self
.
htmlUEConnected
)
+
' bgcolor = "green" >'
+
value
[
1
]
+
'</td>
\n
'
)
else
:
self
.
htmlFile
.
write
(
' <td colspan='
+
str
(
1
+
self
.
htmlUEConnected
)
+
' bgcolor = "red" >'
+
value
[
1
]
+
'</td>
\n
'
)
self
.
htmlFile
.
close
()
\ No newline at end of file
self
.
htmlFile
.
write
(
' <td colspan='
+
str
(
1
+
self
.
htmlUEConnected
)
+
' bgcolor = "red" >'
+
value
[
1
]
+
'</td>
\n
'
)
self
.
htmlFile
.
close
()
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