Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LHCData
lhc-sm-hwc
Commits
173a2f6c
Commit
173a2f6c
authored
Oct 28, 2021
by
Agata Malgorzata Chadaj
Browse files
wip
parent
46e2a8ba
Pipeline
#3174712
passed with stage
in 28 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CI/Jenkinsfile
View file @
173a2f6c
...
...
@@ -5,7 +5,7 @@ pipeline {
dockerfile
{
label
'agent2'
dir
'CI'
args
'--network host -v /cvmfs:/cvmfs:shared -v /root/.ssh/mpesoft_key:/root/.ssh/mpesoft_key:ro --privileged'
args
'--network host -v /cvmfs:/cvmfs:shared -v /root/.ssh/mpesoft_key:/root/.ssh/mpesoft_key:ro
-v /eos:/eos:shared
--privileged'
}
}
...
...
CI/send_results.py
View file @
173a2f6c
"""This script is a workaround as we didn't manage to install papermill as script in the Jenkins pipeline"""
import
json
from
pathlib
import
Path
import
pandas
as
pd
import
argparse
import
nbformat
...
...
@@ -23,18 +24,21 @@ def get_result():
result_nb
=
nbformat
.
read
(
result_path
,
as_version
=
4
)
nb
=
outputs
.
NotebookOutput
(
result_nb
)
try
:
result
=
nb
.
get_cells_by_tag
(
'result'
)[
0
].
get_cell_output
(
outputs
.
CellOutputType
.
STDOUT
)[
0
]
full_result
=
nb
.
get_cells_by_tag
(
'result'
)[
1
].
get_cell_output
(
outputs
.
CellOutputType
.
STDOUT
)[
0
]
result_flag
=
nb
.
get_cells_by_tag
(
'result'
)[
0
].
get_cell_output
(
outputs
.
CellOutputType
.
STDOUT
)[
0
]
except
IndexError
:
result
=
'FAILED'
print
(
'RESULT:'
)
print
(
result
)
return
'FAILED'
,
''
return
result_flag
,
json
.
load
(
full_result
)
def
save_json_to_file
(
args
,
flag
,
comment
):
file_path
=
'/eos/project/l/lhcsm/hwc_dev/lhc-sm-hwc/test.csv'
df
=
pd
.
DataFrame
.
from_dict
(
comment
)
df
.
to_csv
(
file_path
)
if
__name__
==
'__main__'
:
args
=
_get_arg_parser
().
parse_args
()
parameters
=
{
'circuit_name'
:
args
.
circuit_name
,
'discharge_level'
:
int
(
args
.
discharge_level
),
'start_time'
:
args
.
start_time
,
'end_time'
:
args
.
end_time
}
get_result
()
flag
,
text
=
get_result
()
save_json_to_file
(
args
,
flag
,
text
)
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