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
wangwenhui
OpenXG-RAN
Commits
c77e144a
Commit
c77e144a
authored
Jan 07, 2021
by
Mohammed Ismail
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated
parent
b52f1181
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
41 deletions
+17
-41
ci-scripts/cls_containerize.py
ci-scripts/cls_containerize.py
+17
-41
No files found.
ci-scripts/cls_containerize.py
View file @
c77e144a
...
@@ -126,42 +126,23 @@ class Containerize():
...
@@ -126,42 +126,23 @@ class Containerize():
self
.
dockerfileprefix
=
'.rhel8.2'
self
.
dockerfileprefix
=
'.rhel8.2'
imageNames
=
[]
imageNames
=
[]
if
self
.
host
==
'Ubuntu'
:
result
=
re
.
search
(
'eNB'
,
self
.
imageKind
)
result
=
re
.
search
(
'eNB'
,
self
.
imageKind
)
# Creating a tupple with the imageName and the DockerFile prefix pattern on obelix
# Creating a tupple with the imageName and the DockerFile prefix pattern on obelix
if
result
is
not
None
:
if
result
is
not
None
:
imageNames
.
append
((
'oai-enb'
,
'eNB'
))
imageNames
.
append
((
'oai-enb'
,
'eNB'
))
else
:
else
:
result
=
re
.
search
(
'gNB'
,
self
.
imageKind
)
result
=
re
.
search
(
'gNB'
,
self
.
imageKind
)
if
result
is
not
None
:
imageNames
.
append
((
'oai-gnb'
,
'gNB'
))
else
:
result
=
re
.
search
(
'all'
,
self
.
imageKind
)
if
result
is
not
None
:
imageNames
.
append
((
'oai-enb'
,
'eNB'
))
imageNames
.
append
((
'oai-gnb'
,
'gNB'
))
imageNames
.
append
((
'oai-lte-ue'
,
'lteUE'
))
imageNames
.
append
((
'oai-nr-ue'
,
'nrUE'
))
if
len
(
imageNames
)
==
0
:
imageNames
.
append
((
'oai-enb'
,
'eNB'
))
elif
self
.
host
==
'Red Hat'
:
result
=
re
.
search
(
'eNB'
,
self
.
imageKind
)
# Creating a tupple with the imageName and the DockerFile prefix pattern on asterix
if
result
is
not
None
:
if
result
is
not
None
:
imageNames
.
append
((
'oai-
enb'
,
'e
NB'
))
imageNames
.
append
((
'oai-
gnb'
,
'g
NB'
))
else
:
else
:
result
=
re
.
search
(
'
gNB
'
,
self
.
imageKind
)
result
=
re
.
search
(
'
all
'
,
self
.
imageKind
)
if
result
is
not
None
:
if
result
is
not
None
:
imageNames
.
append
((
'oai-gnb'
,
'gNB'
))
imageNames
.
append
((
'oai-enb'
,
'eNB'
))
else
:
#imageNames.append(('oai-gnb', 'gNB'))
result
=
re
.
search
(
'all'
,
self
.
imageKind
)
#imageNames.append(('oai-lte-ue', 'lteUE'))
if
result
is
not
None
:
#imageNames.append(('oai-nr-ue', 'nrUE'))
imageNames
.
append
((
'oai-enb'
,
'eNB'
))
if
len
(
imageNames
)
==
0
:
imageNames
.
append
((
'oai-gnb'
,
'gNB'
))
imageNames
.
append
((
'oai-enb'
,
'eNB'
))
imageNames
.
append
((
'oai-lte-ue'
,
'lteUE'
))
imageNames
.
append
((
'oai-nr-ue'
,
'nrUE'
))
if
len
(
imageNames
)
==
0
:
imageNames
.
append
((
'oai-enb'
,
'eNB'
))
# Workaround for some servers, we need to erase completely the workspace
# Workaround for some servers, we need to erase completely the workspace
if
self
.
forcedWorkspaceCleanup
:
if
self
.
forcedWorkspaceCleanup
:
...
@@ -206,12 +187,7 @@ class Containerize():
...
@@ -206,12 +187,7 @@ class Containerize():
#mySSH.close()
#mySSH.close()
#return 0
#return 0
sharedimage
=
''
sharedimage
=
'ran-build'
if
self
.
host
==
'Ubuntu'
:
sharedimage
=
'ran-build'
elif
self
.
host
==
'Red Hat'
:
sharedimage
=
'ran-build'
# Let's remove any previous run artifacts if still there
# Let's remove any previous run artifacts if still there
mySSH
.
command
(
self
.
cli
+
' image prune --force'
,
'\$'
,
5
)
mySSH
.
command
(
self
.
cli
+
' image prune --force'
,
'\$'
,
5
)
mySSH
.
command
(
self
.
cli
+
' image rm '
+
sharedimage
+
':'
+
imageTag
,
'\$'
,
5
)
mySSH
.
command
(
self
.
cli
+
' image rm '
+
sharedimage
+
':'
+
imageTag
,
'\$'
,
5
)
...
@@ -242,7 +218,7 @@ class Containerize():
...
@@ -242,7 +218,7 @@ class Containerize():
logging
.
error
(
'Could not build properly ran-build'
)
logging
.
error
(
'Could not build properly ran-build'
)
status
=
False
status
=
False
else
:
else
:
result
=
re
.
search
(
'Size
= (?P<size>[0-9\-]+)
bytes'
,
mySSH
.
getBefore
())
result
=
re
.
search
(
'Size
*= *(?P<size>[0-9\-]+) *
bytes'
,
mySSH
.
getBefore
())
if
result
is
not
None
:
if
result
is
not
None
:
imageSize
=
float
(
result
.
group
(
'size'
))
imageSize
=
float
(
result
.
group
(
'size'
))
imageSize
=
imageSize
/
1000
imageSize
=
imageSize
/
1000
...
@@ -263,7 +239,7 @@ class Containerize():
...
@@ -263,7 +239,7 @@ class Containerize():
logging
.
error
(
'Could not build properly '
+
image
)
logging
.
error
(
'Could not build properly '
+
image
)
status
=
False
status
=
False
else
:
else
:
result
=
re
.
search
(
'Size
= (?P<size>[0-9\-]+)
bytes'
,
mySSH
.
getBefore
())
result
=
re
.
search
(
'Size
*= *(?P<size>[0-9\-]+) *
bytes'
,
mySSH
.
getBefore
())
if
result
is
not
None
:
if
result
is
not
None
:
imageSize
=
float
(
result
.
group
(
'size'
))
imageSize
=
float
(
result
.
group
(
'size'
))
imageSize
=
imageSize
/
1000
imageSize
=
imageSize
/
1000
...
...
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