def main(argv):
    FLAGS.verbosity = logging.INFO
    FLAGS(argv)

    with grpc.insecure_channel(FLAGS.service_manager_grpc_server) as channel:
        stub = service_manager_rpc_pb2_grpc.ServiceManagerStub(channel)

        roscore_options = ReadServiceOptions(FLAGS.roscore_options_pbtxt)
        ros_trigger_ui_options = ReadServiceOptions(
            FLAGS.ros_trigger_ui_options_pbtxt)

        if FLAGS.docker_rm_before_start:
            RemoveExistingDockerContainerById(roscore_options.id)
            RemoveExistingDockerContainerById(ros_trigger_ui_options.id)

        RorgCreateService(stub, roscore_options)
        RorgCreateService(stub, ros_trigger_ui_options)

        RorgQueryService(stub, roscore_options.id)
        RorgQueryService(stub, ros_trigger_ui_options.id)

        RorgRequestService(stub, srv_id=ros_trigger_ui_options.id)

        RorgQueryService(stub, roscore_options.id)
        RorgQueryService(stub, ros_trigger_ui_options.id)
Esempio n. 2
0
def main(argv):
  FLAGS.verbosity = logging.INFO
  FLAGS(argv)

  with grpc.insecure_channel(FLAGS.service_manager_grpc_server) as channel:
    stub = service_manager_rpc_pb2_grpc.ServiceManagerStub(channel)
    srv_id_pb = service_id.ServiceId.FromString(FLAGS.service_name).ToProto()

    query_request = service_manager_rpc_pb2.QueryServiceRequest()
    query_request.id.CopyFrom(srv_id_pb)
    logging.info("Request to send: \n%s", str(query_request))

    query_response = stub.QueryService(query_request)
    logging.info("Response: \n%s", str(query_response))
Esempio n. 3
0
def main(argv):
    FLAGS.verbosity = logging.INFO
    FLAGS(argv)

    with grpc.insecure_channel(FLAGS.service_manager_grpc_server) as channel:
        stub = service_manager_rpc_pb2_grpc.ServiceManagerStub(channel)

        request_request = service_manager_rpc_pb2.RequestServiceRequest()
        with open(FLAGS.request_pbtxt_path, "r") as fp:
            pbtxt_content = fp.read()
            google.protobuf.text_format.Merge(pbtxt_content, request_request)

        logging.info("Request to send: \n%s", str(request_request))
        request_response = stub.RequestService(request_request)
        logging.info("Response: \n%s", str(request_response))
Esempio n. 4
0
def main(argv):
  FLAGS.verbosity = logging.INFO
  FLAGS(argv)

  with grpc.insecure_channel(FLAGS.service_manager_grpc_server) as channel:
    stub = service_manager_rpc_pb2_grpc.ServiceManagerStub(channel)

    with open(FLAGS.create_options_pbtxt, "r") as fp:
      pbtxt = fp.read()
      pb_service_options = service_options_pb2.ServiceOptions()
      google.protobuf.text_format.Merge(pbtxt, pb_service_options)

      create_request = service_manager_rpc_pb2.CreateServiceRequest()
      create_request.options.CopyFrom(pb_service_options)
      logging.info("Request to send: \n%s", str(create_request))

      create_response = stub.CreateService(create_request)
      logging.info("Response: \n%s", str(create_response))
Esempio n. 5
0
def main(argv):
    FLAGS.verbosity = logging.INFO
    FLAGS(argv)

    with grpc.insecure_channel(FLAGS.service_manager_grpc_server) as channel:
        stub = service_manager_rpc_pb2_grpc.ServiceManagerStub(channel)

        srv_id_releasor = service_id.ServiceId.FromString(
            FLAGS.releasor).ToProto()
        srv_id_pb = service_id.ServiceId.FromString(
            FLAGS.service_name).ToProto()

        release_request = service_manager_rpc_pb2.ReleaseServiceRequest()
        release_request.request_id.service_id.CopyFrom(srv_id_releasor)
        release_request.request_id.request_uuid = FLAGS.service_name

        logging.info("Request to send: \n%s", str(release_request))

        release_response = stub.ReleaseService(release_request)
        logging.info("Response: \n%s", str(release_response))
 def __init__(self):
   channel = grpc.insecure_channel(FLAGS.service_manager_grpc_server)
   self._rorg_stub = service_manager_rpc_pb2_grpc.ServiceManagerStub(channel)
   self._sync_helper_config = None