From 5134ac0930618ea78812cb74d47b7ce20a6f3f84 Mon Sep 17 00:00:00 2001 From: Alex Barcelo Date: Tue, 11 Feb 2025 14:34:41 +0100 Subject: [PATCH 1/8] testing hatchling for easier protobuf shenanigans --- .gitignore | 1 + compile-protos.sh | 7 - compile_protos.py | 41 + pyproject.toml | 21 +- src/dataclay/proto/__init__.py | 0 src/dataclay/proto/backend/__init__.py | 0 src/dataclay/proto/backend/backend_pb2.py | 86 -- .../proto/backend/backend_pb2_grpc.py | 830 ------------------ src/dataclay/proto/common/__init__.py | 0 src/dataclay/proto/common/common_pb2.py | 43 - src/dataclay/proto/common/common_pb2_grpc.py | 24 - src/dataclay/proto/metadata/__init__.py | 0 src/dataclay/proto/metadata/metadata_pb2.py | 79 -- .../proto/metadata/metadata_pb2_grpc.py | 578 ------------ 14 files changed, 58 insertions(+), 1652 deletions(-) delete mode 100755 compile-protos.sh create mode 100755 compile_protos.py delete mode 100644 src/dataclay/proto/__init__.py delete mode 100644 src/dataclay/proto/backend/__init__.py delete mode 100644 src/dataclay/proto/backend/backend_pb2.py delete mode 100644 src/dataclay/proto/backend/backend_pb2_grpc.py delete mode 100644 src/dataclay/proto/common/__init__.py delete mode 100644 src/dataclay/proto/common/common_pb2.py delete mode 100644 src/dataclay/proto/common/common_pb2_grpc.py delete mode 100644 src/dataclay/proto/metadata/__init__.py delete mode 100644 src/dataclay/proto/metadata/metadata_pb2.py delete mode 100644 src/dataclay/proto/metadata/metadata_pb2_grpc.py diff --git a/.gitignore b/.gitignore index 73990b94..2d8bc944 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ tests/mock/client.properties /.vscode .coverage* coverage.xml +/src/dataclay/proto/ diff --git a/compile-protos.sh b/compile-protos.sh deleted file mode 100755 index 93c7c640..00000000 --- a/compile-protos.sh +++ /dev/null @@ -1,7 +0,0 @@ -python3 -m grpc_tools.protoc \ ---proto_path=dataclay-common \ ---python_out=src \ ---grpc_python_out=src \ -dataclay-common/dataclay/proto/common/* \ -dataclay-common/dataclay/proto/backend/* \ -dataclay-common/dataclay/proto/metadata/* diff --git a/compile_protos.py b/compile_protos.py new file mode 100755 index 00000000..4fa72081 --- /dev/null +++ b/compile_protos.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 + +from importlib import resources +from typing import Any +import grpc_tools.protoc + +try: + from hatchling.builders.hooks.plugin.interface import BuildHookInterface +except ModuleNotFoundError: + if __name__ != "__main__": + # If we are not being run interactively, then that is an error + raise + BuildHookInterface = object + + +def run_protoc(): + grpc_tools_proto = (resources.files("grpc_tools") / "_proto").resolve() + grpc_tools.protoc.main( + [ + "grpc_tools.protoc", + "--proto_path=dataclay-common", + "--python_out=src", + "--grpc_python_out=src", + "dataclay-common/dataclay/proto/common/common.proto", + "dataclay-common/dataclay/proto/backend/backend.proto", + "dataclay-common/dataclay/proto/metadata/metadata.proto", + f"-I{grpc_tools_proto}", + ] + ) + + +class CustomBuildHook(BuildHookInterface): + def initialize(self, version: str, build_data: dict[str, Any]) -> None: + run_protoc() + + def dependencies(self): + return ["grpcio-tools==1.48.2"] + + +if __name__ == "__main__": + run_protoc() diff --git a/pyproject.toml b/pyproject.toml index 2475bb5a..1e66dc80 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] -requires = ["setuptools"] -build-backend = "setuptools.build_meta" +requires = ["hatchling"] +build-backend = "hatchling.build" [project] name = "dataclay" @@ -73,9 +73,6 @@ telemetry = [ [project.scripts] dataclayctl = "dataclay.control.ctl:run" -[tool.setuptools.dynamic] -version = {attr = "dataclay.__version__"} - [tool.isort] profile = "black" extend_skip = "src/dataclay/proto" @@ -106,3 +103,17 @@ filterwarnings = [ "error", "ignore::UserWarning", ] + +[tool.hatch.build.targets.wheel] +packages = ["src/dataclay", "src/storage"] +dependencies = ["grpcio-tools==1.48.2"] + +[tool.hatch.build.targets.sdist] +include = ["src/dataclay", "src/storage", "dataclay-common"] + +[tool.hatch.version] +path = "src/dataclay/__init__.py" + +[tool.hatch.build.hooks.custom] +path = "compile_protos.py" +dependencies = ["grpcio-tools==1.48.2"] \ No newline at end of file diff --git a/src/dataclay/proto/__init__.py b/src/dataclay/proto/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/dataclay/proto/backend/__init__.py b/src/dataclay/proto/backend/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/dataclay/proto/backend/backend_pb2.py b/src/dataclay/proto/backend/backend_pb2.py deleted file mode 100644 index bc68d411..00000000 --- a/src/dataclay/proto/backend/backend_pb2.py +++ /dev/null @@ -1,86 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: dataclay/proto/backend/backend.proto -# Protobuf Python Version: 5.29.0 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 5, - 29, - 0, - '', - 'dataclay/proto/backend/backend.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n$dataclay/proto/backend/backend.proto\x12\x16\x64\x61taclay.proto.backend\x1a\x19google/protobuf/any.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1egoogle/protobuf/wrappers.proto\",\n\x15MakePersistentRequest\x12\x13\n\x0bpickled_obj\x18\x01 \x03(\x0c\"\x8d\x02\n\x17\x43\x61llActiveMethodRequest\x12\x11\n\tobject_id\x18\x01 \x01(\t\x12\x13\n\x0bmethod_name\x18\x02 \x01(\t\x12\x0c\n\x04\x61rgs\x18\x03 \x01(\x0c\x12\x0e\n\x06kwargs\x18\x04 \x01(\x0c\x12^\n\x10\x65xec_constraints\x18\x05 \x03(\x0b\x32\x44.dataclay.proto.backend.CallActiveMethodRequest.ExecConstraintsEntry\x1aL\n\x14\x45xecConstraintsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any:\x02\x38\x01\"?\n\x18\x43\x61llActiveMethodResponse\x12\r\n\x05value\x18\x01 \x01(\x0c\x12\x14\n\x0cis_exception\x18\x02 \x01(\x08\"A\n\x19GetObjectAttributeRequest\x12\x11\n\tobject_id\x18\x01 \x01(\t\x12\x11\n\tattribute\x18\x02 \x01(\t\"A\n\x1aGetObjectAttributeResponse\x12\r\n\x05value\x18\x01 \x01(\x0c\x12\x14\n\x0cis_exception\x18\x02 \x01(\x08\"_\n\x19SetObjectAttributeRequest\x12\x11\n\tobject_id\x18\x01 \x01(\t\x12\x11\n\tattribute\x18\x02 \x01(\t\x12\x1c\n\x14serialized_attribute\x18\x03 \x01(\x0c\"A\n\x1aSetObjectAttributeResponse\x12\r\n\x05value\x18\x01 \x01(\x0c\x12\x14\n\x0cis_exception\x18\x02 \x01(\x08\"A\n\x19\x44\x65lObjectAttributeRequest\x12\x11\n\tobject_id\x18\x01 \x01(\t\x12\x11\n\tattribute\x18\x02 \x01(\t\"A\n\x1a\x44\x65lObjectAttributeResponse\x12\r\n\x05value\x18\x01 \x01(\x0c\x12\x14\n\x0cis_exception\x18\x02 \x01(\x08\"/\n\x1aGetObjectPropertiesRequest\x12\x11\n\tobject_id\x18\x01 \x01(\t\"Q\n\x1dUpdateObjectPropertiesRequest\x12\x11\n\tobject_id\x18\x01 \x01(\t\x12\x1d\n\x15serialized_properties\x18\x02 \x01(\x0c\"v\n\x12SendObjectsRequest\x12\x12\n\nobject_ids\x18\x01 \x03(\t\x12\x12\n\nbackend_id\x18\x02 \x01(\t\x12\x14\n\x0cmake_replica\x18\x03 \x01(\x08\x12\x11\n\trecursive\x18\x04 \x01(\x08\x12\x0f\n\x07remotes\x18\x05 \x01(\x08\"B\n\x16RegisterObjectsRequest\x12\x12\n\ndict_bytes\x18\x01 \x03(\x0c\x12\x14\n\x0cmake_replica\x18\x02 \x01(\x08\",\n\x17NewObjectVersionRequest\x12\x11\n\tobject_id\x18\x01 \x01(\t\"/\n\x18NewObjectVersionResponse\x12\x13\n\x0bobject_info\x18\x01 \x01(\t\"4\n\x1f\x43onsolidateObjectVersionRequest\x12\x11\n\tobject_id\x18\x01 \x01(\t\"@\n\x14ProxifyObjectRequest\x12\x11\n\tobject_id\x18\x01 \x01(\t\x12\x15\n\rnew_object_id\x18\x02 \x01(\t\"A\n\x15\x43hangeObjectIdRequest\x12\x11\n\tobject_id\x18\x01 \x01(\t\x12\x15\n\rnew_object_id\x18\x02 \x01(\t\"d\n\x17NewObjectReplicaRequest\x12\x11\n\tobject_id\x18\x01 \x01(\t\x12\x12\n\nbackend_id\x18\x02 \x01(\t\x12\x11\n\trecursive\x18\x03 \x01(\x08\x12\x0f\n\x07remotes\x18\x04 \x01(\x08\")\n\x13GetClassInfoRequest\x12\x12\n\nclass_name\x18\x01 \x01(\t\"A\n\x14GetClassInfoResponse\x12\x12\n\nproperties\x18\x01 \x03(\t\x12\x15\n\ractivemethods\x18\x02 \x03(\t2\x83\x0e\n\x0e\x42\x61\x63kendService\x12Y\n\x0eMakePersistent\x12-.dataclay.proto.backend.MakePersistentRequest\x1a\x16.google.protobuf.Empty\"\x00\x12w\n\x10\x43\x61llActiveMethod\x12/.dataclay.proto.backend.CallActiveMethodRequest\x1a\x30.dataclay.proto.backend.CallActiveMethodResponse\"\x00\x12}\n\x12GetObjectAttribute\x12\x31.dataclay.proto.backend.GetObjectAttributeRequest\x1a\x32.dataclay.proto.backend.GetObjectAttributeResponse\"\x00\x12}\n\x12SetObjectAttribute\x12\x31.dataclay.proto.backend.SetObjectAttributeRequest\x1a\x32.dataclay.proto.backend.SetObjectAttributeResponse\"\x00\x12}\n\x12\x44\x65lObjectAttribute\x12\x31.dataclay.proto.backend.DelObjectAttributeRequest\x1a\x32.dataclay.proto.backend.DelObjectAttributeResponse\"\x00\x12h\n\x13GetObjectProperties\x12\x32.dataclay.proto.backend.GetObjectPropertiesRequest\x1a\x1b.google.protobuf.BytesValue\"\x00\x12i\n\x16UpdateObjectProperties\x12\x35.dataclay.proto.backend.UpdateObjectPropertiesRequest\x1a\x16.google.protobuf.Empty\"\x00\x12S\n\x0bSendObjects\x12*.dataclay.proto.backend.SendObjectsRequest\x1a\x16.google.protobuf.Empty\"\x00\x12[\n\x0fRegisterObjects\x12..dataclay.proto.backend.RegisterObjectsRequest\x1a\x16.google.protobuf.Empty\"\x00\x12w\n\x10NewObjectVersion\x12/.dataclay.proto.backend.NewObjectVersionRequest\x1a\x30.dataclay.proto.backend.NewObjectVersionResponse\"\x00\x12m\n\x18\x43onsolidateObjectVersion\x12\x37.dataclay.proto.backend.ConsolidateObjectVersionRequest\x1a\x16.google.protobuf.Empty\"\x00\x12W\n\rProxifyObject\x12,.dataclay.proto.backend.ProxifyObjectRequest\x1a\x16.google.protobuf.Empty\"\x00\x12Y\n\x0e\x43hangeObjectId\x12-.dataclay.proto.backend.ChangeObjectIdRequest\x1a\x16.google.protobuf.Empty\"\x00\x12]\n\x10NewObjectReplica\x12/.dataclay.proto.backend.NewObjectReplicaRequest\x1a\x16.google.protobuf.Empty\"\x00\x12<\n\x08\x46lushAll\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x12\x38\n\x04Stop\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x12\x39\n\x05\x44rain\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x12k\n\x0cGetClassInfo\x12+.dataclay.proto.backend.GetClassInfoRequest\x1a,.dataclay.proto.backend.GetClassInfoResponse\"\x00\x42!\n\x1d\x65s.bsc.dataclay.proto.backendP\x01\x62\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'dataclay.proto.backend.backend_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\035es.bsc.dataclay.proto.backendP\001' - _globals['_CALLACTIVEMETHODREQUEST_EXECCONSTRAINTSENTRY']._loaded_options = None - _globals['_CALLACTIVEMETHODREQUEST_EXECCONSTRAINTSENTRY']._serialized_options = b'8\001' - _globals['_MAKEPERSISTENTREQUEST']._serialized_start=152 - _globals['_MAKEPERSISTENTREQUEST']._serialized_end=196 - _globals['_CALLACTIVEMETHODREQUEST']._serialized_start=199 - _globals['_CALLACTIVEMETHODREQUEST']._serialized_end=468 - _globals['_CALLACTIVEMETHODREQUEST_EXECCONSTRAINTSENTRY']._serialized_start=392 - _globals['_CALLACTIVEMETHODREQUEST_EXECCONSTRAINTSENTRY']._serialized_end=468 - _globals['_CALLACTIVEMETHODRESPONSE']._serialized_start=470 - _globals['_CALLACTIVEMETHODRESPONSE']._serialized_end=533 - _globals['_GETOBJECTATTRIBUTEREQUEST']._serialized_start=535 - _globals['_GETOBJECTATTRIBUTEREQUEST']._serialized_end=600 - _globals['_GETOBJECTATTRIBUTERESPONSE']._serialized_start=602 - _globals['_GETOBJECTATTRIBUTERESPONSE']._serialized_end=667 - _globals['_SETOBJECTATTRIBUTEREQUEST']._serialized_start=669 - _globals['_SETOBJECTATTRIBUTEREQUEST']._serialized_end=764 - _globals['_SETOBJECTATTRIBUTERESPONSE']._serialized_start=766 - _globals['_SETOBJECTATTRIBUTERESPONSE']._serialized_end=831 - _globals['_DELOBJECTATTRIBUTEREQUEST']._serialized_start=833 - _globals['_DELOBJECTATTRIBUTEREQUEST']._serialized_end=898 - _globals['_DELOBJECTATTRIBUTERESPONSE']._serialized_start=900 - _globals['_DELOBJECTATTRIBUTERESPONSE']._serialized_end=965 - _globals['_GETOBJECTPROPERTIESREQUEST']._serialized_start=967 - _globals['_GETOBJECTPROPERTIESREQUEST']._serialized_end=1014 - _globals['_UPDATEOBJECTPROPERTIESREQUEST']._serialized_start=1016 - _globals['_UPDATEOBJECTPROPERTIESREQUEST']._serialized_end=1097 - _globals['_SENDOBJECTSREQUEST']._serialized_start=1099 - _globals['_SENDOBJECTSREQUEST']._serialized_end=1217 - _globals['_REGISTEROBJECTSREQUEST']._serialized_start=1219 - _globals['_REGISTEROBJECTSREQUEST']._serialized_end=1285 - _globals['_NEWOBJECTVERSIONREQUEST']._serialized_start=1287 - _globals['_NEWOBJECTVERSIONREQUEST']._serialized_end=1331 - _globals['_NEWOBJECTVERSIONRESPONSE']._serialized_start=1333 - _globals['_NEWOBJECTVERSIONRESPONSE']._serialized_end=1380 - _globals['_CONSOLIDATEOBJECTVERSIONREQUEST']._serialized_start=1382 - _globals['_CONSOLIDATEOBJECTVERSIONREQUEST']._serialized_end=1434 - _globals['_PROXIFYOBJECTREQUEST']._serialized_start=1436 - _globals['_PROXIFYOBJECTREQUEST']._serialized_end=1500 - _globals['_CHANGEOBJECTIDREQUEST']._serialized_start=1502 - _globals['_CHANGEOBJECTIDREQUEST']._serialized_end=1567 - _globals['_NEWOBJECTREPLICAREQUEST']._serialized_start=1569 - _globals['_NEWOBJECTREPLICAREQUEST']._serialized_end=1669 - _globals['_GETCLASSINFOREQUEST']._serialized_start=1671 - _globals['_GETCLASSINFOREQUEST']._serialized_end=1712 - _globals['_GETCLASSINFORESPONSE']._serialized_start=1714 - _globals['_GETCLASSINFORESPONSE']._serialized_end=1779 - _globals['_BACKENDSERVICE']._serialized_start=1782 - _globals['_BACKENDSERVICE']._serialized_end=3577 -# @@protoc_insertion_point(module_scope) diff --git a/src/dataclay/proto/backend/backend_pb2_grpc.py b/src/dataclay/proto/backend/backend_pb2_grpc.py deleted file mode 100644 index 9356e92a..00000000 --- a/src/dataclay/proto/backend/backend_pb2_grpc.py +++ /dev/null @@ -1,830 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings - -from dataclay.proto.backend import backend_pb2 as dataclay_dot_proto_dot_backend_dot_backend__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 - -GRPC_GENERATED_VERSION = '1.70.0' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False - -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True - -if _version_not_supported: - raise RuntimeError( - f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in dataclay/proto/backend/backend_pb2_grpc.py depends on' - + f' grpcio>={GRPC_GENERATED_VERSION}.' - + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' - + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' - ) - - -class BackendServiceStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.MakePersistent = channel.unary_unary( - '/dataclay.proto.backend.BackendService/MakePersistent', - request_serializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.MakePersistentRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.CallActiveMethod = channel.unary_unary( - '/dataclay.proto.backend.BackendService/CallActiveMethod', - request_serializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.CallActiveMethodRequest.SerializeToString, - response_deserializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.CallActiveMethodResponse.FromString, - _registered_method=True) - self.GetObjectAttribute = channel.unary_unary( - '/dataclay.proto.backend.BackendService/GetObjectAttribute', - request_serializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.GetObjectAttributeRequest.SerializeToString, - response_deserializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.GetObjectAttributeResponse.FromString, - _registered_method=True) - self.SetObjectAttribute = channel.unary_unary( - '/dataclay.proto.backend.BackendService/SetObjectAttribute', - request_serializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.SetObjectAttributeRequest.SerializeToString, - response_deserializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.SetObjectAttributeResponse.FromString, - _registered_method=True) - self.DelObjectAttribute = channel.unary_unary( - '/dataclay.proto.backend.BackendService/DelObjectAttribute', - request_serializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.DelObjectAttributeRequest.SerializeToString, - response_deserializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.DelObjectAttributeResponse.FromString, - _registered_method=True) - self.GetObjectProperties = channel.unary_unary( - '/dataclay.proto.backend.BackendService/GetObjectProperties', - request_serializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.GetObjectPropertiesRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_wrappers__pb2.BytesValue.FromString, - _registered_method=True) - self.UpdateObjectProperties = channel.unary_unary( - '/dataclay.proto.backend.BackendService/UpdateObjectProperties', - request_serializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.UpdateObjectPropertiesRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.SendObjects = channel.unary_unary( - '/dataclay.proto.backend.BackendService/SendObjects', - request_serializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.SendObjectsRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.RegisterObjects = channel.unary_unary( - '/dataclay.proto.backend.BackendService/RegisterObjects', - request_serializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.RegisterObjectsRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.NewObjectVersion = channel.unary_unary( - '/dataclay.proto.backend.BackendService/NewObjectVersion', - request_serializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.NewObjectVersionRequest.SerializeToString, - response_deserializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.NewObjectVersionResponse.FromString, - _registered_method=True) - self.ConsolidateObjectVersion = channel.unary_unary( - '/dataclay.proto.backend.BackendService/ConsolidateObjectVersion', - request_serializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.ConsolidateObjectVersionRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.ProxifyObject = channel.unary_unary( - '/dataclay.proto.backend.BackendService/ProxifyObject', - request_serializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.ProxifyObjectRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.ChangeObjectId = channel.unary_unary( - '/dataclay.proto.backend.BackendService/ChangeObjectId', - request_serializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.ChangeObjectIdRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.NewObjectReplica = channel.unary_unary( - '/dataclay.proto.backend.BackendService/NewObjectReplica', - request_serializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.NewObjectReplicaRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.FlushAll = channel.unary_unary( - '/dataclay.proto.backend.BackendService/FlushAll', - request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.Stop = channel.unary_unary( - '/dataclay.proto.backend.BackendService/Stop', - request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.Drain = channel.unary_unary( - '/dataclay.proto.backend.BackendService/Drain', - request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.GetClassInfo = channel.unary_unary( - '/dataclay.proto.backend.BackendService/GetClassInfo', - request_serializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.GetClassInfoRequest.SerializeToString, - response_deserializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.GetClassInfoResponse.FromString, - _registered_method=True) - - -class BackendServiceServicer(object): - """Missing associated documentation comment in .proto file.""" - - def MakePersistent(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def CallActiveMethod(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetObjectAttribute(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def SetObjectAttribute(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DelObjectAttribute(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetObjectProperties(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UpdateObjectProperties(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def SendObjects(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def RegisterObjects(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def NewObjectVersion(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ConsolidateObjectVersion(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ProxifyObject(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ChangeObjectId(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def NewObjectReplica(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def FlushAll(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def Stop(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def Drain(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetClassInfo(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_BackendServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'MakePersistent': grpc.unary_unary_rpc_method_handler( - servicer.MakePersistent, - request_deserializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.MakePersistentRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'CallActiveMethod': grpc.unary_unary_rpc_method_handler( - servicer.CallActiveMethod, - request_deserializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.CallActiveMethodRequest.FromString, - response_serializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.CallActiveMethodResponse.SerializeToString, - ), - 'GetObjectAttribute': grpc.unary_unary_rpc_method_handler( - servicer.GetObjectAttribute, - request_deserializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.GetObjectAttributeRequest.FromString, - response_serializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.GetObjectAttributeResponse.SerializeToString, - ), - 'SetObjectAttribute': grpc.unary_unary_rpc_method_handler( - servicer.SetObjectAttribute, - request_deserializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.SetObjectAttributeRequest.FromString, - response_serializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.SetObjectAttributeResponse.SerializeToString, - ), - 'DelObjectAttribute': grpc.unary_unary_rpc_method_handler( - servicer.DelObjectAttribute, - request_deserializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.DelObjectAttributeRequest.FromString, - response_serializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.DelObjectAttributeResponse.SerializeToString, - ), - 'GetObjectProperties': grpc.unary_unary_rpc_method_handler( - servicer.GetObjectProperties, - request_deserializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.GetObjectPropertiesRequest.FromString, - response_serializer=google_dot_protobuf_dot_wrappers__pb2.BytesValue.SerializeToString, - ), - 'UpdateObjectProperties': grpc.unary_unary_rpc_method_handler( - servicer.UpdateObjectProperties, - request_deserializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.UpdateObjectPropertiesRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'SendObjects': grpc.unary_unary_rpc_method_handler( - servicer.SendObjects, - request_deserializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.SendObjectsRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'RegisterObjects': grpc.unary_unary_rpc_method_handler( - servicer.RegisterObjects, - request_deserializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.RegisterObjectsRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'NewObjectVersion': grpc.unary_unary_rpc_method_handler( - servicer.NewObjectVersion, - request_deserializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.NewObjectVersionRequest.FromString, - response_serializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.NewObjectVersionResponse.SerializeToString, - ), - 'ConsolidateObjectVersion': grpc.unary_unary_rpc_method_handler( - servicer.ConsolidateObjectVersion, - request_deserializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.ConsolidateObjectVersionRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'ProxifyObject': grpc.unary_unary_rpc_method_handler( - servicer.ProxifyObject, - request_deserializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.ProxifyObjectRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'ChangeObjectId': grpc.unary_unary_rpc_method_handler( - servicer.ChangeObjectId, - request_deserializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.ChangeObjectIdRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'NewObjectReplica': grpc.unary_unary_rpc_method_handler( - servicer.NewObjectReplica, - request_deserializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.NewObjectReplicaRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'FlushAll': grpc.unary_unary_rpc_method_handler( - servicer.FlushAll, - request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'Stop': grpc.unary_unary_rpc_method_handler( - servicer.Stop, - request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'Drain': grpc.unary_unary_rpc_method_handler( - servicer.Drain, - request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'GetClassInfo': grpc.unary_unary_rpc_method_handler( - servicer.GetClassInfo, - request_deserializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.GetClassInfoRequest.FromString, - response_serializer=dataclay_dot_proto_dot_backend_dot_backend__pb2.GetClassInfoResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'dataclay.proto.backend.BackendService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('dataclay.proto.backend.BackendService', rpc_method_handlers) - - - # This class is part of an EXPERIMENTAL API. -class BackendService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def MakePersistent(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.backend.BackendService/MakePersistent', - dataclay_dot_proto_dot_backend_dot_backend__pb2.MakePersistentRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def CallActiveMethod(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.backend.BackendService/CallActiveMethod', - dataclay_dot_proto_dot_backend_dot_backend__pb2.CallActiveMethodRequest.SerializeToString, - dataclay_dot_proto_dot_backend_dot_backend__pb2.CallActiveMethodResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def GetObjectAttribute(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.backend.BackendService/GetObjectAttribute', - dataclay_dot_proto_dot_backend_dot_backend__pb2.GetObjectAttributeRequest.SerializeToString, - dataclay_dot_proto_dot_backend_dot_backend__pb2.GetObjectAttributeResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def SetObjectAttribute(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.backend.BackendService/SetObjectAttribute', - dataclay_dot_proto_dot_backend_dot_backend__pb2.SetObjectAttributeRequest.SerializeToString, - dataclay_dot_proto_dot_backend_dot_backend__pb2.SetObjectAttributeResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def DelObjectAttribute(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.backend.BackendService/DelObjectAttribute', - dataclay_dot_proto_dot_backend_dot_backend__pb2.DelObjectAttributeRequest.SerializeToString, - dataclay_dot_proto_dot_backend_dot_backend__pb2.DelObjectAttributeResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def GetObjectProperties(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.backend.BackendService/GetObjectProperties', - dataclay_dot_proto_dot_backend_dot_backend__pb2.GetObjectPropertiesRequest.SerializeToString, - google_dot_protobuf_dot_wrappers__pb2.BytesValue.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def UpdateObjectProperties(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.backend.BackendService/UpdateObjectProperties', - dataclay_dot_proto_dot_backend_dot_backend__pb2.UpdateObjectPropertiesRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def SendObjects(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.backend.BackendService/SendObjects', - dataclay_dot_proto_dot_backend_dot_backend__pb2.SendObjectsRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def RegisterObjects(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.backend.BackendService/RegisterObjects', - dataclay_dot_proto_dot_backend_dot_backend__pb2.RegisterObjectsRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def NewObjectVersion(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.backend.BackendService/NewObjectVersion', - dataclay_dot_proto_dot_backend_dot_backend__pb2.NewObjectVersionRequest.SerializeToString, - dataclay_dot_proto_dot_backend_dot_backend__pb2.NewObjectVersionResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def ConsolidateObjectVersion(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.backend.BackendService/ConsolidateObjectVersion', - dataclay_dot_proto_dot_backend_dot_backend__pb2.ConsolidateObjectVersionRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def ProxifyObject(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.backend.BackendService/ProxifyObject', - dataclay_dot_proto_dot_backend_dot_backend__pb2.ProxifyObjectRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def ChangeObjectId(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.backend.BackendService/ChangeObjectId', - dataclay_dot_proto_dot_backend_dot_backend__pb2.ChangeObjectIdRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def NewObjectReplica(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.backend.BackendService/NewObjectReplica', - dataclay_dot_proto_dot_backend_dot_backend__pb2.NewObjectReplicaRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def FlushAll(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.backend.BackendService/FlushAll', - google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def Stop(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.backend.BackendService/Stop', - google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def Drain(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.backend.BackendService/Drain', - google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def GetClassInfo(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.backend.BackendService/GetClassInfo', - dataclay_dot_proto_dot_backend_dot_backend__pb2.GetClassInfoRequest.SerializeToString, - dataclay_dot_proto_dot_backend_dot_backend__pb2.GetClassInfoResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) diff --git a/src/dataclay/proto/common/__init__.py b/src/dataclay/proto/common/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/dataclay/proto/common/common_pb2.py b/src/dataclay/proto/common/common_pb2.py deleted file mode 100644 index 8a2f0eeb..00000000 --- a/src/dataclay/proto/common/common_pb2.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: dataclay/proto/common/common.proto -# Protobuf Python Version: 5.29.0 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 5, - 29, - 0, - '', - 'dataclay/proto/common/common.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\"dataclay/proto/common/common.proto\x12\x15\x64\x61taclay.proto.common\"F\n\x07\x42\x61\x63kend\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04host\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\x05\x12\x13\n\x0b\x64\x61taclay_id\x18\x04 \x01(\t\"\xcd\x01\n\x0eObjectMetadata\x12\n\n\x02id\x18\x01 \x01(\t\x12\x14\n\x0c\x64\x61taset_name\x18\x02 \x01(\t\x12\x12\n\nclass_name\x18\x03 \x01(\t\x12\x19\n\x11master_backend_id\x18\x04 \x01(\t\x12\x1b\n\x13replica_backend_ids\x18\x05 \x03(\t\x12\x14\n\x0cis_read_only\x18\x06 \x01(\x08\x12\x1a\n\x12original_object_id\x18\x07 \x01(\t\x12\x1b\n\x13versions_object_ids\x18\x08 \x03(\t\"C\n\x08\x44\x61taclay\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04host\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\x05\x12\x0f\n\x07is_this\x18\x04 \x01(\x08\">\n\x05\x41lias\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64\x61taset_name\x18\x02 \x01(\t\x12\x11\n\tobject_id\x18\x03 \x01(\tB \n\x1c\x65s.bsc.dataclay.proto.commonP\x01\x62\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'dataclay.proto.common.common_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\034es.bsc.dataclay.proto.commonP\001' - _globals['_BACKEND']._serialized_start=61 - _globals['_BACKEND']._serialized_end=131 - _globals['_OBJECTMETADATA']._serialized_start=134 - _globals['_OBJECTMETADATA']._serialized_end=339 - _globals['_DATACLAY']._serialized_start=341 - _globals['_DATACLAY']._serialized_end=408 - _globals['_ALIAS']._serialized_start=410 - _globals['_ALIAS']._serialized_end=472 -# @@protoc_insertion_point(module_scope) diff --git a/src/dataclay/proto/common/common_pb2_grpc.py b/src/dataclay/proto/common/common_pb2_grpc.py deleted file mode 100644 index 473e18e5..00000000 --- a/src/dataclay/proto/common/common_pb2_grpc.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings - - -GRPC_GENERATED_VERSION = '1.70.0' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False - -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True - -if _version_not_supported: - raise RuntimeError( - f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in dataclay/proto/common/common_pb2_grpc.py depends on' - + f' grpcio>={GRPC_GENERATED_VERSION}.' - + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' - + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' - ) diff --git a/src/dataclay/proto/metadata/__init__.py b/src/dataclay/proto/metadata/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/dataclay/proto/metadata/metadata_pb2.py b/src/dataclay/proto/metadata/metadata_pb2.py deleted file mode 100644 index bd0b229a..00000000 --- a/src/dataclay/proto/metadata/metadata_pb2.py +++ /dev/null @@ -1,79 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: dataclay/proto/metadata/metadata.proto -# Protobuf Python Version: 5.29.0 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 5, - 29, - 0, - '', - 'dataclay/proto/metadata/metadata.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from dataclay.proto.common import common_pb2 as dataclay_dot_proto_dot_common_dot_common__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n&dataclay/proto/metadata/metadata.proto\x12\x17\x64\x61taclay.proto.metadata\x1a\x1bgoogle/protobuf/empty.proto\x1a\"dataclay/proto/common/common.proto\"7\n\x11NewAccountRequest\x12\x10\n\x08username\x18\x01 \x01(\t\x12\x10\n\x08password\x18\x02 \x01(\t\"%\n\x11GetAccountRequest\x12\x10\n\x08username\x18\x01 \x01(\t\"\x14\n\x12GetAccountResponse\"H\n\x11NewDatasetRequest\x12\x10\n\x08username\x18\x01 \x01(\t\x12\x10\n\x08password\x18\x02 \x01(\t\x12\x0f\n\x07\x64\x61taset\x18\x03 \x01(\t\"<\n\x15GetAllBackendsRequest\x12\x14\n\x0c\x66rom_backend\x18\x01 \x01(\x08\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\"\xba\x01\n\x16GetAllBackendsResponse\x12O\n\x08\x62\x61\x63kends\x18\x01 \x03(\x0b\x32=.dataclay.proto.metadata.GetAllBackendsResponse.BackendsEntry\x1aO\n\rBackendsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12-\n\x05value\x18\x02 \x01(\x0b\x32\x1e.dataclay.proto.common.Backend:\x02\x38\x01\")\n\x12GetDataclayRequest\x12\x13\n\x0b\x64\x61taclay_id\x18\x01 \x01(\t\"+\n\x16GetObjectMDByIdRequest\x12\x11\n\tobject_id\x18\x01 \x01(\t\"E\n\x19GetObjectMDByAliasRequest\x12\x12\n\nalias_name\x18\x01 \x01(\t\x12\x14\n\x0c\x64\x61taset_name\x18\x02 \x01(\t\"\xbc\x01\n\x15GetAllObjectsResponse\x12L\n\x07objects\x18\x01 \x03(\x0b\x32;.dataclay.proto.metadata.GetAllObjectsResponse.ObjectsEntry\x1aU\n\x0cObjectsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x34\n\x05value\x18\x02 \x01(\x0b\x32%.dataclay.proto.common.ObjectMetadata:\x02\x38\x01\">\n\x12\x44\x65leteAliasRequest\x12\x12\n\nalias_name\x18\x01 \x01(\t\x12\x14\n\x0c\x64\x61taset_name\x18\x02 \x01(\t\"=\n\x12GetAllAliasRequest\x12\x14\n\x0c\x64\x61taset_name\x18\x01 \x01(\t\x12\x11\n\tobject_id\x18\x02 \x01(\t\"\xaf\x01\n\x13GetAllAliasResponse\x12J\n\x07\x61liases\x18\x01 \x03(\x0b\x32\x39.dataclay.proto.metadata.GetAllAliasResponse.AliasesEntry\x1aL\n\x0c\x41liasesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12+\n\x05value\x18\x02 \x01(\x0b\x32\x1c.dataclay.proto.common.Alias:\x02\x38\x01\"N\n\x0fNewAliasRequest\x12\x12\n\nalias_name\x18\x01 \x01(\t\x12\x14\n\x0c\x64\x61taset_name\x18\x02 \x01(\t\x12\x11\n\tobject_id\x18\x03 \x01(\t2\xfd\x08\n\x0fMetadataService\x12R\n\nNewAccount\x12*.dataclay.proto.metadata.NewAccountRequest\x1a\x16.google.protobuf.Empty\"\x00\x12g\n\nGetAccount\x12*.dataclay.proto.metadata.GetAccountRequest\x1a+.dataclay.proto.metadata.GetAccountResponse\"\x00\x12R\n\nNewDataset\x12*.dataclay.proto.metadata.NewDatasetRequest\x1a\x16.google.protobuf.Empty\"\x00\x12s\n\x0eGetAllBackends\x12..dataclay.proto.metadata.GetAllBackendsRequest\x1a/.dataclay.proto.metadata.GetAllBackendsResponse\"\x00\x12]\n\x0bGetDataclay\x12+.dataclay.proto.metadata.GetDataclayRequest\x1a\x1f.dataclay.proto.common.Dataclay\"\x00\x12k\n\x0fGetObjectMDById\x12/.dataclay.proto.metadata.GetObjectMDByIdRequest\x1a%.dataclay.proto.common.ObjectMetadata\"\x00\x12q\n\x12GetObjectMDByAlias\x12\x32.dataclay.proto.metadata.GetObjectMDByAliasRequest\x1a%.dataclay.proto.common.ObjectMetadata\"\x00\x12Y\n\rGetAllObjects\x12\x16.google.protobuf.Empty\x1a..dataclay.proto.metadata.GetAllObjectsResponse\"\x00\x12T\n\x0b\x44\x65leteAlias\x12+.dataclay.proto.metadata.DeleteAliasRequest\x1a\x16.google.protobuf.Empty\"\x00\x12N\n\x08NewAlias\x12(.dataclay.proto.metadata.NewAliasRequest\x1a\x16.google.protobuf.Empty\"\x00\x12j\n\x0bGetAllAlias\x12+.dataclay.proto.metadata.GetAllAliasRequest\x1a,.dataclay.proto.metadata.GetAllAliasResponse\"\x00\x12\x38\n\x04Stop\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x42\"\n\x1e\x65s.bsc.dataclay.proto.metadataP\x01\x62\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'dataclay.proto.metadata.metadata_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\036es.bsc.dataclay.proto.metadataP\001' - _globals['_GETALLBACKENDSRESPONSE_BACKENDSENTRY']._loaded_options = None - _globals['_GETALLBACKENDSRESPONSE_BACKENDSENTRY']._serialized_options = b'8\001' - _globals['_GETALLOBJECTSRESPONSE_OBJECTSENTRY']._loaded_options = None - _globals['_GETALLOBJECTSRESPONSE_OBJECTSENTRY']._serialized_options = b'8\001' - _globals['_GETALLALIASRESPONSE_ALIASESENTRY']._loaded_options = None - _globals['_GETALLALIASRESPONSE_ALIASESENTRY']._serialized_options = b'8\001' - _globals['_NEWACCOUNTREQUEST']._serialized_start=132 - _globals['_NEWACCOUNTREQUEST']._serialized_end=187 - _globals['_GETACCOUNTREQUEST']._serialized_start=189 - _globals['_GETACCOUNTREQUEST']._serialized_end=226 - _globals['_GETACCOUNTRESPONSE']._serialized_start=228 - _globals['_GETACCOUNTRESPONSE']._serialized_end=248 - _globals['_NEWDATASETREQUEST']._serialized_start=250 - _globals['_NEWDATASETREQUEST']._serialized_end=322 - _globals['_GETALLBACKENDSREQUEST']._serialized_start=324 - _globals['_GETALLBACKENDSREQUEST']._serialized_end=384 - _globals['_GETALLBACKENDSRESPONSE']._serialized_start=387 - _globals['_GETALLBACKENDSRESPONSE']._serialized_end=573 - _globals['_GETALLBACKENDSRESPONSE_BACKENDSENTRY']._serialized_start=494 - _globals['_GETALLBACKENDSRESPONSE_BACKENDSENTRY']._serialized_end=573 - _globals['_GETDATACLAYREQUEST']._serialized_start=575 - _globals['_GETDATACLAYREQUEST']._serialized_end=616 - _globals['_GETOBJECTMDBYIDREQUEST']._serialized_start=618 - _globals['_GETOBJECTMDBYIDREQUEST']._serialized_end=661 - _globals['_GETOBJECTMDBYALIASREQUEST']._serialized_start=663 - _globals['_GETOBJECTMDBYALIASREQUEST']._serialized_end=732 - _globals['_GETALLOBJECTSRESPONSE']._serialized_start=735 - _globals['_GETALLOBJECTSRESPONSE']._serialized_end=923 - _globals['_GETALLOBJECTSRESPONSE_OBJECTSENTRY']._serialized_start=838 - _globals['_GETALLOBJECTSRESPONSE_OBJECTSENTRY']._serialized_end=923 - _globals['_DELETEALIASREQUEST']._serialized_start=925 - _globals['_DELETEALIASREQUEST']._serialized_end=987 - _globals['_GETALLALIASREQUEST']._serialized_start=989 - _globals['_GETALLALIASREQUEST']._serialized_end=1050 - _globals['_GETALLALIASRESPONSE']._serialized_start=1053 - _globals['_GETALLALIASRESPONSE']._serialized_end=1228 - _globals['_GETALLALIASRESPONSE_ALIASESENTRY']._serialized_start=1152 - _globals['_GETALLALIASRESPONSE_ALIASESENTRY']._serialized_end=1228 - _globals['_NEWALIASREQUEST']._serialized_start=1230 - _globals['_NEWALIASREQUEST']._serialized_end=1308 - _globals['_METADATASERVICE']._serialized_start=1311 - _globals['_METADATASERVICE']._serialized_end=2460 -# @@protoc_insertion_point(module_scope) diff --git a/src/dataclay/proto/metadata/metadata_pb2_grpc.py b/src/dataclay/proto/metadata/metadata_pb2_grpc.py deleted file mode 100644 index 5d70f27d..00000000 --- a/src/dataclay/proto/metadata/metadata_pb2_grpc.py +++ /dev/null @@ -1,578 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings - -from dataclay.proto.common import common_pb2 as dataclay_dot_proto_dot_common_dot_common__pb2 -from dataclay.proto.metadata import metadata_pb2 as dataclay_dot_proto_dot_metadata_dot_metadata__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 - -GRPC_GENERATED_VERSION = '1.70.0' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False - -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True - -if _version_not_supported: - raise RuntimeError( - f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in dataclay/proto/metadata/metadata_pb2_grpc.py depends on' - + f' grpcio>={GRPC_GENERATED_VERSION}.' - + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' - + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' - ) - - -class MetadataServiceStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.NewAccount = channel.unary_unary( - '/dataclay.proto.metadata.MetadataService/NewAccount', - request_serializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.NewAccountRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.GetAccount = channel.unary_unary( - '/dataclay.proto.metadata.MetadataService/GetAccount', - request_serializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetAccountRequest.SerializeToString, - response_deserializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetAccountResponse.FromString, - _registered_method=True) - self.NewDataset = channel.unary_unary( - '/dataclay.proto.metadata.MetadataService/NewDataset', - request_serializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.NewDatasetRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.GetAllBackends = channel.unary_unary( - '/dataclay.proto.metadata.MetadataService/GetAllBackends', - request_serializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetAllBackendsRequest.SerializeToString, - response_deserializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetAllBackendsResponse.FromString, - _registered_method=True) - self.GetDataclay = channel.unary_unary( - '/dataclay.proto.metadata.MetadataService/GetDataclay', - request_serializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetDataclayRequest.SerializeToString, - response_deserializer=dataclay_dot_proto_dot_common_dot_common__pb2.Dataclay.FromString, - _registered_method=True) - self.GetObjectMDById = channel.unary_unary( - '/dataclay.proto.metadata.MetadataService/GetObjectMDById', - request_serializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetObjectMDByIdRequest.SerializeToString, - response_deserializer=dataclay_dot_proto_dot_common_dot_common__pb2.ObjectMetadata.FromString, - _registered_method=True) - self.GetObjectMDByAlias = channel.unary_unary( - '/dataclay.proto.metadata.MetadataService/GetObjectMDByAlias', - request_serializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetObjectMDByAliasRequest.SerializeToString, - response_deserializer=dataclay_dot_proto_dot_common_dot_common__pb2.ObjectMetadata.FromString, - _registered_method=True) - self.GetAllObjects = channel.unary_unary( - '/dataclay.proto.metadata.MetadataService/GetAllObjects', - request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - response_deserializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetAllObjectsResponse.FromString, - _registered_method=True) - self.DeleteAlias = channel.unary_unary( - '/dataclay.proto.metadata.MetadataService/DeleteAlias', - request_serializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.DeleteAliasRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.NewAlias = channel.unary_unary( - '/dataclay.proto.metadata.MetadataService/NewAlias', - request_serializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.NewAliasRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.GetAllAlias = channel.unary_unary( - '/dataclay.proto.metadata.MetadataService/GetAllAlias', - request_serializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetAllAliasRequest.SerializeToString, - response_deserializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetAllAliasResponse.FromString, - _registered_method=True) - self.Stop = channel.unary_unary( - '/dataclay.proto.metadata.MetadataService/Stop', - request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - - -class MetadataServiceServicer(object): - """Missing associated documentation comment in .proto file.""" - - def NewAccount(self, request, context): - """Account Manager - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetAccount(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def NewDataset(self, request, context): - """Dataset Manager - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetAllBackends(self, request, context): - """EE-SL information - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetDataclay(self, request, context): - """Federation - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetObjectMDById(self, request, context): - """Object Metadata - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetObjectMDByAlias(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetAllObjects(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteAlias(self, request, context): - """Alias - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def NewAlias(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetAllAlias(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def Stop(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_MetadataServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'NewAccount': grpc.unary_unary_rpc_method_handler( - servicer.NewAccount, - request_deserializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.NewAccountRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'GetAccount': grpc.unary_unary_rpc_method_handler( - servicer.GetAccount, - request_deserializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetAccountRequest.FromString, - response_serializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetAccountResponse.SerializeToString, - ), - 'NewDataset': grpc.unary_unary_rpc_method_handler( - servicer.NewDataset, - request_deserializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.NewDatasetRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'GetAllBackends': grpc.unary_unary_rpc_method_handler( - servicer.GetAllBackends, - request_deserializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetAllBackendsRequest.FromString, - response_serializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetAllBackendsResponse.SerializeToString, - ), - 'GetDataclay': grpc.unary_unary_rpc_method_handler( - servicer.GetDataclay, - request_deserializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetDataclayRequest.FromString, - response_serializer=dataclay_dot_proto_dot_common_dot_common__pb2.Dataclay.SerializeToString, - ), - 'GetObjectMDById': grpc.unary_unary_rpc_method_handler( - servicer.GetObjectMDById, - request_deserializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetObjectMDByIdRequest.FromString, - response_serializer=dataclay_dot_proto_dot_common_dot_common__pb2.ObjectMetadata.SerializeToString, - ), - 'GetObjectMDByAlias': grpc.unary_unary_rpc_method_handler( - servicer.GetObjectMDByAlias, - request_deserializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetObjectMDByAliasRequest.FromString, - response_serializer=dataclay_dot_proto_dot_common_dot_common__pb2.ObjectMetadata.SerializeToString, - ), - 'GetAllObjects': grpc.unary_unary_rpc_method_handler( - servicer.GetAllObjects, - request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - response_serializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetAllObjectsResponse.SerializeToString, - ), - 'DeleteAlias': grpc.unary_unary_rpc_method_handler( - servicer.DeleteAlias, - request_deserializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.DeleteAliasRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'NewAlias': grpc.unary_unary_rpc_method_handler( - servicer.NewAlias, - request_deserializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.NewAliasRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'GetAllAlias': grpc.unary_unary_rpc_method_handler( - servicer.GetAllAlias, - request_deserializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetAllAliasRequest.FromString, - response_serializer=dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetAllAliasResponse.SerializeToString, - ), - 'Stop': grpc.unary_unary_rpc_method_handler( - servicer.Stop, - request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'dataclay.proto.metadata.MetadataService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('dataclay.proto.metadata.MetadataService', rpc_method_handlers) - - - # This class is part of an EXPERIMENTAL API. -class MetadataService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def NewAccount(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.metadata.MetadataService/NewAccount', - dataclay_dot_proto_dot_metadata_dot_metadata__pb2.NewAccountRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def GetAccount(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.metadata.MetadataService/GetAccount', - dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetAccountRequest.SerializeToString, - dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetAccountResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def NewDataset(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.metadata.MetadataService/NewDataset', - dataclay_dot_proto_dot_metadata_dot_metadata__pb2.NewDatasetRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def GetAllBackends(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.metadata.MetadataService/GetAllBackends', - dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetAllBackendsRequest.SerializeToString, - dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetAllBackendsResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def GetDataclay(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.metadata.MetadataService/GetDataclay', - dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetDataclayRequest.SerializeToString, - dataclay_dot_proto_dot_common_dot_common__pb2.Dataclay.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def GetObjectMDById(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.metadata.MetadataService/GetObjectMDById', - dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetObjectMDByIdRequest.SerializeToString, - dataclay_dot_proto_dot_common_dot_common__pb2.ObjectMetadata.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def GetObjectMDByAlias(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.metadata.MetadataService/GetObjectMDByAlias', - dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetObjectMDByAliasRequest.SerializeToString, - dataclay_dot_proto_dot_common_dot_common__pb2.ObjectMetadata.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def GetAllObjects(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.metadata.MetadataService/GetAllObjects', - google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetAllObjectsResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def DeleteAlias(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.metadata.MetadataService/DeleteAlias', - dataclay_dot_proto_dot_metadata_dot_metadata__pb2.DeleteAliasRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def NewAlias(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.metadata.MetadataService/NewAlias', - dataclay_dot_proto_dot_metadata_dot_metadata__pb2.NewAliasRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def GetAllAlias(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.metadata.MetadataService/GetAllAlias', - dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetAllAliasRequest.SerializeToString, - dataclay_dot_proto_dot_metadata_dot_metadata__pb2.GetAllAliasResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def Stop(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/dataclay.proto.metadata.MetadataService/Stop', - google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) From d255dbd9d54cbd922895d6df6900571bc27eb3d3 Mon Sep 17 00:00:00 2001 From: Alex Barcelo Date: Wed, 12 Feb 2025 16:18:14 +0100 Subject: [PATCH 2/8] minimal seemingly working approach to dynamic dependencies for legacydeps --- compile_protos.py | 35 +++++++++++++++- dynamic_dependencies.py | 81 +++++++++++++++++++++++++++++++++++++ pyproject.toml | 31 +++++--------- requirements-dev.txt | 10 ----- requirements-legacydeps.txt | 12 ------ requirements.txt | 13 ++++++ 6 files changed, 137 insertions(+), 45 deletions(-) create mode 100644 dynamic_dependencies.py delete mode 100644 requirements-dev.txt create mode 100644 requirements.txt diff --git a/compile_protos.py b/compile_protos.py index 4fa72081..0d307362 100755 --- a/compile_protos.py +++ b/compile_protos.py @@ -1,8 +1,9 @@ #!/usr/bin/env python3 +import inspect +from typing import Any from importlib import resources from typing import Any -import grpc_tools.protoc try: from hatchling.builders.hooks.plugin.interface import BuildHookInterface @@ -14,6 +15,10 @@ def run_protoc(): + # Here because during the build process, CustomBuildHook will be imported + # *before* knowing the dependencies of the hook itself. + import grpc_tools.protoc + grpc_tools_proto = (resources.files("grpc_tools") / "_proto").resolve() grpc_tools.protoc.main( [ @@ -29,12 +34,38 @@ def run_protoc(): ) +def find_config_settings_in_hatchling() -> dict[str, Any]: + # Terrible workaround (their words, not mine) given by @virtuald + # https://github.com/pypa/hatch/issues/1072#issuecomment-2448985229 + # Hopefully this will be fixed in the future + for frame_info in inspect.stack(): + frame = frame_info.frame + module = inspect.getmodule(frame) + if ( + module + and module.__name__.startswith("hatchling.build") + and "config_settings" in frame.f_locals + ): + return frame.f_locals["config_settings"] + + return {} + + class CustomBuildHook(BuildHookInterface): def initialize(self, version: str, build_data: dict[str, Any]) -> None: run_protoc() def dependencies(self): - return ["grpcio-tools==1.48.2"] + if find_config_settings_in_hatchling().get("LEGACY_DEPS", "False").lower() in ( + "true", + "on", + "1", + "y", + "yes", + ): + return ["grpcio-tools==1.48.2"] + else: + return ["grpcio-tools==1.67.1"] if __name__ == "__main__": diff --git a/dynamic_dependencies.py b/dynamic_dependencies.py new file mode 100644 index 00000000..27a16c8e --- /dev/null +++ b/dynamic_dependencies.py @@ -0,0 +1,81 @@ +import inspect +import os +import re +from typing import Any + +from hatchling.metadata.plugin.interface import MetadataHookInterface +from packaging.requirements import Requirement +from packaging.utils import canonicalize_name + +# The helper functions in this file are heavily inspired on the job layed +# out by the hatch plugin `hatch-requirements-txt` + + +COMMENT_RE = re.compile(r"(^|\s+)#.*$") +PIP_COMMAND_RE = re.compile(r"\s+(-[A-Za-z]|--[A-Za-z]+)") + + +def find_config_settings_in_hatchling() -> dict[str, Any]: + # Terrible workaround (their words, not mine) given by @virtuald + # https://github.com/pypa/hatch/issues/1072#issuecomment-2448985229 + # Hopefully this will be fixed in the future + for frame_info in inspect.stack(): + frame = frame_info.frame + module = inspect.getmodule(frame) + if ( + module + and module.__name__.startswith("hatchling.build") + and "config_settings" in frame.f_locals + ): + return frame.f_locals["config_settings"] + + return {} + + +def parse_requirements(requirements: list[str]) -> tuple[list[Requirement], list[str]]: + comments = [] + parsed_requirements: list[Requirement] = [] + + for line in requirements: + if line.lstrip().startswith("#"): + comments.append(line) + elif line.lstrip().startswith("-"): + # Likely an argument to pip from a requirements.txt file intended for pip + # (e.g. from pip-compile) + pass + elif line: + # Strip comments from end of line + line = COMMENT_RE.sub("", line) + if "-" in line: + line = PIP_COMMAND_RE.split(line)[0] + req = Requirement(line) + req.name = canonicalize_name(req.name) + parsed_requirements.append(req) + + return parsed_requirements, comments + + +def load_requirements(filename: str) -> list[str]: + if not os.path.isfile(filename): + raise FileNotFoundError(filename) + with open(filename, encoding="UTF-8") as fp: + contents = fp.read() + # Unfold lines ending with \ + contents = re.sub(r"\\\s*\n", " ", contents) + parsed_requirements, _ = parse_requirements(contents.splitlines()) + + return [str(r) for r in parsed_requirements] + + +class DynamicDependenciesMetaDataHook(MetadataHookInterface): + def update(self, metadata): + if find_config_settings_in_hatchling().get("LEGACY_DEPS", "False").lower() in ( + "true", + "on", + "1", + "y", + "yes", + ): + metadata["dependencies"] = load_requirements("requirements-legacydeps.txt") + else: + metadata["dependencies"] = load_requirements("requirements.txt") diff --git a/pyproject.toml b/pyproject.toml index 1e66dc80..e5762742 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,27 +26,13 @@ classifiers = [ "Programming Language :: Python :: 3 :: Only", ] requires-python = ">=3.9,<3.14" -dependencies = [ - "aiorwlock>=1.4.0", - "bcrypt>=4.1.1", - "grpcio>=1.67.1", - "grpcio-health-checking>=1.67.1", - "hiredis>=3.0.0", - "opentelemetry-api>=1.28.1", - "protobuf>=4.25.0", - "psutil>=6.1.0", - "pydantic-settings>=2.6.0", - "redis>=5.1.1", - "get-annotations;python_version<\"3.10\"", - "PyJWT>=2.9.0", - "threadpoolctl>=3.5.0", -] -dynamic = ["version"] +dynamic = ["version", "dependencies"] [project.urls] -"Documentation" = "https://dataclay.bsc.es/" -"Code" = "https://github.com/bsc-dom/dataclay" -"Issue tracker" = "https://github.com/bsc-dom/dataclay/issues" +"Homepage" = "https://dataclay.bsc.es/" +"Documentation" = "https://dataclay.readthedocs.io/" +"Source" = "https://github.com/bsc-dom/dataclay" +"Issues" = "https://github.com/bsc-dom/dataclay/issues" [project.optional-dependencies] dev = [ @@ -106,7 +92,7 @@ filterwarnings = [ [tool.hatch.build.targets.wheel] packages = ["src/dataclay", "src/storage"] -dependencies = ["grpcio-tools==1.48.2"] +ignore-vcs = true [tool.hatch.build.targets.sdist] include = ["src/dataclay", "src/storage", "dataclay-common"] @@ -116,4 +102,7 @@ path = "src/dataclay/__init__.py" [tool.hatch.build.hooks.custom] path = "compile_protos.py" -dependencies = ["grpcio-tools==1.48.2"] \ No newline at end of file + +[tool.hatch.metadata.hooks.custom] +path = "dynamic_dependencies.py" +dependencies = ["packaging"] diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 7a12e734..00000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,10 +0,0 @@ -# Used only for the tests on legacy-deps -# (build process on Dockerfile.legacy-deps) - -pytest -pytest-asyncio -pytest-docker -grpcio-tools -black -isort -coverage[toml] diff --git a/requirements-legacydeps.txt b/requirements-legacydeps.txt index ab0b2934..61779a93 100644 --- a/requirements-legacydeps.txt +++ b/requirements-legacydeps.txt @@ -1,15 +1,3 @@ -# This requirements should be used for installing dataClay in the "legacy dependencies" flavour - -# You will need to install these requirements before installing dataClay. You can do it with: -# -# $ pip install -r requirements-legacydeps.txt -r requirements.txt -# -# Tweak the previous command as you see fit, assuming requirements.txt contains -# your own requirements. You may want to merge into a single requirements.txt. - -# After the requirements are in place, install dataClay without dependencies: -# $ pip install --no-deps "dataclay=={version}" - aiorwlock>=1.4.0 bcrypt>=4.1.1 grpcio>=1.48.2 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..e5692ee1 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,13 @@ +aiorwlock>=1.4.0 +bcrypt>=4.1.1 +grpcio>=1.67.1 +grpcio-health-checking>=1.67.1 +hiredis>=3.0.0 +opentelemetry-api>=1.28.1 +protobuf>=4.25.0 +psutil>=6.1.0 +pydantic-settings>=2.6.0 +redis>=5.1.1 +get-annotations;python_version<"3.10" +PyJWT>=2.9.0 +threadpoolctl>=3.5.0 From 06925d539c577d4c7aee3217683efe7cee505402 Mon Sep 17 00:00:00 2001 From: Alex Barcelo Date: Wed, 12 Feb 2025 16:50:41 +0100 Subject: [PATCH 3/8] tests should work with and without LEGACY_DEPS. legacydeps-flavour image generation documented and configured in CI --- .dockerignore | 8 ++++++-- .github/workflows/docker-publish.yml | 2 +- Dockerfile | 4 +++- Dockerfile.dev | 4 +++- Dockerfile.legacy-deps | 22 ---------------------- Dockerfile.legacy-deps.dev | 16 ---------------- PUBLISH.md | 16 ++++++++++++++++ compile_protos.py | 2 +- dynamic_dependencies.py | 2 +- noxfile.py | 18 +++--------------- tests/functional/conftest.py | 10 +++------- 11 files changed, 37 insertions(+), 67 deletions(-) delete mode 100644 Dockerfile.legacy-deps delete mode 100644 Dockerfile.legacy-deps.dev diff --git a/.dockerignore b/.dockerignore index d141acd9..ddb64344 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,13 +6,17 @@ # Now un-exclude: # !src -!compile-protos.sh +!compile_protos.py +!dynamic_dependencies.py !dataclay-common +!requirements.txt !requirements-legacydeps.txt -!requirements-dev.txt !pyproject.toml !README.md !MANIFEST.in !tests !tox.ini .dockerignore + +# Reexclude protos +src/dataclay/proto \ No newline at end of file diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 66b108cb..7fcf1a2a 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -84,10 +84,10 @@ jobs: uses: docker/build-push-action@v6 with: context: . - file: Dockerfile.legacy-deps platforms: linux/amd64,linux/arm64 build-args: PYTHON_VERSION=${{ matrix.python-version }}-bullseye + LEGACY_DEPS=True push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }}-legacydeps labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index f101e132..25bd17cd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,8 +5,10 @@ ARG PYTHON_VERSION=3.10-bookworm # install dataclay FROM python:$PYTHON_VERSION COPY . /app + +ARG LEGACY_DEPS=False RUN python -m pip install --upgrade pip \ - && python -m pip install /app[telemetry] + && python -m pip install --config-settings=LEGACY_DEPS=$LEGACY_DEPS /app[telemetry] # prepare dataclay storage dir RUN mkdir -p /data/storage; diff --git a/Dockerfile.dev b/Dockerfile.dev index 5113c578..48bf55ab 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -5,8 +5,10 @@ ARG PYTHON_VERSION=3.10-bookworm # install dataclay FROM python:$PYTHON_VERSION COPY . /app + +ARG LEGACY_DEPS=False RUN python -m pip install --upgrade pip \ - && python -m pip install -e /app[telemetry,dev] + && python -m pip install --config-settings=LEGACY_DEPS=$LEGACY_DEPS -e /app[telemetry,dev] # prepare dataclay storage dir RUN mkdir -p /data/storage; diff --git a/Dockerfile.legacy-deps b/Dockerfile.legacy-deps deleted file mode 100644 index ed2496f2..00000000 --- a/Dockerfile.legacy-deps +++ /dev/null @@ -1,22 +0,0 @@ -# syntax=docker/dockerfile:1 - -ARG PYTHON_VERSION=3.10-bookworm - -# install dataclay -FROM python:$PYTHON_VERSION -COPY . /app - -# Compiling protos inside to ensure correctness in contrast with the non-legacy-deps image -RUN python -m pip install --upgrade pip \ - && python -m pip install "grpcio-tools==1.48.2" \ - && cd /app && ./compile-protos.sh - -RUN python -m pip install --upgrade pip \ - && python -m pip install -r /app/requirements-legacydeps.txt \ - && python -m pip install /app --no-deps - -# prepare dataclay storage dir -RUN mkdir -p /data/storage; - -# set workdir and entrypoint -WORKDIR /workdir diff --git a/Dockerfile.legacy-deps.dev b/Dockerfile.legacy-deps.dev deleted file mode 100644 index fe79f1d3..00000000 --- a/Dockerfile.legacy-deps.dev +++ /dev/null @@ -1,16 +0,0 @@ -# syntax=docker/dockerfile:1 - -ARG PYTHON_VERSION=3.10-bookworm - -# install dataclay -FROM python:$PYTHON_VERSION -COPY . /app -RUN python -m pip install --upgrade pip \ - && python -m pip install -r /app/requirements-dev.txt -r /app/requirements-legacydeps.txt \ - && python -m pip install -e /app --no-deps - -# prepare dataclay storage dir -RUN mkdir -p /data/storage; - -# set workdir and entrypoint -WORKDIR /workdir diff --git a/PUBLISH.md b/PUBLISH.md index be0197fe..4eed024c 100644 --- a/PUBLISH.md +++ b/PUBLISH.md @@ -68,6 +68,22 @@ docker buildx build --platform linux/amd64,linux/arm64 \ -t ghcr.io/bsc-dom/dataclay:$VERSION-py3.13-bookworm \ --build-arg PYTHON_VERSION=3.13-bookworm --push . + + # Repeat for Python 3.9 and 3.10 with the _legacy dependency flavour_ + # Build and push Python 3.9 bookworm + docker buildx build --platform linux/amd64,linux/arm64 \ + -t ghcr.io/bsc-dom/dataclay:$VERSION-legacydeps-py3.9-bookworm \ + --build-arg PYTHON_VERSION=3.9-bookworm \ + --build-arg LEGACY_DEPS=True \ + --push . + + # Build and push Python 3.10 bookworm + docker buildx build --platform linux/amd64,linux/arm64 \ + -t ghcr.io/bsc-dom/dataclay:$VERSION-legacydeps-py3.10-bookworm \ + -t ghcr.io/bsc-dom/dataclay:$VERSION-legacydeps \ + --build-arg PYTHON_VERSION=3.10-bookworm \ + --build-arg LEGACY_DEPS=True \ + --push . ``` 6. Publish the release distribution to PyPI: diff --git a/compile_protos.py b/compile_protos.py index 0d307362..51b5ea96 100755 --- a/compile_protos.py +++ b/compile_protos.py @@ -46,7 +46,7 @@ def find_config_settings_in_hatchling() -> dict[str, Any]: and module.__name__.startswith("hatchling.build") and "config_settings" in frame.f_locals ): - return frame.f_locals["config_settings"] + return frame.f_locals["config_settings"] or {} return {} diff --git a/dynamic_dependencies.py b/dynamic_dependencies.py index 27a16c8e..5ee17987 100644 --- a/dynamic_dependencies.py +++ b/dynamic_dependencies.py @@ -27,7 +27,7 @@ def find_config_settings_in_hatchling() -> dict[str, Any]: and module.__name__.startswith("hatchling.build") and "config_settings" in frame.f_locals ): - return frame.f_locals["config_settings"] + return frame.f_locals["config_settings"] or {} return {} diff --git a/noxfile.py b/noxfile.py index ecbb564a..be657011 100644 --- a/noxfile.py +++ b/noxfile.py @@ -22,21 +22,9 @@ def tests(session): @nox.session(python=["3.9", "3.10"], tags=["citests"]) def legacy_deps_tests(session): """Run the test suite with legacy dependencies.""" - session.install("grpcio-tools==1.48.2", "pytest", "pytest-asyncio", "pytest-docker", "pytest-cov", "-r", "requirements-legacydeps.txt") - session.run( - # See compile-protos.sh, it should be the same command - "python3", - "-m", - "grpc_tools.protoc", - "--proto_path=dataclay-common", - "--python_out=src", - "--grpc_python_out=src", - "dataclay-common/dataclay/proto/common/common.proto", - "dataclay-common/dataclay/proto/backend/backend.proto", - "dataclay-common/dataclay/proto/metadata/metadata.proto", - ) - - session.install(".", "--no-deps") + session.install("pytest", "pytest-asyncio", "pytest-docker", "pytest-cov") + + session.install("--config-settings=LEGACY_DEPS=True", ".") session.run("pytest", "--disable-warnings", "--cov", "--cov-report=term-missing", "--build-legacy-deps", "tests/functional") diff --git a/tests/functional/conftest.py b/tests/functional/conftest.py index 2db2dd46..c26ddc4d 100644 --- a/tests/functional/conftest.py +++ b/tests/functional/conftest.py @@ -11,18 +11,14 @@ def python_version(): @pytest.fixture(scope="session") -def docker_setup(python_version, request, docker_compose_legacy_deps_file): +def docker_setup(python_version, request): legacy_deps = request.config.getoption("--build-legacy-deps") - f_flag = f"-f {docker_compose_legacy_deps_file} " if legacy_deps else "" + legacy_arg = f" --build-arg LEGACY_DEPS=True " if legacy_deps else " " return [ - f"{ f_flag }build --build-arg PYTHON_VERSION={python_version}-bookworm", + f"build{ legacy_arg }--build-arg PYTHON_VERSION={python_version}-bookworm", "up -d", ] -@pytest.fixture(scope="session") -def docker_compose_legacy_deps_file(pytestconfig): - return os.path.join(str(pytestconfig.rootdir), "tests/functional", "docker-compose.legacy-deps.yml") - @pytest.fixture(scope="session") def docker_compose_file(pytestconfig): From 0516fde069a45a0874168ed15fe13bf9cbc40cb5 Mon Sep 17 00:00:00 2001 From: Alex Barcelo Date: Wed, 12 Feb 2025 17:07:21 +0100 Subject: [PATCH 4/8] fixing metadata for docker image generation --- .github/workflows/docker-publish.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 7fcf1a2a..cd8c6cfa 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -63,6 +63,16 @@ jobs: type=edge,suffix=-py${{ matrix.python-version }},branch=main type=edge,enable=${{ matrix.python-version == '3.10' }},branch=main + # Extract metadata (tags, labels) for Docker + - name: Extract Docker metadata + id: legacy-deps-meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=edge,suffix=-legacydeps-py${{ matrix.python-version }},branch=main + type=edge,suffix=-legacydeps,enable=${{ matrix.python-version == '3.10' }},branch=main + # Build and push Docker image with Buildx (don't push on PR) - name: Build and push Docker image id: build-and-push @@ -89,7 +99,7 @@ jobs: PYTHON_VERSION=${{ matrix.python-version }}-bullseye LEGACY_DEPS=True push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }}-legacydeps - labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.legacy-deps-meta.outputs.tags }} + labels: ${{ steps.legacy-deps-meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max From 034d2c22e479ae30e75d310afda45bc3458d636d Mon Sep 17 00:00:00 2001 From: Alex Barcelo Date: Wed, 12 Feb 2025 17:13:04 +0100 Subject: [PATCH 5/8] documentation says 'List of build-time variables' --- .github/workflows/docker-publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index cd8c6cfa..00cd9f55 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -81,7 +81,7 @@ jobs: context: . platforms: linux/amd64,linux/arm64 build-args: - PYTHON_VERSION=${{ matrix.python-version }}-bullseye + - PYTHON_VERSION=${{ matrix.python-version }}-bullseye push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} @@ -96,8 +96,8 @@ jobs: context: . platforms: linux/amd64,linux/arm64 build-args: - PYTHON_VERSION=${{ matrix.python-version }}-bullseye - LEGACY_DEPS=True + - PYTHON_VERSION=${{ matrix.python-version }}-bullseye + - LEGACY_DEPS=True push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.legacy-deps-meta.outputs.tags }} labels: ${{ steps.legacy-deps-meta.outputs.labels }} From b9018cb49d5b636deac8cd9faa682176d0ac75da Mon Sep 17 00:00:00 2001 From: Alex Barcelo Date: Wed, 19 Feb 2025 12:35:53 +0100 Subject: [PATCH 6/8] making tests more port-independent and applying a little bit of DRY --- noxfile.py | 4 +- tests/conftest.py | 32 ++++++++++++++++ tests/functional/conftest.py | 27 +++----------- .../functional/docker-compose.legacy-deps.yml | 6 --- tests/functional/docker-compose.yml | 6 +-- tests/functional/test_client.py | 9 ----- tests/proxy/conftest.py | 21 +++++++++++ tests/proxy/proxy_non_owner/conftest.py | 37 +++---------------- tests/proxy/proxy_owner/conftest.py | 37 +++---------------- 9 files changed, 73 insertions(+), 106 deletions(-) delete mode 100644 tests/functional/docker-compose.legacy-deps.yml delete mode 100644 tests/functional/test_client.py create mode 100644 tests/proxy/conftest.py diff --git a/noxfile.py b/noxfile.py index be657011..a62e6b4b 100644 --- a/noxfile.py +++ b/noxfile.py @@ -3,11 +3,11 @@ # Define which Python versions to test with PYPROJECT = nox.project.load_toml("pyproject.toml") PYTHON_VERSIONS = nox.project.python_versions(PYPROJECT) -DEFAULT_PYTHON = "3.10" # Arbitrary decision, choose a reliable version +DEFAULT_PYTHON = "3.10" # Modern-ish version compatible with the legacy-deps # Default sessions (these will be executed in Github Actions) # Maintain a clear separation between code checking and code altering tasks (don't add format) -nox.options.sessions = ["lint", "tests"] +nox.options.sessions = ["lint", "tests", "legacy_deps_tests"] # nox.options.reuse_existing_virtualenvs = True # TODO: Check if necessary diff --git a/tests/conftest.py b/tests/conftest.py index 17de5029..19dbe867 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,3 +1,35 @@ +import sys + +import pytest + + +@pytest.fixture(scope="session") +def python_version(): + return f"{sys.version_info.major}.{sys.version_info.minor}" + + +@pytest.fixture(scope="session") +def docker_setup(python_version, request): + legacy_deps = request.config.getoption("--build-legacy-deps") + legacy_arg = f" --build-arg LEGACY_DEPS=True " if legacy_deps else " " + return [ + f"build{ legacy_arg }--build-arg PYTHON_VERSION={python_version}-bookworm", + "up -d", + ] + + +@pytest.fixture(scope="session") +def proxy_connection(docker_ip, docker_services): + proxy_port = docker_services.port_for("proxy", 8676) + return "127.0.0.1", proxy_port + + +@pytest.fixture(scope="session") +def mds_connection(docker_ip, docker_services): + mds_port = docker_services.port_for("metadata-service", 16587) + return "127.0.0.1", mds_port + + def pytest_addoption(parser): parser.addoption( "--build-legacy-deps", diff --git a/tests/functional/conftest.py b/tests/functional/conftest.py index c26ddc4d..529d7f87 100644 --- a/tests/functional/conftest.py +++ b/tests/functional/conftest.py @@ -1,36 +1,20 @@ import os -import sys import grpc import pytest -@pytest.fixture(scope="session") -def python_version(): - return f"{sys.version_info.major}.{sys.version_info.minor}" - - -@pytest.fixture(scope="session") -def docker_setup(python_version, request): - legacy_deps = request.config.getoption("--build-legacy-deps") - legacy_arg = f" --build-arg LEGACY_DEPS=True " if legacy_deps else " " - return [ - f"build{ legacy_arg }--build-arg PYTHON_VERSION={python_version}-bookworm", - "up -d", - ] - - @pytest.fixture(scope="session") def docker_compose_file(pytestconfig): return os.path.join(str(pytestconfig.rootdir), "tests/functional", "docker-compose.yml") @pytest.fixture(scope="session") -def deploy_dataclay(docker_ip, docker_services): +def wait_dataclay(mds_connection): """Ensure that services are up and responsive.""" - mds_port = docker_services.port_for("metadata-service", 16587) - grpc.channel_ready_future(grpc.insecure_channel(f"127.0.0.1:{mds_port}")).result(timeout=10) + mds_host, mds_port = mds_connection + grpc.channel_ready_future(grpc.insecure_channel(f"{mds_host}:{mds_port}")).result(timeout=10) # TODO: Wait for the backend to be ready before starting the tests # NOTE: Below code is not working since it is not the correct ip @@ -40,10 +24,11 @@ def deploy_dataclay(docker_ip, docker_services): @pytest.fixture(scope="session") -def client(deploy_dataclay): +def client(wait_dataclay, mds_connection): import dataclay - client = dataclay.Client(host="127.0.0.1") + mds_host, mds_port = mds_connection + client = dataclay.Client(host=mds_host, port=mds_port) client.start() yield client client.stop() diff --git a/tests/functional/docker-compose.legacy-deps.yml b/tests/functional/docker-compose.legacy-deps.yml deleted file mode 100644 index e99c3c1f..00000000 --- a/tests/functional/docker-compose.legacy-deps.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - metadata-service: - image: "ghcr.io/bsc-dom/dataclay:dev" - build: - context: ../../ - dockerfile: Dockerfile.legacy-deps.dev diff --git a/tests/functional/docker-compose.yml b/tests/functional/docker-compose.yml index a6e235ea..64fea538 100644 --- a/tests/functional/docker-compose.yml +++ b/tests/functional/docker-compose.yml @@ -2,8 +2,6 @@ services: redis: image: redis:latest - ports: - - 6379:6379 metadata-service: image: "ghcr.io/bsc-dom/dataclay:dev" @@ -16,7 +14,7 @@ services: depends_on: - redis ports: - - 16587:16587 + - 16587 environment: - DATACLAY_KV_HOST=redis - DATACLAY_KV_PORT=6379 @@ -69,7 +67,7 @@ services: proxy: image: "ghcr.io/bsc-dom/dataclay:dev" ports: - - 8676:8676 + - 8676 depends_on: - metadata-service - backend_1 diff --git a/tests/functional/test_client.py b/tests/functional/test_client.py deleted file mode 100644 index 765eeeaa..00000000 --- a/tests/functional/test_client.py +++ /dev/null @@ -1,9 +0,0 @@ -from dataclay import Client - - -def test_client_settings(client): - client_test = Client( - host="127.0.0.1", username="testuser", password="s3cret", dataset="testdata" - ) - client_test.start() - assert client_test.settings.dataclay_host == "127.0.0.1" diff --git a/tests/proxy/conftest.py b/tests/proxy/conftest.py new file mode 100644 index 00000000..de4d3af5 --- /dev/null +++ b/tests/proxy/conftest.py @@ -0,0 +1,21 @@ +import os + +import grpc +import pytest + + +@pytest.fixture(scope="session") +def docker_compose_file(pytestconfig): + return os.path.join(str(pytestconfig.rootdir), "tests/proxy", "docker-compose.yml") + + +@pytest.fixture(scope="session") +def wait_dataclay(proxy_connection): + """Ensure that services are up and responsive.""" + + proxy_host, proxy_port = proxy_connection + grpc.channel_ready_future(grpc.insecure_channel(f"{proxy_host}:{proxy_port}")).result(timeout=10) + + # backend_port = docker_services.port_for("backend", 6867) + # grpc.channel_ready_future(grpc.insecure_channel(f"127.0.0.1:{backend_port}")).result(timeout=10) + diff --git a/tests/proxy/proxy_non_owner/conftest.py b/tests/proxy/proxy_non_owner/conftest.py index ccc585c7..2228fc47 100644 --- a/tests/proxy/proxy_non_owner/conftest.py +++ b/tests/proxy/proxy_non_owner/conftest.py @@ -1,41 +1,14 @@ -import os -import sys - -import grpc import pytest import dataclay @pytest.fixture(scope="session") -def python_version(): - return f"{sys.version_info.major}.{sys.version_info.minor}" - - -@pytest.fixture(scope="session") -def docker_setup(python_version): - return [f"build --build-arg PYTHON_VERSION={python_version}-bookworm", "up -d"] - - -@pytest.fixture(scope="session") -def docker_compose_file(pytestconfig): - return os.path.join(str(pytestconfig.rootdir), "tests/proxy", "docker-compose.yml") - - -@pytest.fixture(scope="session") -def deploy_dataclay(docker_ip, docker_services): - """Ensure that services are up and responsive.""" - - proxy_port = docker_services.port_for("proxy", 8676) - grpc.channel_ready_future(grpc.insecure_channel(f"127.0.0.1:{proxy_port}")).result(timeout=10) - - # backend_port = docker_services.port_for("backend", 6867) - # grpc.channel_ready_future(grpc.insecure_channel(f"127.0.0.1:{backend_port}")).result(timeout=10) - - -@pytest.fixture(scope="session") -def client(deploy_dataclay): - client = dataclay.Client(proxy_host="127.0.0.1", username="Marc", password="s3cret") +def client(wait_dataclay, proxy_connection): + proxy_host, proxy_port = proxy_connection + client = dataclay.Client( + proxy_host=proxy_host, proxy_port=proxy_port, username="Marc", password="s3cret" + ) client.start() yield client client.stop() diff --git a/tests/proxy/proxy_owner/conftest.py b/tests/proxy/proxy_owner/conftest.py index 5aea46af..5a358989 100644 --- a/tests/proxy/proxy_owner/conftest.py +++ b/tests/proxy/proxy_owner/conftest.py @@ -1,41 +1,14 @@ -import os -import sys - -import grpc import pytest import dataclay @pytest.fixture(scope="session") -def python_version(): - return f"{sys.version_info.major}.{sys.version_info.minor}" - - -@pytest.fixture(scope="session") -def docker_setup(python_version): - return [f"build --build-arg PYTHON_VERSION={python_version}-bookworm", "up -d"] - - -@pytest.fixture(scope="session") -def docker_compose_file(pytestconfig): - return os.path.join(str(pytestconfig.rootdir), "tests/proxy", "docker-compose.yml") - - -@pytest.fixture(scope="session") -def deploy_dataclay(docker_ip, docker_services): - """Ensure that services are up and responsive.""" - - proxy_port = docker_services.port_for("proxy", 8676) - grpc.channel_ready_future(grpc.insecure_channel(f"127.0.0.1:{proxy_port}")).result(timeout=10) - - # backend_port = docker_services.port_for("backend", 6867) - # grpc.channel_ready_future(grpc.insecure_channel(f"127.0.0.1:{backend_port}")).result(timeout=10) - - -@pytest.fixture(scope="session") -def client(deploy_dataclay): - client = dataclay.Client(proxy_host="127.0.0.1", username="Alex", password="s3cret") +def client(wait_dataclay, proxy_connection): + proxy_host, proxy_port = proxy_connection + client = dataclay.Client( + proxy_host=proxy_host, proxy_port=proxy_port, username="Alex", password="s3cret" + ) client.start() yield client client.stop() From bdd88b5844399b85f2ab3d174b2574645f045822 Mon Sep 17 00:00:00 2001 From: Alex Barcelo Date: Wed, 19 Feb 2025 12:39:14 +0100 Subject: [PATCH 7/8] documentation says that a *List* is a newline-delimited string --- .github/workflows/docker-publish.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 00cd9f55..22ebf6b7 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -80,8 +80,8 @@ jobs: with: context: . platforms: linux/amd64,linux/arm64 - build-args: - - PYTHON_VERSION=${{ matrix.python-version }}-bullseye + build-args: | + PYTHON_VERSION=${{ matrix.python-version }}-bullseye push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} @@ -95,9 +95,9 @@ jobs: with: context: . platforms: linux/amd64,linux/arm64 - build-args: - - PYTHON_VERSION=${{ matrix.python-version }}-bullseye - - LEGACY_DEPS=True + build-args: | + PYTHON_VERSION=${{ matrix.python-version }}-bullseye + LEGACY_DEPS=True push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.legacy-deps-meta.outputs.tags }} labels: ${{ steps.legacy-deps-meta.outputs.labels }} From 60beab84b5aed82f37d8aa78c27e617f110f4c79 Mon Sep 17 00:00:00 2001 From: Alex Barcelo Date: Wed, 19 Feb 2025 14:16:47 +0100 Subject: [PATCH 8/8] minor semantic fix (should increase compatibility) --- tests/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 19dbe867..5b851b97 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -21,13 +21,13 @@ def docker_setup(python_version, request): @pytest.fixture(scope="session") def proxy_connection(docker_ip, docker_services): proxy_port = docker_services.port_for("proxy", 8676) - return "127.0.0.1", proxy_port + return docker_ip, proxy_port @pytest.fixture(scope="session") def mds_connection(docker_ip, docker_services): mds_port = docker_services.port_for("metadata-service", 16587) - return "127.0.0.1", mds_port + return docker_ip, mds_port def pytest_addoption(parser):