def main(argv):
  """Sets up all the component in their own threads."""

  # We use .startswith so that multiple copies of services can easily be
  # created using systemd as worker1 worker2 ... worker25 etc.

  # Start as a worker.
  if flags.FLAGS.component.startswith("worker"):
    worker.main([argv])

  # Start as a HTTP server that clients communicate with.
  elif flags.FLAGS.component.startswith("http_server"):
    http_server.main([argv])

  # Start as an AdminUI.
  elif flags.FLAGS.component.startswith("ui"):
    admin_ui.main([argv])

  # Start as the data server master. There can only be one master
  elif flags.FLAGS.component == "dataserver_master":
    flags.FLAGS.master = True
    data_server.main([argv])

  # Start dataserver slave
  elif flags.FLAGS.component.startswith("dataserver_slave"):
    data_server.main([argv])

  # If no flags were set then raise.
  else:
    raise RuntimeError("No valid component specified. Got: "
                       "%s." % flags.FLAGS.component)
Esempio n. 2
0
def main(argv):
    """Sets up all the component in their own threads."""

    # We use .startswith so that multiple copies of services can easily be
    # created using systemd as worker1 worker2 ... worker25 etc.

    # Start as a worker.
    if flags.FLAGS.component.startswith("worker"):
        worker.main([argv])

    # Start as a HTTP server that clients communicate with.
    elif flags.FLAGS.component.startswith("http_server"):
        http_server.main([argv])

    # Start as an AdminUI.
    elif flags.FLAGS.component.startswith("ui"):
        admin_ui.main([argv])

    # Start as the data server master. There can only be one master
    elif flags.FLAGS.component == "dataserver_master":
        flags.FLAGS.master = True
        data_server.main([argv])

    # Start dataserver slave
    elif flags.FLAGS.component.startswith("dataserver_slave"):
        data_server.main([argv])

    # If no flags were set then raise.
    else:
        raise RuntimeError("No valid component specified. Got: "
                           "%s." % flags.FLAGS.component)
Esempio n. 3
0
def main(argv):
  """Sets up all the component in their own threads."""

  # We use .startswith so that multiple copies of services can easily be
  # created using systemd as worker1 worker2 ... worker25 etc.

  if not flags.FLAGS.component:
    raise ValueError("Need to specify which component to start.")

  # Start as a worker.
  if flags.FLAGS.component.startswith("worker"):
    worker.main([argv])

  # Start as a frontend that clients communicate with.
  elif flags.FLAGS.component.startswith("frontend"):
    frontend.main([argv])

  # Start as an AdminUI.
  elif flags.FLAGS.component.startswith("admin_ui"):
    admin_ui.main([argv])

  # Raise on invalid component.
  else:
    raise ValueError("No valid component specified. Got: "
                     "%s." % flags.FLAGS.component)
Esempio n. 4
0
def main(argv):
  """Sets up all the component in their own threads."""

  # Start as a worker.
  if flags.FLAGS.start_worker:
    worker.main([argv])

  # Start as a HTTP server that clients communicate with.
  elif flags.FLAGS.start_http_server:
    http_server.main([argv])

  # Start as an AdminUI.
  elif flags.FLAGS.start_ui:
    admin_ui.main([argv])

  # Start as the data server.
  elif flags.FLAGS.start_dataserver:
    data_server.main([argv])

  # If no flags were set then raise.
  else:
    raise RuntimeError("No component specified to start")