From 95e9311a488618eeb7c5bdee3dc01ddebcfefc2d Mon Sep 17 00:00:00 2001 From: ThibaultFy Date: Thu, 21 Dec 2023 15:50:09 +0100 Subject: [PATCH] chore: make proto orc Signed-off-by: ThibaultFy --- backend/orchestrator/common_pb2.py | 37 ++--- backend/orchestrator/common_pb2_grpc.pyi | 13 ++ backend/orchestrator/computeplan_pb2.py | 85 +++++------ backend/orchestrator/computeplan_pb2_grpc.pyi | 65 +++++++-- backend/orchestrator/computetask_pb2.py | 137 +++++++++--------- backend/orchestrator/computetask_pb2_grpc.pyi | 65 +++++++-- backend/orchestrator/datamanager_pb2.py | 61 ++++---- backend/orchestrator/datamanager_pb2_grpc.pyi | 49 +++++-- backend/orchestrator/datasample_pb2.py | 57 ++++---- backend/orchestrator/datasample_pb2_grpc.pyi | 49 +++++-- backend/orchestrator/dataset_pb2.py | 25 ++-- backend/orchestrator/dataset_pb2_grpc.pyi | 25 +++- backend/orchestrator/event_pb2.py | 57 ++++---- backend/orchestrator/event_pb2_grpc.pyi | 32 +++- backend/orchestrator/failure_report_pb2.py | 37 ++--- .../orchestrator/failure_report_pb2_grpc.pyi | 33 ++++- backend/orchestrator/function_pb2.py | 123 ++++++++-------- backend/orchestrator/function_pb2.pyi | 10 +- backend/orchestrator/function_pb2_grpc.pyi | 57 ++++++-- backend/orchestrator/info_pb2.py | 27 ++-- backend/orchestrator/info_pb2.pyi | 5 +- backend/orchestrator/info_pb2_grpc.pyi | 25 +++- backend/orchestrator/model_pb2.py | 49 ++++--- backend/orchestrator/model_pb2_grpc.pyi | 49 +++++-- backend/orchestrator/organization_pb2.py | 33 +++-- .../orchestrator/organization_pb2_grpc.pyi | 33 ++++- backend/orchestrator/performance_pb2.py | 37 ++--- backend/orchestrator/performance_pb2_grpc.pyi | 33 ++++- 28 files changed, 824 insertions(+), 484 deletions(-) diff --git a/backend/orchestrator/common_pb2.py b/backend/orchestrator/common_pb2.py index ec7976841..0f18a905e 100644 --- a/backend/orchestrator/common_pb2.py +++ b/backend/orchestrator/common_pb2.py @@ -1,11 +1,12 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: common.proto +# Protobuf Python Version: 4.25.0 """Generated protocol buffer code.""" -from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -15,22 +16,22 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0c\x63ommon.proto\x12\x0corchestrator\"8\n\x0b\x41\x64\x64ressable\x12\x10\n\x08\x63hecksum\x18\x01 \x01(\t\x12\x17\n\x0fstorage_address\x18\x02 \x01(\t\"d\n\x0bPermissions\x12)\n\x07process\x18\x01 \x01(\x0b\x32\x18.orchestrator.Permission\x12*\n\x08\x64ownload\x18\x02 \x01(\x0b\x32\x18.orchestrator.Permission\"4\n\nPermission\x12\x0e\n\x06public\x18\x01 \x01(\x08\x12\x16\n\x0e\x61uthorized_ids\x18\x02 \x03(\t\"8\n\x0eNewPermissions\x12\x0e\n\x06public\x18\x01 \x01(\x08\x12\x16\n\x0e\x61uthorized_ids\x18\x02 \x03(\t*\xa4\x02\n\tAssetKind\x12\x11\n\rASSET_UNKNOWN\x10\x00\x12\x16\n\x12\x41SSET_ORGANIZATION\x10\x01\x12\x15\n\x11\x41SSET_DATA_SAMPLE\x10\x03\x12\x16\n\x12\x41SSET_DATA_MANAGER\x10\x04\x12\x12\n\x0e\x41SSET_FUNCTION\x10\x05\x12\x16\n\x12\x41SSET_COMPUTE_TASK\x10\x06\x12\x16\n\x12\x41SSET_COMPUTE_PLAN\x10\x07\x12\x0f\n\x0b\x41SSET_MODEL\x10\x08\x12\x15\n\x11\x41SSET_PERFORMANCE\x10\t\x12\x18\n\x14\x41SSET_FAILURE_REPORT\x10\n\x12#\n\x1f\x41SSET_COMPUTE_TASK_OUTPUT_ASSET\x10\x0b\"\x04\x08\x02\x10\x02*\x0c\x41SSET_METRIC*;\n\tSortOrder\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\r\n\tASCENDING\x10\x01\x12\x0e\n\nDESCENDING\x10\x02\x42+Z)github.com/substra/orchestrator/lib/assetb\x06proto3') -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'common_pb2', globals()) +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'common_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' - _ASSETKIND._serialized_start=303 - _ASSETKIND._serialized_end=595 - _SORTORDER._serialized_start=597 - _SORTORDER._serialized_end=656 - _ADDRESSABLE._serialized_start=30 - _ADDRESSABLE._serialized_end=86 - _PERMISSIONS._serialized_start=88 - _PERMISSIONS._serialized_end=188 - _PERMISSION._serialized_start=190 - _PERMISSION._serialized_end=242 - _NEWPERMISSIONS._serialized_start=244 - _NEWPERMISSIONS._serialized_end=300 + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' + _globals['_ASSETKIND']._serialized_start=303 + _globals['_ASSETKIND']._serialized_end=595 + _globals['_SORTORDER']._serialized_start=597 + _globals['_SORTORDER']._serialized_end=656 + _globals['_ADDRESSABLE']._serialized_start=30 + _globals['_ADDRESSABLE']._serialized_end=86 + _globals['_PERMISSIONS']._serialized_start=88 + _globals['_PERMISSIONS']._serialized_end=188 + _globals['_PERMISSION']._serialized_start=190 + _globals['_PERMISSION']._serialized_end=242 + _globals['_NEWPERMISSIONS']._serialized_start=244 + _globals['_NEWPERMISSIONS']._serialized_end=300 # @@protoc_insertion_point(module_scope) diff --git a/backend/orchestrator/common_pb2_grpc.pyi b/backend/orchestrator/common_pb2_grpc.pyi index f3a5a087e..b13382f6a 100644 --- a/backend/orchestrator/common_pb2_grpc.pyi +++ b/backend/orchestrator/common_pb2_grpc.pyi @@ -2,3 +2,16 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file """ +import abc +import collections.abc +import grpc +import grpc.aio +import typing + +_T = typing.TypeVar('_T') + +class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): + ... + +class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore + ... diff --git a/backend/orchestrator/computeplan_pb2.py b/backend/orchestrator/computeplan_pb2.py index ec29b3c26..10320a78c 100644 --- a/backend/orchestrator/computeplan_pb2.py +++ b/backend/orchestrator/computeplan_pb2.py @@ -1,11 +1,12 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: computeplan.proto +# Protobuf Python Version: 4.25.0 """Generated protocol buffer code.""" -from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -16,46 +17,46 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11\x63omputeplan.proto\x12\x0corchestrator\x1a\x1fgoogle/protobuf/timestamp.proto\"\x83\x04\n\x0b\x43omputePlan\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05owner\x18\x02 \x01(\t\x12\x31\n\rcreation_date\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0b\n\x03tag\x18\x10 \x01(\t\x12\x0c\n\x04name\x18\x13 \x01(\t\x12\x39\n\x08metadata\x18\x11 \x03(\x0b\x32\'.orchestrator.ComputePlan.MetadataEntry\x12\x34\n\x10\x63\x61ncelation_date\x18\x12 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x30\n\x0c\x66\x61ilure_date\x18\x14 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01J\x04\x08\x08\x10\tJ\x04\x08\t\x10\nJ\x04\x08\n\x10\x0bJ\x04\x08\x0b\x10\x0cJ\x04\x08\x0c\x10\rJ\x04\x08\x03\x10\x04J\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06J\x04\x08\x06\x10\x07R\rwaiting_countR\ntodo_countR\x0b\x64oing_countR\x0e\x63\x61nceled_countR\x0c\x66\x61iled_countR\ndone_countR\ntask_countR\x06statusR\x1a\x64\x65lete_intermediary_models\"\xc9\x01\n\x0eNewComputePlan\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x0b\n\x03tag\x18\x10 \x01(\t\x12\x0c\n\x04name\x18\x13 \x01(\t\x12<\n\x08metadata\x18\x11 \x03(\x0b\x32*.orchestrator.NewComputePlan.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01J\x04\x08\x12\x10\x13R\x1a\x64\x65lete_intermediary_models\"\"\n\x13GetComputePlanParam\x12\x0b\n\x03key\x18\x01 \x01(\t\"T\n\x14\x41pplyPlanActionParam\x12\x0b\n\x03key\x18\x01 \x01(\t\x12/\n\x06\x61\x63tion\x18\x02 \x01(\x0e\x32\x1f.orchestrator.ComputePlanAction\"\x19\n\x17\x41pplyPlanActionResponse\" \n\x0fPlanQueryFilter\x12\r\n\x05owner\x18\x01 \x01(\t\"g\n\x0fQueryPlansParam\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\r\x12-\n\x06\x66ilter\x18\x03 \x01(\x0b\x32\x1d.orchestrator.PlanQueryFilter\"W\n\x12QueryPlansResponse\x12(\n\x05plans\x18\x01 \x03(\x0b\x32\x19.orchestrator.ComputePlan\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"3\n\x16UpdateComputePlanParam\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\"\x1b\n\x19UpdateComputePlanResponse\"!\n\x12IsPlanRunningParam\x12\x0b\n\x03key\x18\x01 \x01(\t\"+\n\x15IsPlanRunningResponse\x12\x12\n\nis_running\x18\x01 \x01(\x08*F\n\x11\x43omputePlanAction\x12\x17\n\x13PLAN_ACTION_UNKNOWN\x10\x00\x12\x18\n\x14PLAN_ACTION_CANCELED\x10\x01\x32\x88\x04\n\x12\x43omputePlanService\x12G\n\x0cRegisterPlan\x12\x1c.orchestrator.NewComputePlan\x1a\x19.orchestrator.ComputePlan\x12G\n\x07GetPlan\x12!.orchestrator.GetComputePlanParam\x1a\x19.orchestrator.ComputePlan\x12\\\n\x0f\x41pplyPlanAction\x12\".orchestrator.ApplyPlanActionParam\x1a%.orchestrator.ApplyPlanActionResponse\x12M\n\nQueryPlans\x12\x1d.orchestrator.QueryPlansParam\x1a .orchestrator.QueryPlansResponse\x12[\n\nUpdatePlan\x12$.orchestrator.UpdateComputePlanParam\x1a\'.orchestrator.UpdateComputePlanResponse\x12V\n\rIsPlanRunning\x12 .orchestrator.IsPlanRunningParam\x1a#.orchestrator.IsPlanRunningResponseB+Z)github.com/substra/orchestrator/lib/assetb\x06proto3') -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'computeplan_pb2', globals()) +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'computeplan_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' - _COMPUTEPLAN_METADATAENTRY._options = None - _COMPUTEPLAN_METADATAENTRY._serialized_options = b'8\001' - _NEWCOMPUTEPLAN_METADATAENTRY._options = None - _NEWCOMPUTEPLAN_METADATAENTRY._serialized_options = b'8\001' - _COMPUTEPLANACTION._serialized_start=1329 - _COMPUTEPLANACTION._serialized_end=1399 - _COMPUTEPLAN._serialized_start=69 - _COMPUTEPLAN._serialized_end=584 - _COMPUTEPLAN_METADATAENTRY._serialized_start=353 - _COMPUTEPLAN_METADATAENTRY._serialized_end=400 - _NEWCOMPUTEPLAN._serialized_start=587 - _NEWCOMPUTEPLAN._serialized_end=788 - _NEWCOMPUTEPLAN_METADATAENTRY._serialized_start=353 - _NEWCOMPUTEPLAN_METADATAENTRY._serialized_end=400 - _GETCOMPUTEPLANPARAM._serialized_start=790 - _GETCOMPUTEPLANPARAM._serialized_end=824 - _APPLYPLANACTIONPARAM._serialized_start=826 - _APPLYPLANACTIONPARAM._serialized_end=910 - _APPLYPLANACTIONRESPONSE._serialized_start=912 - _APPLYPLANACTIONRESPONSE._serialized_end=937 - _PLANQUERYFILTER._serialized_start=939 - _PLANQUERYFILTER._serialized_end=971 - _QUERYPLANSPARAM._serialized_start=973 - _QUERYPLANSPARAM._serialized_end=1076 - _QUERYPLANSRESPONSE._serialized_start=1078 - _QUERYPLANSRESPONSE._serialized_end=1165 - _UPDATECOMPUTEPLANPARAM._serialized_start=1167 - _UPDATECOMPUTEPLANPARAM._serialized_end=1218 - _UPDATECOMPUTEPLANRESPONSE._serialized_start=1220 - _UPDATECOMPUTEPLANRESPONSE._serialized_end=1247 - _ISPLANRUNNINGPARAM._serialized_start=1249 - _ISPLANRUNNINGPARAM._serialized_end=1282 - _ISPLANRUNNINGRESPONSE._serialized_start=1284 - _ISPLANRUNNINGRESPONSE._serialized_end=1327 - _COMPUTEPLANSERVICE._serialized_start=1402 - _COMPUTEPLANSERVICE._serialized_end=1922 + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' + _globals['_COMPUTEPLAN_METADATAENTRY']._options = None + _globals['_COMPUTEPLAN_METADATAENTRY']._serialized_options = b'8\001' + _globals['_NEWCOMPUTEPLAN_METADATAENTRY']._options = None + _globals['_NEWCOMPUTEPLAN_METADATAENTRY']._serialized_options = b'8\001' + _globals['_COMPUTEPLANACTION']._serialized_start=1329 + _globals['_COMPUTEPLANACTION']._serialized_end=1399 + _globals['_COMPUTEPLAN']._serialized_start=69 + _globals['_COMPUTEPLAN']._serialized_end=584 + _globals['_COMPUTEPLAN_METADATAENTRY']._serialized_start=353 + _globals['_COMPUTEPLAN_METADATAENTRY']._serialized_end=400 + _globals['_NEWCOMPUTEPLAN']._serialized_start=587 + _globals['_NEWCOMPUTEPLAN']._serialized_end=788 + _globals['_NEWCOMPUTEPLAN_METADATAENTRY']._serialized_start=353 + _globals['_NEWCOMPUTEPLAN_METADATAENTRY']._serialized_end=400 + _globals['_GETCOMPUTEPLANPARAM']._serialized_start=790 + _globals['_GETCOMPUTEPLANPARAM']._serialized_end=824 + _globals['_APPLYPLANACTIONPARAM']._serialized_start=826 + _globals['_APPLYPLANACTIONPARAM']._serialized_end=910 + _globals['_APPLYPLANACTIONRESPONSE']._serialized_start=912 + _globals['_APPLYPLANACTIONRESPONSE']._serialized_end=937 + _globals['_PLANQUERYFILTER']._serialized_start=939 + _globals['_PLANQUERYFILTER']._serialized_end=971 + _globals['_QUERYPLANSPARAM']._serialized_start=973 + _globals['_QUERYPLANSPARAM']._serialized_end=1076 + _globals['_QUERYPLANSRESPONSE']._serialized_start=1078 + _globals['_QUERYPLANSRESPONSE']._serialized_end=1165 + _globals['_UPDATECOMPUTEPLANPARAM']._serialized_start=1167 + _globals['_UPDATECOMPUTEPLANPARAM']._serialized_end=1218 + _globals['_UPDATECOMPUTEPLANRESPONSE']._serialized_start=1220 + _globals['_UPDATECOMPUTEPLANRESPONSE']._serialized_end=1247 + _globals['_ISPLANRUNNINGPARAM']._serialized_start=1249 + _globals['_ISPLANRUNNINGPARAM']._serialized_end=1282 + _globals['_ISPLANRUNNINGRESPONSE']._serialized_start=1284 + _globals['_ISPLANRUNNINGRESPONSE']._serialized_end=1327 + _globals['_COMPUTEPLANSERVICE']._serialized_start=1402 + _globals['_COMPUTEPLANSERVICE']._serialized_end=1922 # @@protoc_insertion_point(module_scope) diff --git a/backend/orchestrator/computeplan_pb2_grpc.pyi b/backend/orchestrator/computeplan_pb2_grpc.pyi index ffb149cac..293dada26 100644 --- a/backend/orchestrator/computeplan_pb2_grpc.pyi +++ b/backend/orchestrator/computeplan_pb2_grpc.pyi @@ -3,11 +3,22 @@ isort:skip_file """ import abc +import collections.abc import computeplan_pb2 import grpc +import grpc.aio +import typing + +_T = typing.TypeVar('_T') + +class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): + ... + +class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore + ... class ComputePlanServiceStub: - def __init__(self, channel: grpc.Channel) -> None: ... + def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ... RegisterPlan: grpc.UnaryUnaryMultiCallable[ computeplan_pb2.NewComputePlan, computeplan_pb2.ComputePlan, @@ -33,42 +44,68 @@ class ComputePlanServiceStub: computeplan_pb2.IsPlanRunningResponse, ] +class ComputePlanServiceAsyncStub: + RegisterPlan: grpc.aio.UnaryUnaryMultiCallable[ + computeplan_pb2.NewComputePlan, + computeplan_pb2.ComputePlan, + ] + GetPlan: grpc.aio.UnaryUnaryMultiCallable[ + computeplan_pb2.GetComputePlanParam, + computeplan_pb2.ComputePlan, + ] + ApplyPlanAction: grpc.aio.UnaryUnaryMultiCallable[ + computeplan_pb2.ApplyPlanActionParam, + computeplan_pb2.ApplyPlanActionResponse, + ] + QueryPlans: grpc.aio.UnaryUnaryMultiCallable[ + computeplan_pb2.QueryPlansParam, + computeplan_pb2.QueryPlansResponse, + ] + UpdatePlan: grpc.aio.UnaryUnaryMultiCallable[ + computeplan_pb2.UpdateComputePlanParam, + computeplan_pb2.UpdateComputePlanResponse, + ] + IsPlanRunning: grpc.aio.UnaryUnaryMultiCallable[ + computeplan_pb2.IsPlanRunningParam, + computeplan_pb2.IsPlanRunningResponse, + ] + class ComputePlanServiceServicer(metaclass=abc.ABCMeta): @abc.abstractmethod def RegisterPlan( self, request: computeplan_pb2.NewComputePlan, - context: grpc.ServicerContext, - ) -> computeplan_pb2.ComputePlan: ... + context: _ServicerContext, + ) -> typing.Union[computeplan_pb2.ComputePlan, collections.abc.Awaitable[computeplan_pb2.ComputePlan]]: ... @abc.abstractmethod def GetPlan( self, request: computeplan_pb2.GetComputePlanParam, - context: grpc.ServicerContext, - ) -> computeplan_pb2.ComputePlan: ... + context: _ServicerContext, + ) -> typing.Union[computeplan_pb2.ComputePlan, collections.abc.Awaitable[computeplan_pb2.ComputePlan]]: ... @abc.abstractmethod def ApplyPlanAction( self, request: computeplan_pb2.ApplyPlanActionParam, - context: grpc.ServicerContext, - ) -> computeplan_pb2.ApplyPlanActionResponse: ... + context: _ServicerContext, + ) -> typing.Union[computeplan_pb2.ApplyPlanActionResponse, collections.abc.Awaitable[computeplan_pb2.ApplyPlanActionResponse]]: ... @abc.abstractmethod def QueryPlans( self, request: computeplan_pb2.QueryPlansParam, - context: grpc.ServicerContext, - ) -> computeplan_pb2.QueryPlansResponse: ... + context: _ServicerContext, + ) -> typing.Union[computeplan_pb2.QueryPlansResponse, collections.abc.Awaitable[computeplan_pb2.QueryPlansResponse]]: ... @abc.abstractmethod def UpdatePlan( self, request: computeplan_pb2.UpdateComputePlanParam, - context: grpc.ServicerContext, - ) -> computeplan_pb2.UpdateComputePlanResponse: ... + context: _ServicerContext, + ) -> typing.Union[computeplan_pb2.UpdateComputePlanResponse, collections.abc.Awaitable[computeplan_pb2.UpdateComputePlanResponse]]: ... @abc.abstractmethod def IsPlanRunning( self, request: computeplan_pb2.IsPlanRunningParam, - context: grpc.ServicerContext, - ) -> computeplan_pb2.IsPlanRunningResponse: ... + context: _ServicerContext, + ) -> typing.Union[computeplan_pb2.IsPlanRunningResponse, collections.abc.Awaitable[computeplan_pb2.IsPlanRunningResponse]]: ... -def add_ComputePlanServiceServicer_to_server(servicer: ComputePlanServiceServicer, server: grpc.Server) -> None: ... +def add_ComputePlanServiceServicer_to_server(servicer: ComputePlanServiceServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ... diff --git a/backend/orchestrator/computetask_pb2.py b/backend/orchestrator/computetask_pb2.py index 32036bad8..252594b40 100644 --- a/backend/orchestrator/computetask_pb2.py +++ b/backend/orchestrator/computetask_pb2.py @@ -1,11 +1,12 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: computetask.proto +# Protobuf Python Version: 4.25.0 """Generated protocol buffer code.""" -from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -20,72 +21,72 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11\x63omputetask.proto\x12\x0corchestrator\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x0bmodel.proto\x1a\x11\x64\x61tamanager.proto\x1a\x10\x64\x61tasample.proto\x1a\x0c\x63ommon.proto\"I\n\x13ParentTaskOutputRef\x12\x17\n\x0fparent_task_key\x18\x01 \x01(\t\x12\x19\n\x11output_identifier\x18\x02 \x01(\t\"\x83\x01\n\x10\x43omputeTaskInput\x12\x12\n\nidentifier\x18\x01 \x01(\t\x12\x13\n\tasset_key\x18\x02 \x01(\tH\x00\x12?\n\x12parent_task_output\x18\x03 \x01(\x0b\x32!.orchestrator.ParentTaskOutputRefH\x00\x42\x05\n\x03ref\"V\n\x11\x43omputeTaskOutput\x12.\n\x0bpermissions\x18\x01 \x01(\x0b\x32\x19.orchestrator.Permissions\x12\x11\n\ttransient\x18\x02 \x01(\x08\"\\\n\x14NewComputeTaskOutput\x12\x31\n\x0bpermissions\x18\x01 \x01(\x0b\x32\x1c.orchestrator.NewPermissions\x12\x11\n\ttransient\x18\x02 \x01(\x08\"\xbc\x05\n\x0b\x43omputeTask\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05owner\x18\x04 \x01(\t\x12\x18\n\x10\x63ompute_plan_key\x18\x05 \x01(\t\x12\x0c\n\x04rank\x18\x07 \x01(\x05\x12/\n\x06status\x18\x08 \x01(\x0e\x32\x1f.orchestrator.ComputeTaskStatus\x12\x0e\n\x06worker\x18\t \x01(\t\x12\x31\n\rcreation_date\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x31\n\x0flogs_permission\x18\x0b \x01(\x0b\x32\x18.orchestrator.Permission\x12\x39\n\x08metadata\x18\x10 \x03(\x0b\x32\'.orchestrator.ComputeTask.MetadataEntry\x12.\n\x06inputs\x18\x11 \x03(\x0b\x32\x1e.orchestrator.ComputeTaskInput\x12\x37\n\x07outputs\x18\x13 \x03(\x0b\x32&.orchestrator.ComputeTask.OutputsEntry\x12\x14\n\x0c\x66unction_key\x18\x14 \x01(\t\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1aO\n\x0cOutputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.orchestrator.ComputeTaskOutput:\x02\x38\x01J\x04\x08\x02\x10\x03J\x04\x08\x03\x10\x04J\x04\x08\x06\x10\x07J\x04\x08\x0c\x10\rJ\x04\x08\r\x10\x0eJ\x04\x08\x0e\x10\x0fJ\x04\x08\x0f\x10\x10J\x04\x08\x12\x10\x13R\x08\x63\x61tegoryR\x08\x66unctionR\x04\x64\x61taR\x04testR\x05trainR\tcompositeR\taggregateR\x10parent_task_keysR\x07predict\"\x84\x04\n\x0eNewComputeTask\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x14\n\x0c\x66unction_key\x18\x03 \x01(\t\x12\x18\n\x10\x63ompute_plan_key\x18\x04 \x01(\t\x12\x0e\n\x06worker\x18\x06 \x01(\t\x12<\n\x08metadata\x18\x10 \x03(\x0b\x32*.orchestrator.NewComputeTask.MetadataEntry\x12.\n\x06inputs\x18\x11 \x03(\x0b\x32\x1e.orchestrator.ComputeTaskInput\x12:\n\x07outputs\x18\x13 \x03(\x0b\x32).orchestrator.NewComputeTask.OutputsEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1aR\n\x0cOutputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x31\n\x05value\x18\x02 \x01(\x0b\x32\".orchestrator.NewComputeTaskOutput:\x02\x38\x01J\x04\x08\x02\x10\x03J\x04\x08\x05\x10\x06J\x04\x08\x0c\x10\rJ\x04\x08\r\x10\x0eJ\x04\x08\x0e\x10\x0fJ\x04\x08\x0f\x10\x10J\x04\x08\x12\x10\x13R\x08\x63\x61tegoryR\x10parent_task_keysR\x04\x64\x61taR\x04testR\x05trainR\tcompositeR\taggregateR\x07predict\"A\n\x12RegisterTasksParam\x12+\n\x05tasks\x18\x01 \x03(\x0b\x32\x1c.orchestrator.NewComputeTask\"A\n\x15RegisterTasksResponse\x12(\n\x05tasks\x18\x01 \x03(\x0b\x32\x19.orchestrator.ComputeTask\"\x92\x01\n\x0fTaskQueryFilter\x12\x0e\n\x06worker\x18\x01 \x01(\t\x12/\n\x06status\x18\x02 \x01(\x0e\x32\x1f.orchestrator.ComputeTaskStatus\x12\x18\n\x10\x63ompute_plan_key\x18\x04 \x01(\t\x12\x14\n\x0c\x66unction_key\x18\x05 \x01(\tJ\x04\x08\x03\x10\x04R\x08\x63\x61tegory\"g\n\x0fQueryTasksParam\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\r\x12-\n\x06\x66ilter\x18\x03 \x01(\x0b\x32\x1d.orchestrator.TaskQueryFilter\"W\n\x12QueryTasksResponse\x12(\n\x05tasks\x18\x01 \x03(\x0b\x32\x19.orchestrator.ComputeTask\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x1b\n\x0cGetTaskParam\x12\x0b\n\x03key\x18\x01 \x01(\t\"\x9a\x01\n\x16\x43omputeTaskOutputAsset\x12\x18\n\x10\x63ompute_task_key\x18\x01 \x01(\t\x12&\n\x1e\x63ompute_task_output_identifier\x18\x02 \x01(\t\x12+\n\nasset_kind\x18\x03 \x01(\x0e\x32\x17.orchestrator.AssetKind\x12\x11\n\tasset_key\x18\x04 \x01(\t\"n\n\x14\x41pplyTaskActionParam\x12\x18\n\x10\x63ompute_task_key\x18\x01 \x01(\t\x12/\n\x06\x61\x63tion\x18\x02 \x01(\x0e\x32\x1f.orchestrator.ComputeTaskAction\x12\x0b\n\x03log\x18\x03 \x01(\t\"\x19\n\x17\x41pplyTaskActionResponse\"\xbe\x01\n\x15\x43omputeTaskInputAsset\x12\x12\n\nidentifier\x18\x01 \x01(\t\x12$\n\x05model\x18\x02 \x01(\x0b\x32\x13.orchestrator.ModelH\x00\x12\x31\n\x0c\x64\x61ta_manager\x18\x03 \x01(\x0b\x32\x19.orchestrator.DataManagerH\x00\x12/\n\x0b\x64\x61ta_sample\x18\x04 \x01(\x0b\x32\x18.orchestrator.DataSampleH\x00\x42\x07\n\x05\x61sset\"3\n\x17GetTaskInputAssetsParam\x12\x18\n\x10\x63ompute_task_key\x18\x01 \x01(\t\"Q\n\x1aGetTaskInputAssetsResponse\x12\x33\n\x06\x61ssets\x18\x01 \x03(\x0b\x32#.orchestrator.ComputeTaskInputAsset\"B\n\x12\x44isableOutputParam\x12\x18\n\x10\x63ompute_task_key\x18\x01 \x01(\t\x12\x12\n\nidentifier\x18\x02 \x01(\t\"\x17\n\x15\x44isableOutputResponse*\x97\x01\n\x11\x43omputeTaskStatus\x12\x12\n\x0eSTATUS_UNKNOWN\x10\x00\x12\x12\n\x0eSTATUS_WAITING\x10\x01\x12\x0f\n\x0bSTATUS_TODO\x10\x02\x12\x10\n\x0cSTATUS_DOING\x10\x03\x12\x0f\n\x0bSTATUS_DONE\x10\x04\x12\x13\n\x0fSTATUS_CANCELED\x10\x05\x12\x11\n\rSTATUS_FAILED\x10\x06*\x8b\x01\n\x11\x43omputeTaskAction\x12\x17\n\x13TASK_ACTION_UNKNOWN\x10\x00\x12\x15\n\x11TASK_ACTION_DOING\x10\x01\x12\x18\n\x14TASK_ACTION_CANCELED\x10\x02\x12\x16\n\x12TASK_ACTION_FAILED\x10\x03\x12\x14\n\x10TASK_ACTION_DONE\x10\x04\x32\x9a\x04\n\x12\x43omputeTaskService\x12V\n\rRegisterTasks\x12 .orchestrator.RegisterTasksParam\x1a#.orchestrator.RegisterTasksResponse\x12M\n\nQueryTasks\x12\x1d.orchestrator.QueryTasksParam\x1a .orchestrator.QueryTasksResponse\x12@\n\x07GetTask\x12\x1a.orchestrator.GetTaskParam\x1a\x19.orchestrator.ComputeTask\x12\\\n\x0f\x41pplyTaskAction\x12\".orchestrator.ApplyTaskActionParam\x1a%.orchestrator.ApplyTaskActionResponse\x12\x65\n\x12GetTaskInputAssets\x12%.orchestrator.GetTaskInputAssetsParam\x1a(.orchestrator.GetTaskInputAssetsResponse\x12V\n\rDisableOutput\x12 .orchestrator.DisableOutputParam\x1a#.orchestrator.DisableOutputResponseB+Z)github.com/substra/orchestrator/lib/assetb\x06proto3') -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'computetask_pb2', globals()) +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'computetask_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' - _COMPUTETASK_METADATAENTRY._options = None - _COMPUTETASK_METADATAENTRY._serialized_options = b'8\001' - _COMPUTETASK_OUTPUTSENTRY._options = None - _COMPUTETASK_OUTPUTSENTRY._serialized_options = b'8\001' - _NEWCOMPUTETASK_METADATAENTRY._options = None - _NEWCOMPUTETASK_METADATAENTRY._serialized_options = b'8\001' - _NEWCOMPUTETASK_OUTPUTSENTRY._options = None - _NEWCOMPUTETASK_OUTPUTSENTRY._serialized_options = b'8\001' - _COMPUTETASKSTATUS._serialized_start=2970 - _COMPUTETASKSTATUS._serialized_end=3121 - _COMPUTETASKACTION._serialized_start=3124 - _COMPUTETASKACTION._serialized_end=3263 - _PARENTTASKOUTPUTREF._serialized_start=132 - _PARENTTASKOUTPUTREF._serialized_end=205 - _COMPUTETASKINPUT._serialized_start=208 - _COMPUTETASKINPUT._serialized_end=339 - _COMPUTETASKOUTPUT._serialized_start=341 - _COMPUTETASKOUTPUT._serialized_end=427 - _NEWCOMPUTETASKOUTPUT._serialized_start=429 - _NEWCOMPUTETASKOUTPUT._serialized_end=521 - _COMPUTETASK._serialized_start=524 - _COMPUTETASK._serialized_end=1224 - _COMPUTETASK_METADATAENTRY._serialized_start=960 - _COMPUTETASK_METADATAENTRY._serialized_end=1007 - _COMPUTETASK_OUTPUTSENTRY._serialized_start=1009 - _COMPUTETASK_OUTPUTSENTRY._serialized_end=1088 - _NEWCOMPUTETASK._serialized_start=1227 - _NEWCOMPUTETASK._serialized_end=1743 - _NEWCOMPUTETASK_METADATAENTRY._serialized_start=960 - _NEWCOMPUTETASK_METADATAENTRY._serialized_end=1007 - _NEWCOMPUTETASK_OUTPUTSENTRY._serialized_start=1541 - _NEWCOMPUTETASK_OUTPUTSENTRY._serialized_end=1623 - _REGISTERTASKSPARAM._serialized_start=1745 - _REGISTERTASKSPARAM._serialized_end=1810 - _REGISTERTASKSRESPONSE._serialized_start=1812 - _REGISTERTASKSRESPONSE._serialized_end=1877 - _TASKQUERYFILTER._serialized_start=1880 - _TASKQUERYFILTER._serialized_end=2026 - _QUERYTASKSPARAM._serialized_start=2028 - _QUERYTASKSPARAM._serialized_end=2131 - _QUERYTASKSRESPONSE._serialized_start=2133 - _QUERYTASKSRESPONSE._serialized_end=2220 - _GETTASKPARAM._serialized_start=2222 - _GETTASKPARAM._serialized_end=2249 - _COMPUTETASKOUTPUTASSET._serialized_start=2252 - _COMPUTETASKOUTPUTASSET._serialized_end=2406 - _APPLYTASKACTIONPARAM._serialized_start=2408 - _APPLYTASKACTIONPARAM._serialized_end=2518 - _APPLYTASKACTIONRESPONSE._serialized_start=2520 - _APPLYTASKACTIONRESPONSE._serialized_end=2545 - _COMPUTETASKINPUTASSET._serialized_start=2548 - _COMPUTETASKINPUTASSET._serialized_end=2738 - _GETTASKINPUTASSETSPARAM._serialized_start=2740 - _GETTASKINPUTASSETSPARAM._serialized_end=2791 - _GETTASKINPUTASSETSRESPONSE._serialized_start=2793 - _GETTASKINPUTASSETSRESPONSE._serialized_end=2874 - _DISABLEOUTPUTPARAM._serialized_start=2876 - _DISABLEOUTPUTPARAM._serialized_end=2942 - _DISABLEOUTPUTRESPONSE._serialized_start=2944 - _DISABLEOUTPUTRESPONSE._serialized_end=2967 - _COMPUTETASKSERVICE._serialized_start=3266 - _COMPUTETASKSERVICE._serialized_end=3804 + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' + _globals['_COMPUTETASK_METADATAENTRY']._options = None + _globals['_COMPUTETASK_METADATAENTRY']._serialized_options = b'8\001' + _globals['_COMPUTETASK_OUTPUTSENTRY']._options = None + _globals['_COMPUTETASK_OUTPUTSENTRY']._serialized_options = b'8\001' + _globals['_NEWCOMPUTETASK_METADATAENTRY']._options = None + _globals['_NEWCOMPUTETASK_METADATAENTRY']._serialized_options = b'8\001' + _globals['_NEWCOMPUTETASK_OUTPUTSENTRY']._options = None + _globals['_NEWCOMPUTETASK_OUTPUTSENTRY']._serialized_options = b'8\001' + _globals['_COMPUTETASKSTATUS']._serialized_start=2970 + _globals['_COMPUTETASKSTATUS']._serialized_end=3121 + _globals['_COMPUTETASKACTION']._serialized_start=3124 + _globals['_COMPUTETASKACTION']._serialized_end=3263 + _globals['_PARENTTASKOUTPUTREF']._serialized_start=132 + _globals['_PARENTTASKOUTPUTREF']._serialized_end=205 + _globals['_COMPUTETASKINPUT']._serialized_start=208 + _globals['_COMPUTETASKINPUT']._serialized_end=339 + _globals['_COMPUTETASKOUTPUT']._serialized_start=341 + _globals['_COMPUTETASKOUTPUT']._serialized_end=427 + _globals['_NEWCOMPUTETASKOUTPUT']._serialized_start=429 + _globals['_NEWCOMPUTETASKOUTPUT']._serialized_end=521 + _globals['_COMPUTETASK']._serialized_start=524 + _globals['_COMPUTETASK']._serialized_end=1224 + _globals['_COMPUTETASK_METADATAENTRY']._serialized_start=960 + _globals['_COMPUTETASK_METADATAENTRY']._serialized_end=1007 + _globals['_COMPUTETASK_OUTPUTSENTRY']._serialized_start=1009 + _globals['_COMPUTETASK_OUTPUTSENTRY']._serialized_end=1088 + _globals['_NEWCOMPUTETASK']._serialized_start=1227 + _globals['_NEWCOMPUTETASK']._serialized_end=1743 + _globals['_NEWCOMPUTETASK_METADATAENTRY']._serialized_start=960 + _globals['_NEWCOMPUTETASK_METADATAENTRY']._serialized_end=1007 + _globals['_NEWCOMPUTETASK_OUTPUTSENTRY']._serialized_start=1541 + _globals['_NEWCOMPUTETASK_OUTPUTSENTRY']._serialized_end=1623 + _globals['_REGISTERTASKSPARAM']._serialized_start=1745 + _globals['_REGISTERTASKSPARAM']._serialized_end=1810 + _globals['_REGISTERTASKSRESPONSE']._serialized_start=1812 + _globals['_REGISTERTASKSRESPONSE']._serialized_end=1877 + _globals['_TASKQUERYFILTER']._serialized_start=1880 + _globals['_TASKQUERYFILTER']._serialized_end=2026 + _globals['_QUERYTASKSPARAM']._serialized_start=2028 + _globals['_QUERYTASKSPARAM']._serialized_end=2131 + _globals['_QUERYTASKSRESPONSE']._serialized_start=2133 + _globals['_QUERYTASKSRESPONSE']._serialized_end=2220 + _globals['_GETTASKPARAM']._serialized_start=2222 + _globals['_GETTASKPARAM']._serialized_end=2249 + _globals['_COMPUTETASKOUTPUTASSET']._serialized_start=2252 + _globals['_COMPUTETASKOUTPUTASSET']._serialized_end=2406 + _globals['_APPLYTASKACTIONPARAM']._serialized_start=2408 + _globals['_APPLYTASKACTIONPARAM']._serialized_end=2518 + _globals['_APPLYTASKACTIONRESPONSE']._serialized_start=2520 + _globals['_APPLYTASKACTIONRESPONSE']._serialized_end=2545 + _globals['_COMPUTETASKINPUTASSET']._serialized_start=2548 + _globals['_COMPUTETASKINPUTASSET']._serialized_end=2738 + _globals['_GETTASKINPUTASSETSPARAM']._serialized_start=2740 + _globals['_GETTASKINPUTASSETSPARAM']._serialized_end=2791 + _globals['_GETTASKINPUTASSETSRESPONSE']._serialized_start=2793 + _globals['_GETTASKINPUTASSETSRESPONSE']._serialized_end=2874 + _globals['_DISABLEOUTPUTPARAM']._serialized_start=2876 + _globals['_DISABLEOUTPUTPARAM']._serialized_end=2942 + _globals['_DISABLEOUTPUTRESPONSE']._serialized_start=2944 + _globals['_DISABLEOUTPUTRESPONSE']._serialized_end=2967 + _globals['_COMPUTETASKSERVICE']._serialized_start=3266 + _globals['_COMPUTETASKSERVICE']._serialized_end=3804 # @@protoc_insertion_point(module_scope) diff --git a/backend/orchestrator/computetask_pb2_grpc.pyi b/backend/orchestrator/computetask_pb2_grpc.pyi index 782c90b80..048aca8ad 100644 --- a/backend/orchestrator/computetask_pb2_grpc.pyi +++ b/backend/orchestrator/computetask_pb2_grpc.pyi @@ -3,11 +3,22 @@ isort:skip_file """ import abc +import collections.abc import computetask_pb2 import grpc +import grpc.aio +import typing + +_T = typing.TypeVar('_T') + +class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): + ... + +class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore + ... class ComputeTaskServiceStub: - def __init__(self, channel: grpc.Channel) -> None: ... + def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ... RegisterTasks: grpc.UnaryUnaryMultiCallable[ computetask_pb2.RegisterTasksParam, computetask_pb2.RegisterTasksResponse, @@ -33,42 +44,68 @@ class ComputeTaskServiceStub: computetask_pb2.DisableOutputResponse, ] +class ComputeTaskServiceAsyncStub: + RegisterTasks: grpc.aio.UnaryUnaryMultiCallable[ + computetask_pb2.RegisterTasksParam, + computetask_pb2.RegisterTasksResponse, + ] + QueryTasks: grpc.aio.UnaryUnaryMultiCallable[ + computetask_pb2.QueryTasksParam, + computetask_pb2.QueryTasksResponse, + ] + GetTask: grpc.aio.UnaryUnaryMultiCallable[ + computetask_pb2.GetTaskParam, + computetask_pb2.ComputeTask, + ] + ApplyTaskAction: grpc.aio.UnaryUnaryMultiCallable[ + computetask_pb2.ApplyTaskActionParam, + computetask_pb2.ApplyTaskActionResponse, + ] + GetTaskInputAssets: grpc.aio.UnaryUnaryMultiCallable[ + computetask_pb2.GetTaskInputAssetsParam, + computetask_pb2.GetTaskInputAssetsResponse, + ] + DisableOutput: grpc.aio.UnaryUnaryMultiCallable[ + computetask_pb2.DisableOutputParam, + computetask_pb2.DisableOutputResponse, + ] + class ComputeTaskServiceServicer(metaclass=abc.ABCMeta): @abc.abstractmethod def RegisterTasks( self, request: computetask_pb2.RegisterTasksParam, - context: grpc.ServicerContext, - ) -> computetask_pb2.RegisterTasksResponse: ... + context: _ServicerContext, + ) -> typing.Union[computetask_pb2.RegisterTasksResponse, collections.abc.Awaitable[computetask_pb2.RegisterTasksResponse]]: ... @abc.abstractmethod def QueryTasks( self, request: computetask_pb2.QueryTasksParam, - context: grpc.ServicerContext, - ) -> computetask_pb2.QueryTasksResponse: ... + context: _ServicerContext, + ) -> typing.Union[computetask_pb2.QueryTasksResponse, collections.abc.Awaitable[computetask_pb2.QueryTasksResponse]]: ... @abc.abstractmethod def GetTask( self, request: computetask_pb2.GetTaskParam, - context: grpc.ServicerContext, - ) -> computetask_pb2.ComputeTask: ... + context: _ServicerContext, + ) -> typing.Union[computetask_pb2.ComputeTask, collections.abc.Awaitable[computetask_pb2.ComputeTask]]: ... @abc.abstractmethod def ApplyTaskAction( self, request: computetask_pb2.ApplyTaskActionParam, - context: grpc.ServicerContext, - ) -> computetask_pb2.ApplyTaskActionResponse: ... + context: _ServicerContext, + ) -> typing.Union[computetask_pb2.ApplyTaskActionResponse, collections.abc.Awaitable[computetask_pb2.ApplyTaskActionResponse]]: ... @abc.abstractmethod def GetTaskInputAssets( self, request: computetask_pb2.GetTaskInputAssetsParam, - context: grpc.ServicerContext, - ) -> computetask_pb2.GetTaskInputAssetsResponse: ... + context: _ServicerContext, + ) -> typing.Union[computetask_pb2.GetTaskInputAssetsResponse, collections.abc.Awaitable[computetask_pb2.GetTaskInputAssetsResponse]]: ... @abc.abstractmethod def DisableOutput( self, request: computetask_pb2.DisableOutputParam, - context: grpc.ServicerContext, - ) -> computetask_pb2.DisableOutputResponse: ... + context: _ServicerContext, + ) -> typing.Union[computetask_pb2.DisableOutputResponse, collections.abc.Awaitable[computetask_pb2.DisableOutputResponse]]: ... -def add_ComputeTaskServiceServicer_to_server(servicer: ComputeTaskServiceServicer, server: grpc.Server) -> None: ... +def add_ComputeTaskServiceServicer_to_server(servicer: ComputeTaskServiceServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ... diff --git a/backend/orchestrator/datamanager_pb2.py b/backend/orchestrator/datamanager_pb2.py index 62e196b60..8a714b26f 100644 --- a/backend/orchestrator/datamanager_pb2.py +++ b/backend/orchestrator/datamanager_pb2.py @@ -1,11 +1,12 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: datamanager.proto +# Protobuf Python Version: 4.25.0 """Generated protocol buffer code.""" -from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -17,34 +18,34 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11\x64\x61tamanager.proto\x12\x0corchestrator\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x0c\x63ommon.proto\"\xa2\x03\n\x0b\x44\x61taManager\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\r\n\x05owner\x18\x03 \x01(\t\x12.\n\x0bpermissions\x18\x04 \x01(\x0b\x32\x19.orchestrator.Permissions\x12.\n\x0b\x64\x65scription\x18\x06 \x01(\x0b\x32\x19.orchestrator.Addressable\x12)\n\x06opener\x18\x07 \x01(\x0b\x32\x19.orchestrator.Addressable\x12\x0c\n\x04type\x18\x08 \x01(\t\x12\x31\n\rcreation_date\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x31\n\x0flogs_permission\x18\n \x01(\x0b\x32\x18.orchestrator.Permission\x12\x39\n\x08metadata\x18\x10 \x03(\x0b\x32\'.orchestrator.DataManager.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xf1\x02\n\x0eNewDataManager\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x35\n\x0fnew_permissions\x18\x03 \x01(\x0b\x32\x1c.orchestrator.NewPermissions\x12.\n\x0b\x64\x65scription\x18\x05 \x01(\x0b\x32\x19.orchestrator.Addressable\x12)\n\x06opener\x18\x06 \x01(\x0b\x32\x19.orchestrator.Addressable\x12\x0c\n\x04type\x18\x07 \x01(\t\x12\x35\n\x0flogs_permission\x18\x08 \x01(\x0b\x32\x1c.orchestrator.NewPermissions\x12<\n\x08metadata\x18\x10 \x03(\x0b\x32*.orchestrator.NewDataManager.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\"\n\x13GetDataManagerParam\x12\x0b\n\x03key\x18\x01 \x01(\t\"?\n\x16QueryDataManagersParam\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\r\"f\n\x19QueryDataManagersResponse\x12\x30\n\rdata_managers\x18\x01 \x03(\x0b\x32\x19.orchestrator.DataManager\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"3\n\x16UpdateDataManagerParam\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\"\x1b\n\x19UpdateDataManagerResponse2\xfc\x02\n\x12\x44\x61taManagerService\x12N\n\x13RegisterDataManager\x12\x1c.orchestrator.NewDataManager\x1a\x19.orchestrator.DataManager\x12N\n\x0eGetDataManager\x12!.orchestrator.GetDataManagerParam\x1a\x19.orchestrator.DataManager\x12\x62\n\x11QueryDataManagers\x12$.orchestrator.QueryDataManagersParam\x1a\'.orchestrator.QueryDataManagersResponse\x12\x62\n\x11UpdateDataManager\x12$.orchestrator.UpdateDataManagerParam\x1a\'.orchestrator.UpdateDataManagerResponseB+Z)github.com/substra/orchestrator/lib/assetb\x06proto3') -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'datamanager_pb2', globals()) +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'datamanager_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' - _DATAMANAGER_METADATAENTRY._options = None - _DATAMANAGER_METADATAENTRY._serialized_options = b'8\001' - _NEWDATAMANAGER_METADATAENTRY._options = None - _NEWDATAMANAGER_METADATAENTRY._serialized_options = b'8\001' - _DATAMANAGER._serialized_start=83 - _DATAMANAGER._serialized_end=501 - _DATAMANAGER_METADATAENTRY._serialized_start=454 - _DATAMANAGER_METADATAENTRY._serialized_end=501 - _NEWDATAMANAGER._serialized_start=504 - _NEWDATAMANAGER._serialized_end=873 - _NEWDATAMANAGER_METADATAENTRY._serialized_start=454 - _NEWDATAMANAGER_METADATAENTRY._serialized_end=501 - _GETDATAMANAGERPARAM._serialized_start=875 - _GETDATAMANAGERPARAM._serialized_end=909 - _QUERYDATAMANAGERSPARAM._serialized_start=911 - _QUERYDATAMANAGERSPARAM._serialized_end=974 - _QUERYDATAMANAGERSRESPONSE._serialized_start=976 - _QUERYDATAMANAGERSRESPONSE._serialized_end=1078 - _UPDATEDATAMANAGERPARAM._serialized_start=1080 - _UPDATEDATAMANAGERPARAM._serialized_end=1131 - _UPDATEDATAMANAGERRESPONSE._serialized_start=1133 - _UPDATEDATAMANAGERRESPONSE._serialized_end=1160 - _DATAMANAGERSERVICE._serialized_start=1163 - _DATAMANAGERSERVICE._serialized_end=1543 + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' + _globals['_DATAMANAGER_METADATAENTRY']._options = None + _globals['_DATAMANAGER_METADATAENTRY']._serialized_options = b'8\001' + _globals['_NEWDATAMANAGER_METADATAENTRY']._options = None + _globals['_NEWDATAMANAGER_METADATAENTRY']._serialized_options = b'8\001' + _globals['_DATAMANAGER']._serialized_start=83 + _globals['_DATAMANAGER']._serialized_end=501 + _globals['_DATAMANAGER_METADATAENTRY']._serialized_start=454 + _globals['_DATAMANAGER_METADATAENTRY']._serialized_end=501 + _globals['_NEWDATAMANAGER']._serialized_start=504 + _globals['_NEWDATAMANAGER']._serialized_end=873 + _globals['_NEWDATAMANAGER_METADATAENTRY']._serialized_start=454 + _globals['_NEWDATAMANAGER_METADATAENTRY']._serialized_end=501 + _globals['_GETDATAMANAGERPARAM']._serialized_start=875 + _globals['_GETDATAMANAGERPARAM']._serialized_end=909 + _globals['_QUERYDATAMANAGERSPARAM']._serialized_start=911 + _globals['_QUERYDATAMANAGERSPARAM']._serialized_end=974 + _globals['_QUERYDATAMANAGERSRESPONSE']._serialized_start=976 + _globals['_QUERYDATAMANAGERSRESPONSE']._serialized_end=1078 + _globals['_UPDATEDATAMANAGERPARAM']._serialized_start=1080 + _globals['_UPDATEDATAMANAGERPARAM']._serialized_end=1131 + _globals['_UPDATEDATAMANAGERRESPONSE']._serialized_start=1133 + _globals['_UPDATEDATAMANAGERRESPONSE']._serialized_end=1160 + _globals['_DATAMANAGERSERVICE']._serialized_start=1163 + _globals['_DATAMANAGERSERVICE']._serialized_end=1543 # @@protoc_insertion_point(module_scope) diff --git a/backend/orchestrator/datamanager_pb2_grpc.pyi b/backend/orchestrator/datamanager_pb2_grpc.pyi index a1405a0e8..04f1bc7c4 100644 --- a/backend/orchestrator/datamanager_pb2_grpc.pyi +++ b/backend/orchestrator/datamanager_pb2_grpc.pyi @@ -3,11 +3,22 @@ isort:skip_file """ import abc +import collections.abc import datamanager_pb2 import grpc +import grpc.aio +import typing + +_T = typing.TypeVar('_T') + +class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): + ... + +class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore + ... class DataManagerServiceStub: - def __init__(self, channel: grpc.Channel) -> None: ... + def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ... RegisterDataManager: grpc.UnaryUnaryMultiCallable[ datamanager_pb2.NewDataManager, datamanager_pb2.DataManager, @@ -25,30 +36,48 @@ class DataManagerServiceStub: datamanager_pb2.UpdateDataManagerResponse, ] +class DataManagerServiceAsyncStub: + RegisterDataManager: grpc.aio.UnaryUnaryMultiCallable[ + datamanager_pb2.NewDataManager, + datamanager_pb2.DataManager, + ] + GetDataManager: grpc.aio.UnaryUnaryMultiCallable[ + datamanager_pb2.GetDataManagerParam, + datamanager_pb2.DataManager, + ] + QueryDataManagers: grpc.aio.UnaryUnaryMultiCallable[ + datamanager_pb2.QueryDataManagersParam, + datamanager_pb2.QueryDataManagersResponse, + ] + UpdateDataManager: grpc.aio.UnaryUnaryMultiCallable[ + datamanager_pb2.UpdateDataManagerParam, + datamanager_pb2.UpdateDataManagerResponse, + ] + class DataManagerServiceServicer(metaclass=abc.ABCMeta): @abc.abstractmethod def RegisterDataManager( self, request: datamanager_pb2.NewDataManager, - context: grpc.ServicerContext, - ) -> datamanager_pb2.DataManager: ... + context: _ServicerContext, + ) -> typing.Union[datamanager_pb2.DataManager, collections.abc.Awaitable[datamanager_pb2.DataManager]]: ... @abc.abstractmethod def GetDataManager( self, request: datamanager_pb2.GetDataManagerParam, - context: grpc.ServicerContext, - ) -> datamanager_pb2.DataManager: ... + context: _ServicerContext, + ) -> typing.Union[datamanager_pb2.DataManager, collections.abc.Awaitable[datamanager_pb2.DataManager]]: ... @abc.abstractmethod def QueryDataManagers( self, request: datamanager_pb2.QueryDataManagersParam, - context: grpc.ServicerContext, - ) -> datamanager_pb2.QueryDataManagersResponse: ... + context: _ServicerContext, + ) -> typing.Union[datamanager_pb2.QueryDataManagersResponse, collections.abc.Awaitable[datamanager_pb2.QueryDataManagersResponse]]: ... @abc.abstractmethod def UpdateDataManager( self, request: datamanager_pb2.UpdateDataManagerParam, - context: grpc.ServicerContext, - ) -> datamanager_pb2.UpdateDataManagerResponse: ... + context: _ServicerContext, + ) -> typing.Union[datamanager_pb2.UpdateDataManagerResponse, collections.abc.Awaitable[datamanager_pb2.UpdateDataManagerResponse]]: ... -def add_DataManagerServiceServicer_to_server(servicer: DataManagerServiceServicer, server: grpc.Server) -> None: ... +def add_DataManagerServiceServicer_to_server(servicer: DataManagerServiceServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ... diff --git a/backend/orchestrator/datasample_pb2.py b/backend/orchestrator/datasample_pb2.py index 38bbc7c24..8f998c376 100644 --- a/backend/orchestrator/datasample_pb2.py +++ b/backend/orchestrator/datasample_pb2.py @@ -1,11 +1,12 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: datasample.proto +# Protobuf Python Version: 4.25.0 """Generated protocol buffer code.""" -from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -16,32 +17,32 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10\x64\x61tasample.proto\x12\x0corchestrator\x1a\x1fgoogle/protobuf/timestamp.proto\"\x9b\x01\n\nDataSample\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x19\n\x11\x64\x61ta_manager_keys\x18\x02 \x03(\t\x12\r\n\x05owner\x18\x03 \x01(\t\x12\x11\n\ttest_only\x18\x04 \x01(\x08\x12\x10\n\x08\x63hecksum\x18\x05 \x01(\t\x12\x31\n\rcreation_date\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\\\n\rNewDataSample\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x19\n\x11\x64\x61ta_manager_keys\x18\x02 \x03(\t\x12\x11\n\ttest_only\x18\x03 \x01(\x08\x12\x10\n\x08\x63hecksum\x18\x04 \x01(\t\"H\n\x18RegisterDataSamplesParam\x12,\n\x07samples\x18\x01 \x03(\x0b\x32\x1b.orchestrator.NewDataSample\"M\n\x1bRegisterDataSamplesResponse\x12.\n\x0c\x64\x61ta_samples\x18\x01 \x03(\x0b\x32\x18.orchestrator.DataSample\"A\n\x16UpdateDataSamplesParam\x12\x0c\n\x04keys\x18\x01 \x03(\t\x12\x19\n\x11\x64\x61ta_manager_keys\x18\x02 \x03(\t\"\x1b\n\x19UpdateDataSamplesResponse\"%\n\x15\x44\x61taSampleQueryFilter\x12\x0c\n\x04keys\x18\x01 \x03(\t\"s\n\x15QueryDataSamplesParam\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\r\x12\x33\n\x06\x66ilter\x18\x03 \x01(\x0b\x32#.orchestrator.DataSampleQueryFilter\"c\n\x18QueryDataSamplesResponse\x12.\n\x0c\x64\x61ta_samples\x18\x01 \x03(\x0b\x32\x18.orchestrator.DataSample\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"!\n\x12GetDataSampleParam\x12\x0b\n\x03key\x18\x01 \x01(\t2\x8f\x03\n\x11\x44\x61taSampleService\x12h\n\x13RegisterDataSamples\x12&.orchestrator.RegisterDataSamplesParam\x1a).orchestrator.RegisterDataSamplesResponse\x12\x62\n\x11UpdateDataSamples\x12$.orchestrator.UpdateDataSamplesParam\x1a\'.orchestrator.UpdateDataSamplesResponse\x12_\n\x10QueryDataSamples\x12#.orchestrator.QueryDataSamplesParam\x1a&.orchestrator.QueryDataSamplesResponse\x12K\n\rGetDataSample\x12 .orchestrator.GetDataSampleParam\x1a\x18.orchestrator.DataSampleB+Z)github.com/substra/orchestrator/lib/assetb\x06proto3') -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'datasample_pb2', globals()) +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'datasample_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' - _DATASAMPLE._serialized_start=68 - _DATASAMPLE._serialized_end=223 - _NEWDATASAMPLE._serialized_start=225 - _NEWDATASAMPLE._serialized_end=317 - _REGISTERDATASAMPLESPARAM._serialized_start=319 - _REGISTERDATASAMPLESPARAM._serialized_end=391 - _REGISTERDATASAMPLESRESPONSE._serialized_start=393 - _REGISTERDATASAMPLESRESPONSE._serialized_end=470 - _UPDATEDATASAMPLESPARAM._serialized_start=472 - _UPDATEDATASAMPLESPARAM._serialized_end=537 - _UPDATEDATASAMPLESRESPONSE._serialized_start=539 - _UPDATEDATASAMPLESRESPONSE._serialized_end=566 - _DATASAMPLEQUERYFILTER._serialized_start=568 - _DATASAMPLEQUERYFILTER._serialized_end=605 - _QUERYDATASAMPLESPARAM._serialized_start=607 - _QUERYDATASAMPLESPARAM._serialized_end=722 - _QUERYDATASAMPLESRESPONSE._serialized_start=724 - _QUERYDATASAMPLESRESPONSE._serialized_end=823 - _GETDATASAMPLEPARAM._serialized_start=825 - _GETDATASAMPLEPARAM._serialized_end=858 - _DATASAMPLESERVICE._serialized_start=861 - _DATASAMPLESERVICE._serialized_end=1260 + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' + _globals['_DATASAMPLE']._serialized_start=68 + _globals['_DATASAMPLE']._serialized_end=223 + _globals['_NEWDATASAMPLE']._serialized_start=225 + _globals['_NEWDATASAMPLE']._serialized_end=317 + _globals['_REGISTERDATASAMPLESPARAM']._serialized_start=319 + _globals['_REGISTERDATASAMPLESPARAM']._serialized_end=391 + _globals['_REGISTERDATASAMPLESRESPONSE']._serialized_start=393 + _globals['_REGISTERDATASAMPLESRESPONSE']._serialized_end=470 + _globals['_UPDATEDATASAMPLESPARAM']._serialized_start=472 + _globals['_UPDATEDATASAMPLESPARAM']._serialized_end=537 + _globals['_UPDATEDATASAMPLESRESPONSE']._serialized_start=539 + _globals['_UPDATEDATASAMPLESRESPONSE']._serialized_end=566 + _globals['_DATASAMPLEQUERYFILTER']._serialized_start=568 + _globals['_DATASAMPLEQUERYFILTER']._serialized_end=605 + _globals['_QUERYDATASAMPLESPARAM']._serialized_start=607 + _globals['_QUERYDATASAMPLESPARAM']._serialized_end=722 + _globals['_QUERYDATASAMPLESRESPONSE']._serialized_start=724 + _globals['_QUERYDATASAMPLESRESPONSE']._serialized_end=823 + _globals['_GETDATASAMPLEPARAM']._serialized_start=825 + _globals['_GETDATASAMPLEPARAM']._serialized_end=858 + _globals['_DATASAMPLESERVICE']._serialized_start=861 + _globals['_DATASAMPLESERVICE']._serialized_end=1260 # @@protoc_insertion_point(module_scope) diff --git a/backend/orchestrator/datasample_pb2_grpc.pyi b/backend/orchestrator/datasample_pb2_grpc.pyi index d2ba85809..ead6dde8b 100644 --- a/backend/orchestrator/datasample_pb2_grpc.pyi +++ b/backend/orchestrator/datasample_pb2_grpc.pyi @@ -3,11 +3,22 @@ isort:skip_file """ import abc +import collections.abc import datasample_pb2 import grpc +import grpc.aio +import typing + +_T = typing.TypeVar('_T') + +class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): + ... + +class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore + ... class DataSampleServiceStub: - def __init__(self, channel: grpc.Channel) -> None: ... + def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ... RegisterDataSamples: grpc.UnaryUnaryMultiCallable[ datasample_pb2.RegisterDataSamplesParam, datasample_pb2.RegisterDataSamplesResponse, @@ -25,30 +36,48 @@ class DataSampleServiceStub: datasample_pb2.DataSample, ] +class DataSampleServiceAsyncStub: + RegisterDataSamples: grpc.aio.UnaryUnaryMultiCallable[ + datasample_pb2.RegisterDataSamplesParam, + datasample_pb2.RegisterDataSamplesResponse, + ] + UpdateDataSamples: grpc.aio.UnaryUnaryMultiCallable[ + datasample_pb2.UpdateDataSamplesParam, + datasample_pb2.UpdateDataSamplesResponse, + ] + QueryDataSamples: grpc.aio.UnaryUnaryMultiCallable[ + datasample_pb2.QueryDataSamplesParam, + datasample_pb2.QueryDataSamplesResponse, + ] + GetDataSample: grpc.aio.UnaryUnaryMultiCallable[ + datasample_pb2.GetDataSampleParam, + datasample_pb2.DataSample, + ] + class DataSampleServiceServicer(metaclass=abc.ABCMeta): @abc.abstractmethod def RegisterDataSamples( self, request: datasample_pb2.RegisterDataSamplesParam, - context: grpc.ServicerContext, - ) -> datasample_pb2.RegisterDataSamplesResponse: ... + context: _ServicerContext, + ) -> typing.Union[datasample_pb2.RegisterDataSamplesResponse, collections.abc.Awaitable[datasample_pb2.RegisterDataSamplesResponse]]: ... @abc.abstractmethod def UpdateDataSamples( self, request: datasample_pb2.UpdateDataSamplesParam, - context: grpc.ServicerContext, - ) -> datasample_pb2.UpdateDataSamplesResponse: ... + context: _ServicerContext, + ) -> typing.Union[datasample_pb2.UpdateDataSamplesResponse, collections.abc.Awaitable[datasample_pb2.UpdateDataSamplesResponse]]: ... @abc.abstractmethod def QueryDataSamples( self, request: datasample_pb2.QueryDataSamplesParam, - context: grpc.ServicerContext, - ) -> datasample_pb2.QueryDataSamplesResponse: ... + context: _ServicerContext, + ) -> typing.Union[datasample_pb2.QueryDataSamplesResponse, collections.abc.Awaitable[datasample_pb2.QueryDataSamplesResponse]]: ... @abc.abstractmethod def GetDataSample( self, request: datasample_pb2.GetDataSampleParam, - context: grpc.ServicerContext, - ) -> datasample_pb2.DataSample: ... + context: _ServicerContext, + ) -> typing.Union[datasample_pb2.DataSample, collections.abc.Awaitable[datasample_pb2.DataSample]]: ... -def add_DataSampleServiceServicer_to_server(servicer: DataSampleServiceServicer, server: grpc.Server) -> None: ... +def add_DataSampleServiceServicer_to_server(servicer: DataSampleServiceServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ... diff --git a/backend/orchestrator/dataset_pb2.py b/backend/orchestrator/dataset_pb2.py index 478596f4a..332069f23 100644 --- a/backend/orchestrator/dataset_pb2.py +++ b/backend/orchestrator/dataset_pb2.py @@ -1,11 +1,12 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: dataset.proto +# Protobuf Python Version: 4.25.0 """Generated protocol buffer code.""" -from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -16,16 +17,16 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rdataset.proto\x12\x0corchestrator\x1a\x11\x64\x61tamanager.proto\"\x8f\x01\n\x07\x44\x61taset\x12/\n\x0c\x64\x61ta_manager\x18\x01 \x01(\x0b\x32\x19.orchestrator.DataManager\x12\x18\n\x10\x64\x61ta_sample_keys\x18\x04 \x03(\tJ\x04\x08\x02\x10\x03J\x04\x08\x03\x10\x04R\x16train_data_sample_keysR\x15test_data_sample_keys\"\x1e\n\x0fGetDatasetParam\x12\x0b\n\x03key\x18\x01 \x01(\t2T\n\x0e\x44\x61tasetService\x12\x42\n\nGetDataset\x12\x1d.orchestrator.GetDatasetParam\x1a\x15.orchestrator.DatasetB+Z)github.com/substra/orchestrator/lib/assetb\x06proto3') -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'dataset_pb2', globals()) +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'dataset_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' - _DATASET._serialized_start=51 - _DATASET._serialized_end=194 - _GETDATASETPARAM._serialized_start=196 - _GETDATASETPARAM._serialized_end=226 - _DATASETSERVICE._serialized_start=228 - _DATASETSERVICE._serialized_end=312 + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' + _globals['_DATASET']._serialized_start=51 + _globals['_DATASET']._serialized_end=194 + _globals['_GETDATASETPARAM']._serialized_start=196 + _globals['_GETDATASETPARAM']._serialized_end=226 + _globals['_DATASETSERVICE']._serialized_start=228 + _globals['_DATASETSERVICE']._serialized_end=312 # @@protoc_insertion_point(module_scope) diff --git a/backend/orchestrator/dataset_pb2_grpc.pyi b/backend/orchestrator/dataset_pb2_grpc.pyi index a84a5404f..59d947126 100644 --- a/backend/orchestrator/dataset_pb2_grpc.pyi +++ b/backend/orchestrator/dataset_pb2_grpc.pyi @@ -3,22 +3,39 @@ isort:skip_file """ import abc +import collections.abc import dataset_pb2 import grpc +import grpc.aio +import typing + +_T = typing.TypeVar('_T') + +class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): + ... + +class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore + ... class DatasetServiceStub: - def __init__(self, channel: grpc.Channel) -> None: ... + def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ... GetDataset: grpc.UnaryUnaryMultiCallable[ dataset_pb2.GetDatasetParam, dataset_pb2.Dataset, ] +class DatasetServiceAsyncStub: + GetDataset: grpc.aio.UnaryUnaryMultiCallable[ + dataset_pb2.GetDatasetParam, + dataset_pb2.Dataset, + ] + class DatasetServiceServicer(metaclass=abc.ABCMeta): @abc.abstractmethod def GetDataset( self, request: dataset_pb2.GetDatasetParam, - context: grpc.ServicerContext, - ) -> dataset_pb2.Dataset: ... + context: _ServicerContext, + ) -> typing.Union[dataset_pb2.Dataset, collections.abc.Awaitable[dataset_pb2.Dataset]]: ... -def add_DatasetServiceServicer_to_server(servicer: DatasetServiceServicer, server: grpc.Server) -> None: ... +def add_DatasetServiceServicer_to_server(servicer: DatasetServiceServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ... diff --git a/backend/orchestrator/event_pb2.py b/backend/orchestrator/event_pb2.py index 0f1961044..3a32c2f77 100644 --- a/backend/orchestrator/event_pb2.py +++ b/backend/orchestrator/event_pb2.py @@ -1,11 +1,12 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: event.proto +# Protobuf Python Version: 4.25.0 """Generated protocol buffer code.""" -from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -26,32 +27,32 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0b\x65vent.proto\x12\x0corchestrator\x1a\x0e\x66unction.proto\x1a\x0c\x63ommon.proto\x1a\x11\x63omputeplan.proto\x1a\x11\x63omputetask.proto\x1a\x11\x64\x61tamanager.proto\x1a\x10\x64\x61tasample.proto\x1a\x14\x66\x61ilure_report.proto\x1a\x0bmodel.proto\x1a\x12organization.proto\x1a\x11performance.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb3\x06\n\x05\x45vent\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\tasset_key\x18\x02 \x01(\t\x12+\n\nasset_kind\x18\x03 \x01(\x0e\x32\x17.orchestrator.AssetKind\x12+\n\nevent_kind\x18\x04 \x01(\x0e\x32\x17.orchestrator.EventKind\x12\x0f\n\x07\x63hannel\x18\x05 \x01(\t\x12-\n\ttimestamp\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12*\n\x08\x66unction\x18\x07 \x01(\x0b\x32\x16.orchestrator.FunctionH\x00\x12\x31\n\x0c\x63ompute_plan\x18\x08 \x01(\x0b\x32\x19.orchestrator.ComputePlanH\x00\x12\x31\n\x0c\x63ompute_task\x18\t \x01(\x0b\x32\x19.orchestrator.ComputeTaskH\x00\x12\x31\n\x0c\x64\x61ta_manager\x18\n \x01(\x0b\x32\x19.orchestrator.DataManagerH\x00\x12/\n\x0b\x64\x61ta_sample\x18\x0b \x01(\x0b\x32\x18.orchestrator.DataSampleH\x00\x12\x35\n\x0e\x66\x61ilure_report\x18\x0c \x01(\x0b\x32\x1b.orchestrator.FailureReportH\x00\x12$\n\x05model\x18\r \x01(\x0b\x32\x13.orchestrator.ModelH\x00\x12\x32\n\x0corganization\x18\x0e \x01(\x0b\x32\x1a.orchestrator.OrganizationH\x00\x12\x30\n\x0bperformance\x18\x0f \x01(\x0b\x32\x19.orchestrator.PerformanceH\x00\x12I\n\x19\x63ompute_task_output_asset\x18\x10 \x01(\x0b\x32$.orchestrator.ComputeTaskOutputAssetH\x00\x12\x33\n\x08metadata\x18\x12 \x03(\x0b\x32!.orchestrator.Event.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x07\n\x05\x61sset\"\x90\x01\n\x10QueryEventsParam\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\r\x12.\n\x06\x66ilter\x18\x03 \x01(\x0b\x32\x1e.orchestrator.EventQueryFilter\x12%\n\x04sort\x18\x04 \x01(\x0e\x32\x17.orchestrator.SortOrder\"\xc4\x02\n\x10\x45ventQueryFilter\x12\x11\n\tasset_key\x18\x01 \x01(\t\x12+\n\nasset_kind\x18\x02 \x01(\x0e\x32\x17.orchestrator.AssetKind\x12+\n\nevent_kind\x18\x03 \x01(\x0e\x32\x17.orchestrator.EventKind\x12>\n\x08metadata\x18\x04 \x03(\x0b\x32,.orchestrator.EventQueryFilter.MetadataEntry\x12)\n\x05start\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\'\n\x03\x65nd\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"S\n\x13QueryEventsResponse\x12#\n\x06\x65vents\x18\x01 \x03(\x0b\x32\x13.orchestrator.Event\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"0\n\x16SubscribeToEventsParam\x12\x16\n\x0estart_event_id\x18\x01 \x01(\t*j\n\tEventKind\x12\x11\n\rEVENT_UNKNOWN\x10\x00\x12\x17\n\x13\x45VENT_ASSET_CREATED\x10\x01\x12\x17\n\x13\x45VENT_ASSET_UPDATED\x10\x02\x12\x18\n\x14\x45VENT_ASSET_DISABLED\x10\x03\x32\xb2\x01\n\x0c\x45ventService\x12P\n\x0bQueryEvents\x12\x1e.orchestrator.QueryEventsParam\x1a!.orchestrator.QueryEventsResponse\x12P\n\x11SubscribeToEvents\x12$.orchestrator.SubscribeToEventsParam\x1a\x13.orchestrator.Event0\x01\x42+Z)github.com/substra/orchestrator/lib/assetb\x06proto3') -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'event_pb2', globals()) +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'event_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' - _EVENT_METADATAENTRY._options = None - _EVENT_METADATAENTRY._serialized_options = b'8\001' - _EVENTQUERYFILTER_METADATAENTRY._options = None - _EVENTQUERYFILTER_METADATAENTRY._serialized_options = b'8\001' - _EVENTKIND._serialized_start=1672 - _EVENTKIND._serialized_end=1778 - _EVENT._serialized_start=242 - _EVENT._serialized_end=1061 - _EVENT_METADATAENTRY._serialized_start=1005 - _EVENT_METADATAENTRY._serialized_end=1052 - _QUERYEVENTSPARAM._serialized_start=1064 - _QUERYEVENTSPARAM._serialized_end=1208 - _EVENTQUERYFILTER._serialized_start=1211 - _EVENTQUERYFILTER._serialized_end=1535 - _EVENTQUERYFILTER_METADATAENTRY._serialized_start=1005 - _EVENTQUERYFILTER_METADATAENTRY._serialized_end=1052 - _QUERYEVENTSRESPONSE._serialized_start=1537 - _QUERYEVENTSRESPONSE._serialized_end=1620 - _SUBSCRIBETOEVENTSPARAM._serialized_start=1622 - _SUBSCRIBETOEVENTSPARAM._serialized_end=1670 - _EVENTSERVICE._serialized_start=1781 - _EVENTSERVICE._serialized_end=1959 + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' + _globals['_EVENT_METADATAENTRY']._options = None + _globals['_EVENT_METADATAENTRY']._serialized_options = b'8\001' + _globals['_EVENTQUERYFILTER_METADATAENTRY']._options = None + _globals['_EVENTQUERYFILTER_METADATAENTRY']._serialized_options = b'8\001' + _globals['_EVENTKIND']._serialized_start=1672 + _globals['_EVENTKIND']._serialized_end=1778 + _globals['_EVENT']._serialized_start=242 + _globals['_EVENT']._serialized_end=1061 + _globals['_EVENT_METADATAENTRY']._serialized_start=1005 + _globals['_EVENT_METADATAENTRY']._serialized_end=1052 + _globals['_QUERYEVENTSPARAM']._serialized_start=1064 + _globals['_QUERYEVENTSPARAM']._serialized_end=1208 + _globals['_EVENTQUERYFILTER']._serialized_start=1211 + _globals['_EVENTQUERYFILTER']._serialized_end=1535 + _globals['_EVENTQUERYFILTER_METADATAENTRY']._serialized_start=1005 + _globals['_EVENTQUERYFILTER_METADATAENTRY']._serialized_end=1052 + _globals['_QUERYEVENTSRESPONSE']._serialized_start=1537 + _globals['_QUERYEVENTSRESPONSE']._serialized_end=1620 + _globals['_SUBSCRIBETOEVENTSPARAM']._serialized_start=1622 + _globals['_SUBSCRIBETOEVENTSPARAM']._serialized_end=1670 + _globals['_EVENTSERVICE']._serialized_start=1781 + _globals['_EVENTSERVICE']._serialized_end=1959 # @@protoc_insertion_point(module_scope) diff --git a/backend/orchestrator/event_pb2_grpc.pyi b/backend/orchestrator/event_pb2_grpc.pyi index eace279a2..5702c8671 100644 --- a/backend/orchestrator/event_pb2_grpc.pyi +++ b/backend/orchestrator/event_pb2_grpc.pyi @@ -6,9 +6,19 @@ import abc import collections.abc import event_pb2 import grpc +import grpc.aio +import typing + +_T = typing.TypeVar('_T') + +class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): + ... + +class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore + ... class EventServiceStub: - def __init__(self, channel: grpc.Channel) -> None: ... + def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ... QueryEvents: grpc.UnaryUnaryMultiCallable[ event_pb2.QueryEventsParam, event_pb2.QueryEventsResponse, @@ -18,18 +28,28 @@ class EventServiceStub: event_pb2.Event, ] +class EventServiceAsyncStub: + QueryEvents: grpc.aio.UnaryUnaryMultiCallable[ + event_pb2.QueryEventsParam, + event_pb2.QueryEventsResponse, + ] + SubscribeToEvents: grpc.aio.UnaryStreamMultiCallable[ + event_pb2.SubscribeToEventsParam, + event_pb2.Event, + ] + class EventServiceServicer(metaclass=abc.ABCMeta): @abc.abstractmethod def QueryEvents( self, request: event_pb2.QueryEventsParam, - context: grpc.ServicerContext, - ) -> event_pb2.QueryEventsResponse: ... + context: _ServicerContext, + ) -> typing.Union[event_pb2.QueryEventsResponse, collections.abc.Awaitable[event_pb2.QueryEventsResponse]]: ... @abc.abstractmethod def SubscribeToEvents( self, request: event_pb2.SubscribeToEventsParam, - context: grpc.ServicerContext, - ) -> collections.abc.Iterator[event_pb2.Event]: ... + context: _ServicerContext, + ) -> typing.Union[collections.abc.Iterator[event_pb2.Event], collections.abc.AsyncIterator[event_pb2.Event]]: ... -def add_EventServiceServicer_to_server(servicer: EventServiceServicer, server: grpc.Server) -> None: ... +def add_EventServiceServicer_to_server(servicer: EventServiceServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ... diff --git a/backend/orchestrator/failure_report_pb2.py b/backend/orchestrator/failure_report_pb2.py index b08cb7081..e2ef0cdca 100644 --- a/backend/orchestrator/failure_report_pb2.py +++ b/backend/orchestrator/failure_report_pb2.py @@ -1,11 +1,12 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: failure_report.proto +# Protobuf Python Version: 4.25.0 """Generated protocol buffer code.""" -from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -17,22 +18,22 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x66\x61ilure_report.proto\x12\x0corchestrator\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x0c\x63ommon.proto\"\xf5\x01\n\rFailureReport\x12\x11\n\tasset_key\x18\x01 \x01(\t\x12+\n\nerror_type\x18\x02 \x01(\x0e\x32\x17.orchestrator.ErrorType\x12/\n\x0clogs_address\x18\x03 \x01(\x0b\x32\x19.orchestrator.Addressable\x12\x31\n\rcreation_date\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\r\n\x05owner\x18\x05 \x01(\t\x12\x31\n\nasset_type\x18\x06 \x01(\x0e\x32\x1d.orchestrator.FailedAssetKind\"\xb6\x01\n\x10NewFailureReport\x12\x11\n\tasset_key\x18\x01 \x01(\t\x12+\n\nerror_type\x18\x02 \x01(\x0e\x32\x17.orchestrator.ErrorType\x12/\n\x0clogs_address\x18\x03 \x01(\x0b\x32\x19.orchestrator.Addressable\x12\x31\n\nasset_type\x18\x04 \x01(\x0e\x32\x1d.orchestrator.FailedAssetKind\"*\n\x15GetFailureReportParam\x12\x11\n\tasset_key\x18\x01 \x01(\t*p\n\tErrorType\x12\x1a\n\x16\x45RROR_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10\x45RROR_TYPE_BUILD\x10\x01\x12\x18\n\x14\x45RROR_TYPE_EXECUTION\x10\x02\x12\x17\n\x13\x45RROR_TYPE_INTERNAL\x10\x03*e\n\x0f\x46\x61iledAssetKind\x12\x18\n\x14\x46\x41ILED_ASSET_UNKNOWN\x10\x00\x12\x1d\n\x19\x46\x41ILED_ASSET_COMPUTE_TASK\x10\x01\x12\x19\n\x15\x46\x41ILED_ASSET_FUNCTION\x10\x02\x32\xc2\x01\n\x14\x46\x61ilureReportService\x12T\n\x15RegisterFailureReport\x12\x1e.orchestrator.NewFailureReport\x1a\x1b.orchestrator.FailureReport\x12T\n\x10GetFailureReport\x12#.orchestrator.GetFailureReportParam\x1a\x1b.orchestrator.FailureReportB+Z)github.com/substra/orchestrator/lib/assetb\x06proto3') -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'failure_report_pb2', globals()) +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'failure_report_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' - _ERRORTYPE._serialized_start=562 - _ERRORTYPE._serialized_end=674 - _FAILEDASSETKIND._serialized_start=676 - _FAILEDASSETKIND._serialized_end=777 - _FAILUREREPORT._serialized_start=86 - _FAILUREREPORT._serialized_end=331 - _NEWFAILUREREPORT._serialized_start=334 - _NEWFAILUREREPORT._serialized_end=516 - _GETFAILUREREPORTPARAM._serialized_start=518 - _GETFAILUREREPORTPARAM._serialized_end=560 - _FAILUREREPORTSERVICE._serialized_start=780 - _FAILUREREPORTSERVICE._serialized_end=974 + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' + _globals['_ERRORTYPE']._serialized_start=562 + _globals['_ERRORTYPE']._serialized_end=674 + _globals['_FAILEDASSETKIND']._serialized_start=676 + _globals['_FAILEDASSETKIND']._serialized_end=777 + _globals['_FAILUREREPORT']._serialized_start=86 + _globals['_FAILUREREPORT']._serialized_end=331 + _globals['_NEWFAILUREREPORT']._serialized_start=334 + _globals['_NEWFAILUREREPORT']._serialized_end=516 + _globals['_GETFAILUREREPORTPARAM']._serialized_start=518 + _globals['_GETFAILUREREPORTPARAM']._serialized_end=560 + _globals['_FAILUREREPORTSERVICE']._serialized_start=780 + _globals['_FAILUREREPORTSERVICE']._serialized_end=974 # @@protoc_insertion_point(module_scope) diff --git a/backend/orchestrator/failure_report_pb2_grpc.pyi b/backend/orchestrator/failure_report_pb2_grpc.pyi index 7f21959bf..2919decf5 100644 --- a/backend/orchestrator/failure_report_pb2_grpc.pyi +++ b/backend/orchestrator/failure_report_pb2_grpc.pyi @@ -3,11 +3,22 @@ isort:skip_file """ import abc +import collections.abc import failure_report_pb2 import grpc +import grpc.aio +import typing + +_T = typing.TypeVar('_T') + +class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): + ... + +class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore + ... class FailureReportServiceStub: - def __init__(self, channel: grpc.Channel) -> None: ... + def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ... RegisterFailureReport: grpc.UnaryUnaryMultiCallable[ failure_report_pb2.NewFailureReport, failure_report_pb2.FailureReport, @@ -17,18 +28,28 @@ class FailureReportServiceStub: failure_report_pb2.FailureReport, ] +class FailureReportServiceAsyncStub: + RegisterFailureReport: grpc.aio.UnaryUnaryMultiCallable[ + failure_report_pb2.NewFailureReport, + failure_report_pb2.FailureReport, + ] + GetFailureReport: grpc.aio.UnaryUnaryMultiCallable[ + failure_report_pb2.GetFailureReportParam, + failure_report_pb2.FailureReport, + ] + class FailureReportServiceServicer(metaclass=abc.ABCMeta): @abc.abstractmethod def RegisterFailureReport( self, request: failure_report_pb2.NewFailureReport, - context: grpc.ServicerContext, - ) -> failure_report_pb2.FailureReport: ... + context: _ServicerContext, + ) -> typing.Union[failure_report_pb2.FailureReport, collections.abc.Awaitable[failure_report_pb2.FailureReport]]: ... @abc.abstractmethod def GetFailureReport( self, request: failure_report_pb2.GetFailureReportParam, - context: grpc.ServicerContext, - ) -> failure_report_pb2.FailureReport: ... + context: _ServicerContext, + ) -> typing.Union[failure_report_pb2.FailureReport, collections.abc.Awaitable[failure_report_pb2.FailureReport]]: ... -def add_FailureReportServiceServicer_to_server(servicer: FailureReportServiceServicer, server: grpc.Server) -> None: ... +def add_FailureReportServiceServicer_to_server(servicer: FailureReportServiceServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ... diff --git a/backend/orchestrator/function_pb2.py b/backend/orchestrator/function_pb2.py index 51a52d5cc..84d4df9ce 100644 --- a/backend/orchestrator/function_pb2.py +++ b/backend/orchestrator/function_pb2.py @@ -1,11 +1,12 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: function.proto +# Protobuf Python Version: 4.25.0 """Generated protocol buffer code.""" -from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -15,66 +16,66 @@ from . import common_pb2 as common__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0e\x66unction.proto\x12\x0corchestrator\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x0c\x63ommon.proto\"Z\n\rFunctionInput\x12%\n\x04kind\x18\x01 \x01(\x0e\x32\x17.orchestrator.AssetKind\x12\x10\n\x08multiple\x18\x02 \x01(\x08\x12\x10\n\x08optional\x18\x03 \x01(\x08\"I\n\x0e\x46unctionOutput\x12%\n\x04kind\x18\x01 \x01(\x0e\x32\x17.orchestrator.AssetKind\x12\x10\n\x08multiple\x18\x02 \x01(\x08\"\xc8\x05\n\x08\x46unction\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12.\n\x0b\x64\x65scription\x18\x04 \x01(\x0b\x32\x19.orchestrator.Addressable\x12*\n\x07\x61rchive\x18\x05 \x01(\x0b\x32\x19.orchestrator.Addressable\x12.\n\x0bpermissions\x18\x06 \x01(\x0b\x32\x19.orchestrator.Permissions\x12\r\n\x05owner\x18\x07 \x01(\t\x12\x31\n\rcreation_date\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x36\n\x08metadata\x18\x10 \x03(\x0b\x32$.orchestrator.Function.MetadataEntry\x12\x32\n\x06inputs\x18\x11 \x03(\x0b\x32\".orchestrator.Function.InputsEntry\x12\x34\n\x07outputs\x18\x12 \x03(\x0b\x32#.orchestrator.Function.OutputsEntry\x12,\n\x06status\x18\x13 \x01(\x0e\x32\x1c.orchestrator.FunctionStatus\x12(\n\x05image\x18\x14 \x01(\x0b\x32\x19.orchestrator.Addressable\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1aJ\n\x0bInputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.orchestrator.FunctionInput:\x02\x38\x01\x1aL\n\x0cOutputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12+\n\x05value\x18\x02 \x01(\x0b\x32\x1c.orchestrator.FunctionOutput:\x02\x38\x01J\x04\x08\x03\x10\x04R\x08\x63\x61tegory\"\xc1\x04\n\x0bNewFunction\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12.\n\x0b\x64\x65scription\x18\x04 \x01(\x0b\x32\x19.orchestrator.Addressable\x12*\n\x07\x61rchive\x18\x05 \x01(\x0b\x32\x19.orchestrator.Addressable\x12\x35\n\x0fnew_permissions\x18\x06 \x01(\x0b\x32\x1c.orchestrator.NewPermissions\x12\x39\n\x08metadata\x18\x11 \x03(\x0b\x32\'.orchestrator.NewFunction.MetadataEntry\x12\x35\n\x06inputs\x18\x12 \x03(\x0b\x32%.orchestrator.NewFunction.InputsEntry\x12\x37\n\x07outputs\x18\x13 \x03(\x0b\x32&.orchestrator.NewFunction.OutputsEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1aJ\n\x0bInputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.orchestrator.FunctionInput:\x02\x38\x01\x1aL\n\x0cOutputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12+\n\x05value\x18\x02 \x01(\x0b\x32\x1c.orchestrator.FunctionOutput:\x02\x38\x01J\x04\x08\x03\x10\x04R\x08\x63\x61tegory\"\x1f\n\x10GetFunctionParam\x12\x0b\n\x03key\x18\x01 \x01(\t\"\\\n\x16QueryFunctionsResponse\x12)\n\tFunctions\x18\x01 \x03(\x0b\x32\x16.orchestrator.Function\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"/\n\x13\x46unctionQueryFilter\x12\x18\n\x10\x63ompute_plan_key\x18\x02 \x01(\t\"o\n\x13QueryFunctionsParam\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\r\x12\x31\n\x06\x66ilter\x18\x03 \x01(\x0b\x32!.orchestrator.FunctionQueryFilter\"Z\n\x13UpdateFunctionParam\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12(\n\x05image\x18\x03 \x01(\x0b\x32\x19.orchestrator.Addressable\"\x18\n\x16UpdateFunctionResponse\"^\n\x18\x41pplyFunctionActionParam\x12\x14\n\x0c\x66unction_key\x18\x01 \x01(\t\x12,\n\x06\x61\x63tion\x18\x02 \x01(\x0e\x32\x1c.orchestrator.FunctionAction\"\x1d\n\x1b\x41pplyFunctionActionResponse*\xa0\x01\n\x0e\x46unctionAction\x12\x1b\n\x17\x46UNCTION_ACTION_UNKNOWN\x10\x00\x12\x1c\n\x18\x46UNCTION_ACTION_BUILDING\x10\x01\x12\x1c\n\x18\x46UNCTION_ACTION_CANCELED\x10\x02\x12\x1a\n\x16\x46UNCTION_ACTION_FAILED\x10\x03\x12\x19\n\x15\x46UNCTION_ACTION_READY\x10\x04*\xbd\x01\n\x0e\x46unctionStatus\x12\x1b\n\x17\x46UNCTION_STATUS_UNKNOWN\x10\x00\x12\x1b\n\x17\x46UNCTION_STATUS_WAITING\x10\x01\x12\x1c\n\x18\x46UNCTION_STATUS_BUILDING\x10\x02\x12\x19\n\x15\x46UNCTION_STATUS_READY\x10\x03\x12\x1c\n\x18\x46UNCTION_STATUS_CANCELED\x10\x04\x12\x1a\n\x16\x46UNCTION_STATUS_FAILED\x10\x05\x32\xbf\x03\n\x0f\x46unctionService\x12\x45\n\x10RegisterFunction\x12\x19.orchestrator.NewFunction\x1a\x16.orchestrator.Function\x12\x45\n\x0bGetFunction\x12\x1e.orchestrator.GetFunctionParam\x1a\x16.orchestrator.Function\x12Y\n\x0eQueryFunctions\x12!.orchestrator.QueryFunctionsParam\x1a$.orchestrator.QueryFunctionsResponse\x12Y\n\x0eUpdateFunction\x12!.orchestrator.UpdateFunctionParam\x1a$.orchestrator.UpdateFunctionResponse\x12h\n\x13\x41pplyFunctionAction\x12&.orchestrator.ApplyFunctionActionParam\x1a).orchestrator.ApplyFunctionActionResponseB+Z)github.com/substra/orchestrator/lib/assetb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0e\x66unction.proto\x12\x0corchestrator\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x0c\x63ommon.proto\"Z\n\rFunctionInput\x12%\n\x04kind\x18\x01 \x01(\x0e\x32\x17.orchestrator.AssetKind\x12\x10\n\x08multiple\x18\x02 \x01(\x08\x12\x10\n\x08optional\x18\x03 \x01(\x08\"I\n\x0e\x46unctionOutput\x12%\n\x04kind\x18\x01 \x01(\x0e\x32\x17.orchestrator.AssetKind\x12\x10\n\x08multiple\x18\x02 \x01(\x08\"\xc8\x05\n\x08\x46unction\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12.\n\x0b\x64\x65scription\x18\x04 \x01(\x0b\x32\x19.orchestrator.Addressable\x12*\n\x07\x61rchive\x18\x05 \x01(\x0b\x32\x19.orchestrator.Addressable\x12.\n\x0bpermissions\x18\x06 \x01(\x0b\x32\x19.orchestrator.Permissions\x12\r\n\x05owner\x18\x07 \x01(\t\x12\x31\n\rcreation_date\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x36\n\x08metadata\x18\x10 \x03(\x0b\x32$.orchestrator.Function.MetadataEntry\x12\x32\n\x06inputs\x18\x11 \x03(\x0b\x32\".orchestrator.Function.InputsEntry\x12\x34\n\x07outputs\x18\x12 \x03(\x0b\x32#.orchestrator.Function.OutputsEntry\x12,\n\x06status\x18\x13 \x01(\x0e\x32\x1c.orchestrator.FunctionStatus\x12(\n\x05image\x18\x14 \x01(\x0b\x32\x19.orchestrator.Addressable\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1aJ\n\x0bInputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.orchestrator.FunctionInput:\x02\x38\x01\x1aL\n\x0cOutputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12+\n\x05value\x18\x02 \x01(\x0b\x32\x1c.orchestrator.FunctionOutput:\x02\x38\x01J\x04\x08\x03\x10\x04R\x08\x63\x61tegory\"\xeb\x04\n\x0bNewFunction\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12.\n\x0b\x64\x65scription\x18\x04 \x01(\x0b\x32\x19.orchestrator.Addressable\x12*\n\x07\x61rchive\x18\x05 \x01(\x0b\x32\x19.orchestrator.Addressable\x12\x35\n\x0fnew_permissions\x18\x06 \x01(\x0b\x32\x1c.orchestrator.NewPermissions\x12\x39\n\x08metadata\x18\x11 \x03(\x0b\x32\'.orchestrator.NewFunction.MetadataEntry\x12\x35\n\x06inputs\x18\x12 \x03(\x0b\x32%.orchestrator.NewFunction.InputsEntry\x12\x37\n\x07outputs\x18\x13 \x03(\x0b\x32&.orchestrator.NewFunction.OutputsEntry\x12(\n\x05image\x18\x14 \x01(\x0b\x32\x19.orchestrator.Addressable\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1aJ\n\x0bInputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.orchestrator.FunctionInput:\x02\x38\x01\x1aL\n\x0cOutputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12+\n\x05value\x18\x02 \x01(\x0b\x32\x1c.orchestrator.FunctionOutput:\x02\x38\x01J\x04\x08\x03\x10\x04R\x08\x63\x61tegory\"\x1f\n\x10GetFunctionParam\x12\x0b\n\x03key\x18\x01 \x01(\t\"\\\n\x16QueryFunctionsResponse\x12)\n\tFunctions\x18\x01 \x03(\x0b\x32\x16.orchestrator.Function\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"/\n\x13\x46unctionQueryFilter\x12\x18\n\x10\x63ompute_plan_key\x18\x02 \x01(\t\"o\n\x13QueryFunctionsParam\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\r\x12\x31\n\x06\x66ilter\x18\x03 \x01(\x0b\x32!.orchestrator.FunctionQueryFilter\"Z\n\x13UpdateFunctionParam\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12(\n\x05image\x18\x03 \x01(\x0b\x32\x19.orchestrator.Addressable\"\x18\n\x16UpdateFunctionResponse\"^\n\x18\x41pplyFunctionActionParam\x12\x14\n\x0c\x66unction_key\x18\x01 \x01(\t\x12,\n\x06\x61\x63tion\x18\x02 \x01(\x0e\x32\x1c.orchestrator.FunctionAction\"\x1d\n\x1b\x41pplyFunctionActionResponse*\xa0\x01\n\x0e\x46unctionAction\x12\x1b\n\x17\x46UNCTION_ACTION_UNKNOWN\x10\x00\x12\x1c\n\x18\x46UNCTION_ACTION_BUILDING\x10\x01\x12\x1c\n\x18\x46UNCTION_ACTION_CANCELED\x10\x02\x12\x1a\n\x16\x46UNCTION_ACTION_FAILED\x10\x03\x12\x19\n\x15\x46UNCTION_ACTION_READY\x10\x04*\xbd\x01\n\x0e\x46unctionStatus\x12\x1b\n\x17\x46UNCTION_STATUS_UNKNOWN\x10\x00\x12\x1b\n\x17\x46UNCTION_STATUS_WAITING\x10\x01\x12\x1c\n\x18\x46UNCTION_STATUS_BUILDING\x10\x02\x12\x19\n\x15\x46UNCTION_STATUS_READY\x10\x03\x12\x1c\n\x18\x46UNCTION_STATUS_CANCELED\x10\x04\x12\x1a\n\x16\x46UNCTION_STATUS_FAILED\x10\x05\x32\xbf\x03\n\x0f\x46unctionService\x12\x45\n\x10RegisterFunction\x12\x19.orchestrator.NewFunction\x1a\x16.orchestrator.Function\x12\x45\n\x0bGetFunction\x12\x1e.orchestrator.GetFunctionParam\x1a\x16.orchestrator.Function\x12Y\n\x0eQueryFunctions\x12!.orchestrator.QueryFunctionsParam\x1a$.orchestrator.QueryFunctionsResponse\x12Y\n\x0eUpdateFunction\x12!.orchestrator.UpdateFunctionParam\x1a$.orchestrator.UpdateFunctionResponse\x12h\n\x13\x41pplyFunctionAction\x12&.orchestrator.ApplyFunctionActionParam\x1a).orchestrator.ApplyFunctionActionResponseB+Z)github.com/substra/orchestrator/lib/assetb\x06proto3') -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'function_pb2', globals()) +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'function_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' - _FUNCTION_METADATAENTRY._options = None - _FUNCTION_METADATAENTRY._serialized_options = b'8\001' - _FUNCTION_INPUTSENTRY._options = None - _FUNCTION_INPUTSENTRY._serialized_options = b'8\001' - _FUNCTION_OUTPUTSENTRY._options = None - _FUNCTION_OUTPUTSENTRY._serialized_options = b'8\001' - _NEWFUNCTION_METADATAENTRY._options = None - _NEWFUNCTION_METADATAENTRY._serialized_options = b'8\001' - _NEWFUNCTION_INPUTSENTRY._options = None - _NEWFUNCTION_INPUTSENTRY._serialized_options = b'8\001' - _NEWFUNCTION_OUTPUTSENTRY._options = None - _NEWFUNCTION_OUTPUTSENTRY._serialized_options = b'8\001' - _FUNCTIONACTION._serialized_start=2076 - _FUNCTIONACTION._serialized_end=2236 - _FUNCTIONSTATUS._serialized_start=2239 - _FUNCTIONSTATUS._serialized_end=2428 - _FUNCTIONINPUT._serialized_start=79 - _FUNCTIONINPUT._serialized_end=169 - _FUNCTIONOUTPUT._serialized_start=171 - _FUNCTIONOUTPUT._serialized_end=244 - _FUNCTION._serialized_start=247 - _FUNCTION._serialized_end=959 - _FUNCTION_METADATAENTRY._serialized_start=742 - _FUNCTION_METADATAENTRY._serialized_end=789 - _FUNCTION_INPUTSENTRY._serialized_start=791 - _FUNCTION_INPUTSENTRY._serialized_end=865 - _FUNCTION_OUTPUTSENTRY._serialized_start=867 - _FUNCTION_OUTPUTSENTRY._serialized_end=943 - _NEWFUNCTION._serialized_start=962 - _NEWFUNCTION._serialized_end=1539 - _NEWFUNCTION_METADATAENTRY._serialized_start=742 - _NEWFUNCTION_METADATAENTRY._serialized_end=789 - _NEWFUNCTION_INPUTSENTRY._serialized_start=791 - _NEWFUNCTION_INPUTSENTRY._serialized_end=865 - _NEWFUNCTION_OUTPUTSENTRY._serialized_start=867 - _NEWFUNCTION_OUTPUTSENTRY._serialized_end=943 - _GETFUNCTIONPARAM._serialized_start=1541 - _GETFUNCTIONPARAM._serialized_end=1572 - _QUERYFUNCTIONSRESPONSE._serialized_start=1574 - _QUERYFUNCTIONSRESPONSE._serialized_end=1666 - _FUNCTIONQUERYFILTER._serialized_start=1668 - _FUNCTIONQUERYFILTER._serialized_end=1715 - _QUERYFUNCTIONSPARAM._serialized_start=1717 - _QUERYFUNCTIONSPARAM._serialized_end=1828 - _UPDATEFUNCTIONPARAM._serialized_start=1830 - _UPDATEFUNCTIONPARAM._serialized_end=1920 - _UPDATEFUNCTIONRESPONSE._serialized_start=1922 - _UPDATEFUNCTIONRESPONSE._serialized_end=1946 - _APPLYFUNCTIONACTIONPARAM._serialized_start=1948 - _APPLYFUNCTIONACTIONPARAM._serialized_end=2042 - _APPLYFUNCTIONACTIONRESPONSE._serialized_start=2044 - _APPLYFUNCTIONACTIONRESPONSE._serialized_end=2073 - _FUNCTIONSERVICE._serialized_start=2431 - _FUNCTIONSERVICE._serialized_end=2878 + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' + _globals['_FUNCTION_METADATAENTRY']._options = None + _globals['_FUNCTION_METADATAENTRY']._serialized_options = b'8\001' + _globals['_FUNCTION_INPUTSENTRY']._options = None + _globals['_FUNCTION_INPUTSENTRY']._serialized_options = b'8\001' + _globals['_FUNCTION_OUTPUTSENTRY']._options = None + _globals['_FUNCTION_OUTPUTSENTRY']._serialized_options = b'8\001' + _globals['_NEWFUNCTION_METADATAENTRY']._options = None + _globals['_NEWFUNCTION_METADATAENTRY']._serialized_options = b'8\001' + _globals['_NEWFUNCTION_INPUTSENTRY']._options = None + _globals['_NEWFUNCTION_INPUTSENTRY']._serialized_options = b'8\001' + _globals['_NEWFUNCTION_OUTPUTSENTRY']._options = None + _globals['_NEWFUNCTION_OUTPUTSENTRY']._serialized_options = b'8\001' + _globals['_FUNCTIONACTION']._serialized_start=2118 + _globals['_FUNCTIONACTION']._serialized_end=2278 + _globals['_FUNCTIONSTATUS']._serialized_start=2281 + _globals['_FUNCTIONSTATUS']._serialized_end=2470 + _globals['_FUNCTIONINPUT']._serialized_start=79 + _globals['_FUNCTIONINPUT']._serialized_end=169 + _globals['_FUNCTIONOUTPUT']._serialized_start=171 + _globals['_FUNCTIONOUTPUT']._serialized_end=244 + _globals['_FUNCTION']._serialized_start=247 + _globals['_FUNCTION']._serialized_end=959 + _globals['_FUNCTION_METADATAENTRY']._serialized_start=742 + _globals['_FUNCTION_METADATAENTRY']._serialized_end=789 + _globals['_FUNCTION_INPUTSENTRY']._serialized_start=791 + _globals['_FUNCTION_INPUTSENTRY']._serialized_end=865 + _globals['_FUNCTION_OUTPUTSENTRY']._serialized_start=867 + _globals['_FUNCTION_OUTPUTSENTRY']._serialized_end=943 + _globals['_NEWFUNCTION']._serialized_start=962 + _globals['_NEWFUNCTION']._serialized_end=1581 + _globals['_NEWFUNCTION_METADATAENTRY']._serialized_start=742 + _globals['_NEWFUNCTION_METADATAENTRY']._serialized_end=789 + _globals['_NEWFUNCTION_INPUTSENTRY']._serialized_start=791 + _globals['_NEWFUNCTION_INPUTSENTRY']._serialized_end=865 + _globals['_NEWFUNCTION_OUTPUTSENTRY']._serialized_start=867 + _globals['_NEWFUNCTION_OUTPUTSENTRY']._serialized_end=943 + _globals['_GETFUNCTIONPARAM']._serialized_start=1583 + _globals['_GETFUNCTIONPARAM']._serialized_end=1614 + _globals['_QUERYFUNCTIONSRESPONSE']._serialized_start=1616 + _globals['_QUERYFUNCTIONSRESPONSE']._serialized_end=1708 + _globals['_FUNCTIONQUERYFILTER']._serialized_start=1710 + _globals['_FUNCTIONQUERYFILTER']._serialized_end=1757 + _globals['_QUERYFUNCTIONSPARAM']._serialized_start=1759 + _globals['_QUERYFUNCTIONSPARAM']._serialized_end=1870 + _globals['_UPDATEFUNCTIONPARAM']._serialized_start=1872 + _globals['_UPDATEFUNCTIONPARAM']._serialized_end=1962 + _globals['_UPDATEFUNCTIONRESPONSE']._serialized_start=1964 + _globals['_UPDATEFUNCTIONRESPONSE']._serialized_end=1988 + _globals['_APPLYFUNCTIONACTIONPARAM']._serialized_start=1990 + _globals['_APPLYFUNCTIONACTIONPARAM']._serialized_end=2084 + _globals['_APPLYFUNCTIONACTIONRESPONSE']._serialized_start=2086 + _globals['_APPLYFUNCTIONACTIONRESPONSE']._serialized_end=2115 + _globals['_FUNCTIONSERVICE']._serialized_start=2473 + _globals['_FUNCTIONSERVICE']._serialized_end=2920 # @@protoc_insertion_point(module_scope) diff --git a/backend/orchestrator/function_pb2.pyi b/backend/orchestrator/function_pb2.pyi index 07c9fed23..1dd2efd03 100644 --- a/backend/orchestrator/function_pb2.pyi +++ b/backend/orchestrator/function_pb2.pyi @@ -284,6 +284,7 @@ class NewFunction(google.protobuf.message.Message): METADATA_FIELD_NUMBER: builtins.int INPUTS_FIELD_NUMBER: builtins.int OUTPUTS_FIELD_NUMBER: builtins.int + IMAGE_FIELD_NUMBER: builtins.int key: builtins.str name: builtins.str @property @@ -298,6 +299,8 @@ class NewFunction(google.protobuf.message.Message): def inputs(self) -> google.protobuf.internal.containers.MessageMap[builtins.str, global___FunctionInput]: ... @property def outputs(self) -> google.protobuf.internal.containers.MessageMap[builtins.str, global___FunctionOutput]: ... + @property + def image(self) -> common_pb2.Addressable: ... def __init__( self, *, @@ -309,9 +312,10 @@ class NewFunction(google.protobuf.message.Message): metadata: collections.abc.Mapping[builtins.str, builtins.str] | None = ..., inputs: collections.abc.Mapping[builtins.str, global___FunctionInput] | None = ..., outputs: collections.abc.Mapping[builtins.str, global___FunctionOutput] | None = ..., + image: common_pb2.Addressable | None = ..., ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["archive", b"archive", "description", b"description", "new_permissions", b"new_permissions"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["archive", b"archive", "description", b"description", "inputs", b"inputs", "key", b"key", "metadata", b"metadata", "name", b"name", "new_permissions", b"new_permissions", "outputs", b"outputs"]) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["archive", b"archive", "description", b"description", "image", b"image", "new_permissions", b"new_permissions"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["archive", b"archive", "description", b"description", "image", b"image", "inputs", b"inputs", "key", b"key", "metadata", b"metadata", "name", b"name", "new_permissions", b"new_permissions", "outputs", b"outputs"]) -> None: ... global___NewFunction = NewFunction @@ -387,6 +391,7 @@ class QueryFunctionsParam(google.protobuf.message.Message): global___QueryFunctionsParam = QueryFunctionsParam +@typing_extensions.final class UpdateFunctionParam(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -409,6 +414,7 @@ class UpdateFunctionParam(google.protobuf.message.Message): global___UpdateFunctionParam = UpdateFunctionParam +@typing_extensions.final class UpdateFunctionResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor diff --git a/backend/orchestrator/function_pb2_grpc.pyi b/backend/orchestrator/function_pb2_grpc.pyi index 8dff7a938..82ddfb97f 100644 --- a/backend/orchestrator/function_pb2_grpc.pyi +++ b/backend/orchestrator/function_pb2_grpc.pyi @@ -3,11 +3,22 @@ isort:skip_file """ import abc +import collections.abc import function_pb2 import grpc +import grpc.aio +import typing + +_T = typing.TypeVar('_T') + +class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): + ... + +class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore + ... class FunctionServiceStub: - def __init__(self, channel: grpc.Channel) -> None: ... + def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ... RegisterFunction: grpc.UnaryUnaryMultiCallable[ function_pb2.NewFunction, function_pb2.Function, @@ -29,36 +40,58 @@ class FunctionServiceStub: function_pb2.ApplyFunctionActionResponse, ] +class FunctionServiceAsyncStub: + RegisterFunction: grpc.aio.UnaryUnaryMultiCallable[ + function_pb2.NewFunction, + function_pb2.Function, + ] + GetFunction: grpc.aio.UnaryUnaryMultiCallable[ + function_pb2.GetFunctionParam, + function_pb2.Function, + ] + QueryFunctions: grpc.aio.UnaryUnaryMultiCallable[ + function_pb2.QueryFunctionsParam, + function_pb2.QueryFunctionsResponse, + ] + UpdateFunction: grpc.aio.UnaryUnaryMultiCallable[ + function_pb2.UpdateFunctionParam, + function_pb2.UpdateFunctionResponse, + ] + ApplyFunctionAction: grpc.aio.UnaryUnaryMultiCallable[ + function_pb2.ApplyFunctionActionParam, + function_pb2.ApplyFunctionActionResponse, + ] + class FunctionServiceServicer(metaclass=abc.ABCMeta): @abc.abstractmethod def RegisterFunction( self, request: function_pb2.NewFunction, - context: grpc.ServicerContext, - ) -> function_pb2.Function: ... + context: _ServicerContext, + ) -> typing.Union[function_pb2.Function, collections.abc.Awaitable[function_pb2.Function]]: ... @abc.abstractmethod def GetFunction( self, request: function_pb2.GetFunctionParam, - context: grpc.ServicerContext, - ) -> function_pb2.Function: ... + context: _ServicerContext, + ) -> typing.Union[function_pb2.Function, collections.abc.Awaitable[function_pb2.Function]]: ... @abc.abstractmethod def QueryFunctions( self, request: function_pb2.QueryFunctionsParam, - context: grpc.ServicerContext, - ) -> function_pb2.QueryFunctionsResponse: ... + context: _ServicerContext, + ) -> typing.Union[function_pb2.QueryFunctionsResponse, collections.abc.Awaitable[function_pb2.QueryFunctionsResponse]]: ... @abc.abstractmethod def UpdateFunction( self, request: function_pb2.UpdateFunctionParam, - context: grpc.ServicerContext, - ) -> function_pb2.UpdateFunctionResponse: ... + context: _ServicerContext, + ) -> typing.Union[function_pb2.UpdateFunctionResponse, collections.abc.Awaitable[function_pb2.UpdateFunctionResponse]]: ... @abc.abstractmethod def ApplyFunctionAction( self, request: function_pb2.ApplyFunctionActionParam, - context: grpc.ServicerContext, - ) -> function_pb2.ApplyFunctionActionResponse: ... + context: _ServicerContext, + ) -> typing.Union[function_pb2.ApplyFunctionActionResponse, collections.abc.Awaitable[function_pb2.ApplyFunctionActionResponse]]: ... -def add_FunctionServiceServicer_to_server(servicer: FunctionServiceServicer, server: grpc.Server) -> None: ... +def add_FunctionServiceServicer_to_server(servicer: FunctionServiceServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ... diff --git a/backend/orchestrator/info_pb2.py b/backend/orchestrator/info_pb2.py index 8599a0d00..7ed3c4eca 100644 --- a/backend/orchestrator/info_pb2.py +++ b/backend/orchestrator/info_pb2.py @@ -1,11 +1,12 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: info.proto +# Protobuf Python Version: 4.25.0 """Generated protocol buffer code.""" -from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -13,18 +14,18 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\ninfo.proto\x12\x0corchestrator\"\x13\n\x11QueryVersionParam\"?\n\x14QueryVersionResponse\x12\x14\n\x0corchestrator\x18\x01 \x01(\t\x12\x11\n\tchaincode\x18\x02 \x01(\t2b\n\x0bInfoService\x12S\n\x0cQueryVersion\x12\x1f.orchestrator.QueryVersionParam\x1a\".orchestrator.QueryVersionResponseB+Z)github.com/substra/orchestrator/lib/assetb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\ninfo.proto\x12\x0corchestrator\"\x13\n\x11QueryVersionParam\",\n\x14QueryVersionResponse\x12\x14\n\x0corchestrator\x18\x01 \x01(\t2b\n\x0bInfoService\x12S\n\x0cQueryVersion\x12\x1f.orchestrator.QueryVersionParam\x1a\".orchestrator.QueryVersionResponseB+Z)github.com/substra/orchestrator/lib/assetb\x06proto3') -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'info_pb2', globals()) +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'info_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' - _QUERYVERSIONPARAM._serialized_start=28 - _QUERYVERSIONPARAM._serialized_end=47 - _QUERYVERSIONRESPONSE._serialized_start=49 - _QUERYVERSIONRESPONSE._serialized_end=112 - _INFOSERVICE._serialized_start=114 - _INFOSERVICE._serialized_end=212 + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' + _globals['_QUERYVERSIONPARAM']._serialized_start=28 + _globals['_QUERYVERSIONPARAM']._serialized_end=47 + _globals['_QUERYVERSIONRESPONSE']._serialized_start=49 + _globals['_QUERYVERSIONRESPONSE']._serialized_end=93 + _globals['_INFOSERVICE']._serialized_start=95 + _globals['_INFOSERVICE']._serialized_end=193 # @@protoc_insertion_point(module_scope) diff --git a/backend/orchestrator/info_pb2.pyi b/backend/orchestrator/info_pb2.pyi index 1e6380402..21b83f7bd 100644 --- a/backend/orchestrator/info_pb2.pyi +++ b/backend/orchestrator/info_pb2.pyi @@ -29,15 +29,12 @@ class QueryVersionResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor ORCHESTRATOR_FIELD_NUMBER: builtins.int - CHAINCODE_FIELD_NUMBER: builtins.int orchestrator: builtins.str - chaincode: builtins.str def __init__( self, *, orchestrator: builtins.str = ..., - chaincode: builtins.str = ..., ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["chaincode", b"chaincode", "orchestrator", b"orchestrator"]) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["orchestrator", b"orchestrator"]) -> None: ... global___QueryVersionResponse = QueryVersionResponse diff --git a/backend/orchestrator/info_pb2_grpc.pyi b/backend/orchestrator/info_pb2_grpc.pyi index 237cef953..c9ee70cb7 100644 --- a/backend/orchestrator/info_pb2_grpc.pyi +++ b/backend/orchestrator/info_pb2_grpc.pyi @@ -3,22 +3,39 @@ isort:skip_file """ import abc +import collections.abc import grpc +import grpc.aio import info_pb2 +import typing + +_T = typing.TypeVar('_T') + +class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): + ... + +class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore + ... class InfoServiceStub: - def __init__(self, channel: grpc.Channel) -> None: ... + def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ... QueryVersion: grpc.UnaryUnaryMultiCallable[ info_pb2.QueryVersionParam, info_pb2.QueryVersionResponse, ] +class InfoServiceAsyncStub: + QueryVersion: grpc.aio.UnaryUnaryMultiCallable[ + info_pb2.QueryVersionParam, + info_pb2.QueryVersionResponse, + ] + class InfoServiceServicer(metaclass=abc.ABCMeta): @abc.abstractmethod def QueryVersion( self, request: info_pb2.QueryVersionParam, - context: grpc.ServicerContext, - ) -> info_pb2.QueryVersionResponse: ... + context: _ServicerContext, + ) -> typing.Union[info_pb2.QueryVersionResponse, collections.abc.Awaitable[info_pb2.QueryVersionResponse]]: ... -def add_InfoServiceServicer_to_server(servicer: InfoServiceServicer, server: grpc.Server) -> None: ... +def add_InfoServiceServicer_to_server(servicer: InfoServiceServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ... diff --git a/backend/orchestrator/model_pb2.py b/backend/orchestrator/model_pb2.py index 5d742080e..e21d8c5ce 100644 --- a/backend/orchestrator/model_pb2.py +++ b/backend/orchestrator/model_pb2.py @@ -1,11 +1,12 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: model.proto +# Protobuf Python Version: 4.25.0 """Generated protocol buffer code.""" -from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -17,28 +18,28 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0bmodel.proto\x12\x0corchestrator\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x0c\x63ommon.proto\"\xdc\x01\n\x05Model\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x18\n\x10\x63ompute_task_key\x18\x03 \x01(\t\x12*\n\x07\x61\x64\x64ress\x18\x04 \x01(\x0b\x32\x19.orchestrator.Addressable\x12.\n\x0bpermissions\x18\x05 \x01(\x0b\x32\x19.orchestrator.Permissions\x12\r\n\x05owner\x18\x06 \x01(\t\x12\x31\n\rcreation_date\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampJ\x04\x08\x02\x10\x03R\x08\x63\x61tegory\"\x95\x01\n\x08NewModel\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x18\n\x10\x63ompute_task_key\x18\x03 \x01(\t\x12&\n\x1e\x63ompute_task_output_identifier\x18\x05 \x01(\t\x12*\n\x07\x61\x64\x64ress\x18\x04 \x01(\x0b\x32\x19.orchestrator.AddressableJ\x04\x08\x02\x10\x03R\x08\x63\x61tegory\"=\n\x13RegisterModelsParam\x12&\n\x06models\x18\x01 \x03(\x0b\x32\x16.orchestrator.NewModel\"=\n\x16RegisterModelsResponse\x12#\n\x06models\x18\x01 \x03(\x0b\x32\x13.orchestrator.Model\"5\n\x19GetComputeTaskModelsParam\x12\x18\n\x10\x63ompute_task_key\x18\x01 \x01(\t\"C\n\x1cGetComputeTaskModelsResponse\x12#\n\x06models\x18\x01 \x03(\x0b\x32\x13.orchestrator.Model\"\x1c\n\rGetModelParam\x12\x0b\n\x03key\x18\x01 \x01(\t2\xdd\x02\n\x0cModelService\x12\x41\n\rRegisterModel\x12\x16.orchestrator.NewModel\x1a\x13.orchestrator.Model\"\x03\x88\x02\x01\x12Y\n\x0eRegisterModels\x12!.orchestrator.RegisterModelsParam\x1a$.orchestrator.RegisterModelsResponse\x12<\n\x08GetModel\x12\x1b.orchestrator.GetModelParam\x1a\x13.orchestrator.Model\x12q\n\x1aGetComputeTaskOutputModels\x12\'.orchestrator.GetComputeTaskModelsParam\x1a*.orchestrator.GetComputeTaskModelsResponseB+Z)github.com/substra/orchestrator/lib/assetb\x06proto3') -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'model_pb2', globals()) +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'model_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' - _MODELSERVICE.methods_by_name['RegisterModel']._options = None - _MODELSERVICE.methods_by_name['RegisterModel']._serialized_options = b'\210\002\001' - _MODEL._serialized_start=77 - _MODEL._serialized_end=297 - _NEWMODEL._serialized_start=300 - _NEWMODEL._serialized_end=449 - _REGISTERMODELSPARAM._serialized_start=451 - _REGISTERMODELSPARAM._serialized_end=512 - _REGISTERMODELSRESPONSE._serialized_start=514 - _REGISTERMODELSRESPONSE._serialized_end=575 - _GETCOMPUTETASKMODELSPARAM._serialized_start=577 - _GETCOMPUTETASKMODELSPARAM._serialized_end=630 - _GETCOMPUTETASKMODELSRESPONSE._serialized_start=632 - _GETCOMPUTETASKMODELSRESPONSE._serialized_end=699 - _GETMODELPARAM._serialized_start=701 - _GETMODELPARAM._serialized_end=729 - _MODELSERVICE._serialized_start=732 - _MODELSERVICE._serialized_end=1081 + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' + _globals['_MODELSERVICE'].methods_by_name['RegisterModel']._options = None + _globals['_MODELSERVICE'].methods_by_name['RegisterModel']._serialized_options = b'\210\002\001' + _globals['_MODEL']._serialized_start=77 + _globals['_MODEL']._serialized_end=297 + _globals['_NEWMODEL']._serialized_start=300 + _globals['_NEWMODEL']._serialized_end=449 + _globals['_REGISTERMODELSPARAM']._serialized_start=451 + _globals['_REGISTERMODELSPARAM']._serialized_end=512 + _globals['_REGISTERMODELSRESPONSE']._serialized_start=514 + _globals['_REGISTERMODELSRESPONSE']._serialized_end=575 + _globals['_GETCOMPUTETASKMODELSPARAM']._serialized_start=577 + _globals['_GETCOMPUTETASKMODELSPARAM']._serialized_end=630 + _globals['_GETCOMPUTETASKMODELSRESPONSE']._serialized_start=632 + _globals['_GETCOMPUTETASKMODELSRESPONSE']._serialized_end=699 + _globals['_GETMODELPARAM']._serialized_start=701 + _globals['_GETMODELPARAM']._serialized_end=729 + _globals['_MODELSERVICE']._serialized_start=732 + _globals['_MODELSERVICE']._serialized_end=1081 # @@protoc_insertion_point(module_scope) diff --git a/backend/orchestrator/model_pb2_grpc.pyi b/backend/orchestrator/model_pb2_grpc.pyi index 16b429de6..566688146 100644 --- a/backend/orchestrator/model_pb2_grpc.pyi +++ b/backend/orchestrator/model_pb2_grpc.pyi @@ -3,11 +3,22 @@ isort:skip_file """ import abc +import collections.abc import grpc +import grpc.aio import model_pb2 +import typing + +_T = typing.TypeVar('_T') + +class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): + ... + +class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore + ... class ModelServiceStub: - def __init__(self, channel: grpc.Channel) -> None: ... + def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ... RegisterModel: grpc.UnaryUnaryMultiCallable[ model_pb2.NewModel, model_pb2.Model, @@ -25,30 +36,48 @@ class ModelServiceStub: model_pb2.GetComputeTaskModelsResponse, ] +class ModelServiceAsyncStub: + RegisterModel: grpc.aio.UnaryUnaryMultiCallable[ + model_pb2.NewModel, + model_pb2.Model, + ] + RegisterModels: grpc.aio.UnaryUnaryMultiCallable[ + model_pb2.RegisterModelsParam, + model_pb2.RegisterModelsResponse, + ] + GetModel: grpc.aio.UnaryUnaryMultiCallable[ + model_pb2.GetModelParam, + model_pb2.Model, + ] + GetComputeTaskOutputModels: grpc.aio.UnaryUnaryMultiCallable[ + model_pb2.GetComputeTaskModelsParam, + model_pb2.GetComputeTaskModelsResponse, + ] + class ModelServiceServicer(metaclass=abc.ABCMeta): @abc.abstractmethod def RegisterModel( self, request: model_pb2.NewModel, - context: grpc.ServicerContext, - ) -> model_pb2.Model: ... + context: _ServicerContext, + ) -> typing.Union[model_pb2.Model, collections.abc.Awaitable[model_pb2.Model]]: ... @abc.abstractmethod def RegisterModels( self, request: model_pb2.RegisterModelsParam, - context: grpc.ServicerContext, - ) -> model_pb2.RegisterModelsResponse: ... + context: _ServicerContext, + ) -> typing.Union[model_pb2.RegisterModelsResponse, collections.abc.Awaitable[model_pb2.RegisterModelsResponse]]: ... @abc.abstractmethod def GetModel( self, request: model_pb2.GetModelParam, - context: grpc.ServicerContext, - ) -> model_pb2.Model: ... + context: _ServicerContext, + ) -> typing.Union[model_pb2.Model, collections.abc.Awaitable[model_pb2.Model]]: ... @abc.abstractmethod def GetComputeTaskOutputModels( self, request: model_pb2.GetComputeTaskModelsParam, - context: grpc.ServicerContext, - ) -> model_pb2.GetComputeTaskModelsResponse: ... + context: _ServicerContext, + ) -> typing.Union[model_pb2.GetComputeTaskModelsResponse, collections.abc.Awaitable[model_pb2.GetComputeTaskModelsResponse]]: ... -def add_ModelServiceServicer_to_server(servicer: ModelServiceServicer, server: grpc.Server) -> None: ... +def add_ModelServiceServicer_to_server(servicer: ModelServiceServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ... diff --git a/backend/orchestrator/organization_pb2.py b/backend/orchestrator/organization_pb2.py index 69e686876..4ef4d2352 100644 --- a/backend/orchestrator/organization_pb2.py +++ b/backend/orchestrator/organization_pb2.py @@ -1,11 +1,12 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: organization.proto +# Protobuf Python Version: 4.25.0 """Generated protocol buffer code.""" -from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -16,20 +17,20 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x12organization.proto\x12\x0corchestrator\x1a\x1fgoogle/protobuf/timestamp.proto\"^\n\x0cOrganization\x12\n\n\x02id\x18\x01 \x01(\t\x12\x31\n\rcreation_date\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07\x61\x64\x64ress\x18\x03 \x01(\t\"P\n\x1bGetAllOrganizationsResponse\x12\x31\n\rorganizations\x18\x01 \x03(\x0b\x32\x1a.orchestrator.Organization\",\n\x19RegisterOrganizationParam\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t\"\x1a\n\x18GetAllOrganizationsParam2\xdc\x01\n\x13OrganizationService\x12[\n\x14RegisterOrganization\x12\'.orchestrator.RegisterOrganizationParam\x1a\x1a.orchestrator.Organization\x12h\n\x13GetAllOrganizations\x12&.orchestrator.GetAllOrganizationsParam\x1a).orchestrator.GetAllOrganizationsResponseB+Z)github.com/substra/orchestrator/lib/assetb\x06proto3') -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'organization_pb2', globals()) +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'organization_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' - _ORGANIZATION._serialized_start=69 - _ORGANIZATION._serialized_end=163 - _GETALLORGANIZATIONSRESPONSE._serialized_start=165 - _GETALLORGANIZATIONSRESPONSE._serialized_end=245 - _REGISTERORGANIZATIONPARAM._serialized_start=247 - _REGISTERORGANIZATIONPARAM._serialized_end=291 - _GETALLORGANIZATIONSPARAM._serialized_start=293 - _GETALLORGANIZATIONSPARAM._serialized_end=319 - _ORGANIZATIONSERVICE._serialized_start=322 - _ORGANIZATIONSERVICE._serialized_end=542 + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' + _globals['_ORGANIZATION']._serialized_start=69 + _globals['_ORGANIZATION']._serialized_end=163 + _globals['_GETALLORGANIZATIONSRESPONSE']._serialized_start=165 + _globals['_GETALLORGANIZATIONSRESPONSE']._serialized_end=245 + _globals['_REGISTERORGANIZATIONPARAM']._serialized_start=247 + _globals['_REGISTERORGANIZATIONPARAM']._serialized_end=291 + _globals['_GETALLORGANIZATIONSPARAM']._serialized_start=293 + _globals['_GETALLORGANIZATIONSPARAM']._serialized_end=319 + _globals['_ORGANIZATIONSERVICE']._serialized_start=322 + _globals['_ORGANIZATIONSERVICE']._serialized_end=542 # @@protoc_insertion_point(module_scope) diff --git a/backend/orchestrator/organization_pb2_grpc.pyi b/backend/orchestrator/organization_pb2_grpc.pyi index 81f68251d..f413ebbed 100644 --- a/backend/orchestrator/organization_pb2_grpc.pyi +++ b/backend/orchestrator/organization_pb2_grpc.pyi @@ -3,11 +3,22 @@ isort:skip_file """ import abc +import collections.abc import grpc +import grpc.aio import organization_pb2 +import typing + +_T = typing.TypeVar('_T') + +class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): + ... + +class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore + ... class OrganizationServiceStub: - def __init__(self, channel: grpc.Channel) -> None: ... + def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ... RegisterOrganization: grpc.UnaryUnaryMultiCallable[ organization_pb2.RegisterOrganizationParam, organization_pb2.Organization, @@ -17,18 +28,28 @@ class OrganizationServiceStub: organization_pb2.GetAllOrganizationsResponse, ] +class OrganizationServiceAsyncStub: + RegisterOrganization: grpc.aio.UnaryUnaryMultiCallable[ + organization_pb2.RegisterOrganizationParam, + organization_pb2.Organization, + ] + GetAllOrganizations: grpc.aio.UnaryUnaryMultiCallable[ + organization_pb2.GetAllOrganizationsParam, + organization_pb2.GetAllOrganizationsResponse, + ] + class OrganizationServiceServicer(metaclass=abc.ABCMeta): @abc.abstractmethod def RegisterOrganization( self, request: organization_pb2.RegisterOrganizationParam, - context: grpc.ServicerContext, - ) -> organization_pb2.Organization: ... + context: _ServicerContext, + ) -> typing.Union[organization_pb2.Organization, collections.abc.Awaitable[organization_pb2.Organization]]: ... @abc.abstractmethod def GetAllOrganizations( self, request: organization_pb2.GetAllOrganizationsParam, - context: grpc.ServicerContext, - ) -> organization_pb2.GetAllOrganizationsResponse: ... + context: _ServicerContext, + ) -> typing.Union[organization_pb2.GetAllOrganizationsResponse, collections.abc.Awaitable[organization_pb2.GetAllOrganizationsResponse]]: ... -def add_OrganizationServiceServicer_to_server(servicer: OrganizationServiceServicer, server: grpc.Server) -> None: ... +def add_OrganizationServiceServicer_to_server(servicer: OrganizationServiceServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ... diff --git a/backend/orchestrator/performance_pb2.py b/backend/orchestrator/performance_pb2.py index e3a34d2bb..713daaef7 100644 --- a/backend/orchestrator/performance_pb2.py +++ b/backend/orchestrator/performance_pb2.py @@ -1,11 +1,12 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: performance.proto +# Protobuf Python Version: 4.25.0 """Generated protocol buffer code.""" -from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -16,22 +17,22 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11performance.proto\x12\x0corchestrator\x1a\x1fgoogle/protobuf/timestamp.proto\"m\n\x0eNewPerformance\x12\x18\n\x10\x63ompute_task_key\x18\x01 \x01(\t\x12&\n\x1e\x63ompute_task_output_identifier\x18\x03 \x01(\t\x12\x19\n\x11performance_value\x18\x02 \x01(\x02\"\x9d\x01\n\x0bPerformance\x12\x18\n\x10\x63ompute_task_key\x18\x01 \x01(\t\x12&\n\x1e\x63ompute_task_output_identifier\x18\x06 \x01(\t\x12\x19\n\x11performance_value\x18\x02 \x01(\x02\x12\x31\n\rcreation_date\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"Z\n\x16PerformanceQueryFilter\x12\x18\n\x10\x63ompute_task_key\x18\x01 \x01(\t\x12&\n\x1e\x63ompute_task_output_identifier\x18\x03 \x01(\t\"u\n\x16QueryPerformancesParam\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\r\x12\x34\n\x06\x66ilter\x18\x03 \x01(\x0b\x32$.orchestrator.PerformanceQueryFilter\"e\n\x19QueryPerformancesResponse\x12/\n\x0cPerformances\x18\x01 \x03(\x0b\x32\x19.orchestrator.Performance\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xc8\x01\n\x12PerformanceService\x12N\n\x13RegisterPerformance\x12\x1c.orchestrator.NewPerformance\x1a\x19.orchestrator.Performance\x12\x62\n\x11QueryPerformances\x12$.orchestrator.QueryPerformancesParam\x1a\'.orchestrator.QueryPerformancesResponseB+Z)github.com/substra/orchestrator/lib/assetb\x06proto3') -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'performance_pb2', globals()) +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'performance_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' - _NEWPERFORMANCE._serialized_start=68 - _NEWPERFORMANCE._serialized_end=177 - _PERFORMANCE._serialized_start=180 - _PERFORMANCE._serialized_end=337 - _PERFORMANCEQUERYFILTER._serialized_start=339 - _PERFORMANCEQUERYFILTER._serialized_end=429 - _QUERYPERFORMANCESPARAM._serialized_start=431 - _QUERYPERFORMANCESPARAM._serialized_end=548 - _QUERYPERFORMANCESRESPONSE._serialized_start=550 - _QUERYPERFORMANCESRESPONSE._serialized_end=651 - _PERFORMANCESERVICE._serialized_start=654 - _PERFORMANCESERVICE._serialized_end=854 + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'Z)github.com/substra/orchestrator/lib/asset' + _globals['_NEWPERFORMANCE']._serialized_start=68 + _globals['_NEWPERFORMANCE']._serialized_end=177 + _globals['_PERFORMANCE']._serialized_start=180 + _globals['_PERFORMANCE']._serialized_end=337 + _globals['_PERFORMANCEQUERYFILTER']._serialized_start=339 + _globals['_PERFORMANCEQUERYFILTER']._serialized_end=429 + _globals['_QUERYPERFORMANCESPARAM']._serialized_start=431 + _globals['_QUERYPERFORMANCESPARAM']._serialized_end=548 + _globals['_QUERYPERFORMANCESRESPONSE']._serialized_start=550 + _globals['_QUERYPERFORMANCESRESPONSE']._serialized_end=651 + _globals['_PERFORMANCESERVICE']._serialized_start=654 + _globals['_PERFORMANCESERVICE']._serialized_end=854 # @@protoc_insertion_point(module_scope) diff --git a/backend/orchestrator/performance_pb2_grpc.pyi b/backend/orchestrator/performance_pb2_grpc.pyi index 208308bdd..d9ab9da8a 100644 --- a/backend/orchestrator/performance_pb2_grpc.pyi +++ b/backend/orchestrator/performance_pb2_grpc.pyi @@ -3,11 +3,22 @@ isort:skip_file """ import abc +import collections.abc import grpc +import grpc.aio import performance_pb2 +import typing + +_T = typing.TypeVar('_T') + +class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): + ... + +class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore + ... class PerformanceServiceStub: - def __init__(self, channel: grpc.Channel) -> None: ... + def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ... RegisterPerformance: grpc.UnaryUnaryMultiCallable[ performance_pb2.NewPerformance, performance_pb2.Performance, @@ -17,18 +28,28 @@ class PerformanceServiceStub: performance_pb2.QueryPerformancesResponse, ] +class PerformanceServiceAsyncStub: + RegisterPerformance: grpc.aio.UnaryUnaryMultiCallable[ + performance_pb2.NewPerformance, + performance_pb2.Performance, + ] + QueryPerformances: grpc.aio.UnaryUnaryMultiCallable[ + performance_pb2.QueryPerformancesParam, + performance_pb2.QueryPerformancesResponse, + ] + class PerformanceServiceServicer(metaclass=abc.ABCMeta): @abc.abstractmethod def RegisterPerformance( self, request: performance_pb2.NewPerformance, - context: grpc.ServicerContext, - ) -> performance_pb2.Performance: ... + context: _ServicerContext, + ) -> typing.Union[performance_pb2.Performance, collections.abc.Awaitable[performance_pb2.Performance]]: ... @abc.abstractmethod def QueryPerformances( self, request: performance_pb2.QueryPerformancesParam, - context: grpc.ServicerContext, - ) -> performance_pb2.QueryPerformancesResponse: ... + context: _ServicerContext, + ) -> typing.Union[performance_pb2.QueryPerformancesResponse, collections.abc.Awaitable[performance_pb2.QueryPerformancesResponse]]: ... -def add_PerformanceServiceServicer_to_server(servicer: PerformanceServiceServicer, server: grpc.Server) -> None: ... +def add_PerformanceServiceServicer_to_server(servicer: PerformanceServiceServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ...