Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / chromite / cbuildbot / cbuildbot_config.py
index e42212c..476d4ac 100755 (executable)
@@ -19,6 +19,7 @@ CONFIG_TYPE_PALADIN = 'paladin'
 CONFIG_TYPE_RELEASE = 'release'
 CONFIG_TYPE_FULL = 'full'
 CONFIG_TYPE_FIRMWARE = 'firmware'
+CONFIG_TYPE_RELEASE_AFDO = 'release-afdo'
 
 CONFIG_TYPE_DUMP_ORDER = (
     CONFIG_TYPE_PALADIN,
@@ -31,14 +32,13 @@ CONFIG_TYPE_DUMP_ORDER = (
     'full-group',
     CONFIG_TYPE_RELEASE,
     'release-group',
-    'release-pgo',
-    'release-pgo-generate',
-    'release-pgo-use',
+    'release-afdo',
+    'release-afdo-generate',
+    'release-afdo-use',
     'sdk',
     'chromium-pfq',
     'chromium-pfq-informational',
     'chrome-perf',
-    'chrome-pgo',
     'chrome-pfq',
     'chrome-pfq-informational',
     'pre-flight-branch',
@@ -102,6 +102,9 @@ def OverrideConfigForTrybot(build_config, options):
           hw_config.pool = constants.HWTEST_TRYBOT_POOL
           hw_config.file_bugs = False
           hw_config.priority = constants.HWTEST_DEFAULT_PRIORITY
+      # TODO: Fix full_release_test.py/AUTest on trybots, crbug.com/390828.
+      my_config['hw_tests'] = [hw_config for hw_config in my_config['hw_tests']
+                               if hw_config.suite != constants.HWTEST_AU_SUITE]
 
     # Default to starting with a fresh chroot on remote trybot runs.
     if options.remote_trybot:
@@ -152,6 +155,11 @@ def IsCQType(b_type):
   return b_type == constants.PALADIN_TYPE
 
 
+def IsCanaryType(b_type):
+  """Returns True if this build type is a Canary."""
+  return b_type == constants.CANARY_TYPE
+
+
 # List of usable cbuildbot configs; see add_config method.
 # TODO(mtennant): This is seriously buried in this file.  Move to top
 # and rename something that stands out in a file where the word "config"
@@ -421,11 +429,21 @@ _settings = dict(
 # build_tests -- Builds autotest tests.  Must be True if vm_tests is set.
   build_tests=True,
 
-# pgo_generate -- Generates PGO data.
-  pgo_generate=False,
+# afdo_generate -- Generates AFDO data. Will capture a profile of chrome
+#                  using a hwtest to run a predetermined set of benchmarks.
+  afdo_generate=False,
+
+# afdo_generate_min -- Generates AFDO data, builds the minimum amount
+#                      of artifacts and assumes a non-distributed builder
+#                      (i.e.: the whole process in a single builder).
+  afdo_generate_min=False,
 
-# pgo_use -- Uses PGO data.
-  pgo_use=False,
+# afdo_update_ebuild -- Update the Chrome ebuild with the AFDO profile info.
+  afdo_update_ebuild=False,
+
+# afdo_use -- Uses AFDO data. The Chrome build will be optimized using the
+#             AFDO profile information found in the chrome ebuild file.
+  afdo_use=False,
 
 # vm_tests -- A list of vm tests to run.
   vm_tests=[constants.SIMPLE_AU_TEST_TYPE],
@@ -614,6 +632,10 @@ _settings = dict(
 # chrome.
   chrome_sdk_goma=False,
 
+# image_test -- Run image tests. This should only be set if 'base' is in
+# "images".
+  image_test=False,
+
 # =============================================================================
 )
 
@@ -629,29 +651,38 @@ class HWTestConfig(object):
   """Config object for hardware tests suites.
 
   Members:
-    timeout: Number of seconds to wait before timing out waiting for results.
+    suite: Name of the test suite to run.
+    timeout: Number of seconds to wait before timing out waiting for
+             results.
     pool: Pool to use for hw testing.
+    blocking: Suites that set this true run sequentially; each must pass
+              before the next begins.  Tests that set this false run in
+              parallel after all blocking tests have passed.
     async: Fire-and-forget suite.
-    warn_only: Failure on HW tests warns only (does not generate error). If set,
-               'critical' cannot be set.
+    warn_only: Failure on HW tests warns only (does not generate error).
     critical: Usually we consider structural failures here as OK.
-    num: Maximum number of devices to use when scheduling tests in the hw lab.
+    priority:  Priority at which tests in the suite will be scheduled in
+               the hw lab.
     file_bugs: Should we file bugs if a test fails in a suite run.
-    retry: Should we retry a test if a test fails in a suite run. Retry only
-           works when async is False.
+    num: Maximum number of DUTs to use when scheduling tests in the hw lab.
+    minimum_duts: minimum number of DUTs required for testing in the hw lab.
+    retry: Whether we should retry tests that fail in a suite run.
+
+  Some combinations of member settings are invalid:
+    * A suite config may not specify both blocking and async.
+    * A suite config may not specify both retry and async.
+    * A suite config may not specify both warn_only and critical.
   """
 
-  DEFAULT_HW_TEST = 'bvt'
-  CQ_HW_TEST = 'bvt_cq'
-
   # This timeout is larger than it needs to be because of autotest overhead.
   # TODO(davidjames): Reduce this timeout once http://crbug.com/366141 is fixed.
   DEFAULT_HW_TEST_TIMEOUT = 60 * 220
   BRANCHED_HW_TEST_TIMEOUT = 10 * 60 * 60
   # Number of tests running in parallel in the AU suite.
   AU_TESTS_NUM = 2
-  # Number of tests running in parallel in the QAV suite
-  QAV_TEST_NUM = 2
+  # Number of tests running in parallel in the asynchronous canary
+  # test suite
+  ASYNC_TEST_NUM = 2
 
   @classmethod
   def DefaultList(cls, **kwargs):
@@ -663,23 +694,25 @@ class HWTestConfig(object):
     if (kwargs.get('num', constants.HWTEST_DEFAULT_NUM) >=
         constants.HWTEST_DEFAULT_NUM):
       au_dict = dict(num=cls.AU_TESTS_NUM)
-      qav_dict = dict(num=cls.QAV_TEST_NUM)
+      async_dict = dict(num=cls.ASYNC_TEST_NUM)
     else:
       au_dict = dict(num=1)
-      qav_dict = dict(num=1)
+      async_dict = dict(num=1)
 
     au_kwargs = kwargs.copy()
     au_kwargs.update(au_dict)
 
-    qav_kwargs = kwargs.copy()
-    qav_kwargs.update(qav_dict)
-    qav_kwargs['priority'] = constants.HWTEST_DEFAULT_PRIORITY
-    qav_kwargs['retry'] = False
+    async_kwargs = kwargs.copy()
+    async_kwargs.update(async_dict)
+    async_kwargs['priority'] = constants.HWTEST_DEFAULT_PRIORITY
+    async_kwargs['retry'] = False
+    async_kwargs['async'] = True
 
     # BVT + AU suite.
-    return [cls(cls.DEFAULT_HW_TEST, **kwargs),
-            cls(constants.HWTEST_AU_SUITE, **au_kwargs),
-            cls(constants.HWTEST_QAV_SUITE, **qav_kwargs)]
+    return [cls(constants.HWTEST_BVT_SUITE, blocking=True, **kwargs),
+            cls(constants.HWTEST_AU_SUITE, blocking=True, **au_kwargs),
+            cls(constants.HWTEST_COMMIT_SUITE, **async_kwargs),
+            cls(constants.HWTEST_CANARY_SUITE, **async_kwargs)]
 
   @classmethod
   def DefaultListCanary(cls, **kwargs):
@@ -694,50 +727,67 @@ class HWTestConfig(object):
     return cls.DefaultList(**kwargs)
 
   @classmethod
-  def PGOList(cls, **kwargs):
-    """Returns a default list of HWTestConfig's for a PGO build, with overrides
+  def AFDOList(cls, **kwargs):
+    """Returns a default list of HWTestConfig's for a AFDO build, with overrides
     for optional args.
     """
-    pgo_dict = dict(pool=constants.HWTEST_CHROME_PERF_POOL,
-                    timeout=90 * 60, num=1, async=True, retry=False)
-    pgo_dict.update(kwargs)
-    return [cls('pyauto_perf', **pgo_dict),
-            cls('perf_v2', **pgo_dict)]
+    afdo_dict = dict(pool=constants.HWTEST_CHROME_PERF_POOL,
+                     timeout=120 * 60, num=1, async=True, retry=False)
+    afdo_dict.update(kwargs)
+    return [cls('pyauto_perf', **afdo_dict),
+            cls('perf_v2', **afdo_dict)]
+
+  @classmethod
+  def DefaultListNonCanary(cls, **kwargs):
+    """Return a default list of HWTestConfig's for a non-canary build.
+
+    Optional arguments may be overridden in `kwargs`, except that
+    the `blocking` setting cannot be provided.
+    """
+    return [cls(constants.HWTEST_BVT_SUITE, blocking=True, **kwargs),
+            cls(constants.HWTEST_COMMIT_SUITE, **kwargs)]
 
   @classmethod
   def DefaultListCQ(cls, **kwargs):
-    """Returns a default list of HWTestConfig's for a CQ build,
-    with overrides for optional args.
+    """Return a default list of HWTestConfig's for a CQ build.
+
+    Optional arguments may be overridden in `kwargs`, except that
+    the `blocking` setting cannot be provided.
     """
     default_dict = dict(pool=constants.HWTEST_PALADIN_POOL, timeout=120 * 60,
                         file_bugs=False, priority=constants.HWTEST_CQ_PRIORITY,
                         minimum_duts=4)
     # Allows kwargs overrides to default_dict for cq.
     default_dict.update(kwargs)
-    return [cls(cls.CQ_HW_TEST, **default_dict)]
+    return cls.DefaultListNonCanary(**default_dict)
 
   @classmethod
   def DefaultListPFQ(cls, **kwargs):
-    """Returns a default list of HWTestConfig's for a PFQ build,
-    with overrides for optional args.
+    """Return a default list of HWTestConfig's for a PFQ build.
+
+    Optional arguments may be overridden in `kwargs`, except that
+    the `blocking` setting cannot be provided.
     """
     default_dict = dict(pool=constants.HWTEST_PFQ_POOL, file_bugs=True,
                         priority=constants.HWTEST_PFQ_PRIORITY,
                         retry=False, minimum_duts=4)
     # Allows kwargs overrides to default_dict for pfq.
     default_dict.update(kwargs)
-    return [cls(cls.DEFAULT_HW_TEST, **default_dict)]
+    return cls.DefaultListNonCanary(**default_dict)
 
   def __init__(self, suite, num=constants.HWTEST_DEFAULT_NUM,
                pool=constants.HWTEST_MACH_POOL, timeout=DEFAULT_HW_TEST_TIMEOUT,
-               async=False, warn_only=False, critical=False, file_bugs=False,
-               priority=constants.HWTEST_BUILD_PRIORITY, retry=True,
-               minimum_duts=0):
+               async=False, warn_only=False, critical=False, blocking=False,
+               file_bugs=False, priority=constants.HWTEST_BUILD_PRIORITY,
+               retry=True, minimum_duts=0):
     """Constructor -- see members above."""
+    assert not async or (not blocking and not retry)
+    assert not warn_only or not critical
     self.suite = suite
     self.num = num
     self.pool = pool
     self.timeout = timeout
+    self.blocking = blocking
     self.async = async
     self.warn_only = warn_only
     self.critical = critical
@@ -745,7 +795,6 @@ class HWTestConfig(object):
     self.priority = priority
     self.retry = retry
     self.minimum_duts = minimum_duts
-    assert not (self.warn_only and self.critical)
 
   def SetBranchedValues(self):
     """Changes the HW Test timeout/priority values to branched values."""
@@ -767,12 +816,13 @@ class HWTestConfig(object):
     return int(self.timeout / 60)
 
 
-def PGORecordTest(**kwargs):
+def AFDORecordTest(**kwargs):
   default_dict = dict(pool=constants.HWTEST_SUITES_POOL,
-                      critical=True, num=1, file_bugs=False)
+                      warn_only=True, num=1, file_bugs=True,
+                      timeout=constants.AFDO_GENERATE_TIMEOUT)
   # Allows kwargs overrides to default_dict for cq.
   default_dict.update(kwargs)
-  return HWTestConfig('PGO_record', **default_dict)
+  return HWTestConfig(constants.HWTEST_AFDO_SUITE, **default_dict)
 
 
 # TODO(mtennant): Rename this BuildConfig?
@@ -913,6 +963,7 @@ full = _config(
   git_sync=True,
   trybot_list=True,
   description='Full Builds',
+  image_test=True,
 )
 
 # Full builders with prebuilts.
@@ -989,8 +1040,12 @@ moblab = brillo.derive(
 )
 
 brillo_non_testable = brillo.derive(
-  # Literally build the minimal possible.
-  packages=['virtual/target-os', 'virtual/target-os-dev'],
+  # Literally build the minimal possible. chromeos-initramfs is
+  # required to create the recovery image. If it is not built in
+  # BuildPackages, ArchiveStage will emerge it, causing race condition
+  # with DebugSymbolsStage.
+  packages=['virtual/target-os', 'virtual/target-os-dev',
+            'chromeos-base/chromeos-initramfs'],
   images=['base', 'dev'],
 
   # Disable all the tests!
@@ -1002,11 +1057,19 @@ brillo_non_testable = brillo.derive(
 
   # Since it doesn't generate test images, payloads can't be tested.
   paygen_skip_testing=True,
+  image_test=True,
 )
 
 beaglebone = non_testable_builder.derive(brillo_non_testable,
                                          rootfs_verification=False)
 
+brillo_public_full = full.derive(non_testable_builder,
+                                 brillo_non_testable)
+
+brillo_public_full.add_config('gizmo-full',
+  boards=['gizmo'],
+)
+
 # This adds Chrome branding.
 official_chrome = _config(
   useflags=[constants.USE_CHROME_INTERNAL],
@@ -1087,6 +1150,17 @@ paladin.add_config('x86-generic-asan-paladin',
   important=False,
 )
 
+paladin.add_config('mipsel-o32-generic-paladin',
+  brillo_non_testable,
+  non_testable_builder,
+  boards=['mipsel-o32-generic'],
+  important=False,
+  paladin_builder_name='mipsel-o32-generic paladin',
+  # TODO(benchan): Re-enable 'usepkg_setup_board' when the pre-built toolchain
+  # for MIPS is available (crbug.com/380329).
+  usepkg_setup_board=False,
+)
+
 incremental.add_config('amd64-generic-asan-paladin',
   asan,
   boards=['amd64-generic'],
@@ -1137,10 +1211,16 @@ internal_chromium_pfq = internal.derive(
   prebuilts=constants.PUBLIC,
 )
 
-internal_chromium_pfq.add_config('x86-generic-chromium-pfq',
-  boards=['x86-generic'],
+internal_chromium_pfq.add_config('master-chromium-pfq',
+  boards=[],
   master=True,
   push_overlays=constants.BOTH_OVERLAYS,
+  afdo_update_ebuild=True,
+  chrome_sdk=False,
+)
+
+internal_chromium_pfq.add_config('x86-generic-chromium-pfq',
+  boards=['x86-generic'],
 )
 
 internal_chromium_pfq.add_config('daisy-chromium-pfq',
@@ -1167,6 +1247,8 @@ chrome_pfq.add_config('alex-chrome-pfq',
 
 chrome_pfq.add_config('lumpy-chrome-pfq',
   boards=['lumpy'],
+  afdo_generate=True,
+  hw_tests=[AFDORecordTest()],
 )
 
 chrome_pfq.add_config('daisy_spring-chrome-pfq',
@@ -1298,8 +1380,10 @@ _arm_release_boards = frozenset([
   'nyan',
   'nyan_big',
   'nyan_blaze',
+  'nyan_freon',
   'peach_pi',
   'peach_pit',
+  'rush',
 ])
 _arm_full_boards = _arm_release_boards | frozenset([
   'arm-generic',
@@ -1318,6 +1402,7 @@ _x86_release_boards = frozenset([
   'glimmer',
   'gnawty',
   'kip',
+  'lemmings',
   'leon',
   'link',
   'lumpy',
@@ -1347,18 +1432,32 @@ _x86_release_boards = frozenset([
 ])
 _x86_full_boards = _x86_release_boards | frozenset([
   'amd64-generic',
+  'gizmo',
   'x32-generic',
   'x86-generic',
   'x86-pineview',
 ])
 
+_mips_release_boards = frozenset([
+])
+_mips_full_boards = _mips_release_boards | frozenset([
+  'mipseb-n32-generic',
+  'mipseb-n64-generic',
+  'mipseb-o32-generic',
+  'mipsel-n32-generic',
+  'mipsel-n64-generic',
+  'mipsel-o32-generic',
+])
+
 _all_release_boards = (
     _arm_release_boards |
-    _x86_release_boards
+    _x86_release_boards |
+    _mips_release_boards
 )
 _all_full_boards = (
     _arm_full_boards |
-    _x86_full_boards
+    _x86_full_boards |
+    _mips_full_boards
 )
 
 def _AddFullConfigs():
@@ -1804,16 +1903,8 @@ internal_paladin.add_config('x86-zgb-paladin',
   paladin_builder_name='x86-zgb paladin',
 )
 
-internal_paladin.add_config('mipsel-o32-generic-paladin',
-  brillo_non_testable,
-  boards=['mipsel-o32-generic'],
-  important=False,
-  paladin_builder_name='mipsel-o32-generic paladin',
-)
-
 internal_paladin.add_config('link_freon-paladin',
   boards=['link_freon'],
-  important=False,
   paladin_builder_name='link_freon paladin',
 )
 
@@ -1823,7 +1914,6 @@ internal_paladin.add_config('stumpy_moblab-paladin',
   paladin_builder_name='stumpy_moblab paladin',
 )
 
-
 ### Paladins (CQ builders) which do not run VM or Unit tests on the builder
 ### itself.
 internal_notest_paladin = internal_paladin.derive(non_testable_builder)
@@ -1852,13 +1942,25 @@ internal_notest_paladin.add_config('nyan-paladin',
   paladin_builder_name='nyan paladin',
 )
 
+internal_notest_paladin.add_config('rush-paladin',
+  boards=['rush'],
+  usepkg_setup_board=False,
+  paladin_builder_name='rush paladin',
+  important=False,
+)
+
 internal_notest_paladin.add_config('storm-paladin',
   brillo_non_testable,
   boards=['storm'],
-  important=False,
   paladin_builder_name='storm paladin',
 )
 
+internal_notest_paladin.add_config('nyan_freon-paladin',
+  boards=['nyan_freon'],
+  paladin_builder_name='nyan_freon paladin',
+  important=False,
+)
+
 internal_brillo_paladin = internal_paladin.derive(brillo)
 
 internal_brillo_paladin.add_config('duck-paladin',
@@ -1867,13 +1969,24 @@ internal_brillo_paladin.add_config('duck-paladin',
   trybot_list=True,
 )
 
-internal_brillo_paladin.add_config('gizmo-paladin',
+internal_brillo_paladin.add_config('lemmings-paladin',
+  boards=['lemmings'],
+  paladin_builder_name='lemmings paladin',
+  trybot_list=True,
+  important=False,
+)
+
+
+external_brillo_paladin = paladin.derive(brillo)
+
+external_brillo_paladin.add_config('gizmo-paladin',
   boards=['gizmo'],
   paladin_builder_name='gizmo paladin',
   trybot_list=True,
+  important=False,
 )
 
-internal_brillo_paladin.add_config('panther_embedded-minimal-paladin',
+external_brillo_paladin.add_config('panther_embedded-minimal-paladin',
   boards=['panther_embedded'],
   paladin_builder_name='panther_embedded-minimal paladin',
   profile='minimal',
@@ -1901,7 +2014,6 @@ internal_incremental.add_config('mario-incremental',
 
 _toolchain_major.add_config('internal-toolchain-major', internal, official,
   boards=('x86-alex', 'stumpy', 'daisy'),
-  use_lkgm=True,
   useflags=[constants.USE_CHROME_INTERNAL],
   build_tests=True,
   description=_toolchain_major['description'] + ' (internal)',
@@ -1909,7 +2021,6 @@ _toolchain_major.add_config('internal-toolchain-major', internal, official,
 
 _toolchain_minor.add_config('internal-toolchain-minor', internal, official,
   boards=('x86-alex', 'stumpy', 'daisy'),
-  use_lkgm=True,
   useflags=[constants.USE_CHROME_INTERNAL],
   build_tests=True,
   description=_toolchain_minor['description'] + ' (internal)',
@@ -1940,6 +2051,7 @@ _release = full.derive(official, internal,
   hwqual=True,
   description="Release Builds (canary) (internal)",
   chrome_sdk=True,
+  image_test=True,
 )
 
 _grouped_config = _config(
@@ -1957,9 +2069,12 @@ _grouped_variant_release = _release.derive(_grouped_variant_config)
 
 ### Master release config.
 
-_release.add_config('x86-mario-release',
-  boards=['x86-mario'],
+_release.add_config('master-release',
+  boards=[],
   master=True,
+  sync_chrome=False,
+  chrome_sdk=False,
+  health_alert_recipients=['chromeos-build-alerts@google.com'],
 )
 
 ### Release config groups.
@@ -1992,67 +2107,59 @@ _config.add_group('x86-zgb-release-group',
 _config.add_group('parrot-release-group',
   _release.add_config('parrot-release',
     boards=['parrot'],
+    afdo_use=True,
   ),
   _grouped_variant_release.add_config('parrot_ivb-release',
     boards=['parrot_ivb'],
+    afdo_use=True,
   )
 )
 
-### Release PGO configs.
+### Release AFDO configs.
 
-release_pgo = _release.derive(
+release_afdo = _release.derive(
   trybot_list=False,
   hw_tests=HWTestConfig.DefaultList(pool=constants.HWTEST_CHROME_PERF_POOL,
                                     num=4) +
-           HWTestConfig.PGOList(),
+           HWTestConfig.AFDOList(),
   push_image=False,
   paygen=False,
   dev_installer_prebuilts=False,
 )
 
-_config.add_group('x86-alex-release-pgo',
-  release_pgo.add_config('x86-alex-release-pgo-generate',
-    boards=['x86-alex'],
-    pgo_generate=True,
-  ),
-  release_pgo.add_config('x86-alex-release-pgo-use',
-    boards=['x86-alex'],
-    pgo_use=True,
-  ),
-)
-
-_config.add_group('lumpy-release-pgo',
-  release_pgo.add_config('lumpy-release-pgo-generate',
-    boards=['lumpy'],
-    pgo_generate=True,
-  ),
-  release_pgo.add_config('lumpy-release-pgo-use',
-    boards=['lumpy'],
-    pgo_use=True,
-  ),
-)
+# Now generate generic release-afdo configs if we haven't created anything more
+# specific above already. release-afdo configs are builders that do AFDO profile
+# collection and optimization in the same builder. Used by developers that
+# want to measure performance changes caused by their changes.
+def _AddAFDOConfigs():
+  for board in _all_release_boards:
+    if board in _x86_release_boards:
+      base = {}
+    else:
+      base = non_testable_builder
+    generate_config = _config(
+        base,
+        boards=(board,),
+        afdo_generate_min=True,
+        afdo_update_ebuild=True,
+    )
+    use_config = _config(
+        base,
+        boards=(board,),
+        afdo_use=True,
+    )
 
-_config.add_group('parrot-release-pgo',
-  release_pgo.add_config('parrot-release-pgo-generate',
-    boards=['parrot'],
-    pgo_generate=True,
-  ),
-  release_pgo.add_config('parrot-release-pgo-use',
-    boards=['parrot'],
-    pgo_use=True,
-  ),
-)
+    config_name = '%s-%s' % (board, CONFIG_TYPE_RELEASE_AFDO)
+    if config_name not in config:
+      generate_config_name = '%s-%s-%s' % (board, CONFIG_TYPE_RELEASE_AFDO,
+                                           'generate')
+      use_config_name = '%s-%s-%s' % (board, CONFIG_TYPE_RELEASE_AFDO, 'use')
+      _config.add_group(config_name,
+                        release_afdo.add_config(generate_config_name,
+                                                generate_config),
+                        release_afdo.add_config(use_config_name, use_config))
 
-_config.add_group('daisy-release-pgo',
-  release_pgo.add_config('daisy-release-pgo-generate',
-    boards=['daisy'],
-    pgo_generate=True,
-  ),
-  release_pgo.add_config('daisy-release-pgo-use',
-    boards=['daisy'],
-    pgo_use=True,
-  ),
-)
+_AddAFDOConfigs()
 
 ### Release configs.
 
@@ -2082,18 +2189,50 @@ _release.add_config('fox_wtm2-release',
 _release.add_config('link-release',
   boards=['link'],
   useflags=_release['useflags'] + ['highdpi'],
+  important=True,
 )
 
 _release.add_config('link_freon-release',
   boards=['link_freon'],
   useflags=_release['useflags'] + ['highdpi'],
+  hw_tests=[],
+  # This build can't run vm_tests, bug 387507
+  vm_tests=[],
+  # This build doesn't release yet.
+  paygen=False,
+  important=True,
 )
 
 _release.add_config('lumpy-release',
   boards=['lumpy'],
   critical_for_chrome=True,
+  afdo_use=True,
+)
+
+_release.add_config('samus-release',
+  boards=['samus'],
+  important=True,
+)
+
+# Add specific release configs for these sandybrige/ivybridge boards to
+# enable AFDO. We should remove these once AFDO is enabled everywhere.
+# parrot is added in parrot-release-group above.
+_release.add_config('stumpy-release',
+  boards=['stumpy'],
+  afdo_use=True,
 )
 
+_release.add_config('butterfly-release',
+  boards=['butterfly'],
+  afdo_use=True,
+)
+
+_release.add_config('stout-release',
+  boards=['stout'],
+  afdo_use=True,
+)
+
+
 ### Arm release configs.
 
 _arm_release = _release.derive(non_testable_builder)
@@ -2144,17 +2283,28 @@ _brillo_release = _release.derive(brillo,
 )
 
 _brillo_release.add_config('duck-release',
-   boards=['duck'],
+  boards=['duck'],
 
-   # Hw Lab can't test, yet.
-   paygen_skip_testing=True,
+  # Hw Lab can't test, yet.
+  paygen_skip_testing=True,
+  important=True,
 )
 
 _brillo_release.add_config('gizmo-release',
-   boards=['gizmo'],
+  boards=['gizmo'],
+
+  # This build doesn't generate signed images, so don't try to release them.
+  paygen=False,
+)
+
+_brillo_release.add_config('lemmings-release',
+  boards=['lemmings'],
+
+  # Hw Lab can't test, yet.
+  paygen_skip_testing=True,
 
-   # This build doesn't generate signed images, so don't try to release them.
-   paygen=False,
+  # This build doesn't generate signed images, so don't try to release them.
+  paygen=False,
 )
 
 _brillo_release.add_config('panther_embedded-minimal-release',
@@ -2166,10 +2316,11 @@ _brillo_release.add_config('panther_embedded-minimal-release',
 _arm_brillo_release = _brillo_release.derive(non_testable_builder)
 
 _arm_brillo_release.add_config('storm-release',
-   boards=['storm'],
+  boards=['storm'],
 
-   # Hw Lab can't test duck, yet.
-   paygen_skip_testing=True,
+  # Hw Lab can't test duck, yet.
+  paygen_skip_testing=True,
+  important=True,
 )
 
 _beaglebone_release = _arm_brillo_release.derive(beaglebone)
@@ -2187,6 +2338,7 @@ _config.add_group('beaglebone-release-group',
     # This build doesn't generate signed images, so don't try to release them.
     paygen=False,
   ).derive(_grouped_variant_config),
+  important=True,
 )
 
 _release.add_config('mipsel-o32-generic-release',
@@ -2202,11 +2354,23 @@ _release.add_config('stumpy_moblab-release',
   paygen_skip_delta_payloads=True,
   # TODO: re-enable paygen testing when crbug.com/386473 is fixed.
   paygen_skip_testing=True,
+  important=True,
+)
+
+_release.add_config('rush-release',
+  non_testable_builder,
+  boards=['rush'],
+  hw_tests=[],
+  usepkg_setup_board=False,
+  # This build doesn't generate signed images, so don't try to release them.
+  paygen=False,
+  signer_tests=False,
 )
 
 ### Per-chipset release groups
 
-def _AddGroupConfig(name, base_board, group_boards=(), group_variant_boards=()):
+def _AddGroupConfig(name, base_board, group_boards=(),
+                    group_variant_boards=(), **kwargs):
   """Generate full & release group configs."""
   for group in ('release', 'full'):
     configs = []
@@ -2224,10 +2388,12 @@ def _AddGroupConfig(name, base_board, group_boards=(), group_variant_boards=()):
       else:
         subconfig = {}
       board_config = '%s-%s' % (board, group)
-      configs.append(config[board_config].derive(subconfig))
+      configs.append(config[board_config].derive(subconfig, **kwargs))
 
-    config_name = '%s-%s-group' % (name, group)
-    _config.add_group(config_name, *configs, description=desc)
+      config_name = '%s-%s-group' % (name, group)
+      important = group == 'release' and kwargs.get('important', True)
+    _config.add_group(config_name, *configs, description=desc,
+                      important=important)
 
 # pineview chipset boards
 _AddGroupConfig('pineview', 'x86-mario', (
@@ -2243,24 +2409,12 @@ _AddGroupConfig('sandybridge', 'lumpy', (
     'butterfly',
     'parrot',
     'stumpy',
-))
+), afdo_use=True)
 
 # ivybridge chipset boards
 _AddGroupConfig('ivybridge', 'stout', (), (
     'parrot_ivb',
-))
-
-# sandybridge / ivybridge chipset boards
-# TODO(davidjames): Remove this once we've transitioned to separate builders for
-# sandybridge / ivybridge.
-_AddGroupConfig('sandybridge-ivybridge', 'lumpy', (
-    'butterfly',
-    'parrot',
-    'stout',
-    'stumpy',
-), (
-    'parrot_ivb',
-))
+), afdo_use=True)
 
 # slippy-based haswell boards
 # TODO(davidjames): Combine slippy and beltino into haswell canary, once we've
@@ -2279,14 +2433,6 @@ _AddGroupConfig('slippy', 'peppy', (
 # beltino itself is deprecated in favor of the below boards, so we don't bother
 # building it.
 
-# TODO(dnj): Remove this once the associated Master change using -a,-b variants
-# lands (#202040)
-_AddGroupConfig('beltino', 'panther', (
-    'monroe',
-    'tricky',
-    'zako',
-))
-
 _AddGroupConfig('beltino-a', 'panther', (
     'mccloud',
 ))
@@ -2364,6 +2510,7 @@ _firmware = _config(
   signer_tests=False,
   trybot_list=False,
   paygen=False,
+  image_test=False,
 )
 
 _firmware_release = _release.derive(_firmware,