00c717a1276ceb5570f7c77a7b58a07c19bfc56d,python/paddle_edl/distill/redis/server_register.py,,,#,87

Before Change


    from redis_store import RedisStore

    ip = "127.0.0.1"
    port = 5458
    service_name = "TestService"
    service_name = "DistillService"

    if len(sys.argv) == 2:
        port = int(sys.argv[1])
    elif len(sys.argv) >= 3:
        ip = sys.argv[1]
        port = int(sys.argv[2])
        if len(sys.argv) == 4:
            service_name = sys.argv[3]

    print("register {}:{} service_name={}".format(ip, port, service_name))

    //store = RedisStore("127.0.0.1", 6379)
    store = RedisStore("10.255.100.13", 6379)

After Change


    from redis_store import RedisStore

    import argparse
    parser = argparse.ArgumentParser(description="Server Register")
    parser.add_argument(
        "--db_endpoints",
        type=str,
        default="127.0.0.1:6379",
        help="database endpoints, e.g. 127.0.0.1:6379 [default: %(default)s]")
    parser.add_argument(
        "--db_passwd",
        type=str,
        default=None,
        help="detabase password [default: %(default)s]")
    parser.add_argument(
        "--db_type",
        type=str,
        default="redis",
        help="database type, only support redis for now [default: %(default)s]")
    parser.add_argument(
        "--service_name",
        type=str,
        help="service name where the server is located",
        required=True)
    parser.add_argument(
        "--server",
        type=str,
        help="endpoint of the server, e.g. 127.0.0.1:8888",
        required=True)
    // TODO. service_token
    parser.add_argument(
        "--service_token",
        type=str,
        default=None,
        help="service token, which the same can register [default: %(default)s]"
    )

    args = parser.parse_args()
    server = args.server
    db_endpoints = args.db_endpoints.split(",")

    redis_ip_port = db_endpoints[0].split(":")
    server_ip_port = server.split(":")

    store = RedisStore(redis_ip_port[0], int(redis_ip_port[1]))
    register = ServerRegister(server_ip_port[0],
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 40

Instances


Project Name: PaddlePaddle/edl
Commit Name: 00c717a1276ceb5570f7c77a7b58a07c19bfc56d
Time: 2020-06-02
Author: wangxi16@baidu.com
File Name: python/paddle_edl/distill/redis/server_register.py
Class Name:
Method Name:


Project Name: PaddlePaddle/edl
Commit Name: 00c717a1276ceb5570f7c77a7b58a07c19bfc56d
Time: 2020-06-02
Author: wangxi16@baidu.com
File Name: python/paddle_edl/distill/redis/server_register.py
Class Name:
Method Name:


Project Name: kenshohara/3D-ResNets-PyTorch
Commit Name: 82b45455ebe631854f99c2f716ab5488f1842925
Time: 2018-11-27
Author: kensho.hara@aist.go.jp
File Name: util_scripts/video_jpg_ucf101_hmdb51.py
Class Name:
Method Name:


Project Name: kenshohara/3D-ResNets-PyTorch
Commit Name: 2dc9326a620d9fe60cc8c796812f33011d68f7b9
Time: 2018-11-27
Author: kensho.hara@aist.go.jp
File Name: util_scripts/video_jpg_kinetics_mit.py
Class Name:
Method Name: