caikit.runtime.grpc_server ========================== .. py:module:: caikit.runtime.grpc_server Attributes ---------- .. autoapisummary:: caikit.runtime.grpc_server.log caikit.runtime.grpc_server.PROMETHEUS_METRICS_INTERCEPTOR Classes ------- .. autoapisummary:: caikit.runtime.grpc_server.RuntimeGRPCServer Functions --------- .. autoapisummary:: caikit.runtime.grpc_server.main Module Contents --------------- .. py:data:: log .. py:data:: PROMETHEUS_METRICS_INTERCEPTOR .. py:class:: RuntimeGRPCServer(tls_config_override: Optional[aconfig.Config] = None) Bases: :py:obj:`caikit.runtime.server_base.RuntimeServerBase` An implementation of a gRPC server that serves caikit runtimes .. py:attribute:: server .. py:attribute:: _global_predict_servicer :value: None .. py:attribute:: _prediction_job_management_servicer :value: None .. py:attribute:: model_management_service :value: None .. py:attribute:: training_management_service :value: None .. py:method:: start(blocking: bool = True) Boot the gRPC server. Can be non-blocking, or block until shutdown Args: blocking (boolean): Whether to block until shutdown .. py:method:: stop(grace_period_seconds: Optional[Union[float, int]] = None) Stop the server, with an optional grace period. Args: grace_period_seconds (Union[float, int]): Grace period for service shutdown. Defaults to application config .. py:method:: render_protos(proto_out_dir: str) -> None Renders all the necessary protos for this service into a directory Args: proto_out_dir (str): Path to the directory to write proto files to .. py:method:: make_local_channel() -> grpc.Channel Return an insecure grpc channel over localhost for this server. Useful for unit testing or running local inference. .. py:method:: _load_secret(secret: str) -> str :staticmethod: If the secret points to a file, return the contents (plaintext reads). Else return the string .. py:method:: __enter__() .. py:method:: __exit__(type_, value, traceback) .. py:function:: main(blocking: bool = True)