Пример #1
0
def main():
    if doesServiceExist(conf.MASTER_IP, conf.MASTER_PORT):
        print("%s:%s already been used! change another port" % (conf.MASTER_IP, conf.MASTER_PORT))
        exit(1)
    master_node = master.Master(TaskLoader(), conf)
    server = RPCServerThread(master_node)
    server.start()
    master_node.serve_forever()
Пример #2
0
def main():
    if doesServiceExist(conf.MASTER_IP, conf.MASTER_PORT):
        print("%s:%s already been used! change another port" %
              (conf.MASTER_IP, conf.MASTER_PORT))
        exit(1)
    master_node = master.Master(TaskLoader(), conf)
    server = RPCServerThread(master_node)
    server.start()
    master_node.serve_forever()
Пример #3
0
def get_worker(port):
    ip = utils.IPGetter.get_ip_address()
    master_info = NodeInfo(name="master",ip=conf.MASTER_IP,
                           port=conf.MASTER_PORT, status=NodeStatus.working)
    node_info = NodeInfo(name="worker", ip=ip, port=port, status=NodeStatus.idle)

    if common.doesServiceExist(node_info.ip, node_info.port):
        logging.warning("%s:%s already been used! change another port" % (node_info.ip, node_info.port))
        exit(1)

    worker_node = WorkerNode(master_info, node_info)
    logging.info("%s startup" % worker_node.get_node_info())

    return worker_node
Пример #4
0
def get_worker(port):
    ip = utils.IPGetter.get_ip_address()
    master_info = NodeInfo(name="master",
                           ip=conf.MASTER_IP,
                           port=conf.MASTER_PORT,
                           status=NodeStatus.working)
    node_info = NodeInfo(name="worker",
                         ip=ip,
                         port=port,
                         status=NodeStatus.idle)

    if common.doesServiceExist(node_info.ip, node_info.port):
        logging.warning("%s:%s already been used! change another port" %
                        (node_info.ip, node_info.port))
        exit(1)

    worker_node = WorkerNode(master_info, node_info)
    logging.info("%s startup" % worker_node.get_node_info())

    return worker_node