| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """This module contains functions for fetching and extracting archived builds. | 5 """This module contains functions for fetching and extracting archived builds. |
| 6 | 6 |
| 7 The builds may be stored in different places by different types of builders; | 7 The builds may be stored in different places by different types of builders; |
| 8 for example, builders on tryserver.chromium.perf stores builds in one place, | 8 for example, builders on tryserver.chromium.perf stores builds in one place, |
| 9 while builders on chromium.linux store builds in another. | 9 while builders on chromium.linux store builds in another. |
| 10 | 10 |
| 11 This module can be either imported or run as a stand-alone script to download | 11 This module can be either imported or run as a stand-alone script to download |
| 12 and extract a build. | 12 and extract a build. |
| 13 | 13 |
| 14 Usage: fetch_build.py <type> <revision> <output_dir> [options] | 14 Usage: fetch_build.py <type> <revision> <output_dir> [options] |
| 15 """ | 15 """ |
| 16 | 16 |
| 17 import argparse | 17 import argparse |
| 18 import errno | 18 import errno |
| 19 import logging | 19 import logging |
| 20 import os | 20 import os |
| 21 import shutil | 21 import shutil |
| 22 import sys | 22 import sys |
| 23 import zipfile | 23 import zipfile |
| 24 | 24 |
| 25 # Telemetry (src/tools/telemetry) is expected to be in the PYTHONPATH. | 25 # Telemetry (src/tools/telemetry) is expected to be in the PYTHONPATH. |
| 26 from telemetry.util import cloud_storage | 26 from catapult_base import cloud_storage |
| 27 | 27 |
| 28 import bisect_utils | 28 import bisect_utils |
| 29 | 29 |
| 30 # Possible builder types. | 30 # Possible builder types. |
| 31 PERF_BUILDER = 'perf' | 31 PERF_BUILDER = 'perf' |
| 32 FULL_BUILDER = 'full' | 32 FULL_BUILDER = 'full' |
| 33 ANDROID_CHROME_PERF_BUILDER = 'android-chrome-perf' | 33 ANDROID_CHROME_PERF_BUILDER = 'android-chrome-perf' |
| 34 | 34 |
| 35 # Maximum time in seconds to wait after posting build request to the try server. | 35 # Maximum time in seconds to wait after posting build request to the try server. |
| 36 MAX_MAC_BUILD_TIME = 14400 | 36 MAX_MAC_BUILD_TIME = 14400 |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 print 'Build is not available.' | 500 print 'Build is not available.' |
| 501 return 1 | 501 return 1 |
| 502 | 502 |
| 503 FetchFromCloudStorage(bucket_name, remote_path, args.output_dir) | 503 FetchFromCloudStorage(bucket_name, remote_path, args.output_dir) |
| 504 print 'Build has been downloaded to and extracted in %s.' % args.output_dir | 504 print 'Build has been downloaded to and extracted in %s.' % args.output_dir |
| 505 return 0 | 505 return 0 |
| 506 | 506 |
| 507 | 507 |
| 508 if __name__ == '__main__': | 508 if __name__ == '__main__': |
| 509 sys.exit(Main(sys.argv)) | 509 sys.exit(Main(sys.argv)) |
| OLD | NEW |