Commit 173a2f6c authored by Agata Malgorzata Chadaj's avatar Agata Malgorzata Chadaj
Browse files

wip

parent 46e2a8ba
Pipeline #3174712 passed with stage
in 28 seconds
...@@ -5,7 +5,7 @@ pipeline { ...@@ -5,7 +5,7 @@ pipeline {
dockerfile { dockerfile {
label 'agent2' label 'agent2'
dir 'CI' 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'
} }
} }
......
"""This script is a workaround as we didn't manage to install papermill as script in the Jenkins pipeline""" """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 from pathlib import Path
import pandas as pd
import argparse import argparse
import nbformat import nbformat
...@@ -23,18 +24,21 @@ def get_result(): ...@@ -23,18 +24,21 @@ def get_result():
result_nb = nbformat.read(result_path, as_version=4) result_nb = nbformat.read(result_path, as_version=4)
nb = outputs.NotebookOutput(result_nb) nb = outputs.NotebookOutput(result_nb)
try: 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: except IndexError:
result = 'FAILED' return 'FAILED', ''
print('RESULT:') return result_flag, json.load(full_result)
print(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__': if __name__ == '__main__':
args = _get_arg_parser().parse_args() args = _get_arg_parser().parse_args()
parameters = {'circuit_name': args.circuit_name, flag, text = get_result()
'discharge_level': int(args.discharge_level), save_json_to_file(args, flag, text)
'start_time': args.start_time,
'end_time': args.end_time
}
get_result()
Supports Markdown
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