add a web service to launch calibration from MDC
@maial please have a look
Edited by Steffen Hauf
Merge request reports
Activity
Filter activity
- test_web.py 0 → 100644
1 import zmq 2 con = zmq.Context() 3 socket = con.socket(zmq.REQ) 4 con = socket.connect("tcp://localhost:5004") 5 msg = "','".join(["correct", "SASE1", "SPB", "201831", "900039", "431"]) changed this line in version 9 of the diff
- webservice.py 0 → 100644
1 import asyncio 2 import ast 3 import copy 4 import glob 5 import socket 6 import subprocess 7 import sys 8 import yaml 9 import zmq 10 import zmq.auth.thread 11 12 async def run_cmd(cmd, socket, mode): 13 if mode == "prod": 14 ret = subprocess.run(cmd) 15 socket.send("Started calibration: {}".format(ret.returncode).encode()) changed this line in version 4 of the diff
- webservice.py 0 → 100644
9 import zmq 10 import zmq.auth.thread 11 12 async def run_cmd(cmd, socket, mode): 13 if mode == "prod": 14 ret = subprocess.run(cmd) 15 socket.send("Started calibration: {}".format(ret.returncode).encode()) 16 else: 17 print(" ".join(cmd)) 18 socket.send("Simulated calibratioN: {}".format(" ".join(cmd)).encode()) 19 20 async def server_runner(port, conf_file, mode): 21 context = zmq.Context() 22 auth = zmq.auth.thread.ThreadAuthenticator(context) 23 #auth.start() 24 #auth.allow(*CFG.SERVICE['ZMQ']['IPS']) changed this line in version 4 of the diff
- webconfig.yaml 0 → 100644
1 SPB: 2 AGIPD: 3 inset: AGIPD 4 calfile: xxx 5 mem-cells: 128 6 blc-noise: yes 7 blc-noise-threshold: 100 8 instance: AGIPD1M1 9 JUNGFRAU: 10 inset: DA05 11 calfile: xxx 12 FXE: 13 LPD: 14 inset: LPD 15 calfile: xxx 16 non-linear-gain: yes changed this line in version 9 of the diff
@maial, do you prefer if I move this to a separate git project, in terms of later deployment and maintenance? I am not sure right now, as it is tighly coupled with xfel-calibrate, so maybe versioning both in the same project as it is now is the better approach?
added 2 commits
@karnem, please review this with priority.
- webservice/README.md 0 → 100644
100 job-update-interval: 30 101 job-timeout: 3600 102 ``` 103 104 In case you want to use authentication, add a list of *allowed-ips*. 105 106 In the **metadata-client** section, the client interface to the MDC is configured: 107 108 ``` YAML 109 110 metadata-client: 111 user-id: 112 user-secret: 113 user-email: 114 metadata-web-app-url: 'https://in.xfel.eu/metadata' 115 metadata-web-app-url: 'https://in.xfel.eu/metadata'
Please register or sign in to reply