Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(806)

Side by Side Diff: testing/legion/client_controller.py

Issue 952893003: Update from https://crrev.com/317530 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix gn for nacl Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « testing/commit_queue/config.json ('k') | testing/legion/client_lib.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 """The main client_controller code.
7
8 This code is the main entry point for the client machines and handles
9 registering with the host server and running the local RPC server.
10 """
11
12 import argparse
13 import logging
14 import socket
15 import sys
16 import time
17
18 #pylint: disable=relative-import
19 import client_rpc_server
20 import common_lib
21
22
23 def main():
24 print ' '.join(sys.argv)
25 common_lib.InitLogging()
26 logging.info('Client controller starting')
27
28 parser = argparse.ArgumentParser()
29 parser.add_argument('--otp',
30 help='One time token used to authenticate with the host')
31 parser.add_argument('--host',
32 help='The ip address of the host')
33 parser.add_argument('--idle-timeout', type=int,
34 default=common_lib.DEFAULT_TIMEOUT_SECS,
35 help='The idle timeout for the rpc server in seconds')
36 args, _ = parser.parse_known_args()
37
38 logging.info(
39 'Registering with discovery server at %s using OTP %s', args.host,
40 args.otp)
41 server = common_lib.ConnectToServer(args.host).RegisterClient(
42 args.otp, common_lib.MY_IP)
43
44 server = client_rpc_server.RPCServer(args.host, args.idle_timeout)
45
46 server.serve_forever()
47 return 0
48
49
50 if __name__ == '__main__':
51 sys.exit(main())
OLDNEW
« no previous file with comments | « testing/commit_queue/config.json ('k') | testing/legion/client_lib.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698