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
常顺宇
OpenXG-RAN
Commits
f207b202
Commit
f207b202
authored
3 years ago
by
Remi Hardy
Browse files
Options
Browse Files
Download
Plain Diff
[CI] Pipeline to automate RAN Merge Requests Status Dashboard
parents
03990771
5a4d29e8
x2_handle_sctp_shutdown
512-dataplane-bug-in-l2nfapi_nos1
FR2_NSA
NRUE_usedlschparallel
NR_2port_CSIRS
NR_CSIRS_tomerge
NR_F1C_F1U_extensions
NR_FR2_initsync_fixes
NR_SA_F1AP_5GRECORDS
NR_SA_F1AP_5GRECORDS-USIM
NR_SA_F1AP_5GRECORDS-wf-0623
NR_UE_CONFIG_REQ_FIXES
NR_UE_PUCCH_bugfixes
NR_UE_SA
NR_UE_rework_test
NR_UE_reworking_UCI_procedures
NR_cleanup_PUCCH_resources
NR_gNB_initial_MIB_fix
NR_multiplexing_HARQ_CSI_PUCCH
NR_phytest_bugfixes
NR_reworking_UL_antennaports
NR_scheduling_CSIRS
NR_scheduling_request
RFquality
Test_SA_5GREC
add-ru-docker-image
avxllr
bandwidth-testing
benetel_config_file_fix
benetel_dpdk20
bugfix-nr-t-reordering
bugfix_gnb_rt_stats_html
ci-fix-module-ul-iperf
ci_benetel_longrun_limits
ci_fix_iperf_for_module
ci_hotfix_module_ue_ip_address
ci_improve_module_ctl
ci_nsa_benetel
ci_nsa_fixes
ci_nsa_pipes_improve
ci_nsa_test_integration_2021_wk19
ci_nsa_traces
ci_nsa_uplink
ci_quectel_support
ci_sa_rfsim_test
ci_solve_ul_for_module
ci_test_5GREC
ci_test_nsa_fix_quectel_nic
ci_test_nsa_on_develop
ci_testinfra_as_code
debug-UL-5GRECORDS
debug_UL_signal
detached-w16-test
develop
develop-CCE
develop-NR_SA_F1AP_5GRECORDS
develop-NR_SA_F1AP_5GRECORDS-abs
develop-NR_SA_F1AP_5GRECORDS-hs
develop-NR_SA_F1AP_5GRECORDS-hs1
develop-NR_SA_F1AP_5GRECORDS-lts
develop-NR_SA_F1AP_5GRECORDS-lts-wf
develop-NR_SA_F1AP_5GRECORDS-v3
develop-NR_SA_F1AP_5GRECORDS_100M
develop-NR_SA_F1AP_5GRECORDS_LDPC_FPGA
develop-NR_SA_F1AP_5GRECORDS_lfq_0607
develop-aw2sori
develop-wf-du
dongzhanyi-zte-develop1
episys-merge
fedora-gen-kernel-fix
fix-check
fix-compile
fix-physim-deploy
fix-retransmission-rbg
fix_coreset_dmrs_idx
fix_nr_ulsim
fixgtpu
flexran-rtc-repo-is-public
hack-bch-no-sched-sf-0
integration_2021_wk13_b
integration_2021_wk16
integration_2021_wk17_a
integration_2021_wk17_b
integration_2021_wk18_a
integration_2021_wk18_b
integration_2021_wk19
integration_2021_wk20_a
integration_2021_wk22
integration_2021_wk23
integration_2021_wk27
ldpc_offload_t1
migrate-vm-pipeline-to-bionic
multiple_ssb_sib1_bugfix
nfapi_nr_arch_mod
nr-dl-mimo-2layer
nr-dmrs-fixes
nr-pdcp-benchmarking
nr-pdcp-small-bugfixes
nr-pdcp-srb-integrity
nr_improve_chanest
oairu
phy-asan-fixes
physim-build-deploy
physim-deploy-handle-error-cases
prb_based_dl_channel_estimation
rh_ci_add_uldlharq_stats
rh_ci_gsheet_rt_monitoring
rh_ci_nsa_test_n310
rh_ci_phy_test_improve
rh_ci_test_benetel
rh_ci_test_nsa
rh_ci_test_nsa_wk16
rh_ci_test_nsa_wk17_b
rh_ci_test_nsa_wk17b
rh_ci_test_rfsim_sa
scs_60_iisc
test-5GREC
test-nsa-benetel
test_nsa_gtpu_fix
usrp_stop_cleanly
wf_testc
2021.w27
2021.w26
2021.w25
2021.w24
2021.w23
2021.w22
2021.w20
2021.w19
2021.w18_b
2021.w18_a
2021.w17_b
2021.w16
benetel_gnb_rel_2.0
benetel_enb_rel_2.0
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
285 additions
and
0 deletions
+285
-0
ci-scripts/Jenkinsfile-git-dashboard
ci-scripts/Jenkinsfile-git-dashboard
+45
-0
ci-scripts/ran_dashboard.py
ci-scripts/ran_dashboard.py
+240
-0
No files found.
ci-scripts/Jenkinsfile-git-dashboard
0 → 100644
View file @
f207b202
#
!
/bin/
groovy
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
// Template Jenkins Declarative Pipeline script to run Test w/ RF HW
// Location of the python executor node shall be in the same subnet as the others servers
def
pythonExecutor
=
params
.
pythonExecutor
pipeline
{
agent
{
label
pythonExecutor
}
stages
{
stage
(
"gDashboard"
)
{
steps
{
script
{
//retrieve MR data from gitlab and export to gSheet
sh
returnStdout:
true
,
script:
'python3 ci-scripts/ran_dashboard.py'
}
}
}
}
}
This diff is collapsed.
Click to expand it.
ci-scripts/ran_dashboard.py
0 → 100644
View file @
f207b202
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
#---------------------------------------------------------------------
# Merge Requests Dashboard for RAN on googleSheet
#
# Required Python Version
# Python 3.x
#
#---------------------------------------------------------------------
#-----------------------------------------------------------
# Import
#-----------------------------------------------------------
#import google spreadsheet API
import
gspread
from
oauth2client.service_account
import
ServiceAccountCredentials
import
subprocess
import
shlex
#lexical analysis
import
json
#json structures
import
datetime
#now() and date formating
from
datetime
import
datetime
#-----------------------------------------------------------
# Class Declaration
#-----------------------------------------------------------
class
gDashboard
:
def
__init__
(
self
,
creds_file
,
spreadsheet
,
worksheet
):
#"creds.json", 'OAI RAN Dashboard', 'MR Status'
self
.
scope
=
[
"https://spreadsheets.google.com/feeds"
,
'https://www.googleapis.com/auth/spreadsheets'
,
"https://www.googleapis.com/auth/drive.file"
,
"https://www.googleapis.com/auth/drive"
]
self
.
creds
=
ServiceAccountCredentials
.
from_json_keyfile_name
(
creds_file
,
self
.
scope
)
self
.
client
=
gspread
.
authorize
(
self
.
creds
)
#spreadsheet
self
.
ss
=
self
.
client
.
open
(
spreadsheet
)
#worksheet
self
.
sheet
=
self
.
ss
.
worksheet
(
worksheet
)
self
.
ss
.
del_worksheet
(
self
.
sheet
)
#start by deleting the old sheet
self
.
sheet
=
self
.
ss
.
add_worksheet
(
title
=
worksheet
,
rows
=
"100"
,
cols
=
"20"
)
#create a new one
self
.
d
=
{}
#data dictionary
def
fetchData
(
self
,
cmd
):
#cmd="""curl --silent "https://gitlab.eurecom.fr/api/v4/projects/oai%2Fopenairinterface5g/merge_requests?state=opened&per_page=100" """
process
=
subprocess
.
Popen
(
shlex
.
split
(
cmd
),
stdout
=
subprocess
.
PIPE
)
output
=
process
.
stdout
.
readline
()
tmp
=
output
.
decode
(
"utf-8"
)
self
.
d
=
json
.
loads
(
tmp
)
def
gBuild
(
self
):
#line 1 : get update date
now
=
datetime
.
now
()
# dd/mm/YY H:M:S
dt_string
=
"Update : "
+
now
.
strftime
(
"%d/%m/%Y %H:%M"
)
row
=
[
dt_string
]
self
.
sheet
.
insert_row
(
row
,
index
=
1
,
value_input_option
=
'RAW'
)
#line 2 is empty
#line 3 is column names
i
=
3
row
=
[
"MR"
,
"Created_at"
,
"Author"
,
"Title"
,
"Assignee"
,
"Reviewer"
,
"CAN START"
,
"IN PROGRESS"
,
"COMPLETED"
,
"OK MERGE"
,
"Merge conflicts"
]
self
.
sheet
.
insert_row
(
row
,
index
=
i
,
value_input_option
=
'RAW'
)
#line 4 onward, build data lines
for
x
in
range
(
len
(
self
.
d
)):
i
=
i
+
1
date_time_str
=
self
.
d
[
x
][
'created_at'
]
date_time_obj
=
datetime
.
strptime
(
date_time_str
,
'%Y-%m-%dT%H:%M:%S.%fZ'
)
milestone1
=
milestone2
=
milestone3
=
milestone4
=
""
if
self
.
d
[
x
][
'milestone'
]
!=
None
:
if
self
.
d
[
x
][
'milestone'
][
'title'
]
==
"REVIEW_CAN_START"
:
milestone1
=
"X"
elif
self
.
d
[
x
][
'milestone'
][
'title'
]
==
"REVIEW_IN_PROGRESS"
:
milestone2
=
"X"
elif
self
.
d
[
x
][
'milestone'
][
'title'
]
==
"REVIEW_COMPLETED_AND_APPROVED"
:
milestone3
=
"X"
elif
self
.
d
[
x
][
'milestone'
][
'title'
]
==
"OK_TO_BE_MERGED"
:
milestone4
=
"X"
else
:
pass
else
:
pass
#check if empty or not
if
self
.
d
[
x
][
'assignee'
]
!=
None
:
assignee
=
str
(
self
.
d
[
x
][
'assignee'
][
'name'
])
else
:
assignee
=
""
#check if empty or not
if
len
(
self
.
d
[
x
][
'reviewers'
])
!=
0
:
reviewer
=
str
(
self
.
d
[
x
][
'reviewers'
][
0
][
'name'
])
else
:
reviewer
=
""
if
self
.
d
[
x
][
'has_conflicts'
]
==
True
:
conflicts
=
"YES"
else
:
conflicts
=
""
#build final row
row
=
[
str
(
self
.
d
[
x
][
'iid'
]),
str
(
date_time_obj
.
date
()),
str
(
self
.
d
[
x
][
'author'
][
'name'
]),
str
(
self
.
d
[
x
][
'title'
]),
\
assignee
,
reviewer
,
\
milestone1
,
milestone2
,
milestone3
,
milestone4
,
conflicts
]
#write it to worksheet
self
.
sheet
.
insert_row
(
row
,
index
=
i
,
value_input_option
=
'RAW'
)
def
gFormat
(
self
,
sourceSheetName
,
destinationSheetName
):
# "Formating" , "MR Status"
#copy formating template
sourceSheetId
=
self
.
ss
.
worksheet
(
sourceSheetName
).
_properties
[
'sheetId'
]
destinationSheetId
=
self
.
ss
.
worksheet
(
destinationSheetName
).
_properties
[
'sheetId'
]
body
=
{
"requests"
:
[
{
"copyPaste"
:
{
"source"
:
{
"sheetId"
:
sourceSheetId
,
"startRowIndex"
:
0
,
"endRowIndex"
:
40
,
"startColumnIndex"
:
0
,
"endColumnIndex"
:
20
},
"destination"
:
{
"sheetId"
:
destinationSheetId
,
"startRowIndex"
:
0
,
"endRowIndex"
:
40
,
"startColumnIndex"
:
0
,
"endColumnIndex"
:
20
},
"pasteType"
:
"PASTE_FORMAT"
}
}
]
}
self
.
ss
.
batch_update
(
body
)
#resize columns fit to data, except col 0
sheetId
=
self
.
ss
.
worksheet
(
destinationSheetName
).
_properties
[
'sheetId'
]
body
=
{
"requests"
:
[
{
'autoResizeDimensions'
:
{
'dimensions'
:
{
'sheetId'
:
sheetId
,
'dimension'
:
'COLUMNS'
,
'startIndex'
:
1
,
'endIndex'
:
20
}
}
}
]
}
self
.
ss
.
batch_update
(
body
)
#resize col 0
sheetId
=
self
.
ss
.
worksheet
(
destinationSheetName
).
_properties
[
'sheetId'
]
body
=
{
"requests"
:
[
{
"updateDimensionProperties"
:
{
"range"
:
{
"sheetId"
:
sheetId
,
"dimension"
:
"COLUMNS"
,
"startIndex"
:
0
,
"endIndex"
:
1
},
"properties"
:
{
"pixelSize"
:
100
},
"fields"
:
"pixelSize"
}
}
]
}
self
.
ss
.
batch_update
(
body
)
#resize milestones to be cleaner
sheetId
=
self
.
ss
.
worksheet
(
destinationSheetName
).
_properties
[
'sheetId'
]
body
=
{
"requests"
:
[
{
"updateDimensionProperties"
:
{
"range"
:
{
"sheetId"
:
sheetId
,
"dimension"
:
"COLUMNS"
,
"startIndex"
:
6
,
"endIndex"
:
10
},
"properties"
:
{
"pixelSize"
:
135
},
"fields"
:
"pixelSize"
}
}
]
}
self
.
ss
.
batch_update
(
body
)
def
main
():
my_gDashboard
=
gDashboard
(
"/home/oaicicd/remi/creds.json"
,
'OAI RAN Dashboard'
,
'MR Status'
)
cmd
=
"""curl --silent "https://gitlab.eurecom.fr/api/v4/projects/oai%2Fopenairinterface5g/merge_requests?state=opened&per_page=100" """
my_gDashboard
.
fetchData
(
cmd
)
my_gDashboard
.
gBuild
()
my_gDashboard
.
gFormat
(
"Formating"
,
"MR Status"
)
if
__name__
==
"__main__"
:
# execute only if run as a script
main
()
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