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
zzha zzha
OpenXG-RAN
Commits
52442573
Commit
52442573
authored
Apr 12, 2021
by
Mohammed Ismail
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CI: syntax fix
Signed-off-by:
Mohammed Ismail
<
mohammed.ismail@openairinterface.org
>
parent
20cd80c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
47 deletions
+47
-47
ci-scripts/cls_physim1.py
ci-scripts/cls_physim1.py
+46
-46
ci-scripts/main.py
ci-scripts/main.py
+1
-1
No files found.
ci-scripts/cls_physim1.py
View file @
52442573
...
@@ -43,9 +43,9 @@ class PhySim:
...
@@ -43,9 +43,9 @@ class PhySim:
self
.
eNBIpAddr
=
""
self
.
eNBIpAddr
=
""
self
.
eNBUserName
=
""
self
.
eNBUserName
=
""
self
.
eNBPassword
=
""
self
.
eNBPassword
=
""
self
.
OCUserName
=
""
self
.
OCUserName
=
""
self
.
OCPassword
=
""
self
.
OCPassword
=
""
self
.
OCWorkspace
=
""
self
.
OCWorkspace
=
""
self
.
eNBSourceCodePath
=
""
self
.
eNBSourceCodePath
=
""
self
.
ranRepository
=
""
self
.
ranRepository
=
""
self
.
ranBranch
=
""
self
.
ranBranch
=
""
...
@@ -96,10 +96,10 @@ class PhySim:
...
@@ -96,10 +96,10 @@ class PhySim:
mySSH
.
command
(
'git checkout -f '
+
self
.
ranCommitID
,
'\$'
,
5
)
mySSH
.
command
(
'git checkout -f '
+
self
.
ranCommitID
,
'\$'
,
5
)
mySSH
.
command
(
"sudo podman image inspect --format='Size = {{.Size}} bytes' oai-physim:ci-temp"
,
'\$'
,
60
)
mySSH
.
command
(
"sudo podman image inspect --format='Size = {{.Size}} bytes' oai-physim:ci-temp"
,
'\$'
,
60
)
if
mySSH
.
getBefore
().
count
(
'no such image'
)
!=
0
:
if
mySSH
.
getBefore
().
count
(
'no such image'
)
!=
0
:
logging
.
error
(
'
\u001B
[1m No such image oai-physim
\u001B
[0m'
)
logging
.
error
(
'
\u001B
[1m No such image oai-physim
\u001B
[0m'
)
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
...
@@ -115,46 +115,46 @@ class PhySim:
...
@@ -115,46 +115,46 @@ class PhySim:
else
:
else
:
logging
.
debug
(
'oai-physim size is unknown'
)
logging
.
debug
(
'oai-physim size is unknown'
)
# logging to OC cluster
# logging to OC cluster
mySSH
.
command
(
'oc login -u {self.OCUserName} -p {self.OCPassword}'
,
'\$'
,
6
)
mySSH
.
command
(
'oc login -u {self.OCUserName} -p {self.OCPassword}'
,
'\$'
,
6
)
if
mySSH
.
getBefore
().
count
(
'Login successful'
)
==
0
:
if
mySSH
.
getBefore
().
count
(
'Login successful'
)
==
0
:
logging
.
error
(
'
\u001B
[1m OC Cluster Login Failed
\u001B
[0m'
)
logging
.
error
(
'
\u001B
[1m OC Cluster Login Failed
\u001B
[0m'
)
else
:
else
:
logging
.
debug
(
'
\u001B
[1m Login to OC Cluster Successfully
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1m Login to OC Cluster Successfully
\u001B
[0m'
)
mySSH
.
command
(
'oc project {self.OCWorkspace}'
,
'\$'
,
6
)
mySSH
.
command
(
'oc project {self.OCWorkspace}'
,
'\$'
,
6
)
if
(
mySSH
.
getBefore
().
count
(
'Already on project "{self.OCWorkspace}"'
))
==
0
or
(
mySSH
.
getBefore
().
count
(
'Now using project "{self.OCWorkspace}"'
))
==
0
:
if
(
mySSH
.
getBefore
().
count
(
'Already on project "{self.OCWorkspace}"'
))
==
0
or
(
mySSH
.
getBefore
().
count
(
'Now using project "{self.OCWorkspace}"'
))
==
0
:
logging
.
error
(
'
\u001B
[1m Unable to access OC project {self.OCWorkspace}
\u001B
[0m'
)
logging
.
error
(
'
\u001B
[1m Unable to access OC project {self.OCWorkspace}
\u001B
[0m'
)
else
:
else
:
logging
.
debug
(
'
\u001B
[1m Now using project {self.OCWorkspace}
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1m Now using project {self.OCWorkspace}
\u001B
[0m'
)
# Using helm charts deployment
# Using helm charts deployment
mySSH
.
command
(
'helm install physim ./charts/physims/'
,
'\$'
,
6
)
mySSH
.
command
(
'helm install physim ./charts/physims/'
,
'\$'
,
6
)
if
mySSH
.
getBefore
().
count
(
'STATUS: deployed'
)
==
0
:
if
mySSH
.
getBefore
().
count
(
'STATUS: deployed'
)
==
0
:
logging
.
error
(
'
\u001B
[1m Deploying PhySim Failed using helm chart
\u001B
[0m'
)
logging
.
error
(
'
\u001B
[1m Deploying PhySim Failed using helm chart
\u001B
[0m'
)
else
:
else
:
logging
.
debug
(
'
\u001B
[1m Deployed PhySim Successfully using helm chart
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1m Deployed PhySim Successfully using helm chart
\u001B
[0m'
)
isRunning
=
False
isRunning
=
False
while
(
isRunning
==
False
):
while
(
isRunning
==
False
):
mySSH
.
command
(
'oc get pods -l app.kubernetes.io/instance=physim'
,
'\$'
,
6
)
mySSH
.
command
(
'oc get pods -l app.kubernetes.io/instance=physim'
,
'\$'
,
6
)
if
mySSH
.
getBefore
().
count
(
'Running'
)
==
12
if
mySSH
.
getBefore
().
count
(
'Running'
)
==
12
:
logging
.
debug
(
'
\u001B
[1m Running the physim test Scenarios
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1m Running the physim test Scenarios
\u001B
[0m'
)
isRunning
=
True
isRunning
=
True
podNames
=
re
.
findall
(
'oai[\S\d\w]+'
,
mySSH
.
getBefore
())
podNames
=
re
.
findall
(
'oai[\S\d\w]+'
,
mySSH
.
getBefore
())
# Waiting to complete the running test
# Waiting to complete the running test
count
=
0
count
=
0
isFinished
=
False
isFinished
=
False
while
(
count
<
25
or
isFinished
==
False
):
while
(
count
<
25
or
isFinished
==
False
):
time
.
sleep
(
60
)
time
.
sleep
(
60
)
mySSH
.
command
(
'oc get pods -l app.kubernetes.io/instance=physim'
,
'\$'
,
6
)
mySSH
.
command
(
'oc get pods -l app.kubernetes.io/instance=physim'
,
'\$'
,
6
)
result
=
re
.
search
(
'oai-nr-dlsim[\S\d\w]+'
,
mySSH
.
getBefore
())
result
=
re
.
search
(
'oai-nr-dlsim[\S\d\w]+'
,
mySSH
.
getBefore
())
if
result
is
not
None
:
if
result
is
not
None
:
podName1
=
result
.
group
()
podName1
=
result
.
group
()
mySSH
.
command
(
'oc logs {podName1}'
,
'\$'
,
6
)
mySSH
.
command
(
'oc logs {podName1}'
,
'\$'
,
6
)
if
mySSH
.
getBefore
().
count
(
'Finished'
)
!=
0
:
if
mySSH
.
getBefore
().
count
(
'Finished'
)
!=
0
:
isFinished
=
True
isFinished
=
True
count
+=
1
count
+=
1
if
isFinished
:
if
isFinished
:
logging
.
debug
(
'
\u001B
[1m PhySim test is Complete
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1m PhySim test is Complete
\u001B
[0m'
)
# Getting the logs of each executables running in individual pods
# Getting the logs of each executables running in individual pods
for
podName
in
podNames
:
for
podName
in
podNames
:
...
@@ -164,8 +164,8 @@ class PhySim:
...
@@ -164,8 +164,8 @@ class PhySim:
mySSH
.
command
(
'mv log/* '
+
'physim_test_log_'
+
self
.
testCase_id
,
'\$'
,
5
)
mySSH
.
command
(
'mv log/* '
+
'physim_test_log_'
+
self
.
testCase_id
,
'\$'
,
5
)
# UnDeploy the physical simulator pods
# UnDeploy the physical simulator pods
mySSH
.
command
(
'helm uninstall physim'
,
'\$'
,
10
)
mySSH
.
command
(
'helm uninstall physim'
,
'\$'
,
10
)
if
mySSH
.
getBefore
().
count
(
'release "physim" uninstalled'
)
!=
0
if
mySSH
.
getBefore
().
count
(
'release "physim" uninstalled'
)
!=
0
:
logging
.
debug
(
'
\u001B
[1m UnDeployed PhySim Successfully on OC Cluster
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1m UnDeployed PhySim Successfully on OC Cluster
\u001B
[0m'
)
else
:
else
:
logging
.
debug
(
'
\u001B
[1m Failed to UnDeploy PhySim on OC Cluster
\u001B
[0m'
)
logging
.
debug
(
'
\u001B
[1m Failed to UnDeploy PhySim on OC Cluster
\u001B
[0m'
)
mySSH
.
close
()
mySSH
.
close
()
...
...
ci-scripts/main.py
View file @
52442573
...
@@ -391,7 +391,7 @@ ldpc=cls_physim.PhySim() #create an instance for LDPC test using GPU or CPU b
...
@@ -391,7 +391,7 @@ ldpc=cls_physim.PhySim() #create an instance for LDPC test using GPU or CPU b
#-----------------------------------------------------------
#-----------------------------------------------------------
import
args_parse
import
args_parse
py_param_file_present
,
py_params
,
mode
=
args_parse
.
ArgsParse
(
sys
.
argv
,
CiTestObj
,
RAN
,
HTML
,
EPC
,
ldpc
,
CONTAINERS
,
HELP
,
SCA
)
py_param_file_present
,
py_params
,
mode
=
args_parse
.
ArgsParse
(
sys
.
argv
,
CiTestObj
,
RAN
,
HTML
,
EPC
,
ldpc
,
CONTAINERS
,
HELP
,
SCA
,
PHYSIM
)
...
...
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