Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / chromite / cbuildbot / constants.py
1 # Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 """This module contains constants used by cbuildbot and related code."""
6
7 from __future__ import print_function
8
9 import os
10
11 def _FindSourceRoot():
12   """Try and find the root check out of the chromiumos tree"""
13   source_root = path = os.path.realpath(os.path.join(
14       os.path.abspath(__file__), '..', '..', '..'))
15   while True:
16     if os.path.isdir(os.path.join(path, '.repo')):
17       return path
18     elif path == '/':
19       break
20     path = os.path.dirname(path)
21   return source_root
22
23 SOURCE_ROOT = _FindSourceRoot()
24 CHROOT_SOURCE_ROOT = '/mnt/host/source'
25
26 CROSUTILS_DIR = os.path.join(SOURCE_ROOT, 'src/scripts')
27 CHROMITE_DIR = os.path.join(SOURCE_ROOT, 'chromite')
28 DEPOT_TOOLS_DIR = os.path.join(SOURCE_ROOT, 'chromium/tools/depot_tools')
29 CHROMITE_BIN_SUBDIR = 'chromite/bin'
30 CHROMITE_BIN_DIR = os.path.join(SOURCE_ROOT, CHROMITE_BIN_SUBDIR)
31 PATH_TO_CBUILDBOT = os.path.join(CHROMITE_BIN_SUBDIR, 'cbuildbot')
32 DEFAULT_CHROOT_DIR = 'chroot'
33 SDK_TOOLCHAINS_OUTPUT = 'tmp/toolchain-pkgs'
34 AUTOTEST_BUILD_PATH = 'usr/local/build/autotest'
35
36 HOME_DIRECTORY = os.path.expanduser('~')
37
38 # If cbuiltbot is running on a bot, then the cidb access credentials will be
39 # available here. This directory will not exist otherwise.
40 CIDB_PROD_BOT_CREDS = os.path.join(HOME_DIRECTORY, '.cidb_creds',
41                                    'prod_cidb_bot')
42 CIDB_DEBUG_BOT_CREDS = os.path.join(HOME_DIRECTORY, '.cidb_creds',
43                                     'debug_cidb_bot')
44
45 CIDB_KNOWN_WATERFALLS = ('chromeos',
46                          'chromiumos',
47                          'chromiumos.tryserver',
48                          'chromeos_release',
49                          'chromeos.branch')
50
51 # TODO: Eliminate these or merge with manifest_version.py:STATUS_PASSED
52 # crbug.com/318930
53 FINAL_STATUS_PASSED = 'passed'
54 FINAL_STATUS_FAILED = 'failed'
55
56 # Re-execution API constants.
57 # Used by --resume and --bootstrap to decipher which options they
58 # can pass to the target cbuildbot (since it may not have that
59 # option).
60 # Format is Major:Minor.  Minor is used for tracking new options added
61 # that aren't critical to the older version if it's not ran.
62 # Major is used for tracking heavy API breakage- for example, no longer
63 # supporting the --resume option.
64 REEXEC_API_MAJOR = 0
65 REEXEC_API_MINOR = 3
66 REEXEC_API_VERSION = '%i.%i' % (REEXEC_API_MAJOR, REEXEC_API_MINOR)
67
68 # Minor version 3 is the first to support --master-build-id
69 REEXEC_API_MASTER_BUILD_ID = 3
70
71 # We rely on the (waterfall, builder name, build number) to uniquely identify
72 # a build. However, future migrations or state wipes of the buildbot master may
73 # cause it to reset its build number counter. When that happens, this value
74 # should be incremented, ensuring that (waterfall, builder name, build number,
75 # buildbot generation) is a unique identifier of builds.
76 BUILDBOT_GENERATION = 1
77
78 ISOLATESERVER = 'https://isolateserver.appspot.com'
79
80 GOOGLE_EMAIL = '@google.com'
81 CHROMIUM_EMAIL = '@chromium.org'
82
83 CORP_DOMAIN = 'corp.google.com'
84 GOLO_DOMAIN = 'golo.chromium.org'
85 CHROME_DOMAIN = 'chrome.' + CORP_DOMAIN
86
87 GOB_HOST = '%s.googlesource.com'
88
89 EXTERNAL_GOB_INSTANCE = 'chromium'
90 EXTERNAL_GERRIT_INSTANCE = 'chromium-review'
91 EXTERNAL_GOB_HOST = GOB_HOST % EXTERNAL_GOB_INSTANCE
92 EXTERNAL_GERRIT_HOST = GOB_HOST % EXTERNAL_GERRIT_INSTANCE
93 EXTERNAL_GOB_URL = 'https://%s' % EXTERNAL_GOB_HOST
94 EXTERNAL_GERRIT_URL = 'https://%s' % EXTERNAL_GERRIT_HOST
95
96 INTERNAL_GOB_INSTANCE = 'chrome-internal'
97 INTERNAL_GERRIT_INSTANCE = 'chrome-internal-review'
98 INTERNAL_GOB_HOST = GOB_HOST % INTERNAL_GOB_INSTANCE
99 INTERNAL_GERRIT_HOST = GOB_HOST % INTERNAL_GERRIT_INSTANCE
100 INTERNAL_GOB_URL = 'https://%s' % INTERNAL_GOB_HOST
101 INTERNAL_GERRIT_URL = 'https://%s' % INTERNAL_GERRIT_HOST
102
103 REPO_PROJECT = 'external/repo'
104 REPO_URL = '%s/%s' % (EXTERNAL_GOB_URL, REPO_PROJECT)
105
106 CHROMITE_PROJECT = 'chromiumos/chromite'
107 CHROMITE_URL = '%s/%s' % (EXTERNAL_GOB_URL, CHROMITE_PROJECT)
108 CHROMIUM_SRC_PROJECT = 'chromium/src'
109 CHROMIUM_GOB_URL = '%s/%s.git' % (EXTERNAL_GOB_URL, CHROMIUM_SRC_PROJECT)
110 CHROME_INTERNAL_PROJECT = 'chrome/src-internal'
111 CHROME_INTERNAL_GOB_URL = '%s/%s.git' % (
112     INTERNAL_GOB_URL, CHROME_INTERNAL_PROJECT)
113
114 MANIFEST_PROJECT = 'chromiumos/manifest'
115 MANIFEST_INT_PROJECT = 'chromeos/manifest-internal'
116 MANIFEST_PROJECTS = (MANIFEST_PROJECT, MANIFEST_INT_PROJECT)
117
118 MANIFEST_URL = '%s/%s' % (EXTERNAL_GOB_URL, MANIFEST_PROJECT)
119 MANIFEST_INT_URL = '%s/%s' % (INTERNAL_GERRIT_URL, MANIFEST_INT_PROJECT)
120
121 DEFAULT_MANIFEST = 'default.xml'
122 OFFICIAL_MANIFEST = 'official.xml'
123 SHARED_CACHE_ENVVAR = 'CROS_CACHEDIR'
124
125 # CrOS remotes specified in the manifests.
126 EXTERNAL_REMOTE = 'cros'
127 INTERNAL_REMOTE = 'cros-internal'
128 CHROMIUM_REMOTE = 'chromium'
129 CHROME_REMOTE = 'chrome'
130
131 GERRIT_HOSTS = {
132     EXTERNAL_REMOTE: EXTERNAL_GERRIT_HOST,
133     INTERNAL_REMOTE: INTERNAL_GERRIT_HOST,
134 }
135
136 CROS_REMOTES = {
137     EXTERNAL_REMOTE: EXTERNAL_GOB_URL,
138     INTERNAL_REMOTE: INTERNAL_GOB_URL,
139 }
140
141 GIT_REMOTES = {
142     CHROMIUM_REMOTE: EXTERNAL_GOB_URL,
143     CHROME_REMOTE: INTERNAL_GOB_URL,
144 }
145 GIT_REMOTES.update(CROS_REMOTES)
146
147 # Prefix to distinguish internal and external changes. This is used
148 # when user specifies a patch with "-g", when generating a key for
149 # a patch to used in our PatchCache, and when display a custom string
150 # for the patch.
151 INTERNAL_CHANGE_PREFIX = '*'
152 EXTERNAL_CHANGE_PREFIX = ''
153
154 CHANGE_PREFIX = {
155     INTERNAL_REMOTE: INTERNAL_CHANGE_PREFIX,
156     EXTERNAL_REMOTE: EXTERNAL_CHANGE_PREFIX,
157 }
158
159 # List of remotes that are ok to include in the external manifest.
160 EXTERNAL_REMOTES = (EXTERNAL_REMOTE, CHROMIUM_REMOTE)
161
162 # Mapping 'remote name' -> regexp that matches names of repositories on that
163 # remote that can be branched when creating CrOS branch. Branching script will
164 # actually create a new git ref when branching these projects. It won't attempt
165 # to create a git ref for other projects that may be mentioned in a manifest.
166 BRANCHABLE_PROJECTS = {
167     EXTERNAL_REMOTE: r'chromiumos/(.+)',
168     INTERNAL_REMOTE: r'chromeos/(.+)',
169 }
170
171 # TODO(sosa): Move to manifest-versions-external once its created
172 MANIFEST_VERSIONS_SUFFIX = '/chromiumos/manifest-versions'
173 MANIFEST_VERSIONS_INT_SUFFIX = '/chromeos/manifest-versions'
174 MANIFEST_VERSIONS_GS_URL = 'gs://chromeos-manifest-versions'
175 TRASH_BUCKET = 'gs://chromeos-throw-away-bucket'
176
177 STREAK_COUNTERS = 'streak_counters'
178
179 PATCH_BRANCH = 'patch_branch'
180 STABLE_EBUILD_BRANCH = 'stabilizing_branch'
181 MERGE_BRANCH = 'merge_branch'
182
183 # These branches are deleted at the beginning of every buildbot run.
184 CREATED_BRANCHES = [
185     PATCH_BRANCH,
186     STABLE_EBUILD_BRANCH,
187     MERGE_BRANCH
188 ]
189
190 # Constants for uprevving Chrome
191
192 # Portage category and package name for Chrome.
193 CHROME_PN = 'chromeos-chrome'
194 CHROME_CP = 'chromeos-base/%s' % CHROME_PN
195
196 # Other packages to uprev while uprevving Chrome.
197 OTHER_CHROME_PACKAGES = ['chromeos-base/chromium-source']
198
199 # Chrome use flags
200 USE_CHROME_INTERNAL = 'chrome_internal'
201 USE_AFDO_USE = 'afdo_use'
202
203
204 # Builds and validates _alpha ebuilds.  These builds sync to the latest
205 # revsion of the Chromium src tree and build with that checkout.
206 CHROME_REV_TOT = 'tot'
207
208 # Builds and validates chrome at a given revision through cbuildbot
209 # --chrome_version
210 CHROME_REV_SPEC = 'spec'
211
212 # Builds and validates the latest Chromium release as defined by
213 # ~/trunk/releases in the Chrome src tree.  These ebuilds are suffixed with rc.
214 CHROME_REV_LATEST = 'latest_release'
215
216 # Builds and validates the latest Chromium release for a specific Chromium
217 # branch that we want to watch.  These ebuilds are suffixed with rc.
218 CHROME_REV_STICKY = 'stable_release'
219
220 # Builds and validates Chromium for a pre-populated directory.
221 # Also uses _alpha, since portage doesn't have anything lower.
222 CHROME_REV_LOCAL = 'local'
223 VALID_CHROME_REVISIONS = [CHROME_REV_TOT, CHROME_REV_LATEST,
224                           CHROME_REV_STICKY, CHROME_REV_LOCAL, CHROME_REV_SPEC]
225
226
227 # Build types supported.
228
229 # TODO(sosa): Deprecate PFQ type.
230 # Incremental builds that are built using binary packages when available.
231 # These builds have less validation than other build types.
232 INCREMENTAL_TYPE = 'binary'
233
234 # These builds serve as PFQ builders.  This is being deprecated.
235 PFQ_TYPE = 'pfq'
236
237 # Hybrid Commit and PFQ type.  Ultimate protection.  Commonly referred to
238 # as simply "commit queue" now.
239 PALADIN_TYPE = 'paladin'
240
241 # A builder that kicks off Pre-CQ builders that bless the purest CLs.
242 PRE_CQ_LAUNCHER_TYPE = 'priest'
243
244 # A builder that cuts and prunes branches.
245 CREATE_BRANCH_TYPE = 'gardener'
246
247 # Chrome PFQ type.  Incremental build type that builds and validates new
248 # versions of Chrome.  Only valid if set with CHROME_REV.  See
249 # VALID_CHROME_REVISIONS for more information.
250 CHROME_PFQ_TYPE = 'chrome'
251
252 # Builds from source and non-incremental.  This builds fully wipe their
253 # chroot before the start of every build and no not use a BINHOST.
254 BUILD_FROM_SOURCE_TYPE = 'full'
255
256 # Full but with versioned logic.
257 CANARY_TYPE = 'canary'
258
259 # Generate payloads for an already built build/version.
260 PAYLOADS_TYPE = 'payloads'
261
262 BRANCH_UTIL_CONFIG = 'branch-util'
263
264 # Special build type for Chroot builders.  These builds focus on building
265 # toolchains and validate that they work.
266 CHROOT_BUILDER_TYPE = 'chroot'
267 CHROOT_BUILDER_BOARD = 'amd64-host'
268
269 # Build that refreshes the online Portage package status spreadsheet.
270 REFRESH_PACKAGES_TYPE = 'refresh_packages'
271
272 VALID_BUILD_TYPES = (
273     PALADIN_TYPE,
274     INCREMENTAL_TYPE,
275     BUILD_FROM_SOURCE_TYPE,
276     CANARY_TYPE,
277     CHROOT_BUILDER_TYPE,
278     CHROOT_BUILDER_BOARD,
279     CHROME_PFQ_TYPE,
280     PFQ_TYPE,
281     PRE_CQ_LAUNCHER_TYPE,
282     REFRESH_PACKAGES_TYPE,
283     CREATE_BRANCH_TYPE,
284     PAYLOADS_TYPE,
285 )
286
287 # The name of the builder used to launch the pre-CQ.
288 PRE_CQ_BUILDER_NAME = 'pre-cq-group'
289
290 # The name of the Pre-CQ launcher on the waterfall.
291 PRE_CQ_LAUNCHER_NAME = 'Pre-CQ Launcher'
292
293 # Define pool of machines for Hardware tests.
294 HWTEST_DEFAULT_NUM = 6
295 HWTEST_TRYBOT_NUM = 3
296 HWTEST_MACH_POOL = 'bvt'
297 HWTEST_PALADIN_POOL = 'cq'
298 HWTEST_TOT_PALADIN_POOL = 'tot-cq'
299 HWTEST_PFQ_POOL = 'pfq'
300 HWTEST_SUITES_POOL = 'suites'
301 HWTEST_CHROME_PERF_POOL = 'chromeperf'
302 HWTEST_TRYBOT_POOL = 'try-bot'
303
304
305 # Defines for the various hardware test suites:
306 #   AU: Blocking suite run against all canaries; tests basic AU
307 #       functionality.
308 #   BVT:  Basic blocking suite to be run against any build that
309 #       requires a HWTest phase.
310 #   COMMIT:  Suite of basic tests required for commits to the source
311 #       tree.  Runs as a blocking suite on the CQ and PFQ; runs as
312 #       a non-blocking suite on canaries.
313 #   CANARY:  Non-blocking suite run only against the canaries.
314 #   AFDO:  Non-blocking suite run only AFDO builders.
315 HWTEST_AU_SUITE = 'au'
316 HWTEST_BVT_SUITE = 'bvt-inline'
317 HWTEST_COMMIT_SUITE = 'bvt-cq'
318 HWTEST_CANARY_SUITE = 'bvt-perbuild'
319 HWTEST_AFDO_SUITE = 'AFDO_record'
320
321
322 # Additional timeout to wait for autotest to abort a suite if the test takes
323 # too long to run. This is meant to be overly conservative as a timeout may
324 # indicate that autotest is at capacity.
325 HWTEST_TIMEOUT_EXTENSION = 10 * 60
326
327 HWTEST_DEFAULT_PRIORITY = 'DEFAULT'
328 HWTEST_CQ_PRIORITY = 'CQ'
329 HWTEST_BUILD_PRIORITY = 'Build'
330 HWTEST_PFQ_PRIORITY = 'PFQ'
331 HWTEST_POST_BUILD_PRIORITY = 'PostBuild'
332
333 # Ordered by priority (first item being lowest).
334 HWTEST_VALID_PRIORITIES = ['Weekly',
335                            'Daily',
336                            HWTEST_POST_BUILD_PRIORITY,
337                            HWTEST_DEFAULT_PRIORITY,
338                            HWTEST_BUILD_PRIORITY,
339                            HWTEST_PFQ_PRIORITY,
340                            HWTEST_CQ_PRIORITY]
341
342 # Creates a mapping of priorities to make easy comparsions.
343 HWTEST_PRIORITIES_MAP = dict(
344     (p, i) for i, p in enumerate(HWTEST_VALID_PRIORITIES))
345
346 # Defines VM Test types.
347 FULL_AU_TEST_TYPE = 'full_suite'
348 SIMPLE_AU_TEST_TYPE = 'pfq_suite'
349 SMOKE_SUITE_TEST_TYPE = 'smoke_suite'
350 TELEMETRY_SUITE_TEST_TYPE = 'telemetry_suite'
351 CROS_VM_TEST_TYPE = 'cros_vm_test'
352 DEV_MODE_TEST_TYPE = 'dev_mode_test'
353 VALID_VM_TEST_TYPES = [FULL_AU_TEST_TYPE, SIMPLE_AU_TEST_TYPE,
354                        SMOKE_SUITE_TEST_TYPE, TELEMETRY_SUITE_TEST_TYPE,
355                        CROS_VM_TEST_TYPE, DEV_MODE_TEST_TYPE]
356
357 CHROMIUMOS_OVERLAY_DIR = 'src/third_party/chromiumos-overlay'
358 VERSION_FILE = os.path.join(CHROMIUMOS_OVERLAY_DIR,
359                             'chromeos/config/chromeos_version.sh')
360 SDK_VERSION_FILE = os.path.join(CHROMIUMOS_OVERLAY_DIR,
361                                 'chromeos/binhost/host/sdk_version.conf')
362 SDK_GS_BUCKET = 'chromiumos-sdk'
363
364 PUBLIC = 'public'
365 PRIVATE = 'private'
366
367 BOTH_OVERLAYS = 'both'
368 PUBLIC_OVERLAYS = PUBLIC
369 PRIVATE_OVERLAYS = PRIVATE
370 VALID_OVERLAYS = [BOTH_OVERLAYS, PUBLIC_OVERLAYS, PRIVATE_OVERLAYS, None]
371
372 # Common default logging settings for use with the logging module.
373 LOGGER_FMT = '%(asctime)s: %(levelname)s: %(message)s'
374 LOGGER_DATE_FMT = '%H:%M:%S'
375
376 # Used by remote patch serialization/deserialzation.
377 INTERNAL_PATCH_TAG = 'i'
378 EXTERNAL_PATCH_TAG = 'e'
379 PATCH_TAGS = (INTERNAL_PATCH_TAG, EXTERNAL_PATCH_TAG)
380
381 # Tree status strings
382 TREE_OPEN = 'open'
383 TREE_THROTTLED = 'throttled'
384 TREE_CLOSED = 'closed'
385 TREE_MAINTENANCE = 'maintenance'
386 # The statuses are listed in the order of increasing severity.
387 VALID_TREE_STATUSES = (TREE_OPEN, TREE_THROTTLED, TREE_CLOSED, TREE_MAINTENANCE)
388
389
390 _GERRIT_QUERY_TEMPLATE = ('status:open AND '
391                           'label:Code-Review=+2 AND '
392                           'label:Verified=+1 AND '
393                           'label:Commit-Queue>=%+i AND '
394                           'NOT ( label:CodeReview=-2 OR label:Verified=-1 OR '
395                           'is:draft )')
396
397 # Default gerrit query used to find changes for CQ.
398 # Permits CQ+1 or CQ+2 changes.
399 DEFAULT_CQ_READY_QUERY = _GERRIT_QUERY_TEMPLATE % 1
400
401 # Gerrit query used to find changes for CQ when tree is throttled.
402 # Permits only CQ+2 changes.
403 THROTTLED_CQ_READY_QUERY = _GERRIT_QUERY_TEMPLATE % 2
404
405 # Default filter rules for verifying that Gerrit returned results that matched
406 # our query. This used for working around Gerrit bugs.
407 DEFAULT_CQ_READY_FIELDS = {
408     'CRVW': '2',
409     'VRIF': '1',
410     'COMR': ('1', '2'),
411 }
412
413 DEFAULT_CQ_SHOULD_REJECT_FIELDS = {
414     'CRVW': '-2',
415     'VRIF': '-1',
416 }
417
418 GERRIT_ON_BORG_LABELS = {
419     'Code-Review': 'CRVW',
420     'Commit-Queue': 'COMR',
421     'Verified': 'VRIF',
422     'Trybot-Verified': 'TBVF',
423 }
424
425 # Actions that a CQ run can take on a CL
426 CL_ACTION_PICKED_UP = 'picked_up'         # CL picked up in CommitQueueSync
427 CL_ACTION_SUBMITTED = 'submitted'         # CL submitted successfully
428 CL_ACTION_KICKED_OUT = 'kicked_out'       # CL CQ-Ready value set to zero
429 CL_ACTION_SUBMIT_FAILED = 'submit_failed' # CL submitted but submit failed
430 CL_ACTION_VERIFIED = 'verified'           # CL was verified by the builder
431
432 # Actions the Pre-CQ Launcher can take on a CL
433 # See cbuildbot/stages/sync_stages.py:PreCQLauncherStage for more info
434 CL_ACTION_PRE_CQ_INFLIGHT = 'pre_cq_inflight'
435 CL_ACTION_PRE_CQ_PASSED = 'pre_cq_passed'
436 CL_ACTION_PRE_CQ_FAILED = 'pre_cq_failed'
437 CL_ACTION_PRE_CQ_LAUNCHING = 'pre_cq_launching'
438 CL_ACTION_PRE_CQ_WAITING = 'pre_cq_waiting'
439 CL_ACTION_PRE_CQ_READY_TO_SUBMIT = 'pre_cq_ready_to_submit'
440
441 CL_ACTIONS = [CL_ACTION_PICKED_UP,
442               CL_ACTION_SUBMITTED,
443               CL_ACTION_KICKED_OUT,
444               CL_ACTION_SUBMIT_FAILED,
445               CL_ACTION_VERIFIED,
446               CL_ACTION_PRE_CQ_INFLIGHT,
447               CL_ACTION_PRE_CQ_PASSED,
448               CL_ACTION_PRE_CQ_FAILED,
449               CL_ACTION_PRE_CQ_LAUNCHING,
450               CL_ACTION_PRE_CQ_WAITING,
451               CL_ACTION_PRE_CQ_READY_TO_SUBMIT]
452
453 # CQ types.
454 CQ = 'cq'
455 PRE_CQ = 'pre-cq'
456
457 # Environment variables that should be exposed to all children processes
458 # invoked via cros_build_lib.RunCommand.
459 ENV_PASSTHRU = ('CROS_SUDO_KEEP_ALIVE', SHARED_CACHE_ENVVAR)
460
461 # List of variables to proxy into the chroot from the host, and to
462 # have sudo export if existent. Anytime this list is modified, a new
463 # chroot_version_hooks.d upgrade script that symlinks to 45_rewrite_sudoers.d
464 # should be created.
465 CHROOT_ENVIRONMENT_WHITELIST = (
466   'CHROMEOS_OFFICIAL',
467   'CHROMEOS_VERSION_AUSERVER',
468   'CHROMEOS_VERSION_DEVSERVER',
469   'CHROMEOS_VERSION_TRACK',
470   'GCC_GITHASH',
471   'GIT_AUTHOR_EMAIL',
472   'GIT_AUTHOR_NAME',
473   'GIT_COMMITTER_EMAIL',
474   'GIT_COMMITTER_NAME',
475   'GIT_PROXY_COMMAND',
476   'GIT_SSH',
477   'RSYNC_PROXY',
478   'SSH_AGENT_PID',
479   'SSH_AUTH_SOCK',
480   'USE',
481   'all_proxy',
482   'ftp_proxy',
483   'http_proxy',
484   'https_proxy',
485   'no_proxy',
486 )
487
488 # Paths for Chrome LKGM which are relative to the Chromium base url.
489 CHROME_LKGM_FILE = 'CHROMEOS_LKGM'
490 PATH_TO_CHROME_LKGM = 'chromeos/%s' % CHROME_LKGM_FILE
491 SVN_CHROME_LKGM = 'trunk/src/%s' % PATH_TO_CHROME_LKGM
492
493 # Cache constants.
494 COMMON_CACHE = 'common'
495
496 # Artifact constants.
497 def _SlashToUnderscore(string):
498   return string.replace('/', '_')
499
500 DEFAULT_ARCHIVE_BUCKET = 'gs://chromeos-image-archive'
501 RELEASE_BUCKET = 'gs://chromeos-releases'
502 TRASH_BUCKET = 'gs://chromeos-throw-away-bucket'
503 CHROME_SYSROOT_TAR = 'sysroot_%s.tar.xz' % _SlashToUnderscore(CHROME_CP)
504 CHROME_ENV_TAR = 'environment_%s.tar.xz' % _SlashToUnderscore(CHROME_CP)
505 CHROME_ENV_FILE = 'environment'
506 BASE_IMAGE_NAME = 'chromiumos_base_image'
507 BASE_IMAGE_TAR = '%s.tar.xz' % BASE_IMAGE_NAME
508 BASE_IMAGE_BIN = '%s.bin' % BASE_IMAGE_NAME
509 IMAGE_SCRIPTS_NAME = 'image_scripts'
510 IMAGE_SCRIPTS_TAR = '%s.tar.xz' % IMAGE_SCRIPTS_NAME
511 VM_IMAGE_NAME = 'chromiumos_qemu_image'
512 VM_IMAGE_BIN = '%s.bin' % VM_IMAGE_NAME
513 VM_DISK_PREFIX = 'chromiumos_qemu_disk.bin'
514 VM_MEM_PREFIX = 'chromiumos_qemu_mem.bin'
515 VM_TEST_RESULTS = 'vm_test_results_%(attempt)s'
516
517 METADATA_JSON = 'metadata.json'
518 PARTIAL_METADATA_JSON = 'partial-metadata.json'
519 DELTA_SYSROOT_TAR = 'delta_sysroot.tar.xz'
520 DELTA_SYSROOT_BATCH = 'batch'
521
522 # Global configuration constants.
523 CHROMITE_CONFIG_DIR = os.path.expanduser('~/.chromite')
524 CHROME_SDK_BASHRC = os.path.join(CHROMITE_CONFIG_DIR, 'chrome_sdk.bashrc')
525 SYNC_RETRIES = 2
526 SLEEP_TIMEOUT = 30
527
528 # Lab status url.
529 LAB_STATUS_URL = 'http://chromiumos-lab.appspot.com/current?format=json'
530
531 GOLO_SMTP_SERVER = 'mail.golo.chromium.org'
532
533 # URLs to the various waterfalls.
534 BUILD_DASHBOARD = 'http://build.chromium.org/p/chromiumos'
535 BUILD_INT_DASHBOARD = 'https://uberchromegw.corp.google.com/i/chromeos'
536 TRYBOT_DASHBOARD = 'https://uberchromegw.corp.google.com/i/chromiumos.tryserver'
537
538 # Valid sherrif types.
539 TREE_SHERIFF = 'tree'
540 BUILD_DEPUTY = 'build'
541 LAB_SHERIFF = 'lab'
542 CHROME_GARDENER = 'chrome'
543
544 # URLs to retrieve sheriff names from the waterfall.
545 TREE_SHERIFF_URL = '%s/sheriff.js' % (BUILD_DASHBOARD)
546 TREE_SHERIFF2_URL = '%s/sheriff2.js' % (BUILD_DASHBOARD)
547 BUILD_DEPUTY_URL = '%s/chromeos_build_deputy.js' % (BUILD_DASHBOARD)
548 LAB_SHERIFF_URL = '%s/sheriff_cros_lab.js' % (BUILD_DASHBOARD)
549 CHROME_GARDENER_URL = '%s/sheriff_cr_cros_gardeners.js' % (BUILD_DASHBOARD)
550
551 SHERIFF_TYPE_TO_URL = {
552     TREE_SHERIFF: (TREE_SHERIFF_URL, TREE_SHERIFF2_URL),
553     BUILD_DEPUTY: (BUILD_DEPUTY_URL,),
554     LAB_SHERIFF: (LAB_SHERIFF_URL,),
555     CHROME_GARDENER: (CHROME_GARDENER_URL)
556 }
557
558
559 # Useful config targets.
560 CQ_MASTER = 'master-paladin'
561
562 # Useful google storage locations.
563 PRE_CQ_GROUP_GS_LOCATION = 'trybot-pre-cq-group'
564
565 # Email validation regex. Not quite fully compliant with RFC 2822, but good
566 # approximation.
567 EMAIL_REGEX = r'[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}'
568
569 # Blacklist of files not allowed to be uploaded into the Partner Project Google
570 # Storage Buckets:
571 # debug.tgz contains debug symbols.
572 # manifest.xml exposes all of our repo names.
573 # vm_test_results can contain symbolicated crash dumps.
574 EXTRA_BUCKETS_FILES_BLACKLIST = [
575     'debug.tgz',
576     'manifest.xml',
577     'vm_test_results_*'
578 ]
579
580 # AFDO common constants.
581 # How long does the AFDO_record autotest have to generate the AFDO perf data.
582 AFDO_GENERATE_TIMEOUT = 90 * 60