Commit a3d5b85c authored by Agata Malgorzata Chadaj's avatar Agata Malgorzata Chadaj
Browse files

wip

parent 46ed8fe4
Pipeline #3168179 canceled with stage
......@@ -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}"
}
}
}
......
"""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()
#!/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"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment