fix/cpy_conf_after_req
The copy of the config file is directly written in the local repository after receiving a zmq request(a trigger) and copying all of the generated figures.
Otherwise the config file wont be updated on the remote repository.
Deleting the tmp folder line has been deleted, as I think it is a good idea to have the tmp after a timeout. tmp files might have info over what caused the timeout.
Merge request reports
Activity
- Resolved by Karim Ahmed
169 169 config['GLOBAL']['report-service']['port'])) 170 170 171 asyncio.ensure_future(copy_files(conf_file, 172 config['GLOBAL']['git']['figures-local'], 173 sem=None)) 174 175 171 while True: 176 172 response = await socket.recv_pyobj() 177 173 await socket.send_pyobj('Build DC reports through -->') 178 174 logging.info("response: {}".format(response)) 179 175 176 # Send the conf.yaml file after receiving a zmq-req. 177 asyncio.ensure_future(copy_files(conf_file, 178 config['GLOBAL']['git'] 179 ['figures-local'], 180 sem=None)) changed this line in version 3 of the diff
168 168 socket.bind("{}:{}".format(config['GLOBAL']['report-service']['bind-to'], 169 169 config['GLOBAL']['report-service']['port'])) 170 170 171 asyncio.ensure_future(copy_files(conf_file, 172 config['GLOBAL']['git']['figures-local'], 173 sem=None)) 174 175 171 while True: 176 172 response = await socket.recv_pyobj() 177 173 await socket.send_pyobj('Build DC reports through -->') 178 174 logging.info("response: {}".format(response)) 179 175 176 # Send the conf.yaml file after receiving a zmq-req. 177 asyncio.ensure_future(copy_files(conf_file, changed this line in version 3 of the diff
204 200 continue 205 201 206 202 logging.info('Requested Configuration: {}'.format(req_cfg)) 207 203 208 204 async def do_action(cfg): 205 209 206 logging.info('Run plot production') 210 207 208 fig_local = '{}/figures'.format(cfg['GLOBAL']['git'] 209 ['repo-local']) changed this line in version 6 of the diff
295 288 for k, v in det_new_files.items()]) 296 289 297 290 logging.info('{} figures of {} are copied into {}'.format( 298 len(figures), det_name, path)) 291 len(figures), det_name, fig_local)) 292 293 # Write the requested cfg.yaml before pushing all figures. 294 with open('{}/report_conf.yaml'.format( 295 fig_local), 'w') as outfile: 296 yaml.dump(cfg, outfile, default_flow_style=False) 297 298 all_new_files.append('{}/report_conf.yaml'.format(fig_local)) 299 299 @haufs @karnem please review this.
Instead of copying the yaml file. The yaml file would be written now directly in the DC-local-repository.
This makes sure to push the requested config file in cases of:
- Using the default conf.yaml
- Choosing some of the instruments (not all) from the default conf.yaml file.
- Choosing a very different file as the conf.yaml.
In any case after copying the generated figures and before pushing it to the
git
, the copied.copied(cfg) file is written into a yaml file in the local repository.Edited by Karim Ahmed
295 287 for k, v in det_new_files.items()]) 296 288 297 289 logging.info('{} figures of {} are copied into {}'.format( 298 len(figures), det_name, path)) 290 len(figures), det_name, fig_local)) 291 292 # Remove sensitive information from the config file. 293 del cfg['GLOBAL'] This part is to avoid copying sensitive info as a user token for example.
Edited by Karim Ahmed
204 200 continue 205 201 206 202 logging.info('Requested Configuration: {}'.format(req_cfg)) 207 203 208 204 async def do_action(cfg): 209 logging.info('Run plot production') 210 205 206 logging.info('Run plot production') 207 local_repo = cfg['GLOBAL']['git']['repo-local']