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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-RAN
Commits
f77bf443
Commit
f77bf443
authored
2 years ago
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Help function for copying RAN build logs to executor
parent
580b2f32
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
21 deletions
+30
-21
ci-scripts/cls_containerize.py
ci-scripts/cls_containerize.py
+30
-21
No files found.
ci-scripts/cls_containerize.py
View file @
f77bf443
...
@@ -48,6 +48,26 @@ import sshconnection as SSH
...
@@ -48,6 +48,26 @@ import sshconnection as SSH
import
helpreadme
as
HELP
import
helpreadme
as
HELP
import
constants
as
CONST
import
constants
as
CONST
#-----------------------------------------------------------
# Helper functions used here and in other classes
# (e.g., cls_cluster.py)
#-----------------------------------------------------------
def
CopyLogsToExecutor
(
sshSession
,
sourcePath
,
log_name
,
scpIp
,
scpUser
,
scpPw
):
sshSession
.
command
(
f'cd
{
sourcePath
}
/cmake_targets'
,
'\$'
,
5
)
sshSession
.
command
(
f'rm -f
{
log_name
}
.zip'
,
'\$'
,
5
)
sshSession
.
command
(
f'mkdir -p
{
log_name
}
'
,
'\$'
,
5
)
sshSession
.
command
(
f'mv log/*
{
log_name
}
'
,
'\$'
,
5
)
sshSession
.
command
(
f'zip -r -qq
{
log_name
}
.zip
{
log_name
}
'
,
'\$'
,
5
)
# copy zip to executor for analysis
if
(
os
.
path
.
isfile
(
f'./
{
log_name
}
.zip'
)):
os
.
remove
(
f'./
{
log_name
}
.zip'
)
if
(
os
.
path
.
isdir
(
f'./
{
log_name
}
'
)):
shutil
.
rmtree
(
f'./
{
log_name
}
'
)
sshSession
.
copyin
(
scpIp
,
scpUser
,
scpPw
,
f'
{
sourcePath
}
/cmake_targets/
{
log_name
}
.zip'
,
'.'
)
sshSession
.
command
(
f'rm -f
{
log_name
}
.zip'
,
'\$'
,
5
)
ZipFile
(
f'
{
log_name
}
.zip'
).
extractall
(
'.'
)
#-----------------------------------------------------------
#-----------------------------------------------------------
# Class Declaration
# Class Declaration
#-----------------------------------------------------------
#-----------------------------------------------------------
...
@@ -333,30 +353,19 @@ class Containerize():
...
@@ -333,30 +353,19 @@ class Containerize():
# Now pruning dangling images in between target builds
# Now pruning dangling images in between target builds
mySSH
.
command
(
self
.
cli
+
' image prune --force'
,
'\$'
,
30
)
mySSH
.
command
(
self
.
cli
+
' image prune --force'
,
'\$'
,
30
)
# Analyzing the logs
# Remove all intermediate build images and clean up
mySSH
.
command
(
'cd '
+
lSourcePath
+
'/cmake_targets'
,
'\$'
,
5
)
mySSH
.
command
(
'mkdir -p build_log_'
+
self
.
testCase_id
,
'\$'
,
5
)
mySSH
.
command
(
'mv log/* '
+
'build_log_'
+
self
.
testCase_id
,
'\$'
,
5
)
mySSH
.
command
(
'cd '
+
lSourcePath
+
'/cmake_targets'
,
'\$'
,
5
)
mySSH
.
command
(
'rm -f build_log_'
+
self
.
testCase_id
+
'.zip || true'
,
'\$'
,
5
)
if
(
os
.
path
.
isfile
(
'./build_log_'
+
self
.
testCase_id
+
'.zip'
)):
os
.
remove
(
'./build_log_'
+
self
.
testCase_id
+
'.zip'
)
if
(
os
.
path
.
isdir
(
'./build_log_'
+
self
.
testCase_id
)):
shutil
.
rmtree
(
'./build_log_'
+
self
.
testCase_id
)
mySSH
.
command
(
'zip -r -qq build_log_'
+
self
.
testCase_id
+
'.zip build_log_'
+
self
.
testCase_id
,
'\$'
,
5
)
mySSH
.
copyin
(
lIpAddr
,
lUserName
,
lPassWord
,
lSourcePath
+
'/cmake_targets/build_log_'
+
self
.
testCase_id
+
'.zip'
,
'.'
)
mySSH
.
command
(
'rm -f build_log_'
+
self
.
testCase_id
+
'.zip'
,
'\$'
,
5
)
# Remove all intermediate build images
if
self
.
ranAllowMerge
and
forceBaseImageBuild
:
if
self
.
ranAllowMerge
and
forceBaseImageBuild
:
mySSH
.
command
(
self
.
cli
+
' image rm '
+
baseImage
+
':'
+
baseTag
+
' || true'
,
'\$'
,
30
)
mySSH
.
command
(
f'
{
self
.
cli
}
image rm
{
baseImage
}
:
{
baseTag
}
|| true'
,
'\$'
,
30
)
mySSH
.
command
(
self
.
cli
+
' image rm ran-build:'
+
imageTag
+
' || true'
,
'\$'
,
30
)
mySSH
.
command
(
f'
{
self
.
cli
}
image rm ran-build:
{
imageTag
}
'
,
'\$'
,
30
)
# Cleaning any created tmp volume
mySSH
.
command
(
f'
{
self
.
cli
}
volume prune --force'
,
'\$'
,
15
)
mySSH
.
command
(
self
.
cli
+
' volume prune --force || true'
,
'\$'
,
15
)
# create a zip with all logs
build_log_name
=
f'build_log_
{
self
.
testCase_id
}
'
CopyLogsToExecutor
(
mySSH
,
lSourcePath
,
build_log_name
,
lIpAddr
,
lUserName
,
lPassWord
)
mySSH
.
close
()
mySSH
.
close
()
ZipFile
(
'build_log_'
+
self
.
testCase_id
+
'.zip'
).
extractall
(
'.'
)
#Trying to identify the errors and warnings for each built images
# Analyzing the logs
# Trying to identify the errors and warnings for each built images
imageNames1
=
imageNames
imageNames1
=
imageNames
base
=
(
'ran-base'
,
'ran'
)
base
=
(
'ran-base'
,
'ran'
)
imageNames1
.
insert
(
0
,
base
)
imageNames1
.
insert
(
0
,
base
)
...
...
This diff is collapsed.
Click to expand it.
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