Esempio n. 1
0
def get_trial(stub):
  try:
    reply = stub.GetTrial(api_pb2.GetTrialRequest(trial_name=TEST_TRIAL), 10)
    trial = reply.trial
    if trial and trial.name == TEST_TRIAL:
      logger.info("Get trial %s successfully" % TEST_TRIAL)
    else:
      raise Exception()
  except:
    logger.error("Failed to get trial %s" % TEST_TRIAL, exc_info=True)
    raise
Esempio n. 2
0
def get_best_trial(trial_id):
    vizier_core = "vizier-core.kubeflow:6789"
    with grpc.insecure_channel(vizier_core) as channel:
        stub = api_pb2_grpc.ManagerStub(channel)
        response = stub.GetTrial(api_pb2.GetTrialRequest(trial_id=trial_id))
        return response.trial