Esempio n. 1
0
    def cancel(
        control_address: str,
        **kwargs,
    ):
        """
        Cancel this runtime by sending a TERMINATE control message

        :param control_address: the address where the control message needs to be sent
        :param kwargs: extra keyword arguments
        """
        try:
            Grpclet.send_ctrl_msg(control_address, 'TERMINATE')
        except RpcError:
            # TERMINATE can fail if the the runtime dies before sending the return value
            pass
Esempio n. 2
0
    def is_ready(ctrl_address: str, **kwargs) -> bool:
        """
        Check if status is ready.

        :param ctrl_address: the address where the control message needs to be sent
        :param kwargs: extra keyword arguments

        :return: True if status is ready else False.
        """

        try:
            response = Grpclet.send_ctrl_msg(ctrl_address, 'STATUS')
        except RpcError:
            return False

        return True
Esempio n. 3
0
 def send_status():
     return Grpclet.send_ctrl_msg(
         pod_address=f'{args.host}:{args.port_in}',
         command='STATUS')