Ejemplo n.º 1
0
    def __init__(self, broker, app_id):
        """ Configuration constructor. 

    Args:
      broker: The broker to use.
      app_id: Application id.
    """
        file_io.set_logging_format()
        self._broker = broker
        self._broker_location = self.__broker_location(broker)
        self._app_id = app_id
        self._queue_info_db = None
        self._queue_info_file = None
        file_io.mkdir(self.CELERY_CONFIG_DIR)
        file_io.mkdir(self.CELERY_WORKER_DIR)
Ejemplo n.º 2
0
  def __init__(self, broker, app_id):
    """ Configuration constructor. 

    Args:
      broker: The broker to use.
      app_id: Application id.
    """
    file_io.set_logging_format()
    self._broker = broker
    self._broker_location = self.__broker_location(broker)
    self._app_id = app_id
    self._queue_info_db = None
    self._queue_info_file = None
    file_io.mkdir(self.CELERY_CONFIG_DIR)
    file_io.mkdir(self.CELERY_WORKER_DIR)
Ejemplo n.º 3
0
  def __init__(self):
    """ DistributedTaskQueue Constructor. """
    file_io.set_logging_format()
    file_io.mkdir(self.LOG_DIR)
    file_io.mkdir(TaskQueueConfig.CELERY_WORKER_DIR)
    file_io.mkdir(TaskQueueConfig.CELERY_CONFIG_DIR)

    setup_env()

    master_db_ip = appscale_info.get_db_master_ip()
    connection_str = master_db_ip + ":" + str(constants.DB_SERVER_PORT)
    ds_distrib = datastore_distributed.DatastoreDistributed(
    constants.DASHBOARD_APP_ID, connection_str, False, False)
    apiproxy_stub_map.apiproxy.RegisterStub('datastore_v3', ds_distrib)
    os.environ['APPLICATION_ID'] = constants.DASHBOARD_APP_ID
Ejemplo n.º 4
0
    def __init__(self):
        """ DistributedTaskQueue Constructor. """
        file_io.set_logging_format()
        file_io.mkdir(self.LOG_DIR)
        file_io.mkdir(TaskQueueConfig.CELERY_WORKER_DIR)
        file_io.mkdir(TaskQueueConfig.CELERY_CONFIG_DIR)

        setup_env()

        # Cache all queue information in memory.
        self.__queue_info_cache = {}

        master_db_ip = appscale_info.get_db_master_ip()
        connection_str = master_db_ip + ":" + str(constants.DB_SERVER_PORT)
        ds_distrib = datastore_distributed.DatastoreDistributed(
            constants.DASHBOARD_APP_ID, connection_str, require_indexes=False)
        apiproxy_stub_map.apiproxy.RegisterStub('datastore_v3', ds_distrib)
        os.environ['APPLICATION_ID'] = constants.DASHBOARD_APP_ID
Ejemplo n.º 5
0
  def __init__(self):
    """ DistributedTaskQueue Constructor. """
    file_io.set_logging_format()
    file_io.mkdir(self.LOG_DIR)
    file_io.mkdir(TaskQueueConfig.CELERY_WORKER_DIR)
    file_io.mkdir(TaskQueueConfig.CELERY_CONFIG_DIR)

    setup_env()
  
    # Cache all queue information in memory.
    self.__queue_info_cache = {}

    master_db_ip = appscale_info.get_db_master_ip()
    connection_str = master_db_ip + ":" + str(constants.DB_SERVER_PORT)
    ds_distrib = datastore_distributed.DatastoreDistributed(
      constants.DASHBOARD_APP_ID, connection_str, require_indexes=False)
    apiproxy_stub_map.apiproxy.RegisterStub('datastore_v3', ds_distrib)
    os.environ['APPLICATION_ID'] = constants.DASHBOARD_APP_ID

    # Flag to see if code needs to be reloaded.
    self.__force_reload = False
Ejemplo n.º 6
0
  return True

def usage():
  """ Prints usage of this program """
  print "args: --help or -h for this menu"

################################
# MAIN
################################
if __name__ == "__main__":
  for args_index in range(1, len(sys.argv)):
    if sys.argv[args_index] in ("-h", "--help"):
      usage()
      sys.exit()

  INTERNAL_IP = appscale_info.get_private_ip()
  SERVER = SOAPpy.SOAPServer((INTERNAL_IP, constants.APP_MANAGER_PORT))

  SERVER.registerFunction(start_app)
  SERVER.registerFunction(stop_app)
  SERVER.registerFunction(stop_app_instance)
  SERVER.registerFunction(restart_app_instances_for_app)

  file_io.set_logging_format()

  while 1:
    try:
      SERVER.serve_forever()
    except SSL.SSLError:
      pass
Ejemplo n.º 7
0
def usage():
    """ Prints usage of this program """
    print "args: --help or -h for this menu"


################################
# MAIN
################################
if __name__ == "__main__":
    for args_index in range(1, len(sys.argv)):
        if sys.argv[args_index] in ("-h", "--help"):
            usage()
            sys.exit()

    INTERNAL_IP = appscale_info.get_private_ip()
    SERVER = SOAPpy.SOAPServer((INTERNAL_IP, constants.APP_MANAGER_PORT))

    SERVER.registerFunction(start_app)
    SERVER.registerFunction(stop_app)
    SERVER.registerFunction(stop_app_instance)
    SERVER.registerFunction(restart_app_instances_for_app)

    file_io.set_logging_format()

    while 1:
        try:
            SERVER.serve_forever()
        except SSL.SSLError:
            pass
Ejemplo n.º 8
0
 def __init__(self):
   """ DistributedTaskQueue Constructor. """
   file_io.set_logging_format()
   file_io.mkdir(self.LOG_DIR)
   file_io.mkdir(TaskQueueConfig.CELERY_WORKER_DIR)
   file_io.mkdir(TaskQueueConfig.CELERY_CONFIG_DIR)
Ejemplo n.º 9
0
 def __init__(self):
     """ DistributedTaskQueue Constructor. """
     file_io.set_logging_format()
     file_io.mkdir(self.LOG_DIR)
     file_io.mkdir(TaskQueueConfig.CELERY_WORKER_DIR)
     file_io.mkdir(TaskQueueConfig.CELERY_CONFIG_DIR)