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
a3d5b85c
Commit
a3d5b85c
authored
Oct 26, 2021
by
Agata Malgorzata Chadaj
Browse files
wip
parent
46ed8fe4
Pipeline
#3168179
canceled with stage
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CI/Jenkinsfile
View file @
a3d5b85c
...
...
@@ -21,9 +21,7 @@ pipeline {
}
stage
(
'Send analysis results'
)
{
steps
{
sh
'python send_results.py'
sh
"./CI/setup_second_step.sh ${params.notebook} ${params.circuit_name} ${params.discharge_level} \"${params.start_time}\" \"${params.end_time}\" ${params.API_BRANCH} ${params.NB_BRANCH}"
}
}
}
...
...
CI/send_results.py
View file @
a3d5b85c
"""This script is a workaround as we didn't manage to install papermill as script in the Jenkins pipeline"""
import
papermill
as
pm
from
pathlib
import
Path
import
argparse
from
nbformat.v4
import
nbformat
from
lhcsmnb
import
outputs
,
parameters
from
outputs
import
CellOutputType
def
_get_arg_parser
():
"""Specifies script arguments. Returns parser.
...
...
@@ -15,6 +19,17 @@ def _get_arg_parser():
return
parser
def
get_result
():
result_path
=
Path
(
"./output/result.ipynb"
)
result_nb
=
nbformat
.
read
(
result_path
,
as_version
=
4
)
nb
=
outputs
.
NotebookOutput
(
result_nb
)
try
:
result
=
nb
.
get_cell_by_tag
(
'result'
)[
0
].
get_cell_output
(
CellOutputType
.
STDOUT
)[
0
]
except
IndexError
:
result
=
'FAILED'
print
(
'RESULT:'
)
print
(
result
)
if
__name__
==
'__main__'
:
args
=
_get_arg_parser
().
parse_args
()
parameters
=
{
'circuit_name'
:
args
.
circuit_name
,
...
...
@@ -22,4 +37,5 @@ if __name__ == '__main__':
'start_time'
:
args
.
start_time
,
'end_time'
:
args
.
end_time
}
get_result
()
CI/setup_second_step.sh
0 → 100644
View file @
a3d5b85c
#!/bin/bash
export
API_BRANCH
=
"
$6
"
export
NB_BRANCH
=
"
$7
"
source
./CI/env_setup.sh
python3 ./CI/send_results.py
"
$1
"
"
$2
"
"
$3
"
"
$4
"
"
$5
"
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