コード例 #1
0
ファイル: interface.py プロジェクト: frankier/client
    def join(self) -> None:
        # shutdown
        request = pb.Request(shutdown=pb.ShutdownRequest())
        record = self._make_record(request=request)
        _ = self._communicate(record)

        if self._router:
            self._router.join()
コード例 #2
0
ファイル: interface.py プロジェクト: khituras/client
    def join(self):
        # shutdown
        request = wandb_internal_pb2.Request(
            shutdown=wandb_internal_pb2.ShutdownRequest())
        record = self._make_record(request=request)
        _ = self._communicate(record)

        if self._router:
            self._router.join()
コード例 #3
0
ファイル: interface.py プロジェクト: sqiangcao99/client
 def _make_request(
     self,
     login: pb.LoginRequest = None,
     get_summary: pb.GetSummaryRequest = None,
     pause: pb.PauseRequest = None,
     resume: pb.ResumeRequest = None,
     stop_status: pb.StopStatusRequest = None,
     network_status: pb.NetworkStatusRequest = None,
     poll_exit: pb.PollExitRequest = None,
     sampled_history: pb.SampledHistoryRequest = None,
     run_start: pb.RunStartRequest = None,
     check_version: pb.CheckVersionRequest = None,
     log_artifact: pb.LogArtifactRequest = None,
     defer: pb.DeferRequest = None,
 ) -> pb.Record:
     request = pb.Request()
     if login:
         request.login.CopyFrom(login)
     elif get_summary:
         request.get_summary.CopyFrom(get_summary)
     elif pause:
         request.pause.CopyFrom(pause)
     elif resume:
         request.resume.CopyFrom(resume)
     elif stop_status:
         request.stop_status.CopyFrom(stop_status)
     elif network_status:
         request.network_status.CopyFrom(network_status)
     elif poll_exit:
         request.poll_exit.CopyFrom(poll_exit)
     elif sampled_history:
         request.sampled_history.CopyFrom(sampled_history)
     elif run_start:
         request.run_start.CopyFrom(run_start)
     elif check_version:
         request.check_version.CopyFrom(check_version)
     elif log_artifact:
         request.log_artifact.CopyFrom(log_artifact)
     elif defer:
         request.defer.CopyFrom(defer)
     else:
         raise Exception("Invalid request")
     record = self._make_record(request=request)
     # All requests do not get persisted
     record.control.local = True
     return record
コード例 #4
0
 def _make_request(
     self,
     login=None,
     get_summary=None,
     pause=None,
     resume=None,
     stop_status=None,
     network_status=None,
     poll_exit=None,
     sampled_history=None,
     run_start=None,
     check_version=None,
     log_artifact=None,
     defer=None,
 ):
     request = pb.Request()
     if login:
         request.login.CopyFrom(login)
     elif get_summary:
         request.get_summary.CopyFrom(get_summary)
     elif pause:
         request.pause.CopyFrom(pause)
     elif resume:
         request.resume.CopyFrom(resume)
     elif stop_status:
         request.stop_status.CopyFrom(stop_status)
     elif network_status:
         request.network_status.CopyFrom(network_status)
     elif poll_exit:
         request.poll_exit.CopyFrom(poll_exit)
     elif sampled_history:
         request.sampled_history.CopyFrom(sampled_history)
     elif run_start:
         request.run_start.CopyFrom(run_start)
     elif check_version:
         request.check_version.CopyFrom(check_version)
     elif log_artifact:
         request.log_artifact.CopyFrom(log_artifact)
     elif defer:
         request.defer.CopyFrom(defer)
     else:
         raise Exception("Invalid request")
     record = self._make_record(request=request)
     # All requests do not get persisted
     record.control.local = True
     return record
コード例 #5
0
ファイル: conftest.py プロジェクト: ayulockin/client
    def fn(write_function, logdir="./", save=True, root_dir="./"):

        with backend_interface() as interface:
            proto_run = pb.RunRecord()
            mocked_run._make_proto_run(proto_run)

            run_start = pb.RunStartRequest()
            run_start.run.CopyFrom(proto_run)

            request = pb.Request()
            request.run_start.CopyFrom(run_start)

            record = pb.Record()
            record.request.CopyFrom(request)
            internal_hm.handle_request_run_start(record)
            internal_hm._tb_watcher.add(logdir, save, root_dir)

            # need to sleep to give time for the tb_watcher delay
            time.sleep(15)
            write_function()

        ctx_util = parse_ctx(mock_server.ctx)
        return ctx_util
コード例 #6
0
 def _communicate_shutdown(self) -> None:
     # shutdown
     request = pb.Request(shutdown=pb.ShutdownRequest())
     record = self._make_record(request=request)
     _ = self._communicate(record)