caikit.runtime.server_base ========================== .. py:module:: caikit.runtime.server_base .. autoapi-nested-parse:: Base class with common functionality across all caikit servers Attributes ---------- .. autoapisummary:: caikit.runtime.server_base.log caikit.runtime.server_base.error Classes ------- .. autoapisummary:: caikit.runtime.server_base.ServerThreadPool caikit.runtime.server_base.RuntimeServerBase Module Contents --------------- .. py:data:: log .. py:data:: error .. py:class:: ServerThreadPool Simple wrapper for all servers to share a single thread pool .. py:method:: _build_pool() -> concurrent.futures.ThreadPoolExecutor :staticmethod: .. py:attribute:: pool .. py:class:: RuntimeServerBase(base_port: int, tls_config_override: Optional[aconfig.Config]) Bases: :py:obj:`abc.ABC` Helper class that provides a standard way to create an ABC using inheritance. .. py:attribute:: __doc__ :value: 'Base class with common functionality across all caikit servers' .. py:attribute:: _metrics_server_started :value: False .. py:attribute:: config .. py:attribute:: port .. py:attribute:: tls_config .. py:attribute:: enable_inference .. py:attribute:: enable_training .. py:attribute:: enable_inference_jobs .. py:attribute:: inference_service :type: Optional[caikit.runtime.service_factory.ServicePackage] .. py:attribute:: inference_job_service :type: Optional[caikit.runtime.service_factory.ServicePackage] .. py:attribute:: training_service .. py:attribute:: runtime_info_service :type: Optional[caikit.runtime.service_factory.ServicePackage] .. py:attribute:: thread_pool :type: concurrent.futures.ThreadPoolExecutor .. py:attribute:: interrupter :type: Optional[caikit.runtime.work_management.abortable_context.ThreadInterrupter] .. py:method:: _start_metrics_server() -> None :classmethod: Start a single instance of the metrics server based on configuration .. py:method:: interrupt(signal_, _stack_frame) .. py:method:: _intercept_interrupt_signal() -> None Intercept signal handlers to allow the server to stop on interrupt. Calling this on a non-main thread has no effect. This does not override any existing non-default signal handlers, it will call them all in the reverse order they are registered. .. py:method:: _add_signal_handler(sig, handler) :staticmethod: .. py:method:: _shut_down_model_manager() Shared utility for shutting down the model manager .. py:method:: start(blocking: bool = True) :abstractmethod: .. py:method:: stop() :abstractmethod: .. py:method:: __enter__() .. py:method:: __exit__(type_, value, traceback)