caikit.runtime.dump_services ============================ .. py:module:: caikit.runtime.dump_services Attributes ---------- .. autoapisummary:: caikit.runtime.dump_services.log caikit.runtime.dump_services.error Functions --------- .. autoapisummary:: caikit.runtime.dump_services.dump_grpc_services caikit.runtime.dump_services.dump_http_services caikit.runtime.dump_services._try_find_file_by_name caikit.runtime.dump_services._recursive_safe_add_to_pool caikit.runtime.dump_services._descriptor_to_proto caikit.runtime.dump_services._get_proto_file_descriptors caikit.runtime.dump_services._dump_consolidated_protos caikit.runtime.dump_services._get_grpc_service_packages caikit.runtime.dump_services.main Module Contents --------------- .. py:data:: log .. py:data:: error .. py:function:: dump_grpc_services(output_dir: str, write_modules_file: bool, consolidate: bool = False) Utility for rendering the all generated interfaces to proto files Args: output_dir (str): The directory where the generated services should be placed write_modules_file (bool): Whether or not to write out the compatibility file for supported modules consolidate (bool): Whether or not to consolidate the generated protos by package .. py:function:: dump_http_services(output_dir: str) Dump out the openapi.json for the HTTP server .. py:function:: _try_find_file_by_name(name: str, pool: google.protobuf.descriptor_pool.DescriptorPool) -> Optional[google.protobuf.descriptor.FileDescriptor] Attempt to find a file descriptor by name and return None if not found .. py:function:: _recursive_safe_add_to_pool(fd_proto: google.protobuf.descriptor_pb2.FileDescriptorProto, fd_protos_to_add: Dict[str, google.protobuf.descriptor_pb2.FileDescriptorProto], dpool: google.protobuf.descriptor_pool.DescriptorPool) -> google.protobuf.descriptor.FileDescriptor Recursively add the given file descriptor and all of its dependencies to the pool and handle double-add conflicts. .. py:function:: _descriptor_to_proto(descriptor: Union[google.protobuf.descriptor.Descriptor, google.protobuf.descriptor.EnumDescriptor, google.protobuf.descriptor.ServiceDescriptor]) -> Union[google.protobuf.descriptor_pb2.DescriptorProto, google.protobuf.descriptor_pb2.EnumDescriptorProto, google.protobuf.descriptor_pb2.ServiceDescriptorProto] Convert a given Descriptor type to the corresponding Proto for comparison by content rather than instance id .. py:function:: _get_proto_file_descriptors(object_descriptors: List[Union[google.protobuf.descriptor.Descriptor, google.protobuf.descriptor.EnumDescriptor, google.protobuf.descriptor.ServiceDescriptor]]) -> Dict[str, google.protobuf.descriptor_pb2.FileDescriptorProto] Get a dict mapping package names to consolidated DescriptorProto objects holding all auto-generated messages and enums in the given package. .. py:function:: _dump_consolidated_protos(fd_protos: Dict[str, google.protobuf.descriptor_pb2.FileDescriptorProto], interfaces_dir: str) Dump all protobuf interfaces consolidated by package .. py:function:: _get_grpc_service_packages(write_modules_file: bool = False) -> List[caikit.runtime.service_factory.ServicePackage] Get all enabled grpc service packages .. py:function:: main()