From 7b6b198ca24b29e5f7b955c8d1f46f3c7ac6739e Mon Sep 17 00:00:00 2001 From: PawelPlesniak Date: Wed, 29 Jul 2026 14:02:58 +0200 Subject: [PATCH 1/6] First iteration of RCaaS defined --- schema/druncschema/run_control.proto | 78 ++++++ src/druncschema/run_control_pb2.py | 69 +++++ src/druncschema/run_control_pb2.pyi | 341 ++++++++++++++++++++++++ src/druncschema/run_control_pb2_grpc.py | 183 +++++++++++++ 4 files changed, 671 insertions(+) create mode 100644 schema/druncschema/run_control.proto create mode 100644 src/druncschema/run_control_pb2.py create mode 100644 src/druncschema/run_control_pb2.pyi create mode 100644 src/druncschema/run_control_pb2_grpc.py diff --git a/schema/druncschema/run_control.proto b/schema/druncschema/run_control.proto new file mode 100644 index 0000000..2ba0399 --- /dev/null +++ b/schema/druncschema/run_control.proto @@ -0,0 +1,78 @@ +syntax = "proto3"; + +package dunedaq.druncschema.run_control; + +import "druncschema/token.proto"; + +service RunControl { + rpc validate_session (ValidateSessionRequest) returns (ValidateSessionResponse) {} + rpc start_session (StartSessionRequest) returns (StartSessionResponse) {} + rpc end_session (EndSessionRequest) returns (StartSessionResponse) {} +} + +message DeploySessionResponseFlag { + enum Flag { + SUCCESS = 0; + FAILURE_CONFIGURATION_FILE_NOT_FOUND = 1; + FAILURE_SESSION_ID_NOT_FOUND = 2; + FAILURE_SESSION_NAME_IN_USE = 3; + FAILURE_SESSION_NAME_INVALID = 4; + FAILURE_RESOURCES_CANNOT_BE_ALLOCATED = 5; + FAILURE_INSUFFICIENT_PRIVILEGES_TO_USE_RESOURCES = 6; + FAILURE_WEB_PROXY_ENABLED = 7; + FAILURE_OTHER = 8; + } + Flag status = 1; +} + +message EndSessionResponseFlag { + enum Flag { + SUCCESS = 0; + FAILURE_APPLICATION_STILL_ALIVE = 1; + FAILURE_OTHER = 2; + } + Flag status = 1; +} + +message ValidateSessionRequest { + Token token = 1; + string process_manager = 2; + string path_to_configuration_file = 3; + string ssesion_id = 4; + string session_name = 5; + map options = 6; +} + +message ValidateSessionResponse { + Token token = 1; + DeploySessionResponseFlag result = 2; +} + +message StartSessionRequest { + Token token = 1; + string process_manager = 2; + string path_to_configuration_file = 3; + string ssesion_id = 4; + string session_name = 5; + map options = 6; +} + +message StartSessionResponse { + Token token = 1; + DeploySessionResponseFlag result = 2; +} + +message EndSessionRequest { + Token token = 1; + string process_manager = 2; + string path_to_configuration_file = 3; + string ssesion_id = 4; + string session_name = 5; + map options = 6; +} + +message EndSessionResponse { + Token token = 1; + EndSessionResponseFlag result = 2; +} + diff --git a/src/druncschema/run_control_pb2.py b/src/druncschema/run_control_pb2.py new file mode 100644 index 0000000..c5694d6 --- /dev/null +++ b/src/druncschema/run_control_pb2.py @@ -0,0 +1,69 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: druncschema/run_control.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'druncschema/run_control.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from druncschema import token_pb2 as druncschema_dot_token__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x64runcschema/run_control.proto\x12\x1f\x64unedaq.druncschema.run_control\x1a\x17\x64runcschema/token.proto\"\xa4\x03\n\x19\x44\x65ploySessionResponseFlag\x12O\n\x06status\x18\x01 \x01(\x0e\x32?.dunedaq.druncschema.run_control.DeploySessionResponseFlag.Flag\"\xb5\x02\n\x04\x46lag\x12\x0b\n\x07SUCCESS\x10\x00\x12(\n$FAILURE_CONFIGURATION_FILE_NOT_FOUND\x10\x01\x12 \n\x1c\x46\x41ILURE_SESSION_ID_NOT_FOUND\x10\x02\x12\x1f\n\x1b\x46\x41ILURE_SESSION_NAME_IN_USE\x10\x03\x12 \n\x1c\x46\x41ILURE_SESSION_NAME_INVALID\x10\x04\x12)\n%FAILURE_RESOURCES_CANNOT_BE_ALLOCATED\x10\x05\x12\x34\n0FAILURE_INSUFFICIENT_PRIVILEGES_TO_USE_RESOURCES\x10\x06\x12\x1d\n\x19\x46\x41ILURE_WEB_PROXY_ENABLED\x10\x07\x12\x11\n\rFAILURE_OTHER\x10\x08\"\xb3\x01\n\x16\x45ndSessionResponseFlag\x12L\n\x06status\x18\x01 \x01(\x0e\x32<.dunedaq.druncschema.run_control.EndSessionResponseFlag.Flag\"K\n\x04\x46lag\x12\x0b\n\x07SUCCESS\x10\x00\x12#\n\x1f\x46\x41ILURE_APPLICATION_STILL_ALIVE\x10\x01\x12\x11\n\rFAILURE_OTHER\x10\x02\"\xb1\x02\n\x16ValidateSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12U\n\x07options\x18\x06 \x03(\x0b\x32\x44.dunedaq.druncschema.run_control.ValidateSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x90\x01\n\x17ValidateSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12J\n\x06result\x18\x02 \x01(\x0b\x32:.dunedaq.druncschema.run_control.DeploySessionResponseFlag\"\xab\x02\n\x13StartSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12R\n\x07options\x18\x06 \x03(\x0b\x32\x41.dunedaq.druncschema.run_control.StartSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x8d\x01\n\x14StartSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12J\n\x06result\x18\x02 \x01(\x0b\x32:.dunedaq.druncschema.run_control.DeploySessionResponseFlag\"\xa7\x02\n\x11\x45ndSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12P\n\x07options\x18\x06 \x03(\x0b\x32?.dunedaq.druncschema.run_control.EndSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x88\x01\n\x12\x45ndSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12G\n\x06result\x18\x02 \x01(\x0b\x32\x37.dunedaq.druncschema.run_control.EndSessionResponseFlag2\x92\x03\n\nRunControl\x12\x87\x01\n\x10validate_session\x12\x37.dunedaq.druncschema.run_control.ValidateSessionRequest\x1a\x38.dunedaq.druncschema.run_control.ValidateSessionResponse\"\x00\x12~\n\rstart_session\x12\x34.dunedaq.druncschema.run_control.StartSessionRequest\x1a\x35.dunedaq.druncschema.run_control.StartSessionResponse\"\x00\x12z\n\x0b\x65nd_session\x12\x32.dunedaq.druncschema.run_control.EndSessionRequest\x1a\x35.dunedaq.druncschema.run_control.StartSessionResponse\"\x00\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'druncschema.run_control_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_VALIDATESESSIONREQUEST_OPTIONSENTRY']._loaded_options = None + _globals['_VALIDATESESSIONREQUEST_OPTIONSENTRY']._serialized_options = b'8\001' + _globals['_STARTSESSIONREQUEST_OPTIONSENTRY']._loaded_options = None + _globals['_STARTSESSIONREQUEST_OPTIONSENTRY']._serialized_options = b'8\001' + _globals['_ENDSESSIONREQUEST_OPTIONSENTRY']._loaded_options = None + _globals['_ENDSESSIONREQUEST_OPTIONSENTRY']._serialized_options = b'8\001' + _globals['_DEPLOYSESSIONRESPONSEFLAG']._serialized_start=92 + _globals['_DEPLOYSESSIONRESPONSEFLAG']._serialized_end=512 + _globals['_DEPLOYSESSIONRESPONSEFLAG_FLAG']._serialized_start=203 + _globals['_DEPLOYSESSIONRESPONSEFLAG_FLAG']._serialized_end=512 + _globals['_ENDSESSIONRESPONSEFLAG']._serialized_start=515 + _globals['_ENDSESSIONRESPONSEFLAG']._serialized_end=694 + _globals['_ENDSESSIONRESPONSEFLAG_FLAG']._serialized_start=619 + _globals['_ENDSESSIONRESPONSEFLAG_FLAG']._serialized_end=694 + _globals['_VALIDATESESSIONREQUEST']._serialized_start=697 + _globals['_VALIDATESESSIONREQUEST']._serialized_end=1002 + _globals['_VALIDATESESSIONREQUEST_OPTIONSENTRY']._serialized_start=956 + _globals['_VALIDATESESSIONREQUEST_OPTIONSENTRY']._serialized_end=1002 + _globals['_VALIDATESESSIONRESPONSE']._serialized_start=1005 + _globals['_VALIDATESESSIONRESPONSE']._serialized_end=1149 + _globals['_STARTSESSIONREQUEST']._serialized_start=1152 + _globals['_STARTSESSIONREQUEST']._serialized_end=1451 + _globals['_STARTSESSIONREQUEST_OPTIONSENTRY']._serialized_start=956 + _globals['_STARTSESSIONREQUEST_OPTIONSENTRY']._serialized_end=1002 + _globals['_STARTSESSIONRESPONSE']._serialized_start=1454 + _globals['_STARTSESSIONRESPONSE']._serialized_end=1595 + _globals['_ENDSESSIONREQUEST']._serialized_start=1598 + _globals['_ENDSESSIONREQUEST']._serialized_end=1893 + _globals['_ENDSESSIONREQUEST_OPTIONSENTRY']._serialized_start=956 + _globals['_ENDSESSIONREQUEST_OPTIONSENTRY']._serialized_end=1002 + _globals['_ENDSESSIONRESPONSE']._serialized_start=1896 + _globals['_ENDSESSIONRESPONSE']._serialized_end=2032 + _globals['_RUNCONTROL']._serialized_start=2035 + _globals['_RUNCONTROL']._serialized_end=2437 +# @@protoc_insertion_point(module_scope) diff --git a/src/druncschema/run_control_pb2.pyi b/src/druncschema/run_control_pb2.pyi new file mode 100644 index 0000000..0140c16 --- /dev/null +++ b/src/druncschema/run_control_pb2.pyi @@ -0,0 +1,341 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +""" + +from collections import abc as _abc +from druncschema import token_pb2 as _token_pb2 +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf.internal import containers as _containers +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +import builtins as _builtins +import sys +import typing as _typing + +if sys.version_info >= (3, 11): + from typing import TypeAlias as _TypeAlias, Never as _Never +else: + from typing_extensions import TypeAlias as _TypeAlias, Never as _Never + +DESCRIPTOR: _descriptor.FileDescriptor + +@_typing.final +class DeploySessionResponseFlag(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + class _Flag: + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 + + class _FlagEnumTypeWrapper(_enum_type_wrapper._EnumTypeWrapper[DeploySessionResponseFlag._Flag.ValueType], _builtins.type): + DESCRIPTOR: _descriptor.EnumDescriptor + SUCCESS: DeploySessionResponseFlag._Flag.ValueType # 0 + FAILURE_CONFIGURATION_FILE_NOT_FOUND: DeploySessionResponseFlag._Flag.ValueType # 1 + FAILURE_SESSION_ID_NOT_FOUND: DeploySessionResponseFlag._Flag.ValueType # 2 + FAILURE_SESSION_NAME_IN_USE: DeploySessionResponseFlag._Flag.ValueType # 3 + FAILURE_SESSION_NAME_INVALID: DeploySessionResponseFlag._Flag.ValueType # 4 + FAILURE_RESOURCES_CANNOT_BE_ALLOCATED: DeploySessionResponseFlag._Flag.ValueType # 5 + FAILURE_INSUFFICIENT_PRIVILEGES_TO_USE_RESOURCES: DeploySessionResponseFlag._Flag.ValueType # 6 + FAILURE_WEB_PROXY_ENABLED: DeploySessionResponseFlag._Flag.ValueType # 7 + FAILURE_OTHER: DeploySessionResponseFlag._Flag.ValueType # 8 + + class Flag(_Flag, metaclass=_FlagEnumTypeWrapper): ... + SUCCESS: DeploySessionResponseFlag.Flag.ValueType # 0 + FAILURE_CONFIGURATION_FILE_NOT_FOUND: DeploySessionResponseFlag.Flag.ValueType # 1 + FAILURE_SESSION_ID_NOT_FOUND: DeploySessionResponseFlag.Flag.ValueType # 2 + FAILURE_SESSION_NAME_IN_USE: DeploySessionResponseFlag.Flag.ValueType # 3 + FAILURE_SESSION_NAME_INVALID: DeploySessionResponseFlag.Flag.ValueType # 4 + FAILURE_RESOURCES_CANNOT_BE_ALLOCATED: DeploySessionResponseFlag.Flag.ValueType # 5 + FAILURE_INSUFFICIENT_PRIVILEGES_TO_USE_RESOURCES: DeploySessionResponseFlag.Flag.ValueType # 6 + FAILURE_WEB_PROXY_ENABLED: DeploySessionResponseFlag.Flag.ValueType # 7 + FAILURE_OTHER: DeploySessionResponseFlag.Flag.ValueType # 8 + + STATUS_FIELD_NUMBER: _builtins.int + status: Global___DeploySessionResponseFlag.Flag.ValueType + def __init__( + self, + *, + status: Global___DeploySessionResponseFlag.Flag.ValueType = ..., + ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["status", b"status"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___DeploySessionResponseFlag: _TypeAlias = DeploySessionResponseFlag # noqa: Y015 + +@_typing.final +class EndSessionResponseFlag(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + class _Flag: + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 + + class _FlagEnumTypeWrapper(_enum_type_wrapper._EnumTypeWrapper[EndSessionResponseFlag._Flag.ValueType], _builtins.type): + DESCRIPTOR: _descriptor.EnumDescriptor + SUCCESS: EndSessionResponseFlag._Flag.ValueType # 0 + FAILURE_APPLICATION_STILL_ALIVE: EndSessionResponseFlag._Flag.ValueType # 1 + FAILURE_OTHER: EndSessionResponseFlag._Flag.ValueType # 2 + + class Flag(_Flag, metaclass=_FlagEnumTypeWrapper): ... + SUCCESS: EndSessionResponseFlag.Flag.ValueType # 0 + FAILURE_APPLICATION_STILL_ALIVE: EndSessionResponseFlag.Flag.ValueType # 1 + FAILURE_OTHER: EndSessionResponseFlag.Flag.ValueType # 2 + + STATUS_FIELD_NUMBER: _builtins.int + status: Global___EndSessionResponseFlag.Flag.ValueType + def __init__( + self, + *, + status: Global___EndSessionResponseFlag.Flag.ValueType = ..., + ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["status", b"status"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___EndSessionResponseFlag: _TypeAlias = EndSessionResponseFlag # noqa: Y015 + +@_typing.final +class ValidateSessionRequest(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + @_typing.final + class OptionsEntry(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + KEY_FIELD_NUMBER: _builtins.int + VALUE_FIELD_NUMBER: _builtins.int + key: _builtins.str + value: _builtins.str + def __init__( + self, + *, + key: _builtins.str = ..., + value: _builtins.str = ..., + ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["key", b"key", "value", b"value"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + + TOKEN_FIELD_NUMBER: _builtins.int + PROCESS_MANAGER_FIELD_NUMBER: _builtins.int + PATH_TO_CONFIGURATION_FILE_FIELD_NUMBER: _builtins.int + SSESION_ID_FIELD_NUMBER: _builtins.int + SESSION_NAME_FIELD_NUMBER: _builtins.int + OPTIONS_FIELD_NUMBER: _builtins.int + process_manager: _builtins.str + path_to_configuration_file: _builtins.str + ssesion_id: _builtins.str + session_name: _builtins.str + @_builtins.property + def token(self) -> _token_pb2.Token: ... + @_builtins.property + def options(self) -> _containers.ScalarMap[_builtins.str, _builtins.str]: ... + def __init__( + self, + *, + token: _token_pb2.Token | None = ..., + process_manager: _builtins.str = ..., + path_to_configuration_file: _builtins.str = ..., + ssesion_id: _builtins.str = ..., + session_name: _builtins.str = ..., + options: _abc.Mapping[_builtins.str, _builtins.str] | None = ..., + ) -> None: ... + _HasFieldArgType: _TypeAlias = _typing.Literal["token", b"token"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["options", b"options", "path_to_configuration_file", b"path_to_configuration_file", "process_manager", b"process_manager", "session_name", b"session_name", "ssesion_id", b"ssesion_id", "token", b"token"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___ValidateSessionRequest: _TypeAlias = ValidateSessionRequest # noqa: Y015 + +@_typing.final +class ValidateSessionResponse(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + TOKEN_FIELD_NUMBER: _builtins.int + RESULT_FIELD_NUMBER: _builtins.int + @_builtins.property + def token(self) -> _token_pb2.Token: ... + @_builtins.property + def result(self) -> Global___DeploySessionResponseFlag: ... + def __init__( + self, + *, + token: _token_pb2.Token | None = ..., + result: Global___DeploySessionResponseFlag | None = ..., + ) -> None: ... + _HasFieldArgType: _TypeAlias = _typing.Literal["result", b"result", "token", b"token"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["result", b"result", "token", b"token"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___ValidateSessionResponse: _TypeAlias = ValidateSessionResponse # noqa: Y015 + +@_typing.final +class StartSessionRequest(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + @_typing.final + class OptionsEntry(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + KEY_FIELD_NUMBER: _builtins.int + VALUE_FIELD_NUMBER: _builtins.int + key: _builtins.str + value: _builtins.str + def __init__( + self, + *, + key: _builtins.str = ..., + value: _builtins.str = ..., + ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["key", b"key", "value", b"value"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + + TOKEN_FIELD_NUMBER: _builtins.int + PROCESS_MANAGER_FIELD_NUMBER: _builtins.int + PATH_TO_CONFIGURATION_FILE_FIELD_NUMBER: _builtins.int + SSESION_ID_FIELD_NUMBER: _builtins.int + SESSION_NAME_FIELD_NUMBER: _builtins.int + OPTIONS_FIELD_NUMBER: _builtins.int + process_manager: _builtins.str + path_to_configuration_file: _builtins.str + ssesion_id: _builtins.str + session_name: _builtins.str + @_builtins.property + def token(self) -> _token_pb2.Token: ... + @_builtins.property + def options(self) -> _containers.ScalarMap[_builtins.str, _builtins.str]: ... + def __init__( + self, + *, + token: _token_pb2.Token | None = ..., + process_manager: _builtins.str = ..., + path_to_configuration_file: _builtins.str = ..., + ssesion_id: _builtins.str = ..., + session_name: _builtins.str = ..., + options: _abc.Mapping[_builtins.str, _builtins.str] | None = ..., + ) -> None: ... + _HasFieldArgType: _TypeAlias = _typing.Literal["token", b"token"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["options", b"options", "path_to_configuration_file", b"path_to_configuration_file", "process_manager", b"process_manager", "session_name", b"session_name", "ssesion_id", b"ssesion_id", "token", b"token"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___StartSessionRequest: _TypeAlias = StartSessionRequest # noqa: Y015 + +@_typing.final +class StartSessionResponse(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + TOKEN_FIELD_NUMBER: _builtins.int + RESULT_FIELD_NUMBER: _builtins.int + @_builtins.property + def token(self) -> _token_pb2.Token: ... + @_builtins.property + def result(self) -> Global___DeploySessionResponseFlag: ... + def __init__( + self, + *, + token: _token_pb2.Token | None = ..., + result: Global___DeploySessionResponseFlag | None = ..., + ) -> None: ... + _HasFieldArgType: _TypeAlias = _typing.Literal["result", b"result", "token", b"token"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["result", b"result", "token", b"token"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___StartSessionResponse: _TypeAlias = StartSessionResponse # noqa: Y015 + +@_typing.final +class EndSessionRequest(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + @_typing.final + class OptionsEntry(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + KEY_FIELD_NUMBER: _builtins.int + VALUE_FIELD_NUMBER: _builtins.int + key: _builtins.str + value: _builtins.str + def __init__( + self, + *, + key: _builtins.str = ..., + value: _builtins.str = ..., + ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["key", b"key", "value", b"value"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + + TOKEN_FIELD_NUMBER: _builtins.int + PROCESS_MANAGER_FIELD_NUMBER: _builtins.int + PATH_TO_CONFIGURATION_FILE_FIELD_NUMBER: _builtins.int + SSESION_ID_FIELD_NUMBER: _builtins.int + SESSION_NAME_FIELD_NUMBER: _builtins.int + OPTIONS_FIELD_NUMBER: _builtins.int + process_manager: _builtins.str + path_to_configuration_file: _builtins.str + ssesion_id: _builtins.str + session_name: _builtins.str + @_builtins.property + def token(self) -> _token_pb2.Token: ... + @_builtins.property + def options(self) -> _containers.ScalarMap[_builtins.str, _builtins.str]: ... + def __init__( + self, + *, + token: _token_pb2.Token | None = ..., + process_manager: _builtins.str = ..., + path_to_configuration_file: _builtins.str = ..., + ssesion_id: _builtins.str = ..., + session_name: _builtins.str = ..., + options: _abc.Mapping[_builtins.str, _builtins.str] | None = ..., + ) -> None: ... + _HasFieldArgType: _TypeAlias = _typing.Literal["token", b"token"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["options", b"options", "path_to_configuration_file", b"path_to_configuration_file", "process_manager", b"process_manager", "session_name", b"session_name", "ssesion_id", b"ssesion_id", "token", b"token"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___EndSessionRequest: _TypeAlias = EndSessionRequest # noqa: Y015 + +@_typing.final +class EndSessionResponse(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + TOKEN_FIELD_NUMBER: _builtins.int + RESULT_FIELD_NUMBER: _builtins.int + @_builtins.property + def token(self) -> _token_pb2.Token: ... + @_builtins.property + def result(self) -> Global___EndSessionResponseFlag: ... + def __init__( + self, + *, + token: _token_pb2.Token | None = ..., + result: Global___EndSessionResponseFlag | None = ..., + ) -> None: ... + _HasFieldArgType: _TypeAlias = _typing.Literal["result", b"result", "token", b"token"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["result", b"result", "token", b"token"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___EndSessionResponse: _TypeAlias = EndSessionResponse # noqa: Y015 diff --git a/src/druncschema/run_control_pb2_grpc.py b/src/druncschema/run_control_pb2_grpc.py new file mode 100644 index 0000000..a8bb74d --- /dev/null +++ b/src/druncschema/run_control_pb2_grpc.py @@ -0,0 +1,183 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from druncschema import run_control_pb2 as druncschema_dot_run__control__pb2 + +GRPC_GENERATED_VERSION = '1.75.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in druncschema/run_control_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class RunControlStub(object): + """Missing associated documentation comment in .proto file.""" + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.validate_session = channel.unary_unary( + '/dunedaq.druncschema.run_control.RunControl/validate_session', + request_serializer=druncschema_dot_run__control__pb2.ValidateSessionRequest.SerializeToString, + response_deserializer=druncschema_dot_run__control__pb2.ValidateSessionResponse.FromString, + _registered_method=True) + self.start_session = channel.unary_unary( + '/dunedaq.druncschema.run_control.RunControl/start_session', + request_serializer=druncschema_dot_run__control__pb2.StartSessionRequest.SerializeToString, + response_deserializer=druncschema_dot_run__control__pb2.StartSessionResponse.FromString, + _registered_method=True) + self.end_session = channel.unary_unary( + '/dunedaq.druncschema.run_control.RunControl/end_session', + request_serializer=druncschema_dot_run__control__pb2.EndSessionRequest.SerializeToString, + response_deserializer=druncschema_dot_run__control__pb2.StartSessionResponse.FromString, + _registered_method=True) + + +class RunControlServicer(object): + """Missing associated documentation comment in .proto file.""" + + def validate_session(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def start_session(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def end_session(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_RunControlServicer_to_server(servicer, server): + rpc_method_handlers = { + 'validate_session': grpc.unary_unary_rpc_method_handler( + servicer.validate_session, + request_deserializer=druncschema_dot_run__control__pb2.ValidateSessionRequest.FromString, + response_serializer=druncschema_dot_run__control__pb2.ValidateSessionResponse.SerializeToString, + ), + 'start_session': grpc.unary_unary_rpc_method_handler( + servicer.start_session, + request_deserializer=druncschema_dot_run__control__pb2.StartSessionRequest.FromString, + response_serializer=druncschema_dot_run__control__pb2.StartSessionResponse.SerializeToString, + ), + 'end_session': grpc.unary_unary_rpc_method_handler( + servicer.end_session, + request_deserializer=druncschema_dot_run__control__pb2.EndSessionRequest.FromString, + response_serializer=druncschema_dot_run__control__pb2.StartSessionResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'dunedaq.druncschema.run_control.RunControl', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('dunedaq.druncschema.run_control.RunControl', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class RunControl(object): + """Missing associated documentation comment in .proto file.""" + + @staticmethod + def validate_session(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/dunedaq.druncschema.run_control.RunControl/validate_session', + druncschema_dot_run__control__pb2.ValidateSessionRequest.SerializeToString, + druncschema_dot_run__control__pb2.ValidateSessionResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def start_session(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/dunedaq.druncschema.run_control.RunControl/start_session', + druncschema_dot_run__control__pb2.StartSessionRequest.SerializeToString, + druncschema_dot_run__control__pb2.StartSessionResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def end_session(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/dunedaq.druncschema.run_control.RunControl/end_session', + druncschema_dot_run__control__pb2.EndSessionRequest.SerializeToString, + druncschema_dot_run__control__pb2.StartSessionResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) From 523c828ccb06dbb8e91fa31cd456111033031da6 Mon Sep 17 00:00:00 2001 From: PawelPlesniak Date: Thu, 30 Jul 2026 11:02:45 +0200 Subject: [PATCH 2/6] Extending run control service to include send_msg command --- schema/druncschema/run_control.proto | 3 ++ src/druncschema/run_control_pb2.py | 60 +++++++++++++------------ src/druncschema/run_control_pb2_grpc.py | 45 +++++++++++++++++++ 3 files changed, 79 insertions(+), 29 deletions(-) diff --git a/schema/druncschema/run_control.proto b/schema/druncschema/run_control.proto index 2ba0399..709724c 100644 --- a/schema/druncschema/run_control.proto +++ b/schema/druncschema/run_control.proto @@ -2,12 +2,15 @@ syntax = "proto3"; package dunedaq.druncschema.run_control; +import "druncschema/request_response.proto"; import "druncschema/token.proto"; +import "druncschema/generic.proto"; service RunControl { rpc validate_session (ValidateSessionRequest) returns (ValidateSessionResponse) {} rpc start_session (StartSessionRequest) returns (StartSessionResponse) {} rpc end_session (EndSessionRequest) returns (StartSessionResponse) {} + rpc send_msg (Request) returns (OutcomeStatus) {} } message DeploySessionResponseFlag { diff --git a/src/druncschema/run_control_pb2.py b/src/druncschema/run_control_pb2.py index c5694d6..0c54749 100644 --- a/src/druncschema/run_control_pb2.py +++ b/src/druncschema/run_control_pb2.py @@ -22,10 +22,12 @@ _sym_db = _symbol_database.Default() +from druncschema import request_response_pb2 as druncschema_dot_request__response__pb2 from druncschema import token_pb2 as druncschema_dot_token__pb2 +from druncschema import generic_pb2 as druncschema_dot_generic__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x64runcschema/run_control.proto\x12\x1f\x64unedaq.druncschema.run_control\x1a\x17\x64runcschema/token.proto\"\xa4\x03\n\x19\x44\x65ploySessionResponseFlag\x12O\n\x06status\x18\x01 \x01(\x0e\x32?.dunedaq.druncschema.run_control.DeploySessionResponseFlag.Flag\"\xb5\x02\n\x04\x46lag\x12\x0b\n\x07SUCCESS\x10\x00\x12(\n$FAILURE_CONFIGURATION_FILE_NOT_FOUND\x10\x01\x12 \n\x1c\x46\x41ILURE_SESSION_ID_NOT_FOUND\x10\x02\x12\x1f\n\x1b\x46\x41ILURE_SESSION_NAME_IN_USE\x10\x03\x12 \n\x1c\x46\x41ILURE_SESSION_NAME_INVALID\x10\x04\x12)\n%FAILURE_RESOURCES_CANNOT_BE_ALLOCATED\x10\x05\x12\x34\n0FAILURE_INSUFFICIENT_PRIVILEGES_TO_USE_RESOURCES\x10\x06\x12\x1d\n\x19\x46\x41ILURE_WEB_PROXY_ENABLED\x10\x07\x12\x11\n\rFAILURE_OTHER\x10\x08\"\xb3\x01\n\x16\x45ndSessionResponseFlag\x12L\n\x06status\x18\x01 \x01(\x0e\x32<.dunedaq.druncschema.run_control.EndSessionResponseFlag.Flag\"K\n\x04\x46lag\x12\x0b\n\x07SUCCESS\x10\x00\x12#\n\x1f\x46\x41ILURE_APPLICATION_STILL_ALIVE\x10\x01\x12\x11\n\rFAILURE_OTHER\x10\x02\"\xb1\x02\n\x16ValidateSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12U\n\x07options\x18\x06 \x03(\x0b\x32\x44.dunedaq.druncschema.run_control.ValidateSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x90\x01\n\x17ValidateSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12J\n\x06result\x18\x02 \x01(\x0b\x32:.dunedaq.druncschema.run_control.DeploySessionResponseFlag\"\xab\x02\n\x13StartSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12R\n\x07options\x18\x06 \x03(\x0b\x32\x41.dunedaq.druncschema.run_control.StartSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x8d\x01\n\x14StartSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12J\n\x06result\x18\x02 \x01(\x0b\x32:.dunedaq.druncschema.run_control.DeploySessionResponseFlag\"\xa7\x02\n\x11\x45ndSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12P\n\x07options\x18\x06 \x03(\x0b\x32?.dunedaq.druncschema.run_control.EndSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x88\x01\n\x12\x45ndSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12G\n\x06result\x18\x02 \x01(\x0b\x32\x37.dunedaq.druncschema.run_control.EndSessionResponseFlag2\x92\x03\n\nRunControl\x12\x87\x01\n\x10validate_session\x12\x37.dunedaq.druncschema.run_control.ValidateSessionRequest\x1a\x38.dunedaq.druncschema.run_control.ValidateSessionResponse\"\x00\x12~\n\rstart_session\x12\x34.dunedaq.druncschema.run_control.StartSessionRequest\x1a\x35.dunedaq.druncschema.run_control.StartSessionResponse\"\x00\x12z\n\x0b\x65nd_session\x12\x32.dunedaq.druncschema.run_control.EndSessionRequest\x1a\x35.dunedaq.druncschema.run_control.StartSessionResponse\"\x00\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x64runcschema/run_control.proto\x12\x1f\x64unedaq.druncschema.run_control\x1a\"druncschema/request_response.proto\x1a\x17\x64runcschema/token.proto\x1a\x19\x64runcschema/generic.proto\"\xa4\x03\n\x19\x44\x65ploySessionResponseFlag\x12O\n\x06status\x18\x01 \x01(\x0e\x32?.dunedaq.druncschema.run_control.DeploySessionResponseFlag.Flag\"\xb5\x02\n\x04\x46lag\x12\x0b\n\x07SUCCESS\x10\x00\x12(\n$FAILURE_CONFIGURATION_FILE_NOT_FOUND\x10\x01\x12 \n\x1c\x46\x41ILURE_SESSION_ID_NOT_FOUND\x10\x02\x12\x1f\n\x1b\x46\x41ILURE_SESSION_NAME_IN_USE\x10\x03\x12 \n\x1c\x46\x41ILURE_SESSION_NAME_INVALID\x10\x04\x12)\n%FAILURE_RESOURCES_CANNOT_BE_ALLOCATED\x10\x05\x12\x34\n0FAILURE_INSUFFICIENT_PRIVILEGES_TO_USE_RESOURCES\x10\x06\x12\x1d\n\x19\x46\x41ILURE_WEB_PROXY_ENABLED\x10\x07\x12\x11\n\rFAILURE_OTHER\x10\x08\"\xb3\x01\n\x16\x45ndSessionResponseFlag\x12L\n\x06status\x18\x01 \x01(\x0e\x32<.dunedaq.druncschema.run_control.EndSessionResponseFlag.Flag\"K\n\x04\x46lag\x12\x0b\n\x07SUCCESS\x10\x00\x12#\n\x1f\x46\x41ILURE_APPLICATION_STILL_ALIVE\x10\x01\x12\x11\n\rFAILURE_OTHER\x10\x02\"\xb1\x02\n\x16ValidateSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12U\n\x07options\x18\x06 \x03(\x0b\x32\x44.dunedaq.druncschema.run_control.ValidateSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x90\x01\n\x17ValidateSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12J\n\x06result\x18\x02 \x01(\x0b\x32:.dunedaq.druncschema.run_control.DeploySessionResponseFlag\"\xab\x02\n\x13StartSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12R\n\x07options\x18\x06 \x03(\x0b\x32\x41.dunedaq.druncschema.run_control.StartSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x8d\x01\n\x14StartSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12J\n\x06result\x18\x02 \x01(\x0b\x32:.dunedaq.druncschema.run_control.DeploySessionResponseFlag\"\xa7\x02\n\x11\x45ndSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12P\n\x07options\x18\x06 \x03(\x0b\x32?.dunedaq.druncschema.run_control.EndSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x88\x01\n\x12\x45ndSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12G\n\x06result\x18\x02 \x01(\x0b\x32\x37.dunedaq.druncschema.run_control.EndSessionResponseFlag2\xe2\x03\n\nRunControl\x12\x87\x01\n\x10validate_session\x12\x37.dunedaq.druncschema.run_control.ValidateSessionRequest\x1a\x38.dunedaq.druncschema.run_control.ValidateSessionResponse\"\x00\x12~\n\rstart_session\x12\x34.dunedaq.druncschema.run_control.StartSessionRequest\x1a\x35.dunedaq.druncschema.run_control.StartSessionResponse\"\x00\x12z\n\x0b\x65nd_session\x12\x32.dunedaq.druncschema.run_control.EndSessionRequest\x1a\x35.dunedaq.druncschema.run_control.StartSessionResponse\"\x00\x12N\n\x08send_msg\x12\x1c.dunedaq.druncschema.Request\x1a\".dunedaq.druncschema.OutcomeStatus\"\x00\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -38,32 +40,32 @@ _globals['_STARTSESSIONREQUEST_OPTIONSENTRY']._serialized_options = b'8\001' _globals['_ENDSESSIONREQUEST_OPTIONSENTRY']._loaded_options = None _globals['_ENDSESSIONREQUEST_OPTIONSENTRY']._serialized_options = b'8\001' - _globals['_DEPLOYSESSIONRESPONSEFLAG']._serialized_start=92 - _globals['_DEPLOYSESSIONRESPONSEFLAG']._serialized_end=512 - _globals['_DEPLOYSESSIONRESPONSEFLAG_FLAG']._serialized_start=203 - _globals['_DEPLOYSESSIONRESPONSEFLAG_FLAG']._serialized_end=512 - _globals['_ENDSESSIONRESPONSEFLAG']._serialized_start=515 - _globals['_ENDSESSIONRESPONSEFLAG']._serialized_end=694 - _globals['_ENDSESSIONRESPONSEFLAG_FLAG']._serialized_start=619 - _globals['_ENDSESSIONRESPONSEFLAG_FLAG']._serialized_end=694 - _globals['_VALIDATESESSIONREQUEST']._serialized_start=697 - _globals['_VALIDATESESSIONREQUEST']._serialized_end=1002 - _globals['_VALIDATESESSIONREQUEST_OPTIONSENTRY']._serialized_start=956 - _globals['_VALIDATESESSIONREQUEST_OPTIONSENTRY']._serialized_end=1002 - _globals['_VALIDATESESSIONRESPONSE']._serialized_start=1005 - _globals['_VALIDATESESSIONRESPONSE']._serialized_end=1149 - _globals['_STARTSESSIONREQUEST']._serialized_start=1152 - _globals['_STARTSESSIONREQUEST']._serialized_end=1451 - _globals['_STARTSESSIONREQUEST_OPTIONSENTRY']._serialized_start=956 - _globals['_STARTSESSIONREQUEST_OPTIONSENTRY']._serialized_end=1002 - _globals['_STARTSESSIONRESPONSE']._serialized_start=1454 - _globals['_STARTSESSIONRESPONSE']._serialized_end=1595 - _globals['_ENDSESSIONREQUEST']._serialized_start=1598 - _globals['_ENDSESSIONREQUEST']._serialized_end=1893 - _globals['_ENDSESSIONREQUEST_OPTIONSENTRY']._serialized_start=956 - _globals['_ENDSESSIONREQUEST_OPTIONSENTRY']._serialized_end=1002 - _globals['_ENDSESSIONRESPONSE']._serialized_start=1896 - _globals['_ENDSESSIONRESPONSE']._serialized_end=2032 - _globals['_RUNCONTROL']._serialized_start=2035 - _globals['_RUNCONTROL']._serialized_end=2437 + _globals['_DEPLOYSESSIONRESPONSEFLAG']._serialized_start=155 + _globals['_DEPLOYSESSIONRESPONSEFLAG']._serialized_end=575 + _globals['_DEPLOYSESSIONRESPONSEFLAG_FLAG']._serialized_start=266 + _globals['_DEPLOYSESSIONRESPONSEFLAG_FLAG']._serialized_end=575 + _globals['_ENDSESSIONRESPONSEFLAG']._serialized_start=578 + _globals['_ENDSESSIONRESPONSEFLAG']._serialized_end=757 + _globals['_ENDSESSIONRESPONSEFLAG_FLAG']._serialized_start=682 + _globals['_ENDSESSIONRESPONSEFLAG_FLAG']._serialized_end=757 + _globals['_VALIDATESESSIONREQUEST']._serialized_start=760 + _globals['_VALIDATESESSIONREQUEST']._serialized_end=1065 + _globals['_VALIDATESESSIONREQUEST_OPTIONSENTRY']._serialized_start=1019 + _globals['_VALIDATESESSIONREQUEST_OPTIONSENTRY']._serialized_end=1065 + _globals['_VALIDATESESSIONRESPONSE']._serialized_start=1068 + _globals['_VALIDATESESSIONRESPONSE']._serialized_end=1212 + _globals['_STARTSESSIONREQUEST']._serialized_start=1215 + _globals['_STARTSESSIONREQUEST']._serialized_end=1514 + _globals['_STARTSESSIONREQUEST_OPTIONSENTRY']._serialized_start=1019 + _globals['_STARTSESSIONREQUEST_OPTIONSENTRY']._serialized_end=1065 + _globals['_STARTSESSIONRESPONSE']._serialized_start=1517 + _globals['_STARTSESSIONRESPONSE']._serialized_end=1658 + _globals['_ENDSESSIONREQUEST']._serialized_start=1661 + _globals['_ENDSESSIONREQUEST']._serialized_end=1956 + _globals['_ENDSESSIONREQUEST_OPTIONSENTRY']._serialized_start=1019 + _globals['_ENDSESSIONREQUEST_OPTIONSENTRY']._serialized_end=1065 + _globals['_ENDSESSIONRESPONSE']._serialized_start=1959 + _globals['_ENDSESSIONRESPONSE']._serialized_end=2095 + _globals['_RUNCONTROL']._serialized_start=2098 + _globals['_RUNCONTROL']._serialized_end=2580 # @@protoc_insertion_point(module_scope) diff --git a/src/druncschema/run_control_pb2_grpc.py b/src/druncschema/run_control_pb2_grpc.py index a8bb74d..dd3112f 100644 --- a/src/druncschema/run_control_pb2_grpc.py +++ b/src/druncschema/run_control_pb2_grpc.py @@ -3,6 +3,8 @@ import grpc import warnings +from druncschema import generic_pb2 as druncschema_dot_generic__pb2 +from druncschema import request_response_pb2 as druncschema_dot_request__response__pb2 from druncschema import run_control_pb2 as druncschema_dot_run__control__pb2 GRPC_GENERATED_VERSION = '1.75.0' @@ -49,6 +51,11 @@ def __init__(self, channel): request_serializer=druncschema_dot_run__control__pb2.EndSessionRequest.SerializeToString, response_deserializer=druncschema_dot_run__control__pb2.StartSessionResponse.FromString, _registered_method=True) + self.send_msg = channel.unary_unary( + '/dunedaq.druncschema.run_control.RunControl/send_msg', + request_serializer=druncschema_dot_request__response__pb2.Request.SerializeToString, + response_deserializer=druncschema_dot_generic__pb2.OutcomeStatus.FromString, + _registered_method=True) class RunControlServicer(object): @@ -72,6 +79,12 @@ def end_session(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def send_msg(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def add_RunControlServicer_to_server(servicer, server): rpc_method_handlers = { @@ -90,6 +103,11 @@ def add_RunControlServicer_to_server(servicer, server): request_deserializer=druncschema_dot_run__control__pb2.EndSessionRequest.FromString, response_serializer=druncschema_dot_run__control__pb2.StartSessionResponse.SerializeToString, ), + 'send_msg': grpc.unary_unary_rpc_method_handler( + servicer.send_msg, + request_deserializer=druncschema_dot_request__response__pb2.Request.FromString, + response_serializer=druncschema_dot_generic__pb2.OutcomeStatus.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( 'dunedaq.druncschema.run_control.RunControl', rpc_method_handlers) @@ -181,3 +199,30 @@ def end_session(request, timeout, metadata, _registered_method=True) + + @staticmethod + def send_msg(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/dunedaq.druncschema.run_control.RunControl/send_msg', + druncschema_dot_request__response__pb2.Request.SerializeToString, + druncschema_dot_generic__pb2.OutcomeStatus.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) From 3aa9bc4c5bd82f4fb2ab8fb7857a7231e991f33f Mon Sep 17 00:00:00 2001 From: PawelPlesniak Date: Thu, 30 Jul 2026 15:12:48 +0200 Subject: [PATCH 3/6] Renaming one of the RPC methods to align with what we have in other servers --- schema/druncschema/run_control.proto | 11 ++++- src/druncschema/run_control_pb2.py | 10 +++-- src/druncschema/run_control_pb2.pyi | 44 +++++++++++++++++++ src/druncschema/run_control_pb2_grpc.py | 57 ++++++++++++++++++++++--- 4 files changed, 111 insertions(+), 11 deletions(-) diff --git a/schema/druncschema/run_control.proto b/schema/druncschema/run_control.proto index 709724c..8dca133 100644 --- a/schema/druncschema/run_control.proto +++ b/schema/druncschema/run_control.proto @@ -10,7 +10,8 @@ service RunControl { rpc validate_session (ValidateSessionRequest) returns (ValidateSessionResponse) {} rpc start_session (StartSessionRequest) returns (StartSessionResponse) {} rpc end_session (EndSessionRequest) returns (StartSessionResponse) {} - rpc send_msg (Request) returns (OutcomeStatus) {} + rpc log_on_server (Request) returns (OutcomeStatus) {} + rpc validate_communication (ValidateCommunicationRequest) returns (ValidateCommunicationResponse) {} } message DeploySessionResponseFlag { @@ -79,3 +80,11 @@ message EndSessionResponse { EndSessionResponseFlag result = 2; } +message ValidateCommunicationRequest { + Token token = 1; +} + +message ValidateCommunicationResponse { + Token token = 1; + OutcomeFlag status = 2; +} \ No newline at end of file diff --git a/src/druncschema/run_control_pb2.py b/src/druncschema/run_control_pb2.py index 0c54749..47980c2 100644 --- a/src/druncschema/run_control_pb2.py +++ b/src/druncschema/run_control_pb2.py @@ -27,7 +27,7 @@ from druncschema import generic_pb2 as druncschema_dot_generic__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x64runcschema/run_control.proto\x12\x1f\x64unedaq.druncschema.run_control\x1a\"druncschema/request_response.proto\x1a\x17\x64runcschema/token.proto\x1a\x19\x64runcschema/generic.proto\"\xa4\x03\n\x19\x44\x65ploySessionResponseFlag\x12O\n\x06status\x18\x01 \x01(\x0e\x32?.dunedaq.druncschema.run_control.DeploySessionResponseFlag.Flag\"\xb5\x02\n\x04\x46lag\x12\x0b\n\x07SUCCESS\x10\x00\x12(\n$FAILURE_CONFIGURATION_FILE_NOT_FOUND\x10\x01\x12 \n\x1c\x46\x41ILURE_SESSION_ID_NOT_FOUND\x10\x02\x12\x1f\n\x1b\x46\x41ILURE_SESSION_NAME_IN_USE\x10\x03\x12 \n\x1c\x46\x41ILURE_SESSION_NAME_INVALID\x10\x04\x12)\n%FAILURE_RESOURCES_CANNOT_BE_ALLOCATED\x10\x05\x12\x34\n0FAILURE_INSUFFICIENT_PRIVILEGES_TO_USE_RESOURCES\x10\x06\x12\x1d\n\x19\x46\x41ILURE_WEB_PROXY_ENABLED\x10\x07\x12\x11\n\rFAILURE_OTHER\x10\x08\"\xb3\x01\n\x16\x45ndSessionResponseFlag\x12L\n\x06status\x18\x01 \x01(\x0e\x32<.dunedaq.druncschema.run_control.EndSessionResponseFlag.Flag\"K\n\x04\x46lag\x12\x0b\n\x07SUCCESS\x10\x00\x12#\n\x1f\x46\x41ILURE_APPLICATION_STILL_ALIVE\x10\x01\x12\x11\n\rFAILURE_OTHER\x10\x02\"\xb1\x02\n\x16ValidateSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12U\n\x07options\x18\x06 \x03(\x0b\x32\x44.dunedaq.druncschema.run_control.ValidateSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x90\x01\n\x17ValidateSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12J\n\x06result\x18\x02 \x01(\x0b\x32:.dunedaq.druncschema.run_control.DeploySessionResponseFlag\"\xab\x02\n\x13StartSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12R\n\x07options\x18\x06 \x03(\x0b\x32\x41.dunedaq.druncschema.run_control.StartSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x8d\x01\n\x14StartSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12J\n\x06result\x18\x02 \x01(\x0b\x32:.dunedaq.druncschema.run_control.DeploySessionResponseFlag\"\xa7\x02\n\x11\x45ndSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12P\n\x07options\x18\x06 \x03(\x0b\x32?.dunedaq.druncschema.run_control.EndSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x88\x01\n\x12\x45ndSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12G\n\x06result\x18\x02 \x01(\x0b\x32\x37.dunedaq.druncschema.run_control.EndSessionResponseFlag2\xe2\x03\n\nRunControl\x12\x87\x01\n\x10validate_session\x12\x37.dunedaq.druncschema.run_control.ValidateSessionRequest\x1a\x38.dunedaq.druncschema.run_control.ValidateSessionResponse\"\x00\x12~\n\rstart_session\x12\x34.dunedaq.druncschema.run_control.StartSessionRequest\x1a\x35.dunedaq.druncschema.run_control.StartSessionResponse\"\x00\x12z\n\x0b\x65nd_session\x12\x32.dunedaq.druncschema.run_control.EndSessionRequest\x1a\x35.dunedaq.druncschema.run_control.StartSessionResponse\"\x00\x12N\n\x08send_msg\x12\x1c.dunedaq.druncschema.Request\x1a\".dunedaq.druncschema.OutcomeStatus\"\x00\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x64runcschema/run_control.proto\x12\x1f\x64unedaq.druncschema.run_control\x1a\"druncschema/request_response.proto\x1a\x17\x64runcschema/token.proto\x1a\x19\x64runcschema/generic.proto\"\xa4\x03\n\x19\x44\x65ploySessionResponseFlag\x12O\n\x06status\x18\x01 \x01(\x0e\x32?.dunedaq.druncschema.run_control.DeploySessionResponseFlag.Flag\"\xb5\x02\n\x04\x46lag\x12\x0b\n\x07SUCCESS\x10\x00\x12(\n$FAILURE_CONFIGURATION_FILE_NOT_FOUND\x10\x01\x12 \n\x1c\x46\x41ILURE_SESSION_ID_NOT_FOUND\x10\x02\x12\x1f\n\x1b\x46\x41ILURE_SESSION_NAME_IN_USE\x10\x03\x12 \n\x1c\x46\x41ILURE_SESSION_NAME_INVALID\x10\x04\x12)\n%FAILURE_RESOURCES_CANNOT_BE_ALLOCATED\x10\x05\x12\x34\n0FAILURE_INSUFFICIENT_PRIVILEGES_TO_USE_RESOURCES\x10\x06\x12\x1d\n\x19\x46\x41ILURE_WEB_PROXY_ENABLED\x10\x07\x12\x11\n\rFAILURE_OTHER\x10\x08\"\xb3\x01\n\x16\x45ndSessionResponseFlag\x12L\n\x06status\x18\x01 \x01(\x0e\x32<.dunedaq.druncschema.run_control.EndSessionResponseFlag.Flag\"K\n\x04\x46lag\x12\x0b\n\x07SUCCESS\x10\x00\x12#\n\x1f\x46\x41ILURE_APPLICATION_STILL_ALIVE\x10\x01\x12\x11\n\rFAILURE_OTHER\x10\x02\"\xb1\x02\n\x16ValidateSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12U\n\x07options\x18\x06 \x03(\x0b\x32\x44.dunedaq.druncschema.run_control.ValidateSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x90\x01\n\x17ValidateSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12J\n\x06result\x18\x02 \x01(\x0b\x32:.dunedaq.druncschema.run_control.DeploySessionResponseFlag\"\xab\x02\n\x13StartSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12R\n\x07options\x18\x06 \x03(\x0b\x32\x41.dunedaq.druncschema.run_control.StartSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x8d\x01\n\x14StartSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12J\n\x06result\x18\x02 \x01(\x0b\x32:.dunedaq.druncschema.run_control.DeploySessionResponseFlag\"\xa7\x02\n\x11\x45ndSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12P\n\x07options\x18\x06 \x03(\x0b\x32?.dunedaq.druncschema.run_control.EndSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x88\x01\n\x12\x45ndSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12G\n\x06result\x18\x02 \x01(\x0b\x32\x37.dunedaq.druncschema.run_control.EndSessionResponseFlag\"I\n\x1cValidateCommunicationRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\"|\n\x1dValidateCommunicationResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x30\n\x06status\x18\x02 \x01(\x0e\x32 .dunedaq.druncschema.OutcomeFlag2\x83\x05\n\nRunControl\x12\x87\x01\n\x10validate_session\x12\x37.dunedaq.druncschema.run_control.ValidateSessionRequest\x1a\x38.dunedaq.druncschema.run_control.ValidateSessionResponse\"\x00\x12~\n\rstart_session\x12\x34.dunedaq.druncschema.run_control.StartSessionRequest\x1a\x35.dunedaq.druncschema.run_control.StartSessionResponse\"\x00\x12z\n\x0b\x65nd_session\x12\x32.dunedaq.druncschema.run_control.EndSessionRequest\x1a\x35.dunedaq.druncschema.run_control.StartSessionResponse\"\x00\x12S\n\rlog_on_server\x12\x1c.dunedaq.druncschema.Request\x1a\".dunedaq.druncschema.OutcomeStatus\"\x00\x12\x99\x01\n\x16validate_communication\x12=.dunedaq.druncschema.run_control.ValidateCommunicationRequest\x1a>.dunedaq.druncschema.run_control.ValidateCommunicationResponse\"\x00\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -66,6 +66,10 @@ _globals['_ENDSESSIONREQUEST_OPTIONSENTRY']._serialized_end=1065 _globals['_ENDSESSIONRESPONSE']._serialized_start=1959 _globals['_ENDSESSIONRESPONSE']._serialized_end=2095 - _globals['_RUNCONTROL']._serialized_start=2098 - _globals['_RUNCONTROL']._serialized_end=2580 + _globals['_VALIDATECOMMUNICATIONREQUEST']._serialized_start=2097 + _globals['_VALIDATECOMMUNICATIONREQUEST']._serialized_end=2170 + _globals['_VALIDATECOMMUNICATIONRESPONSE']._serialized_start=2172 + _globals['_VALIDATECOMMUNICATIONRESPONSE']._serialized_end=2296 + _globals['_RUNCONTROL']._serialized_start=2299 + _globals['_RUNCONTROL']._serialized_end=2942 # @@protoc_insertion_point(module_scope) diff --git a/src/druncschema/run_control_pb2.pyi b/src/druncschema/run_control_pb2.pyi index 0140c16..053c6d5 100644 --- a/src/druncschema/run_control_pb2.pyi +++ b/src/druncschema/run_control_pb2.pyi @@ -4,6 +4,7 @@ isort:skip_file """ from collections import abc as _abc +from druncschema import generic_pb2 as _generic_pb2 from druncschema import token_pb2 as _token_pb2 from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -339,3 +340,46 @@ class EndSessionResponse(_message.Message): def WhichOneof(self, oneof_group: _Never) -> None: ... Global___EndSessionResponse: _TypeAlias = EndSessionResponse # noqa: Y015 + +@_typing.final +class ValidateCommunicationRequest(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + TOKEN_FIELD_NUMBER: _builtins.int + @_builtins.property + def token(self) -> _token_pb2.Token: ... + def __init__( + self, + *, + token: _token_pb2.Token | None = ..., + ) -> None: ... + _HasFieldArgType: _TypeAlias = _typing.Literal["token", b"token"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["token", b"token"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___ValidateCommunicationRequest: _TypeAlias = ValidateCommunicationRequest # noqa: Y015 + +@_typing.final +class ValidateCommunicationResponse(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + TOKEN_FIELD_NUMBER: _builtins.int + STATUS_FIELD_NUMBER: _builtins.int + status: _generic_pb2.OutcomeFlag.ValueType + @_builtins.property + def token(self) -> _token_pb2.Token: ... + def __init__( + self, + *, + token: _token_pb2.Token | None = ..., + status: _generic_pb2.OutcomeFlag.ValueType = ..., + ) -> None: ... + _HasFieldArgType: _TypeAlias = _typing.Literal["token", b"token"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["status", b"status", "token", b"token"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___ValidateCommunicationResponse: _TypeAlias = ValidateCommunicationResponse # noqa: Y015 diff --git a/src/druncschema/run_control_pb2_grpc.py b/src/druncschema/run_control_pb2_grpc.py index dd3112f..b9323a3 100644 --- a/src/druncschema/run_control_pb2_grpc.py +++ b/src/druncschema/run_control_pb2_grpc.py @@ -51,11 +51,16 @@ def __init__(self, channel): request_serializer=druncschema_dot_run__control__pb2.EndSessionRequest.SerializeToString, response_deserializer=druncschema_dot_run__control__pb2.StartSessionResponse.FromString, _registered_method=True) - self.send_msg = channel.unary_unary( - '/dunedaq.druncschema.run_control.RunControl/send_msg', + self.log_on_server = channel.unary_unary( + '/dunedaq.druncschema.run_control.RunControl/log_on_server', request_serializer=druncschema_dot_request__response__pb2.Request.SerializeToString, response_deserializer=druncschema_dot_generic__pb2.OutcomeStatus.FromString, _registered_method=True) + self.validate_communication = channel.unary_unary( + '/dunedaq.druncschema.run_control.RunControl/validate_communication', + request_serializer=druncschema_dot_run__control__pb2.ValidateCommunicationRequest.SerializeToString, + response_deserializer=druncschema_dot_run__control__pb2.ValidateCommunicationResponse.FromString, + _registered_method=True) class RunControlServicer(object): @@ -79,7 +84,13 @@ def end_session(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') - def send_msg(self, request, context): + def log_on_server(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def validate_communication(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') @@ -103,11 +114,16 @@ def add_RunControlServicer_to_server(servicer, server): request_deserializer=druncschema_dot_run__control__pb2.EndSessionRequest.FromString, response_serializer=druncschema_dot_run__control__pb2.StartSessionResponse.SerializeToString, ), - 'send_msg': grpc.unary_unary_rpc_method_handler( - servicer.send_msg, + 'log_on_server': grpc.unary_unary_rpc_method_handler( + servicer.log_on_server, request_deserializer=druncschema_dot_request__response__pb2.Request.FromString, response_serializer=druncschema_dot_generic__pb2.OutcomeStatus.SerializeToString, ), + 'validate_communication': grpc.unary_unary_rpc_method_handler( + servicer.validate_communication, + request_deserializer=druncschema_dot_run__control__pb2.ValidateCommunicationRequest.FromString, + response_serializer=druncschema_dot_run__control__pb2.ValidateCommunicationResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( 'dunedaq.druncschema.run_control.RunControl', rpc_method_handlers) @@ -201,7 +217,7 @@ def end_session(request, _registered_method=True) @staticmethod - def send_msg(request, + def log_on_server(request, target, options=(), channel_credentials=None, @@ -214,7 +230,7 @@ def send_msg(request, return grpc.experimental.unary_unary( request, target, - '/dunedaq.druncschema.run_control.RunControl/send_msg', + '/dunedaq.druncschema.run_control.RunControl/log_on_server', druncschema_dot_request__response__pb2.Request.SerializeToString, druncschema_dot_generic__pb2.OutcomeStatus.FromString, options, @@ -226,3 +242,30 @@ def send_msg(request, timeout, metadata, _registered_method=True) + + @staticmethod + def validate_communication(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/dunedaq.druncschema.run_control.RunControl/validate_communication', + druncschema_dot_run__control__pb2.ValidateCommunicationRequest.SerializeToString, + druncschema_dot_run__control__pb2.ValidateCommunicationResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) From d2fdc41b30a945f084102102ed68ef428dad3a84 Mon Sep 17 00:00:00 2001 From: PawelPlesniak Date: Thu, 30 Jul 2026 17:29:35 +0200 Subject: [PATCH 4/6] WIP --- schema/druncschema/run_control.proto | 21 +++++- src/druncschema/run_control_pb2.py | 36 ++++----- src/druncschema/run_control_pb2.pyi | 98 ++++++++++++++++++------- src/druncschema/run_control_pb2_grpc.py | 14 ++-- 4 files changed, 116 insertions(+), 53 deletions(-) diff --git a/schema/druncschema/run_control.proto b/schema/druncschema/run_control.proto index 8dca133..f357a79 100644 --- a/schema/druncschema/run_control.proto +++ b/schema/druncschema/run_control.proto @@ -10,7 +10,7 @@ service RunControl { rpc validate_session (ValidateSessionRequest) returns (ValidateSessionResponse) {} rpc start_session (StartSessionRequest) returns (StartSessionResponse) {} rpc end_session (EndSessionRequest) returns (StartSessionResponse) {} - rpc log_on_server (Request) returns (OutcomeStatus) {} + rpc log_on_server (LogOnServerRequest) returns (LogOnServerResponse) {} rpc validate_communication (ValidateCommunicationRequest) returns (ValidateCommunicationResponse) {} } @@ -58,7 +58,8 @@ message StartSessionRequest { string path_to_configuration_file = 3; string ssesion_id = 4; string session_name = 5; - map options = 6; + string controller_log_level = 6; + float sleep_between_app_boot = 7; } message StartSessionResponse { @@ -87,4 +88,20 @@ message ValidateCommunicationRequest { message ValidateCommunicationResponse { Token token = 1; OutcomeFlag status = 2; +} + +message LogOnServerRequest { + Token token = 1; + string text = 2; + string severity = 3; + string target = 4; + bool execute_along_path = 5; + bool execute_on_all_subsequent_children_in_path = 6; +} + +message LogOnServerResponse { + Token token = 1; + string name = 2; + ResponseFlag flag = 3; + repeated LogOnServerResponse children = 4; } \ No newline at end of file diff --git a/src/druncschema/run_control_pb2.py b/src/druncschema/run_control_pb2.py index 47980c2..06e500b 100644 --- a/src/druncschema/run_control_pb2.py +++ b/src/druncschema/run_control_pb2.py @@ -27,7 +27,7 @@ from druncschema import generic_pb2 as druncschema_dot_generic__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x64runcschema/run_control.proto\x12\x1f\x64unedaq.druncschema.run_control\x1a\"druncschema/request_response.proto\x1a\x17\x64runcschema/token.proto\x1a\x19\x64runcschema/generic.proto\"\xa4\x03\n\x19\x44\x65ploySessionResponseFlag\x12O\n\x06status\x18\x01 \x01(\x0e\x32?.dunedaq.druncschema.run_control.DeploySessionResponseFlag.Flag\"\xb5\x02\n\x04\x46lag\x12\x0b\n\x07SUCCESS\x10\x00\x12(\n$FAILURE_CONFIGURATION_FILE_NOT_FOUND\x10\x01\x12 \n\x1c\x46\x41ILURE_SESSION_ID_NOT_FOUND\x10\x02\x12\x1f\n\x1b\x46\x41ILURE_SESSION_NAME_IN_USE\x10\x03\x12 \n\x1c\x46\x41ILURE_SESSION_NAME_INVALID\x10\x04\x12)\n%FAILURE_RESOURCES_CANNOT_BE_ALLOCATED\x10\x05\x12\x34\n0FAILURE_INSUFFICIENT_PRIVILEGES_TO_USE_RESOURCES\x10\x06\x12\x1d\n\x19\x46\x41ILURE_WEB_PROXY_ENABLED\x10\x07\x12\x11\n\rFAILURE_OTHER\x10\x08\"\xb3\x01\n\x16\x45ndSessionResponseFlag\x12L\n\x06status\x18\x01 \x01(\x0e\x32<.dunedaq.druncschema.run_control.EndSessionResponseFlag.Flag\"K\n\x04\x46lag\x12\x0b\n\x07SUCCESS\x10\x00\x12#\n\x1f\x46\x41ILURE_APPLICATION_STILL_ALIVE\x10\x01\x12\x11\n\rFAILURE_OTHER\x10\x02\"\xb1\x02\n\x16ValidateSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12U\n\x07options\x18\x06 \x03(\x0b\x32\x44.dunedaq.druncschema.run_control.ValidateSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x90\x01\n\x17ValidateSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12J\n\x06result\x18\x02 \x01(\x0b\x32:.dunedaq.druncschema.run_control.DeploySessionResponseFlag\"\xab\x02\n\x13StartSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12R\n\x07options\x18\x06 \x03(\x0b\x32\x41.dunedaq.druncschema.run_control.StartSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x8d\x01\n\x14StartSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12J\n\x06result\x18\x02 \x01(\x0b\x32:.dunedaq.druncschema.run_control.DeploySessionResponseFlag\"\xa7\x02\n\x11\x45ndSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12P\n\x07options\x18\x06 \x03(\x0b\x32?.dunedaq.druncschema.run_control.EndSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x88\x01\n\x12\x45ndSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12G\n\x06result\x18\x02 \x01(\x0b\x32\x37.dunedaq.druncschema.run_control.EndSessionResponseFlag\"I\n\x1cValidateCommunicationRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\"|\n\x1dValidateCommunicationResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x30\n\x06status\x18\x02 \x01(\x0e\x32 .dunedaq.druncschema.OutcomeFlag2\x83\x05\n\nRunControl\x12\x87\x01\n\x10validate_session\x12\x37.dunedaq.druncschema.run_control.ValidateSessionRequest\x1a\x38.dunedaq.druncschema.run_control.ValidateSessionResponse\"\x00\x12~\n\rstart_session\x12\x34.dunedaq.druncschema.run_control.StartSessionRequest\x1a\x35.dunedaq.druncschema.run_control.StartSessionResponse\"\x00\x12z\n\x0b\x65nd_session\x12\x32.dunedaq.druncschema.run_control.EndSessionRequest\x1a\x35.dunedaq.druncschema.run_control.StartSessionResponse\"\x00\x12S\n\rlog_on_server\x12\x1c.dunedaq.druncschema.Request\x1a\".dunedaq.druncschema.OutcomeStatus\"\x00\x12\x99\x01\n\x16validate_communication\x12=.dunedaq.druncschema.run_control.ValidateCommunicationRequest\x1a>.dunedaq.druncschema.run_control.ValidateCommunicationResponse\"\x00\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x64runcschema/run_control.proto\x12\x1f\x64unedaq.druncschema.run_control\x1a\"druncschema/request_response.proto\x1a\x17\x64runcschema/token.proto\x1a\x19\x64runcschema/generic.proto\"\xa4\x03\n\x19\x44\x65ploySessionResponseFlag\x12O\n\x06status\x18\x01 \x01(\x0e\x32?.dunedaq.druncschema.run_control.DeploySessionResponseFlag.Flag\"\xb5\x02\n\x04\x46lag\x12\x0b\n\x07SUCCESS\x10\x00\x12(\n$FAILURE_CONFIGURATION_FILE_NOT_FOUND\x10\x01\x12 \n\x1c\x46\x41ILURE_SESSION_ID_NOT_FOUND\x10\x02\x12\x1f\n\x1b\x46\x41ILURE_SESSION_NAME_IN_USE\x10\x03\x12 \n\x1c\x46\x41ILURE_SESSION_NAME_INVALID\x10\x04\x12)\n%FAILURE_RESOURCES_CANNOT_BE_ALLOCATED\x10\x05\x12\x34\n0FAILURE_INSUFFICIENT_PRIVILEGES_TO_USE_RESOURCES\x10\x06\x12\x1d\n\x19\x46\x41ILURE_WEB_PROXY_ENABLED\x10\x07\x12\x11\n\rFAILURE_OTHER\x10\x08\"\xb3\x01\n\x16\x45ndSessionResponseFlag\x12L\n\x06status\x18\x01 \x01(\x0e\x32<.dunedaq.druncschema.run_control.EndSessionResponseFlag.Flag\"K\n\x04\x46lag\x12\x0b\n\x07SUCCESS\x10\x00\x12#\n\x1f\x46\x41ILURE_APPLICATION_STILL_ALIVE\x10\x01\x12\x11\n\rFAILURE_OTHER\x10\x02\"\xb1\x02\n\x16ValidateSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12U\n\x07options\x18\x06 \x03(\x0b\x32\x44.dunedaq.druncschema.run_control.ValidateSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x90\x01\n\x17ValidateSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12J\n\x06result\x18\x02 \x01(\x0b\x32:.dunedaq.druncschema.run_control.DeploySessionResponseFlag\"\xe5\x01\n\x13StartSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12\x1c\n\x14\x63ontroller_log_level\x18\x06 \x01(\t\x12\x1e\n\x16sleep_between_app_boot\x18\x07 \x01(\x02\"\x8d\x01\n\x14StartSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12J\n\x06result\x18\x02 \x01(\x0b\x32:.dunedaq.druncschema.run_control.DeploySessionResponseFlag\"\xa7\x02\n\x11\x45ndSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12P\n\x07options\x18\x06 \x03(\x0b\x32?.dunedaq.druncschema.run_control.EndSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x88\x01\n\x12\x45ndSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12G\n\x06result\x18\x02 \x01(\x0b\x32\x37.dunedaq.druncschema.run_control.EndSessionResponseFlag\"I\n\x1cValidateCommunicationRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\"|\n\x1dValidateCommunicationResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x30\n\x06status\x18\x02 \x01(\x0e\x32 .dunedaq.druncschema.OutcomeFlag\"\xbf\x01\n\x12LogOnServerRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x0c\n\x04text\x18\x02 \x01(\t\x12\x10\n\x08severity\x18\x03 \x01(\t\x12\x0e\n\x06target\x18\x04 \x01(\t\x12\x1a\n\x12\x65xecute_along_path\x18\x05 \x01(\x08\x12\x32\n*execute_on_all_subsequent_children_in_path\x18\x06 \x01(\x08\"\xc7\x01\n\x13LogOnServerResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x0c\n\x04name\x18\x02 \x01(\t\x12/\n\x04\x66lag\x18\x03 \x01(\x0e\x32!.dunedaq.druncschema.ResponseFlag\x12\x46\n\x08\x63hildren\x18\x04 \x03(\x0b\x32\x34.dunedaq.druncschema.run_control.LogOnServerResponse2\xac\x05\n\nRunControl\x12\x87\x01\n\x10validate_session\x12\x37.dunedaq.druncschema.run_control.ValidateSessionRequest\x1a\x38.dunedaq.druncschema.run_control.ValidateSessionResponse\"\x00\x12~\n\rstart_session\x12\x34.dunedaq.druncschema.run_control.StartSessionRequest\x1a\x35.dunedaq.druncschema.run_control.StartSessionResponse\"\x00\x12z\n\x0b\x65nd_session\x12\x32.dunedaq.druncschema.run_control.EndSessionRequest\x1a\x35.dunedaq.druncschema.run_control.StartSessionResponse\"\x00\x12|\n\rlog_on_server\x12\x33.dunedaq.druncschema.run_control.LogOnServerRequest\x1a\x34.dunedaq.druncschema.run_control.LogOnServerResponse\"\x00\x12\x99\x01\n\x16validate_communication\x12=.dunedaq.druncschema.run_control.ValidateCommunicationRequest\x1a>.dunedaq.druncschema.run_control.ValidateCommunicationResponse\"\x00\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -36,8 +36,6 @@ DESCRIPTOR._loaded_options = None _globals['_VALIDATESESSIONREQUEST_OPTIONSENTRY']._loaded_options = None _globals['_VALIDATESESSIONREQUEST_OPTIONSENTRY']._serialized_options = b'8\001' - _globals['_STARTSESSIONREQUEST_OPTIONSENTRY']._loaded_options = None - _globals['_STARTSESSIONREQUEST_OPTIONSENTRY']._serialized_options = b'8\001' _globals['_ENDSESSIONREQUEST_OPTIONSENTRY']._loaded_options = None _globals['_ENDSESSIONREQUEST_OPTIONSENTRY']._serialized_options = b'8\001' _globals['_DEPLOYSESSIONRESPONSEFLAG']._serialized_start=155 @@ -55,21 +53,23 @@ _globals['_VALIDATESESSIONRESPONSE']._serialized_start=1068 _globals['_VALIDATESESSIONRESPONSE']._serialized_end=1212 _globals['_STARTSESSIONREQUEST']._serialized_start=1215 - _globals['_STARTSESSIONREQUEST']._serialized_end=1514 - _globals['_STARTSESSIONREQUEST_OPTIONSENTRY']._serialized_start=1019 - _globals['_STARTSESSIONREQUEST_OPTIONSENTRY']._serialized_end=1065 - _globals['_STARTSESSIONRESPONSE']._serialized_start=1517 - _globals['_STARTSESSIONRESPONSE']._serialized_end=1658 - _globals['_ENDSESSIONREQUEST']._serialized_start=1661 - _globals['_ENDSESSIONREQUEST']._serialized_end=1956 + _globals['_STARTSESSIONREQUEST']._serialized_end=1444 + _globals['_STARTSESSIONRESPONSE']._serialized_start=1447 + _globals['_STARTSESSIONRESPONSE']._serialized_end=1588 + _globals['_ENDSESSIONREQUEST']._serialized_start=1591 + _globals['_ENDSESSIONREQUEST']._serialized_end=1886 _globals['_ENDSESSIONREQUEST_OPTIONSENTRY']._serialized_start=1019 _globals['_ENDSESSIONREQUEST_OPTIONSENTRY']._serialized_end=1065 - _globals['_ENDSESSIONRESPONSE']._serialized_start=1959 - _globals['_ENDSESSIONRESPONSE']._serialized_end=2095 - _globals['_VALIDATECOMMUNICATIONREQUEST']._serialized_start=2097 - _globals['_VALIDATECOMMUNICATIONREQUEST']._serialized_end=2170 - _globals['_VALIDATECOMMUNICATIONRESPONSE']._serialized_start=2172 - _globals['_VALIDATECOMMUNICATIONRESPONSE']._serialized_end=2296 - _globals['_RUNCONTROL']._serialized_start=2299 - _globals['_RUNCONTROL']._serialized_end=2942 + _globals['_ENDSESSIONRESPONSE']._serialized_start=1889 + _globals['_ENDSESSIONRESPONSE']._serialized_end=2025 + _globals['_VALIDATECOMMUNICATIONREQUEST']._serialized_start=2027 + _globals['_VALIDATECOMMUNICATIONREQUEST']._serialized_end=2100 + _globals['_VALIDATECOMMUNICATIONRESPONSE']._serialized_start=2102 + _globals['_VALIDATECOMMUNICATIONRESPONSE']._serialized_end=2226 + _globals['_LOGONSERVERREQUEST']._serialized_start=2229 + _globals['_LOGONSERVERREQUEST']._serialized_end=2420 + _globals['_LOGONSERVERRESPONSE']._serialized_start=2423 + _globals['_LOGONSERVERRESPONSE']._serialized_end=2622 + _globals['_RUNCONTROL']._serialized_start=2625 + _globals['_RUNCONTROL']._serialized_end=3309 # @@protoc_insertion_point(module_scope) diff --git a/src/druncschema/run_control_pb2.pyi b/src/druncschema/run_control_pb2.pyi index 053c6d5..cd61d92 100644 --- a/src/druncschema/run_control_pb2.pyi +++ b/src/druncschema/run_control_pb2.pyi @@ -5,6 +5,7 @@ isort:skip_file from collections import abc as _abc from druncschema import generic_pb2 as _generic_pb2 +from druncschema import request_response_pb2 as _request_response_pb2 from druncschema import token_pb2 as _token_pb2 from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -185,40 +186,21 @@ Global___ValidateSessionResponse: _TypeAlias = ValidateSessionResponse # noqa: class StartSessionRequest(_message.Message): DESCRIPTOR: _descriptor.Descriptor - @_typing.final - class OptionsEntry(_message.Message): - DESCRIPTOR: _descriptor.Descriptor - - KEY_FIELD_NUMBER: _builtins.int - VALUE_FIELD_NUMBER: _builtins.int - key: _builtins.str - value: _builtins.str - def __init__( - self, - *, - key: _builtins.str = ..., - value: _builtins.str = ..., - ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... - _ClearFieldArgType: _TypeAlias = _typing.Literal["key", b"key", "value", b"value"] # noqa: Y015 - def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... - TOKEN_FIELD_NUMBER: _builtins.int PROCESS_MANAGER_FIELD_NUMBER: _builtins.int PATH_TO_CONFIGURATION_FILE_FIELD_NUMBER: _builtins.int SSESION_ID_FIELD_NUMBER: _builtins.int SESSION_NAME_FIELD_NUMBER: _builtins.int - OPTIONS_FIELD_NUMBER: _builtins.int + CONTROLLER_LOG_LEVEL_FIELD_NUMBER: _builtins.int + SLEEP_BETWEEN_APP_BOOT_FIELD_NUMBER: _builtins.int process_manager: _builtins.str path_to_configuration_file: _builtins.str ssesion_id: _builtins.str session_name: _builtins.str + controller_log_level: _builtins.str + sleep_between_app_boot: _builtins.float @_builtins.property def token(self) -> _token_pb2.Token: ... - @_builtins.property - def options(self) -> _containers.ScalarMap[_builtins.str, _builtins.str]: ... def __init__( self, *, @@ -227,11 +209,12 @@ class StartSessionRequest(_message.Message): path_to_configuration_file: _builtins.str = ..., ssesion_id: _builtins.str = ..., session_name: _builtins.str = ..., - options: _abc.Mapping[_builtins.str, _builtins.str] | None = ..., + controller_log_level: _builtins.str = ..., + sleep_between_app_boot: _builtins.float = ..., ) -> None: ... _HasFieldArgType: _TypeAlias = _typing.Literal["token", b"token"] # noqa: Y015 def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... - _ClearFieldArgType: _TypeAlias = _typing.Literal["options", b"options", "path_to_configuration_file", b"path_to_configuration_file", "process_manager", b"process_manager", "session_name", b"session_name", "ssesion_id", b"ssesion_id", "token", b"token"] # noqa: Y015 + _ClearFieldArgType: _TypeAlias = _typing.Literal["controller_log_level", b"controller_log_level", "path_to_configuration_file", b"path_to_configuration_file", "process_manager", b"process_manager", "session_name", b"session_name", "sleep_between_app_boot", b"sleep_between_app_boot", "ssesion_id", b"ssesion_id", "token", b"token"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... def WhichOneof(self, oneof_group: _Never) -> None: ... @@ -383,3 +366,68 @@ class ValidateCommunicationResponse(_message.Message): def WhichOneof(self, oneof_group: _Never) -> None: ... Global___ValidateCommunicationResponse: _TypeAlias = ValidateCommunicationResponse # noqa: Y015 + +@_typing.final +class LogOnServerRequest(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + TOKEN_FIELD_NUMBER: _builtins.int + TEXT_FIELD_NUMBER: _builtins.int + SEVERITY_FIELD_NUMBER: _builtins.int + TARGET_FIELD_NUMBER: _builtins.int + EXECUTE_ALONG_PATH_FIELD_NUMBER: _builtins.int + EXECUTE_ON_ALL_SUBSEQUENT_CHILDREN_IN_PATH_FIELD_NUMBER: _builtins.int + text: _builtins.str + severity: _builtins.str + target: _builtins.str + execute_along_path: _builtins.bool + execute_on_all_subsequent_children_in_path: _builtins.bool + @_builtins.property + def token(self) -> _token_pb2.Token: ... + def __init__( + self, + *, + token: _token_pb2.Token | None = ..., + text: _builtins.str = ..., + severity: _builtins.str = ..., + target: _builtins.str = ..., + execute_along_path: _builtins.bool = ..., + execute_on_all_subsequent_children_in_path: _builtins.bool = ..., + ) -> None: ... + _HasFieldArgType: _TypeAlias = _typing.Literal["token", b"token"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["execute_along_path", b"execute_along_path", "execute_on_all_subsequent_children_in_path", b"execute_on_all_subsequent_children_in_path", "severity", b"severity", "target", b"target", "text", b"text", "token", b"token"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___LogOnServerRequest: _TypeAlias = LogOnServerRequest # noqa: Y015 + +@_typing.final +class LogOnServerResponse(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + TOKEN_FIELD_NUMBER: _builtins.int + NAME_FIELD_NUMBER: _builtins.int + FLAG_FIELD_NUMBER: _builtins.int + CHILDREN_FIELD_NUMBER: _builtins.int + name: _builtins.str + flag: _request_response_pb2.ResponseFlag.ValueType + @_builtins.property + def token(self) -> _token_pb2.Token: ... + @_builtins.property + def children(self) -> _containers.RepeatedCompositeFieldContainer[Global___LogOnServerResponse]: ... + def __init__( + self, + *, + token: _token_pb2.Token | None = ..., + name: _builtins.str = ..., + flag: _request_response_pb2.ResponseFlag.ValueType = ..., + children: _abc.Iterable[Global___LogOnServerResponse] | None = ..., + ) -> None: ... + _HasFieldArgType: _TypeAlias = _typing.Literal["token", b"token"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["children", b"children", "flag", b"flag", "name", b"name", "token", b"token"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___LogOnServerResponse: _TypeAlias = LogOnServerResponse # noqa: Y015 diff --git a/src/druncschema/run_control_pb2_grpc.py b/src/druncschema/run_control_pb2_grpc.py index b9323a3..c04d127 100644 --- a/src/druncschema/run_control_pb2_grpc.py +++ b/src/druncschema/run_control_pb2_grpc.py @@ -3,8 +3,6 @@ import grpc import warnings -from druncschema import generic_pb2 as druncschema_dot_generic__pb2 -from druncschema import request_response_pb2 as druncschema_dot_request__response__pb2 from druncschema import run_control_pb2 as druncschema_dot_run__control__pb2 GRPC_GENERATED_VERSION = '1.75.0' @@ -53,8 +51,8 @@ def __init__(self, channel): _registered_method=True) self.log_on_server = channel.unary_unary( '/dunedaq.druncschema.run_control.RunControl/log_on_server', - request_serializer=druncschema_dot_request__response__pb2.Request.SerializeToString, - response_deserializer=druncschema_dot_generic__pb2.OutcomeStatus.FromString, + request_serializer=druncschema_dot_run__control__pb2.LogOnServerRequest.SerializeToString, + response_deserializer=druncschema_dot_run__control__pb2.LogOnServerResponse.FromString, _registered_method=True) self.validate_communication = channel.unary_unary( '/dunedaq.druncschema.run_control.RunControl/validate_communication', @@ -116,8 +114,8 @@ def add_RunControlServicer_to_server(servicer, server): ), 'log_on_server': grpc.unary_unary_rpc_method_handler( servicer.log_on_server, - request_deserializer=druncschema_dot_request__response__pb2.Request.FromString, - response_serializer=druncschema_dot_generic__pb2.OutcomeStatus.SerializeToString, + request_deserializer=druncschema_dot_run__control__pb2.LogOnServerRequest.FromString, + response_serializer=druncschema_dot_run__control__pb2.LogOnServerResponse.SerializeToString, ), 'validate_communication': grpc.unary_unary_rpc_method_handler( servicer.validate_communication, @@ -231,8 +229,8 @@ def log_on_server(request, request, target, '/dunedaq.druncschema.run_control.RunControl/log_on_server', - druncschema_dot_request__response__pb2.Request.SerializeToString, - druncschema_dot_generic__pb2.OutcomeStatus.FromString, + druncschema_dot_run__control__pb2.LogOnServerRequest.SerializeToString, + druncschema_dot_run__control__pb2.LogOnServerResponse.FromString, options, channel_credentials, insecure, From 50eb889f94b87fbdfb6cb066fbf3f0704678a5ca Mon Sep 17 00:00:00 2001 From: PawelPlesniak Date: Thu, 30 Jul 2026 17:45:25 +0200 Subject: [PATCH 5/6] Start session now works --- schema/druncschema/run_control.proto | 7 +++--- src/druncschema/run_control_pb2.py | 36 ++++++++++++++-------------- src/druncschema/run_control_pb2.pyi | 11 +++++---- 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/schema/druncschema/run_control.proto b/schema/druncschema/run_control.proto index f357a79..3c6b889 100644 --- a/schema/druncschema/run_control.proto +++ b/schema/druncschema/run_control.proto @@ -56,10 +56,11 @@ message StartSessionRequest { Token token = 1; string process_manager = 2; string path_to_configuration_file = 3; - string ssesion_id = 4; + string session_id = 4; string session_name = 5; - string controller_log_level = 6; - float sleep_between_app_boot = 7; + bool override_logs = 6; + string controller_log_level = 7; + float sleep_between_app_boot = 8; } message StartSessionResponse { diff --git a/src/druncschema/run_control_pb2.py b/src/druncschema/run_control_pb2.py index 06e500b..f70a058 100644 --- a/src/druncschema/run_control_pb2.py +++ b/src/druncschema/run_control_pb2.py @@ -27,7 +27,7 @@ from druncschema import generic_pb2 as druncschema_dot_generic__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x64runcschema/run_control.proto\x12\x1f\x64unedaq.druncschema.run_control\x1a\"druncschema/request_response.proto\x1a\x17\x64runcschema/token.proto\x1a\x19\x64runcschema/generic.proto\"\xa4\x03\n\x19\x44\x65ploySessionResponseFlag\x12O\n\x06status\x18\x01 \x01(\x0e\x32?.dunedaq.druncschema.run_control.DeploySessionResponseFlag.Flag\"\xb5\x02\n\x04\x46lag\x12\x0b\n\x07SUCCESS\x10\x00\x12(\n$FAILURE_CONFIGURATION_FILE_NOT_FOUND\x10\x01\x12 \n\x1c\x46\x41ILURE_SESSION_ID_NOT_FOUND\x10\x02\x12\x1f\n\x1b\x46\x41ILURE_SESSION_NAME_IN_USE\x10\x03\x12 \n\x1c\x46\x41ILURE_SESSION_NAME_INVALID\x10\x04\x12)\n%FAILURE_RESOURCES_CANNOT_BE_ALLOCATED\x10\x05\x12\x34\n0FAILURE_INSUFFICIENT_PRIVILEGES_TO_USE_RESOURCES\x10\x06\x12\x1d\n\x19\x46\x41ILURE_WEB_PROXY_ENABLED\x10\x07\x12\x11\n\rFAILURE_OTHER\x10\x08\"\xb3\x01\n\x16\x45ndSessionResponseFlag\x12L\n\x06status\x18\x01 \x01(\x0e\x32<.dunedaq.druncschema.run_control.EndSessionResponseFlag.Flag\"K\n\x04\x46lag\x12\x0b\n\x07SUCCESS\x10\x00\x12#\n\x1f\x46\x41ILURE_APPLICATION_STILL_ALIVE\x10\x01\x12\x11\n\rFAILURE_OTHER\x10\x02\"\xb1\x02\n\x16ValidateSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12U\n\x07options\x18\x06 \x03(\x0b\x32\x44.dunedaq.druncschema.run_control.ValidateSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x90\x01\n\x17ValidateSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12J\n\x06result\x18\x02 \x01(\x0b\x32:.dunedaq.druncschema.run_control.DeploySessionResponseFlag\"\xe5\x01\n\x13StartSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12\x1c\n\x14\x63ontroller_log_level\x18\x06 \x01(\t\x12\x1e\n\x16sleep_between_app_boot\x18\x07 \x01(\x02\"\x8d\x01\n\x14StartSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12J\n\x06result\x18\x02 \x01(\x0b\x32:.dunedaq.druncschema.run_control.DeploySessionResponseFlag\"\xa7\x02\n\x11\x45ndSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12P\n\x07options\x18\x06 \x03(\x0b\x32?.dunedaq.druncschema.run_control.EndSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x88\x01\n\x12\x45ndSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12G\n\x06result\x18\x02 \x01(\x0b\x32\x37.dunedaq.druncschema.run_control.EndSessionResponseFlag\"I\n\x1cValidateCommunicationRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\"|\n\x1dValidateCommunicationResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x30\n\x06status\x18\x02 \x01(\x0e\x32 .dunedaq.druncschema.OutcomeFlag\"\xbf\x01\n\x12LogOnServerRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x0c\n\x04text\x18\x02 \x01(\t\x12\x10\n\x08severity\x18\x03 \x01(\t\x12\x0e\n\x06target\x18\x04 \x01(\t\x12\x1a\n\x12\x65xecute_along_path\x18\x05 \x01(\x08\x12\x32\n*execute_on_all_subsequent_children_in_path\x18\x06 \x01(\x08\"\xc7\x01\n\x13LogOnServerResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x0c\n\x04name\x18\x02 \x01(\t\x12/\n\x04\x66lag\x18\x03 \x01(\x0e\x32!.dunedaq.druncschema.ResponseFlag\x12\x46\n\x08\x63hildren\x18\x04 \x03(\x0b\x32\x34.dunedaq.druncschema.run_control.LogOnServerResponse2\xac\x05\n\nRunControl\x12\x87\x01\n\x10validate_session\x12\x37.dunedaq.druncschema.run_control.ValidateSessionRequest\x1a\x38.dunedaq.druncschema.run_control.ValidateSessionResponse\"\x00\x12~\n\rstart_session\x12\x34.dunedaq.druncschema.run_control.StartSessionRequest\x1a\x35.dunedaq.druncschema.run_control.StartSessionResponse\"\x00\x12z\n\x0b\x65nd_session\x12\x32.dunedaq.druncschema.run_control.EndSessionRequest\x1a\x35.dunedaq.druncschema.run_control.StartSessionResponse\"\x00\x12|\n\rlog_on_server\x12\x33.dunedaq.druncschema.run_control.LogOnServerRequest\x1a\x34.dunedaq.druncschema.run_control.LogOnServerResponse\"\x00\x12\x99\x01\n\x16validate_communication\x12=.dunedaq.druncschema.run_control.ValidateCommunicationRequest\x1a>.dunedaq.druncschema.run_control.ValidateCommunicationResponse\"\x00\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x64runcschema/run_control.proto\x12\x1f\x64unedaq.druncschema.run_control\x1a\"druncschema/request_response.proto\x1a\x17\x64runcschema/token.proto\x1a\x19\x64runcschema/generic.proto\"\xa4\x03\n\x19\x44\x65ploySessionResponseFlag\x12O\n\x06status\x18\x01 \x01(\x0e\x32?.dunedaq.druncschema.run_control.DeploySessionResponseFlag.Flag\"\xb5\x02\n\x04\x46lag\x12\x0b\n\x07SUCCESS\x10\x00\x12(\n$FAILURE_CONFIGURATION_FILE_NOT_FOUND\x10\x01\x12 \n\x1c\x46\x41ILURE_SESSION_ID_NOT_FOUND\x10\x02\x12\x1f\n\x1b\x46\x41ILURE_SESSION_NAME_IN_USE\x10\x03\x12 \n\x1c\x46\x41ILURE_SESSION_NAME_INVALID\x10\x04\x12)\n%FAILURE_RESOURCES_CANNOT_BE_ALLOCATED\x10\x05\x12\x34\n0FAILURE_INSUFFICIENT_PRIVILEGES_TO_USE_RESOURCES\x10\x06\x12\x1d\n\x19\x46\x41ILURE_WEB_PROXY_ENABLED\x10\x07\x12\x11\n\rFAILURE_OTHER\x10\x08\"\xb3\x01\n\x16\x45ndSessionResponseFlag\x12L\n\x06status\x18\x01 \x01(\x0e\x32<.dunedaq.druncschema.run_control.EndSessionResponseFlag.Flag\"K\n\x04\x46lag\x12\x0b\n\x07SUCCESS\x10\x00\x12#\n\x1f\x46\x41ILURE_APPLICATION_STILL_ALIVE\x10\x01\x12\x11\n\rFAILURE_OTHER\x10\x02\"\xb1\x02\n\x16ValidateSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12U\n\x07options\x18\x06 \x03(\x0b\x32\x44.dunedaq.druncschema.run_control.ValidateSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x90\x01\n\x17ValidateSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12J\n\x06result\x18\x02 \x01(\x0b\x32:.dunedaq.druncschema.run_control.DeploySessionResponseFlag\"\xfc\x01\n\x13StartSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nsession_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12\x15\n\roverride_logs\x18\x06 \x01(\x08\x12\x1c\n\x14\x63ontroller_log_level\x18\x07 \x01(\t\x12\x1e\n\x16sleep_between_app_boot\x18\x08 \x01(\x02\"\x8d\x01\n\x14StartSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12J\n\x06result\x18\x02 \x01(\x0b\x32:.dunedaq.druncschema.run_control.DeploySessionResponseFlag\"\xa7\x02\n\x11\x45ndSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12P\n\x07options\x18\x06 \x03(\x0b\x32?.dunedaq.druncschema.run_control.EndSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x88\x01\n\x12\x45ndSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12G\n\x06result\x18\x02 \x01(\x0b\x32\x37.dunedaq.druncschema.run_control.EndSessionResponseFlag\"I\n\x1cValidateCommunicationRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\"|\n\x1dValidateCommunicationResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x30\n\x06status\x18\x02 \x01(\x0e\x32 .dunedaq.druncschema.OutcomeFlag\"\xbf\x01\n\x12LogOnServerRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x0c\n\x04text\x18\x02 \x01(\t\x12\x10\n\x08severity\x18\x03 \x01(\t\x12\x0e\n\x06target\x18\x04 \x01(\t\x12\x1a\n\x12\x65xecute_along_path\x18\x05 \x01(\x08\x12\x32\n*execute_on_all_subsequent_children_in_path\x18\x06 \x01(\x08\"\xc7\x01\n\x13LogOnServerResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x0c\n\x04name\x18\x02 \x01(\t\x12/\n\x04\x66lag\x18\x03 \x01(\x0e\x32!.dunedaq.druncschema.ResponseFlag\x12\x46\n\x08\x63hildren\x18\x04 \x03(\x0b\x32\x34.dunedaq.druncschema.run_control.LogOnServerResponse2\xac\x05\n\nRunControl\x12\x87\x01\n\x10validate_session\x12\x37.dunedaq.druncschema.run_control.ValidateSessionRequest\x1a\x38.dunedaq.druncschema.run_control.ValidateSessionResponse\"\x00\x12~\n\rstart_session\x12\x34.dunedaq.druncschema.run_control.StartSessionRequest\x1a\x35.dunedaq.druncschema.run_control.StartSessionResponse\"\x00\x12z\n\x0b\x65nd_session\x12\x32.dunedaq.druncschema.run_control.EndSessionRequest\x1a\x35.dunedaq.druncschema.run_control.StartSessionResponse\"\x00\x12|\n\rlog_on_server\x12\x33.dunedaq.druncschema.run_control.LogOnServerRequest\x1a\x34.dunedaq.druncschema.run_control.LogOnServerResponse\"\x00\x12\x99\x01\n\x16validate_communication\x12=.dunedaq.druncschema.run_control.ValidateCommunicationRequest\x1a>.dunedaq.druncschema.run_control.ValidateCommunicationResponse\"\x00\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -53,23 +53,23 @@ _globals['_VALIDATESESSIONRESPONSE']._serialized_start=1068 _globals['_VALIDATESESSIONRESPONSE']._serialized_end=1212 _globals['_STARTSESSIONREQUEST']._serialized_start=1215 - _globals['_STARTSESSIONREQUEST']._serialized_end=1444 - _globals['_STARTSESSIONRESPONSE']._serialized_start=1447 - _globals['_STARTSESSIONRESPONSE']._serialized_end=1588 - _globals['_ENDSESSIONREQUEST']._serialized_start=1591 - _globals['_ENDSESSIONREQUEST']._serialized_end=1886 + _globals['_STARTSESSIONREQUEST']._serialized_end=1467 + _globals['_STARTSESSIONRESPONSE']._serialized_start=1470 + _globals['_STARTSESSIONRESPONSE']._serialized_end=1611 + _globals['_ENDSESSIONREQUEST']._serialized_start=1614 + _globals['_ENDSESSIONREQUEST']._serialized_end=1909 _globals['_ENDSESSIONREQUEST_OPTIONSENTRY']._serialized_start=1019 _globals['_ENDSESSIONREQUEST_OPTIONSENTRY']._serialized_end=1065 - _globals['_ENDSESSIONRESPONSE']._serialized_start=1889 - _globals['_ENDSESSIONRESPONSE']._serialized_end=2025 - _globals['_VALIDATECOMMUNICATIONREQUEST']._serialized_start=2027 - _globals['_VALIDATECOMMUNICATIONREQUEST']._serialized_end=2100 - _globals['_VALIDATECOMMUNICATIONRESPONSE']._serialized_start=2102 - _globals['_VALIDATECOMMUNICATIONRESPONSE']._serialized_end=2226 - _globals['_LOGONSERVERREQUEST']._serialized_start=2229 - _globals['_LOGONSERVERREQUEST']._serialized_end=2420 - _globals['_LOGONSERVERRESPONSE']._serialized_start=2423 - _globals['_LOGONSERVERRESPONSE']._serialized_end=2622 - _globals['_RUNCONTROL']._serialized_start=2625 - _globals['_RUNCONTROL']._serialized_end=3309 + _globals['_ENDSESSIONRESPONSE']._serialized_start=1912 + _globals['_ENDSESSIONRESPONSE']._serialized_end=2048 + _globals['_VALIDATECOMMUNICATIONREQUEST']._serialized_start=2050 + _globals['_VALIDATECOMMUNICATIONREQUEST']._serialized_end=2123 + _globals['_VALIDATECOMMUNICATIONRESPONSE']._serialized_start=2125 + _globals['_VALIDATECOMMUNICATIONRESPONSE']._serialized_end=2249 + _globals['_LOGONSERVERREQUEST']._serialized_start=2252 + _globals['_LOGONSERVERREQUEST']._serialized_end=2443 + _globals['_LOGONSERVERRESPONSE']._serialized_start=2446 + _globals['_LOGONSERVERRESPONSE']._serialized_end=2645 + _globals['_RUNCONTROL']._serialized_start=2648 + _globals['_RUNCONTROL']._serialized_end=3332 # @@protoc_insertion_point(module_scope) diff --git a/src/druncschema/run_control_pb2.pyi b/src/druncschema/run_control_pb2.pyi index cd61d92..b2995a2 100644 --- a/src/druncschema/run_control_pb2.pyi +++ b/src/druncschema/run_control_pb2.pyi @@ -189,14 +189,16 @@ class StartSessionRequest(_message.Message): TOKEN_FIELD_NUMBER: _builtins.int PROCESS_MANAGER_FIELD_NUMBER: _builtins.int PATH_TO_CONFIGURATION_FILE_FIELD_NUMBER: _builtins.int - SSESION_ID_FIELD_NUMBER: _builtins.int + SESSION_ID_FIELD_NUMBER: _builtins.int SESSION_NAME_FIELD_NUMBER: _builtins.int + OVERRIDE_LOGS_FIELD_NUMBER: _builtins.int CONTROLLER_LOG_LEVEL_FIELD_NUMBER: _builtins.int SLEEP_BETWEEN_APP_BOOT_FIELD_NUMBER: _builtins.int process_manager: _builtins.str path_to_configuration_file: _builtins.str - ssesion_id: _builtins.str + session_id: _builtins.str session_name: _builtins.str + override_logs: _builtins.bool controller_log_level: _builtins.str sleep_between_app_boot: _builtins.float @_builtins.property @@ -207,14 +209,15 @@ class StartSessionRequest(_message.Message): token: _token_pb2.Token | None = ..., process_manager: _builtins.str = ..., path_to_configuration_file: _builtins.str = ..., - ssesion_id: _builtins.str = ..., + session_id: _builtins.str = ..., session_name: _builtins.str = ..., + override_logs: _builtins.bool = ..., controller_log_level: _builtins.str = ..., sleep_between_app_boot: _builtins.float = ..., ) -> None: ... _HasFieldArgType: _TypeAlias = _typing.Literal["token", b"token"] # noqa: Y015 def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... - _ClearFieldArgType: _TypeAlias = _typing.Literal["controller_log_level", b"controller_log_level", "path_to_configuration_file", b"path_to_configuration_file", "process_manager", b"process_manager", "session_name", b"session_name", "sleep_between_app_boot", b"sleep_between_app_boot", "ssesion_id", b"ssesion_id", "token", b"token"] # noqa: Y015 + _ClearFieldArgType: _TypeAlias = _typing.Literal["controller_log_level", b"controller_log_level", "override_logs", b"override_logs", "path_to_configuration_file", b"path_to_configuration_file", "process_manager", b"process_manager", "session_id", b"session_id", "session_name", b"session_name", "sleep_between_app_boot", b"sleep_between_app_boot", "token", b"token"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... def WhichOneof(self, oneof_group: _Never) -> None: ... From c366c99aa91f7bf632bd335e89f2f7036fd83d55 Mon Sep 17 00:00:00 2001 From: PawelPlesniak Date: Thu, 30 Jul 2026 18:29:14 +0200 Subject: [PATCH 6/6] Base work done --- schema/druncschema/run_control.proto | 4 +- src/druncschema/run_control_pb2.py | 71 +++++++++++++------------ src/druncschema/run_control_pb2_grpc.py | 44 +++++++++++++++ 3 files changed, 83 insertions(+), 36 deletions(-) diff --git a/schema/druncschema/run_control.proto b/schema/druncschema/run_control.proto index 3c6b889..9ae204e 100644 --- a/schema/druncschema/run_control.proto +++ b/schema/druncschema/run_control.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package dunedaq.druncschema.run_control; +import "druncschema/process_manager.proto"; import "druncschema/request_response.proto"; import "druncschema/token.proto"; import "druncschema/generic.proto"; @@ -10,7 +11,8 @@ service RunControl { rpc validate_session (ValidateSessionRequest) returns (ValidateSessionResponse) {} rpc start_session (StartSessionRequest) returns (StartSessionResponse) {} rpc end_session (EndSessionRequest) returns (StartSessionResponse) {} - rpc log_on_server (LogOnServerRequest) returns (LogOnServerResponse) {} + rpc logs (dunedaq.druncschema.process_manager.LogRequest) returns (dunedaq.druncschema.process_manager.LogLines) {} + rpc log_on_server (LogOnServerRequest) returns (LogOnServerResponse) {} rpc validate_communication (ValidateCommunicationRequest) returns (ValidateCommunicationResponse) {} } diff --git a/src/druncschema/run_control_pb2.py b/src/druncschema/run_control_pb2.py index f70a058..1c2153b 100644 --- a/src/druncschema/run_control_pb2.py +++ b/src/druncschema/run_control_pb2.py @@ -22,12 +22,13 @@ _sym_db = _symbol_database.Default() +from druncschema import process_manager_pb2 as druncschema_dot_process__manager__pb2 from druncschema import request_response_pb2 as druncschema_dot_request__response__pb2 from druncschema import token_pb2 as druncschema_dot_token__pb2 from druncschema import generic_pb2 as druncschema_dot_generic__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x64runcschema/run_control.proto\x12\x1f\x64unedaq.druncschema.run_control\x1a\"druncschema/request_response.proto\x1a\x17\x64runcschema/token.proto\x1a\x19\x64runcschema/generic.proto\"\xa4\x03\n\x19\x44\x65ploySessionResponseFlag\x12O\n\x06status\x18\x01 \x01(\x0e\x32?.dunedaq.druncschema.run_control.DeploySessionResponseFlag.Flag\"\xb5\x02\n\x04\x46lag\x12\x0b\n\x07SUCCESS\x10\x00\x12(\n$FAILURE_CONFIGURATION_FILE_NOT_FOUND\x10\x01\x12 \n\x1c\x46\x41ILURE_SESSION_ID_NOT_FOUND\x10\x02\x12\x1f\n\x1b\x46\x41ILURE_SESSION_NAME_IN_USE\x10\x03\x12 \n\x1c\x46\x41ILURE_SESSION_NAME_INVALID\x10\x04\x12)\n%FAILURE_RESOURCES_CANNOT_BE_ALLOCATED\x10\x05\x12\x34\n0FAILURE_INSUFFICIENT_PRIVILEGES_TO_USE_RESOURCES\x10\x06\x12\x1d\n\x19\x46\x41ILURE_WEB_PROXY_ENABLED\x10\x07\x12\x11\n\rFAILURE_OTHER\x10\x08\"\xb3\x01\n\x16\x45ndSessionResponseFlag\x12L\n\x06status\x18\x01 \x01(\x0e\x32<.dunedaq.druncschema.run_control.EndSessionResponseFlag.Flag\"K\n\x04\x46lag\x12\x0b\n\x07SUCCESS\x10\x00\x12#\n\x1f\x46\x41ILURE_APPLICATION_STILL_ALIVE\x10\x01\x12\x11\n\rFAILURE_OTHER\x10\x02\"\xb1\x02\n\x16ValidateSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12U\n\x07options\x18\x06 \x03(\x0b\x32\x44.dunedaq.druncschema.run_control.ValidateSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x90\x01\n\x17ValidateSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12J\n\x06result\x18\x02 \x01(\x0b\x32:.dunedaq.druncschema.run_control.DeploySessionResponseFlag\"\xfc\x01\n\x13StartSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nsession_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12\x15\n\roverride_logs\x18\x06 \x01(\x08\x12\x1c\n\x14\x63ontroller_log_level\x18\x07 \x01(\t\x12\x1e\n\x16sleep_between_app_boot\x18\x08 \x01(\x02\"\x8d\x01\n\x14StartSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12J\n\x06result\x18\x02 \x01(\x0b\x32:.dunedaq.druncschema.run_control.DeploySessionResponseFlag\"\xa7\x02\n\x11\x45ndSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12P\n\x07options\x18\x06 \x03(\x0b\x32?.dunedaq.druncschema.run_control.EndSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x88\x01\n\x12\x45ndSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12G\n\x06result\x18\x02 \x01(\x0b\x32\x37.dunedaq.druncschema.run_control.EndSessionResponseFlag\"I\n\x1cValidateCommunicationRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\"|\n\x1dValidateCommunicationResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x30\n\x06status\x18\x02 \x01(\x0e\x32 .dunedaq.druncschema.OutcomeFlag\"\xbf\x01\n\x12LogOnServerRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x0c\n\x04text\x18\x02 \x01(\t\x12\x10\n\x08severity\x18\x03 \x01(\t\x12\x0e\n\x06target\x18\x04 \x01(\t\x12\x1a\n\x12\x65xecute_along_path\x18\x05 \x01(\x08\x12\x32\n*execute_on_all_subsequent_children_in_path\x18\x06 \x01(\x08\"\xc7\x01\n\x13LogOnServerResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x0c\n\x04name\x18\x02 \x01(\t\x12/\n\x04\x66lag\x18\x03 \x01(\x0e\x32!.dunedaq.druncschema.ResponseFlag\x12\x46\n\x08\x63hildren\x18\x04 \x03(\x0b\x32\x34.dunedaq.druncschema.run_control.LogOnServerResponse2\xac\x05\n\nRunControl\x12\x87\x01\n\x10validate_session\x12\x37.dunedaq.druncschema.run_control.ValidateSessionRequest\x1a\x38.dunedaq.druncschema.run_control.ValidateSessionResponse\"\x00\x12~\n\rstart_session\x12\x34.dunedaq.druncschema.run_control.StartSessionRequest\x1a\x35.dunedaq.druncschema.run_control.StartSessionResponse\"\x00\x12z\n\x0b\x65nd_session\x12\x32.dunedaq.druncschema.run_control.EndSessionRequest\x1a\x35.dunedaq.druncschema.run_control.StartSessionResponse\"\x00\x12|\n\rlog_on_server\x12\x33.dunedaq.druncschema.run_control.LogOnServerRequest\x1a\x34.dunedaq.druncschema.run_control.LogOnServerResponse\"\x00\x12\x99\x01\n\x16validate_communication\x12=.dunedaq.druncschema.run_control.ValidateCommunicationRequest\x1a>.dunedaq.druncschema.run_control.ValidateCommunicationResponse\"\x00\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x64runcschema/run_control.proto\x12\x1f\x64unedaq.druncschema.run_control\x1a!druncschema/process_manager.proto\x1a\"druncschema/request_response.proto\x1a\x17\x64runcschema/token.proto\x1a\x19\x64runcschema/generic.proto\"\xa4\x03\n\x19\x44\x65ploySessionResponseFlag\x12O\n\x06status\x18\x01 \x01(\x0e\x32?.dunedaq.druncschema.run_control.DeploySessionResponseFlag.Flag\"\xb5\x02\n\x04\x46lag\x12\x0b\n\x07SUCCESS\x10\x00\x12(\n$FAILURE_CONFIGURATION_FILE_NOT_FOUND\x10\x01\x12 \n\x1c\x46\x41ILURE_SESSION_ID_NOT_FOUND\x10\x02\x12\x1f\n\x1b\x46\x41ILURE_SESSION_NAME_IN_USE\x10\x03\x12 \n\x1c\x46\x41ILURE_SESSION_NAME_INVALID\x10\x04\x12)\n%FAILURE_RESOURCES_CANNOT_BE_ALLOCATED\x10\x05\x12\x34\n0FAILURE_INSUFFICIENT_PRIVILEGES_TO_USE_RESOURCES\x10\x06\x12\x1d\n\x19\x46\x41ILURE_WEB_PROXY_ENABLED\x10\x07\x12\x11\n\rFAILURE_OTHER\x10\x08\"\xb3\x01\n\x16\x45ndSessionResponseFlag\x12L\n\x06status\x18\x01 \x01(\x0e\x32<.dunedaq.druncschema.run_control.EndSessionResponseFlag.Flag\"K\n\x04\x46lag\x12\x0b\n\x07SUCCESS\x10\x00\x12#\n\x1f\x46\x41ILURE_APPLICATION_STILL_ALIVE\x10\x01\x12\x11\n\rFAILURE_OTHER\x10\x02\"\xb1\x02\n\x16ValidateSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12U\n\x07options\x18\x06 \x03(\x0b\x32\x44.dunedaq.druncschema.run_control.ValidateSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x90\x01\n\x17ValidateSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12J\n\x06result\x18\x02 \x01(\x0b\x32:.dunedaq.druncschema.run_control.DeploySessionResponseFlag\"\xfc\x01\n\x13StartSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nsession_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12\x15\n\roverride_logs\x18\x06 \x01(\x08\x12\x1c\n\x14\x63ontroller_log_level\x18\x07 \x01(\t\x12\x1e\n\x16sleep_between_app_boot\x18\x08 \x01(\x02\"\x8d\x01\n\x14StartSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12J\n\x06result\x18\x02 \x01(\x0b\x32:.dunedaq.druncschema.run_control.DeploySessionResponseFlag\"\xa7\x02\n\x11\x45ndSessionRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x17\n\x0fprocess_manager\x18\x02 \x01(\t\x12\"\n\x1apath_to_configuration_file\x18\x03 \x01(\t\x12\x12\n\nssesion_id\x18\x04 \x01(\t\x12\x14\n\x0csession_name\x18\x05 \x01(\t\x12P\n\x07options\x18\x06 \x03(\x0b\x32?.dunedaq.druncschema.run_control.EndSessionRequest.OptionsEntry\x1a.\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x88\x01\n\x12\x45ndSessionResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12G\n\x06result\x18\x02 \x01(\x0b\x32\x37.dunedaq.druncschema.run_control.EndSessionResponseFlag\"I\n\x1cValidateCommunicationRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\"|\n\x1dValidateCommunicationResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x30\n\x06status\x18\x02 \x01(\x0e\x32 .dunedaq.druncschema.OutcomeFlag\"\xbf\x01\n\x12LogOnServerRequest\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x0c\n\x04text\x18\x02 \x01(\t\x12\x10\n\x08severity\x18\x03 \x01(\t\x12\x0e\n\x06target\x18\x04 \x01(\t\x12\x1a\n\x12\x65xecute_along_path\x18\x05 \x01(\x08\x12\x32\n*execute_on_all_subsequent_children_in_path\x18\x06 \x01(\x08\"\xc7\x01\n\x13LogOnServerResponse\x12)\n\x05token\x18\x01 \x01(\x0b\x32\x1a.dunedaq.druncschema.Token\x12\x0c\n\x04name\x18\x02 \x01(\t\x12/\n\x04\x66lag\x18\x03 \x01(\x0e\x32!.dunedaq.druncschema.ResponseFlag\x12\x46\n\x08\x63hildren\x18\x04 \x03(\x0b\x32\x34.dunedaq.druncschema.run_control.LogOnServerResponse2\x96\x06\n\nRunControl\x12\x87\x01\n\x10validate_session\x12\x37.dunedaq.druncschema.run_control.ValidateSessionRequest\x1a\x38.dunedaq.druncschema.run_control.ValidateSessionResponse\"\x00\x12~\n\rstart_session\x12\x34.dunedaq.druncschema.run_control.StartSessionRequest\x1a\x35.dunedaq.druncschema.run_control.StartSessionResponse\"\x00\x12z\n\x0b\x65nd_session\x12\x32.dunedaq.druncschema.run_control.EndSessionRequest\x1a\x35.dunedaq.druncschema.run_control.StartSessionResponse\"\x00\x12h\n\x04logs\x12/.dunedaq.druncschema.process_manager.LogRequest\x1a-.dunedaq.druncschema.process_manager.LogLines\"\x00\x12|\n\rlog_on_server\x12\x33.dunedaq.druncschema.run_control.LogOnServerRequest\x1a\x34.dunedaq.druncschema.run_control.LogOnServerResponse\"\x00\x12\x99\x01\n\x16validate_communication\x12=.dunedaq.druncschema.run_control.ValidateCommunicationRequest\x1a>.dunedaq.druncschema.run_control.ValidateCommunicationResponse\"\x00\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -38,38 +39,38 @@ _globals['_VALIDATESESSIONREQUEST_OPTIONSENTRY']._serialized_options = b'8\001' _globals['_ENDSESSIONREQUEST_OPTIONSENTRY']._loaded_options = None _globals['_ENDSESSIONREQUEST_OPTIONSENTRY']._serialized_options = b'8\001' - _globals['_DEPLOYSESSIONRESPONSEFLAG']._serialized_start=155 - _globals['_DEPLOYSESSIONRESPONSEFLAG']._serialized_end=575 - _globals['_DEPLOYSESSIONRESPONSEFLAG_FLAG']._serialized_start=266 - _globals['_DEPLOYSESSIONRESPONSEFLAG_FLAG']._serialized_end=575 - _globals['_ENDSESSIONRESPONSEFLAG']._serialized_start=578 - _globals['_ENDSESSIONRESPONSEFLAG']._serialized_end=757 - _globals['_ENDSESSIONRESPONSEFLAG_FLAG']._serialized_start=682 - _globals['_ENDSESSIONRESPONSEFLAG_FLAG']._serialized_end=757 - _globals['_VALIDATESESSIONREQUEST']._serialized_start=760 - _globals['_VALIDATESESSIONREQUEST']._serialized_end=1065 - _globals['_VALIDATESESSIONREQUEST_OPTIONSENTRY']._serialized_start=1019 - _globals['_VALIDATESESSIONREQUEST_OPTIONSENTRY']._serialized_end=1065 - _globals['_VALIDATESESSIONRESPONSE']._serialized_start=1068 - _globals['_VALIDATESESSIONRESPONSE']._serialized_end=1212 - _globals['_STARTSESSIONREQUEST']._serialized_start=1215 - _globals['_STARTSESSIONREQUEST']._serialized_end=1467 - _globals['_STARTSESSIONRESPONSE']._serialized_start=1470 - _globals['_STARTSESSIONRESPONSE']._serialized_end=1611 - _globals['_ENDSESSIONREQUEST']._serialized_start=1614 - _globals['_ENDSESSIONREQUEST']._serialized_end=1909 - _globals['_ENDSESSIONREQUEST_OPTIONSENTRY']._serialized_start=1019 - _globals['_ENDSESSIONREQUEST_OPTIONSENTRY']._serialized_end=1065 - _globals['_ENDSESSIONRESPONSE']._serialized_start=1912 - _globals['_ENDSESSIONRESPONSE']._serialized_end=2048 - _globals['_VALIDATECOMMUNICATIONREQUEST']._serialized_start=2050 - _globals['_VALIDATECOMMUNICATIONREQUEST']._serialized_end=2123 - _globals['_VALIDATECOMMUNICATIONRESPONSE']._serialized_start=2125 - _globals['_VALIDATECOMMUNICATIONRESPONSE']._serialized_end=2249 - _globals['_LOGONSERVERREQUEST']._serialized_start=2252 - _globals['_LOGONSERVERREQUEST']._serialized_end=2443 - _globals['_LOGONSERVERRESPONSE']._serialized_start=2446 - _globals['_LOGONSERVERRESPONSE']._serialized_end=2645 - _globals['_RUNCONTROL']._serialized_start=2648 - _globals['_RUNCONTROL']._serialized_end=3332 + _globals['_DEPLOYSESSIONRESPONSEFLAG']._serialized_start=190 + _globals['_DEPLOYSESSIONRESPONSEFLAG']._serialized_end=610 + _globals['_DEPLOYSESSIONRESPONSEFLAG_FLAG']._serialized_start=301 + _globals['_DEPLOYSESSIONRESPONSEFLAG_FLAG']._serialized_end=610 + _globals['_ENDSESSIONRESPONSEFLAG']._serialized_start=613 + _globals['_ENDSESSIONRESPONSEFLAG']._serialized_end=792 + _globals['_ENDSESSIONRESPONSEFLAG_FLAG']._serialized_start=717 + _globals['_ENDSESSIONRESPONSEFLAG_FLAG']._serialized_end=792 + _globals['_VALIDATESESSIONREQUEST']._serialized_start=795 + _globals['_VALIDATESESSIONREQUEST']._serialized_end=1100 + _globals['_VALIDATESESSIONREQUEST_OPTIONSENTRY']._serialized_start=1054 + _globals['_VALIDATESESSIONREQUEST_OPTIONSENTRY']._serialized_end=1100 + _globals['_VALIDATESESSIONRESPONSE']._serialized_start=1103 + _globals['_VALIDATESESSIONRESPONSE']._serialized_end=1247 + _globals['_STARTSESSIONREQUEST']._serialized_start=1250 + _globals['_STARTSESSIONREQUEST']._serialized_end=1502 + _globals['_STARTSESSIONRESPONSE']._serialized_start=1505 + _globals['_STARTSESSIONRESPONSE']._serialized_end=1646 + _globals['_ENDSESSIONREQUEST']._serialized_start=1649 + _globals['_ENDSESSIONREQUEST']._serialized_end=1944 + _globals['_ENDSESSIONREQUEST_OPTIONSENTRY']._serialized_start=1054 + _globals['_ENDSESSIONREQUEST_OPTIONSENTRY']._serialized_end=1100 + _globals['_ENDSESSIONRESPONSE']._serialized_start=1947 + _globals['_ENDSESSIONRESPONSE']._serialized_end=2083 + _globals['_VALIDATECOMMUNICATIONREQUEST']._serialized_start=2085 + _globals['_VALIDATECOMMUNICATIONREQUEST']._serialized_end=2158 + _globals['_VALIDATECOMMUNICATIONRESPONSE']._serialized_start=2160 + _globals['_VALIDATECOMMUNICATIONRESPONSE']._serialized_end=2284 + _globals['_LOGONSERVERREQUEST']._serialized_start=2287 + _globals['_LOGONSERVERREQUEST']._serialized_end=2478 + _globals['_LOGONSERVERRESPONSE']._serialized_start=2481 + _globals['_LOGONSERVERRESPONSE']._serialized_end=2680 + _globals['_RUNCONTROL']._serialized_start=2683 + _globals['_RUNCONTROL']._serialized_end=3473 # @@protoc_insertion_point(module_scope) diff --git a/src/druncschema/run_control_pb2_grpc.py b/src/druncschema/run_control_pb2_grpc.py index c04d127..2f4bfc6 100644 --- a/src/druncschema/run_control_pb2_grpc.py +++ b/src/druncschema/run_control_pb2_grpc.py @@ -3,6 +3,7 @@ import grpc import warnings +from druncschema import process_manager_pb2 as druncschema_dot_process__manager__pb2 from druncschema import run_control_pb2 as druncschema_dot_run__control__pb2 GRPC_GENERATED_VERSION = '1.75.0' @@ -49,6 +50,11 @@ def __init__(self, channel): request_serializer=druncschema_dot_run__control__pb2.EndSessionRequest.SerializeToString, response_deserializer=druncschema_dot_run__control__pb2.StartSessionResponse.FromString, _registered_method=True) + self.logs = channel.unary_unary( + '/dunedaq.druncschema.run_control.RunControl/logs', + request_serializer=druncschema_dot_process__manager__pb2.LogRequest.SerializeToString, + response_deserializer=druncschema_dot_process__manager__pb2.LogLines.FromString, + _registered_method=True) self.log_on_server = channel.unary_unary( '/dunedaq.druncschema.run_control.RunControl/log_on_server', request_serializer=druncschema_dot_run__control__pb2.LogOnServerRequest.SerializeToString, @@ -82,6 +88,12 @@ def end_session(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def logs(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def log_on_server(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -112,6 +124,11 @@ def add_RunControlServicer_to_server(servicer, server): request_deserializer=druncschema_dot_run__control__pb2.EndSessionRequest.FromString, response_serializer=druncschema_dot_run__control__pb2.StartSessionResponse.SerializeToString, ), + 'logs': grpc.unary_unary_rpc_method_handler( + servicer.logs, + request_deserializer=druncschema_dot_process__manager__pb2.LogRequest.FromString, + response_serializer=druncschema_dot_process__manager__pb2.LogLines.SerializeToString, + ), 'log_on_server': grpc.unary_unary_rpc_method_handler( servicer.log_on_server, request_deserializer=druncschema_dot_run__control__pb2.LogOnServerRequest.FromString, @@ -214,6 +231,33 @@ def end_session(request, metadata, _registered_method=True) + @staticmethod + def logs(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/dunedaq.druncschema.run_control.RunControl/logs', + druncschema_dot_process__manager__pb2.LogRequest.SerializeToString, + druncschema_dot_process__manager__pb2.LogLines.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def log_on_server(request, target,