Skip to content
Snippets Groups Projects

add a web service to launch calibration from MDC

Merged Steffen Hauf requested to merge feat/webservice into master

@maial please have a look

Edited by Steffen Hauf

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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"])
  • 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())
  • 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'])
  • Author Maintainer

    As a second step the web service could monitor SLURM to provide progress reports back to the MDC

  • 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
  • Steffen Hauf changed target branch from feat/force_high_gain_agipd to master

    changed target branch from feat/force_high_gain_agipd to master

  • Steffen Hauf added 1 commit

    added 1 commit

    • 5c9a5587 - Move webservice to own directory

    Compare with previous version

  • Steffen Hauf added 1 commit

    added 1 commit

    Compare with previous version

  • Author Maintainer

    @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?

  • Steffen Hauf added 3 commits

    added 3 commits

    • 774051d6 - Make in and output folders configurable
    • 974c8288 - Move to argparser
    • b2c5dc6d - First working version with MDC interface

    Compare with previous version

  • Steffen Hauf added 1 commit

    added 1 commit

    Compare with previous version

  • Steffen Hauf added 3 commits

    added 3 commits

    Compare with previous version

  • Steffen Hauf added 1 commit

    added 1 commit

    Compare with previous version

  • Steffen Hauf added 1 commit

    added 1 commit

    Compare with previous version

  • Steffen Hauf added 1 commit

    added 1 commit

    Compare with previous version

  • Steffen Hauf added 2 commits

    added 2 commits

    Compare with previous version

  • Steffen Hauf unmarked as a Work In Progress

    unmarked as a Work In Progress

  • Author Maintainer

    @karnem, please review this with priority.

  • 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'
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading