caikit.runtime.dump_services

Attributes

log

error

Functions

dump_grpc_services(output_dir, write_modules_file[, ...])

Utility for rendering the all generated interfaces to proto files

dump_http_services(output_dir)

Dump out the openapi.json for the HTTP server

_try_find_file_by_name(...)

Attempt to find a file descriptor by name and return None if not found

_recursive_safe_add_to_pool(...)

Recursively add the given file descriptor and all of its dependencies to

_descriptor_to_proto(...)

Convert a given Descriptor type to the corresponding Proto for

_get_proto_file_descriptors(→ Dict[str, ...)

Get a dict mapping package names to consolidated DescriptorProto objects

_dump_consolidated_protos(fd_protos, interfaces_dir)

Dump all protobuf interfaces consolidated by package

_get_grpc_service_packages(...)

Get all enabled grpc service packages

main()

Module Contents

caikit.runtime.dump_services.log[source]
caikit.runtime.dump_services.error
caikit.runtime.dump_services.dump_grpc_services(output_dir: str, write_modules_file: bool, consolidate: bool = False)[source]

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

caikit.runtime.dump_services.dump_http_services(output_dir: str)[source]

Dump out the openapi.json for the HTTP server

caikit.runtime.dump_services._try_find_file_by_name(name: str, pool: google.protobuf.descriptor_pool.DescriptorPool) google.protobuf.descriptor.FileDescriptor | None[source]

Attempt to find a file descriptor by name and return None if not found

caikit.runtime.dump_services._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[source]

Recursively add the given file descriptor and all of its dependencies to the pool and handle double-add conflicts.

caikit.runtime.dump_services._descriptor_to_proto(descriptor: google.protobuf.descriptor.Descriptor | google.protobuf.descriptor.EnumDescriptor | google.protobuf.descriptor.ServiceDescriptor) google.protobuf.descriptor_pb2.DescriptorProto | google.protobuf.descriptor_pb2.EnumDescriptorProto | google.protobuf.descriptor_pb2.ServiceDescriptorProto[source]

Convert a given Descriptor type to the corresponding Proto for comparison by content rather than instance id

caikit.runtime.dump_services._get_proto_file_descriptors(object_descriptors: List[google.protobuf.descriptor.Descriptor | google.protobuf.descriptor.EnumDescriptor | google.protobuf.descriptor.ServiceDescriptor]) Dict[str, google.protobuf.descriptor_pb2.FileDescriptorProto][source]

Get a dict mapping package names to consolidated DescriptorProto objects holding all auto-generated messages and enums in the given package.

caikit.runtime.dump_services._dump_consolidated_protos(fd_protos: Dict[str, google.protobuf.descriptor_pb2.FileDescriptorProto], interfaces_dir: str)[source]

Dump all protobuf interfaces consolidated by package

caikit.runtime.dump_services._get_grpc_service_packages(write_modules_file: bool = False) List[caikit.runtime.service_factory.ServicePackage][source]

Get all enabled grpc service packages

caikit.runtime.dump_services.main()[source]