Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / infra / scripts / legacy / site_config / config_default.py
blob8d0cb0add31550b57bd952f02a20e18e8147613e
1 # Copyright 2012 The Chromium 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.
5 """Seeds a number of variables defined in chromium_config.py.
7 The recommended way is to fork this file and use a custom DEPS forked from
8 config/XXX/DEPS with the right configuration data."""
10 import os
11 import re
12 import socket
15 SERVICE_ACCOUNTS_PATH = '/creds/service_accounts'
18 class classproperty(object):
19 """A decorator that allows is_production_host to only to be defined once."""
20 def __init__(self, getter):
21 self.getter = getter
22 def __get__(self, instance, owner):
23 return self.getter(owner)
26 class Master(object):
27 # Repository URLs used by the SVNPoller and 'gclient config'.
28 server_url = 'http://src.chromium.org'
29 repo_root = '/svn'
30 git_server_url = 'https://chromium.googlesource.com'
32 # External repos.
33 googlecode_url = 'http://%s.googlecode.com/svn'
34 sourceforge_url = 'https://svn.code.sf.net/p/%(repo)s/code'
35 googlecode_revlinktmpl = 'https://code.google.com/p/%s/source/browse?r=%s'
37 # Directly fetches from anonymous Blink svn server.
38 webkit_root_url = 'http://src.chromium.org/blink'
39 nacl_trunk_url = 'http://src.chromium.org/native_client/trunk'
41 llvm_url = 'http://llvm.org/svn/llvm-project'
43 # Perf Dashboard upload URL.
44 dashboard_upload_url = 'https://chromeperf.appspot.com'
46 # Actually for Chromium OS slaves.
47 chromeos_url = git_server_url + '/chromiumos.git'
49 # Default domain for emails to come from and
50 # domains to which emails can be sent.
51 master_domain = 'example.com'
52 permitted_domains = ('example.com',)
54 # Your smtp server to enable mail notifications.
55 smtp = 'smtp'
57 # By default, bot_password will be filled in by config.GetBotPassword().
58 bot_password = None
60 # Fake urls to make various factories happy.
61 trunk_internal_url = None
62 trunk_internal_url_src = None
63 slave_internal_url = None
64 git_internal_server_url = None
65 syzygy_internal_url = None
66 v8_internal_url = None
69 class Base(object):
70 """Master base template.
71 Contains stubs for variables that all masters must define."""
73 # Base service offset for 'master_port'
74 MASTER_PORT = 2
75 # Base service offset for 'slave_port'
76 SLAVE_PORT = 3
77 # Base service offset for 'master_port_alt'
78 MASTER_PORT_ALT = 4
79 # Base service offset for 'try_job_port'
80 TRY_JOB_PORT = 5
82 # A BuildBucket bucket to poll.
83 buildbucket_bucket = None
85 # Master address. You should probably copy this file in another svn repo
86 # so you can override this value on both the slaves and the master.
87 master_host = 'localhost'
88 @classproperty
89 def current_host(cls):
90 return socket.getfqdn()
91 @classproperty
92 def in_production(cls):
93 return re.match(r'master.*\.golo\.chromium\.org', cls.current_host)
94 # Only report that we are running on a master if the master_host (even when
95 # master_host is overridden by a subclass) is the same as the current host.
96 @classproperty
97 def is_production_host(cls):
98 return cls.current_host == cls.master_host
100 # 'from:' field for emails sent from the server.
101 from_address = 'nobody@example.com'
102 # Additional email addresses to send gatekeeper (automatic tree closage)
103 # notifications. Unnecessary for experimental masters and try servers.
104 tree_closing_notification_recipients = []
106 @classproperty
107 def master_port(cls):
108 return cls._compose_port(cls.MASTER_PORT)
110 @classproperty
111 def slave_port(cls):
112 # Which port slaves use to connect to the master.
113 return cls._compose_port(cls.SLAVE_PORT)
115 @classproperty
116 def master_port_alt(cls):
117 # The alternate read-only page. Optional.
118 return cls._compose_port(cls.MASTER_PORT_ALT)
120 @classproperty
121 def try_job_port(cls):
122 return cls._compose_port(cls.TRY_JOB_PORT)
124 @classmethod
125 def _compose_port(cls, service):
126 """Returns: The port number for 'service' from the master's static config.
128 Port numbers are mapped of the form:
129 XYYZZ
130 || \__The last two digits identify the master, e.g. master.chromium
131 |\____The second and third digits identify the master host, e.g.
132 | master1.golo
133 \_____The first digit identifies the port type, e.g. master_port
135 If any configuration is missing (incremental migration), this method will
136 return '0' for that query, indicating no port.
138 return (
139 (service * 10000) + # X
140 (cls.master_port_base * 100) + # YY
141 cls.master_port_id) # ZZ
143 service_account_file = None
145 @classproperty
146 def service_account_path(cls):
147 if cls.service_account_file is None:
148 return None
149 return os.path.join(SERVICE_ACCOUNTS_PATH, cls.service_account_file)
151 ## Per-master configs.
153 class Master1(Base):
154 """Chromium master."""
155 master_host = 'master1.golo.chromium.org'
156 master_port_base = 1
157 from_address = 'buildbot@chromium.org'
158 tree_closing_notification_recipients = [
159 'chromium-build-failure@chromium-gatekeeper-sentry.appspotmail.com']
160 base_app_url = 'https://chromium-status.appspot.com'
161 tree_status_url = base_app_url + '/status'
162 store_revisions_url = base_app_url + '/revisions'
163 last_good_url = base_app_url + '/lkgr'
164 last_good_blink_url = 'http://blink-status.appspot.com/lkgr'
166 class Master2(Base):
167 """Legacy ChromeOS master."""
168 master_host = 'master2.golo.chromium.org'
169 master_port_base = 2
170 tree_closing_notification_recipients = [
171 'chromeos-build-failures@google.com']
172 from_address = 'buildbot@chromium.org'
174 class Master2a(Base):
175 """Chromeos master."""
176 master_host = 'master2a.golo.chromium.org'
177 master_port_base = 15
178 tree_closing_notification_recipients = [
179 'chromeos-build-failures@google.com']
180 from_address = 'buildbot@chromium.org'
182 class Master3(Base):
183 """Client master."""
184 master_host = 'master3.golo.chromium.org'
185 master_port_base = 3
186 tree_closing_notification_recipients = []
187 from_address = 'buildbot@chromium.org'
189 class Master4(Base):
190 """Try server master."""
191 master_host = 'master4.golo.chromium.org'
192 master_port_base = 4
193 tree_closing_notification_recipients = []
194 from_address = 'tryserver@chromium.org'
195 code_review_site = 'https://codereview.chromium.org'
197 class Master4a(Base):
198 """Try server master."""
199 master_host = 'master4a.golo.chromium.org'
200 master_port_base = 14
201 tree_closing_notification_recipients = []
202 from_address = 'tryserver@chromium.org'
203 code_review_site = 'https://codereview.chromium.org'
205 ## Native Client related
207 class NaClBase(Master3):
208 """Base class for Native Client masters."""
209 tree_closing_notification_recipients = ['bradnelson@chromium.org']
210 base_app_url = 'https://nativeclient-status.appspot.com'
211 tree_status_url = base_app_url + '/status'
212 store_revisions_url = base_app_url + '/revisions'
213 last_good_url = base_app_url + '/lkgr'
214 perf_base_url = 'http://build.chromium.org/f/client/perf'
216 ## ChromiumOS related
218 class ChromiumOSBase(Master2):
219 """Legacy base class for ChromiumOS masters"""
220 base_app_url = 'https://chromiumos-status.appspot.com'
221 tree_status_url = base_app_url + '/status'
222 store_revisions_url = base_app_url + '/revisions'
223 last_good_url = base_app_url + '/lkgr'
225 class ChromiumOSBase2a(Master2a):
226 """Base class for ChromiumOS masters"""
227 base_app_url = 'https://chromiumos-status.appspot.com'
228 tree_status_url = base_app_url + '/status'
229 store_revisions_url = base_app_url + '/revisions'
230 last_good_url = base_app_url + '/lkgr'