blob: 6514c89bc0134971b4ec92a83adca4f533025869 [file] [log] [blame]
xixuanbea010f2017-03-27 10:10:19 -07001# Copyright 2017 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"""Module for ChromeOS & Android build related logic in suite scheduler."""
Xixuan Wu5d6063e2017-09-05 16:15:07 -07006# pylint: disable=g-bad-import-order
xixuanbea010f2017-03-27 10:10:19 -07007
Xixuan Wu5d6063e2017-09-05 16:15:07 -07008from distutils import version
xixuanbea010f2017-03-27 10:10:19 -07009import collections
Xixuan Wu244e0ec2018-05-23 14:49:55 -070010import json
xixuanbea010f2017-03-27 10:10:19 -070011import logging
12import re
13
Xixuan Wu5d6063e2017-09-05 16:15:07 -070014import apiclient
15
Xixuan Wuf856ff12019-05-21 14:09:38 -070016BuildInfo = collections.namedtuple(
17 'BuildInfo',
18 [
19 'board',
20 'model',
21 'milestone',
22 'platform',
23 'build_config',
24 ])
25
xixuanbea010f2017-03-27 10:10:19 -070026# Bare branches
27BARE_BRANCHES = ['factory', 'firmware']
28
29# Definition of os types.
30OS_TYPE_CROS = 'cros'
31OS_TYPE_BRILLO = 'brillo'
32OS_TYPE_ANDROID = 'android'
33OS_TYPES = [OS_TYPE_CROS, OS_TYPE_BRILLO, OS_TYPE_ANDROID]
34OS_TYPES_LAUNCH_CONTROL = [OS_TYPE_BRILLO, OS_TYPE_ANDROID]
35
Xixuan Wu5d6063e2017-09-05 16:15:07 -070036# Launch control build's target's information
xixuanbea010f2017-03-27 10:10:19 -070037LaunchControlBuildTargetInfo = collections.namedtuple(
38 'LaunchControlBuildTargetInfo',
39 [
Xixuan Wu5d6063e2017-09-05 16:15:07 -070040 'target',
41 'type',
xixuanbea010f2017-03-27 10:10:19 -070042 ])
43
Xixuan Wu5d6063e2017-09-05 16:15:07 -070044# ChromeOS build config's information
xixuanbea010f2017-03-27 10:10:19 -070045CrOSBuildConfigInfo = collections.namedtuple(
46 'CrOSBuildConfigInfo',
47 [
Xixuan Wu5d6063e2017-09-05 16:15:07 -070048 'board',
49 'type',
xixuanbea010f2017-03-27 10:10:19 -070050 ])
51
xixuanbea010f2017-03-27 10:10:19 -070052# The default build type for fetching latest build.
Xixuan Wu7899db52018-05-29 14:19:06 -070053_DEFAULT_BUILD_SUFFIX = '-release'
xixuanbea010f2017-03-27 10:10:19 -070054
55# The default setting of board for fetching latest build.
Ned Nguyenb0a377d2020-08-27 08:43:30 -060056_DEFAULT_HEAD = 'master'
xixuanbea010f2017-03-27 10:10:19 -070057
58# The path for storing the latest build.
Ned Nguyenb0a377d2020-08-27 08:43:30 -060059_GS_LATEST_HEAD_PATTERN = '%(board)s%(suffix)s/%(name)s'
xixuanbea010f2017-03-27 10:10:19 -070060
61# The gs bucket to fetch the latest build.
62_GS_BUCKET = 'chromeos-image-archive'
63
64# The file in Google Storage to fetch the latest build.
Dhanya Ganesh8860cf02021-04-13 21:12:12 +000065_LATEST_HEAD = 'LATEST-main'
xixuanbea010f2017-03-27 10:10:19 -070066
Xixuan Wu244e0ec2018-05-23 14:49:55 -070067# The bucket for ChromeOS build release boards. Maintained by GoldenEye.
68_GE_RELEASE_BUILD_BUCKET = 'chromeos-build-release-console'
69
xixuanbea010f2017-03-27 10:10:19 -070070# Special android target to board map.
71_ANDROID_TARGET_TO_BOARD_MAP = {
72 'seed_l8150': 'gm4g_sprout',
73 'bat_land': 'bat'
74}
75
76# CrOS build name patter
77_CROS_BUILD_PATTERN = '%(board)s-%(build_type)s/R%(milestone)s-%(manifest)s'
78
79# Android build name pattern
80_ANDROID_BUILD_PATTERN = '%(branch)s/%(target)s/%(build_id)s'
81
82# The pattern for Launch Control target
83_LAUNCH_CONTROL_TARGET_PATTERN = r'(?P<build_target>.+)-(?P<build_type>[^-]+)'
84
85# The pattern for CrOS build config
86_CROS_BUILD_CONFIG_PATTERN = r'-([^-]+)(?:-group)?'
Xixuan Wu5d6063e2017-09-05 16:15:07 -070087
88
89class NoBuildError(Exception):
90 """Raised when failing to get the required build from Google Storage."""
91
92
93class BuildType(object):
94 """Representing the type of test source build.
95
96 This is used to identify the test source build for testing.
97 """
98 FIRMWARE_RW = 'firmware_rw'
99 FIRMWARE_RO = 'firmware_ro'
100 CROS = 'cros'
101
102
103class BuildVersionKey(object):
104 """Keys referring to the builds to install in run_suites."""
105
106 CROS_VERSION = 'cros_version'
107 ANDROID_BUILD_VERSION = 'android_version'
108 TESTBED_BUILD_VERSION = 'testbed_version'
109 FW_RW_VERSION = 'fwrw_version'
110 FW_RO_VERSION = 'fwro_version'
111
112
113class AndroidBuild(collections.namedtuple(
114 '_AndroidBuildBase', ['branch', 'target', 'build_id']), object):
115 """Class for constructing android build string."""
116
117 def __str__(self):
118 return _ANDROID_BUILD_PATTERN % {'branch': self.branch,
119 'target': self.target,
120 'build_id': self.build_id}
121
122
123class CrOSBuild(collections.namedtuple(
124 '_CrOSBuildBase',
125 ['board', 'build_type', 'milestone', 'manifest']), object):
126 """Class for constructing ChromeOS build string."""
127
128 def __str__(self):
129 return _CROS_BUILD_PATTERN % {'board': self.board,
130 'build_type': self.build_type,
131 'milestone': self.milestone,
132 'manifest': self.manifest}
133
134
135def get_latest_cros_build_from_gs(storage_client, board=None, suffix=None):
136 """Get latest build for given board from Google Storage.
137
138 Args:
139 storage_client: a rest_client.StorageRestClient object.
140 board: the board to fetch latest build. Default is 'master'.
141 suffix: suffix represents build channel, like '-release'.
142 Default is '-paladin'.
143
144 Returns:
145 a ChromeOS version string, e.g. '59.0.000.0'.
146
147 Raises:
148 HttpError if error happens in interacting with Google Storage.
149 """
Ned Nguyenb0a377d2020-08-27 08:43:30 -0600150 board = board if board is not None else _DEFAULT_HEAD
Xixuan Wu5d6063e2017-09-05 16:15:07 -0700151 suffix = suffix if suffix is not None else _DEFAULT_BUILD_SUFFIX
Ned Nguyenb0a377d2020-08-27 08:43:30 -0600152 file_to_check = _GS_LATEST_HEAD_PATTERN % {
Xixuan Wu5d6063e2017-09-05 16:15:07 -0700153 'board': board,
154 'suffix': suffix,
Ned Nguyenb0a377d2020-08-27 08:43:30 -0600155 'name': _LATEST_HEAD}
Xixuan Wu5d6063e2017-09-05 16:15:07 -0700156
157 try:
158 return storage_client.read_object(_GS_BUCKET, file_to_check)
159 except apiclient.errors.HttpError as e:
160 raise NoBuildError(
161 'Cannot find latest build for board %s, suffix %s: %s' %
162 (board, suffix, str(e)))
163
164
Xixuan Wu244e0ec2018-05-23 14:49:55 -0700165def get_board_family_mapping_from_gs(storage_client):
166 """Get board_family to boards mapping from Google Storage.
167
168 Args:
169 storage_client: a rest_client.StorageRestClient object.
170
171 Returns:
172 a dictionary of mapping between board family name to boards, e.g.
173 {'nyan': ['nyan', 'nyan_big', 'nyan_blaze', ..]}
174
175 Raises:
176 HttpError if error happens in interacting with Google Storage.
177 """
178 try:
179 boards = storage_client.read_object(_GE_RELEASE_BUILD_BUCKET, 'boards.json')
180 json_object = json.loads(boards)
181 board_family = {}
182 for board in json_object['boards']:
183 group = board['reference_group']
184 if not group:
185 continue
186
187 # This is to change boards like nyan-blaze to nyan_blaze, which is
188 # actually used in lab.
189 board_name = board['public_codename'].replace('-', '_')
190 if group not in board_family:
191 board_family[group] = []
192
193 board_family[group].append(board_name)
194
195 logging.info('Successfully get following board families from GS: %r',
196 board_family.keys())
197 return board_family
198 except apiclient.errors.HttpError as e:
199 logging.error('Cannot load boards.json in bucket %s: %s',
200 _GE_RELEASE_BUILD_BUCKET, str(e))
201 raise
202
203
Jack Neus8f0edb42022-03-17 20:21:39 +0000204def buildinfo_list_to_branch_build_dict(cros_board_list, buildinfo_list,
205 rubik_build_targets = None,
206 use_rubik = False):
Craig Bergstrom58263d32018-04-26 14:11:35 -0600207 """Validate and convert a list of BuildInfo to branch build dict.
Xixuan Wu5d6063e2017-09-05 16:15:07 -0700208
209 Args:
Xixuan Wu6fb16272017-10-19 13:16:00 -0700210 cros_board_list: The board list including all CrOS boards.
Xixuan Wuc6819012019-05-23 11:34:59 -0700211 buildinfo_list: A list of BuildInfo objects.
Jack Neus8f0edb42022-03-17 20:21:39 +0000212 rubik_build_targets: A set of build targets to use Rubik builds for.
213 use_rubik: bool. If True will only keep builds for build targets in
214 rubik_build_targets. If False, will only keep build targets not in
215 rubik_build_targets.
Xixuan Wu5d6063e2017-09-05 16:15:07 -0700216
217 Returns:
Craig Bergstrom58263d32018-04-26 14:11:35 -0600218 A branch build dict:
219 key: a tuple of (board, build_type, milestone), like:
220 ('wolf', 'release', '58')
221 value: the latest manifest for the given tuple, like:
222 '9242.0.0'.
Xixuan Wu5d6063e2017-09-05 16:15:07 -0700223 """
Xixuan Wu5d6063e2017-09-05 16:15:07 -0700224 branch_build_dict = {}
Craig Bergstrom58263d32018-04-26 14:11:35 -0600225 for build in buildinfo_list:
Xixuan Wu5d6063e2017-09-05 16:15:07 -0700226 try:
227 build_config_info = parse_cros_build_config(build.board,
228 build.build_config)
229 except ValueError as e:
230 logging.warning('Failed to parse build config: %s: %s',
231 build.build_config, e)
232 continue
233
234 if build.board != build_config_info.board:
235 logging.warning('Non-matched build_config and board: %s, %s',
236 build.board, build.board)
237 continue
238
Xixuan Wu6fb16272017-10-19 13:16:00 -0700239 if build.board not in cros_board_list:
240 logging.warning('%s is not a valid CrOS board.', build.board)
241 continue
242
Jack Neus8f0edb42022-03-17 20:21:39 +0000243 if rubik_build_targets:
244 if use_rubik:
245 # Discard builds for build targets not in rubik_build_targets.
246 if build.board not in rubik_build_targets:
247 logging.warning('%s is not a Rubik board, discarding.', build.board)
248 continue
249 else:
250 # Discard builds for build targets in rubik_build_targets.
251 if build.board in rubik_build_targets:
252 logging.warning('%s is a Rubik board, discarding.', build.board)
253 continue
254
Xixuan Wu8d2f2862018-08-28 16:48:04 -0700255 build_key = (build.board, build.model, build_config_info.type,
256 build.milestone)
Xixuan Wu5d6063e2017-09-05 16:15:07 -0700257 cur_manifest = branch_build_dict.get(build_key)
258 if cur_manifest is not None:
259 branch_build_dict[build_key] = max(
260 [cur_manifest, build.platform], key=version.LooseVersion)
261 else:
262 branch_build_dict[build_key] = build.platform
263
264 return branch_build_dict
265
266
Xinan Lin71eeeb02020-03-10 17:37:12 -0700267def get_cros_builds(build_client, cros_board_list, earliest_end_time,
Jack Neus8f0edb42022-03-17 20:21:39 +0000268 latest_end_time, event_type, rubik_build_targets = None):
Xinan Linea1efcb2019-12-30 23:46:42 -0800269 """Get branch builds for ChromeOS boards inside the given time span.
Craig Bergstrom58263d32018-04-26 14:11:35 -0600270
271 Args:
Xixuan Wuc6819012019-05-23 11:34:59 -0700272 build_client: a rest_client.BuildBucketBigqueryClient object, to
273 connect Buildbucket Bigquery.
Craig Bergstrom58263d32018-04-26 14:11:35 -0600274 cros_board_list: The board list including all CrOS boards.
Xinan Linea1efcb2019-12-30 23:46:42 -0800275 earliest_end_time: a datetime.datetime object in UTC.
276 latest_end_time: a datetime.datetime object in UTC.
Xinan Lin71eeeb02020-03-10 17:37:12 -0700277 event: a string of event type.
Jack Neus8f0edb42022-03-17 20:21:39 +0000278 rubik_build_targets: set of build targets for which we should use Rubik
279 builds instead of Leagcy.
Craig Bergstrom58263d32018-04-26 14:11:35 -0600280
281 Returns:
282 a two-tuple of branch build dicts. Each branch build dict has
283 keys and value described below. The first build_dict describes
284 successful builds and the second describes builds that failed
Jared Loucks7068d8b2022-04-28 09:41:33 -0600285 but met the relaxed success requirement (a successful 'UploadTestArtifacts'
Craig Bergstrom58263d32018-04-26 14:11:35 -0600286 stage).
287 key: a tuple of (board, build_type, milestone), like:
288 ('wolf', 'release', '58')
289 value: the latest manifest for the given tuple, like:
290 '9242.0.0'.
291 """
Xixuan Wuc6819012019-05-23 11:34:59 -0700292 # Buildbucket Bigquery use UTC timezone
Xinan Linea1efcb2019-12-30 23:46:42 -0800293 all_branch_builds = build_client.get_passed_builds(
Xinan Lin71eeeb02020-03-10 17:37:12 -0700294 earliest_end_time, latest_end_time, event_type)
Xinan Linea1efcb2019-12-30 23:46:42 -0800295 relaxed_builds = build_client.get_relaxed_passed_builds(
Xinan Lin71eeeb02020-03-10 17:37:12 -0700296 earliest_end_time, latest_end_time, event_type)
Jack Neus8f0edb42022-03-17 20:21:39 +0000297 all_branch_rubik_builds = build_client.get_passed_rubik_builds(
298 earliest_end_time, latest_end_time, event_type)
Craig Bergstrom58263d32018-04-26 14:11:35 -0600299
Jack Neus8f0edb42022-03-17 20:21:39 +0000300 # TODO(b/225382624): Remove all logic fetching Legacy builds
Craig Bergstrom58263d32018-04-26 14:11:35 -0600301 branch_builds_dict = buildinfo_list_to_branch_build_dict(
Jack Neus8f0edb42022-03-17 20:21:39 +0000302 cros_board_list, all_branch_builds, rubik_build_targets=rubik_build_targets)
303 rubik_branch_builds_dict = buildinfo_list_to_branch_build_dict(
304 cros_board_list, all_branch_rubik_builds, rubik_build_targets=rubik_build_targets,
305 use_rubik=True)
Craig Bergstrom58263d32018-04-26 14:11:35 -0600306 relaxed_builds_dict = buildinfo_list_to_branch_build_dict(
Jack Neuscb14a3b2022-04-01 16:39:38 +0000307 cros_board_list, relaxed_builds + all_branch_builds,
Jack Neus8f0edb42022-03-17 20:21:39 +0000308 rubik_build_targets=rubik_build_targets)
Jack Neuscb14a3b2022-04-01 16:39:38 +0000309 # Include Rubik builds in the relaxed builds dict. We can't pass the rubik
310 # builds to the above call because they'll get filtered out (use_rubik is False).
311 relaxed_builds_dict.update(rubik_branch_builds_dict)
Craig Bergstrom58263d32018-04-26 14:11:35 -0600312
Jack Neus8f0edb42022-03-17 20:21:39 +0000313 return dict(branch_builds_dict, **rubik_branch_builds_dict), relaxed_builds_dict
Craig Bergstrom58263d32018-04-26 14:11:35 -0600314
315
Xixuan Wu5d6063e2017-09-05 16:15:07 -0700316def get_latest_launch_control_build(android_client, branch, target):
317 """Get the latest launch control build from Android Build API.
318
319 Args:
320 android_client: a rest_client.AndroidBuildRestClient object.
321 branch: the launch control branch.
322 target: the launch control target.
323
324 Returns:
325 a string latest launch control build id.
326
327 Raises:
328 NoBuildError if no latest launch control build is found.
329 """
330 try:
331 latest_build_id = android_client.get_latest_build_id(branch, target)
332 if latest_build_id is None:
333 raise NoBuildError('No latest builds is found.')
334
335 return latest_build_id
336 except apiclient.errors.HttpError as e:
337 raise NoBuildError('HttpError happened in getting the latest launch '
338 'control build for '
339 '%s,%s: %s' % (branch, target, str(e)))
340
341
342def get_launch_control_builds_by_branch_targets(
343 android_client, android_board_list, launch_control_branch_targets):
344 """Get latest launch_control_builds for android boards.
345
346 For every tasks in this event, if it has settings of launch control
347 branch & target, get the latest launch control build for it.
348
349 Args:
350 android_client: a rest_client.AndroidBuildRestClient object to
351 interact with android build API.
352 android_board_list: a list of Android boards.
353 launch_control_branch_targets: a dict of branch:targets, see property
354 launch_control_branch_targets in base_event.py.
355
356 Returns:
357 a launch control build dict:
358 key: an android board, like 'shamu'.
359 value: a list involves the latest builds for each pair
360 (branch, target) of this board, like:
361 [u'git_nyc-mr2-release/shamu-userdebug/3844975',
362 u'git_nyc-mr1-release/shamu-userdebug/3783920']
363 """
364 launch_control_dict = {}
365 board_to_builds_dict = {}
366 for branch, targets in launch_control_branch_targets.iteritems():
367 for t in targets:
368 try:
369 board = parse_launch_control_target(t).target
370 except ValueError:
371 logging.warning(
372 'Failed to parse launch control target: %s', t)
373 continue
374
375 if board not in android_board_list:
376 continue
377
378 # Use dict here to reduce the times to call AndroidBuild API
379 if launch_control_dict.get((branch, t)) is None:
380 try:
381 build_id = get_latest_launch_control_build(
382 android_client, branch, t)
383 except NoBuildError as e:
384 logging.warning(e)
385 continue
386
387 build = str(AndroidBuild(branch, t, build_id))
388 launch_control_dict[(branch, t)] = build
389 board_to_builds_dict.setdefault(board, []).append(
390 build)
391
392 for board, in board_to_builds_dict.iteritems():
393 mapped_board = get_board_by_android_target(board)
394 if mapped_board != board:
395 logging.debug('Map board %s to %s', board, mapped_board)
396 if board_to_builds_dict.get(mapped_board) is None:
397 del board_to_builds_dict[board]
398 else:
399 board_to_builds_dict[board] = board_to_builds_dict[
400 mapped_board]
401
402 return board_to_builds_dict
403
404
405def parse_launch_control_target(target):
406 """Parse the build target and type from a Launch Control target.
407
408 The Launch Control target has the format of build_target-build_type, e.g.,
409 shamu-eng or dragonboard-userdebug. This method extracts the build target
410 and type from the target name.
411
412 Args:
413 target: Name of a Launch Control target, e.g., shamu-userdebug.
414
415 Returns:
416 a LaunchControlBuildTargetInfo object whose value is like
417 (target='shamu',
418 type='userdebug')
419
420 Raises:
421 ValueError: if target is not valid.
422 """
423 match = re.match(_LAUNCH_CONTROL_TARGET_PATTERN, target)
424 if not match:
425 raise ValueError('target format is not valid')
426
427 return LaunchControlBuildTargetInfo(match.group('build_target'),
428 match.group('build_type'))
429
430
431def parse_cros_build_config(board, build_config):
432 """Parse build_type from a given builder for a given board.
433
434 Args:
435 board: the prefix of a ChromeOS build_config, representing board.
436 build_config: a ChromeOS build_config name, like 'kevin-release'.
437
438 Returns:
439 a CrOSBuildConfigInfo object whose value is like
440 (board='kevin',
441 type='release')
442
443 Raises:
444 ValueError: if build_config is in invalid form.
445 """
446 if build_config[0:len(board)] != board:
447 raise ValueError('build_config cannot be parsed: %s' % build_config)
448
449 match = re.match(_CROS_BUILD_CONFIG_PATTERN, build_config[len(board):])
450 if not match:
451 raise ValueError('build_config %s is not matched %s' % (
452 build_config, _CROS_BUILD_CONFIG_PATTERN))
453
454 return CrOSBuildConfigInfo(board, match.groups()[0])
455
456
457def get_board_by_android_target(target):
458 """Map a android target to a android board.
459
460 # Mapping between an android board name and a build target. This is for
461 # special case handling for certain Android board that the board name and
462 # build target name does not match.
463 # This comes from server/site_utils.py in autotest module.
464
465 Args:
466 target: an android target.
467
468 Returns:
469 a string android board mapped by ANDROID_TARGET_TO_BOARD_MAP.
470 """
471 return _ANDROID_TARGET_TO_BOARD_MAP.get(target, target)
Xixuan Wu588668d2019-01-04 10:33:31 -0800472
473
474def to_full_model(board, model):
475 """Form a full model name with given board, model.
476
477 Args:
478 board: A string board name.
479 model: A string model name.
480
481 Returns:
482 A string full_model name.
483 """
484 return '%s_%s' % (board, model)
Xixuan Wub4b2f412019-05-03 11:22:31 -0700485
486
487def reshape_board(board):
488 """Reshape some variants of board names to original board.
489
490 Args:
491 board: A string board name.
492
493 Returns:
494 A string board name after reshaping.
495 """
496 # The hack derives from build info structure saved in CIDB/buildbucket:
Kazuhiro Inabaf0208222020-03-05 10:33:07 +0900497 # *-kernelnext/*-arcnext etc are saved as board name, but not the real board
Xixuan Wub4b2f412019-05-03 11:22:31 -0700498 # for DUT.
Sean Abraham2a177d72021-02-01 09:38:16 -0700499 # NOTE: please try to keep this list in sync with the corresponding list in
500 # chromite/lib/config_lib.py
501 special_suffixes = [
Navil Perezc7a29172021-03-09 22:06:25 +0000502 '-arc64', #
Sean Abraham2a177d72021-02-01 09:38:16 -0700503 '-arc-r', #
504 '-arc-r-userdebug', #
Jiyoun Haff42b7d2021-04-22 13:35:33 +0900505 '-arc-s', #
Sean Abraham2a177d72021-02-01 09:38:16 -0700506 '-arcnext', #
507 '-arcvm', #
Arowa Suliman4c5b2bc2021-08-09 18:57:06 -0700508 '-connectivitynext', #
Sean Abraham2a177d72021-02-01 09:38:16 -0700509 '-borealis', #
510 '-campfire', #
511 '-cfm', #
512 '-kernelnext', #
513 '-kvm', #
Sean Abrahamd6815ba2021-02-26 09:29:53 -0700514 '-libcamera', #
C Shapiro975a83a2021-08-16 15:14:50 -0500515 '-manatee', #
Sean Abraham2a177d72021-02-01 09:38:16 -0700516 '-ndktranslation', #
Kazuhiro Inaba840dac72021-02-01 16:47:05 +0900517 '-userdebug', #
Sean Abrahambf297a92020-12-10 09:19:49 -0700518 ]
Stephen Boydfb1bfaa2021-07-14 21:19:48 +0000519 # ARM64 userspace boards use 64 suffix but can't put that in list above
520 # because of collisions with boards like kevin-arc64.
521 ARM64_BOARDS = ['kevin64', 'trogdor64']
Sean Abraham2a177d72021-02-01 09:38:16 -0700522 for s in special_suffixes:
Sean Abrahambf297a92020-12-10 09:19:49 -0700523 if board.endswith(s):
524 board = board[:-len(s)]
Stephen Boydfb1bfaa2021-07-14 21:19:48 +0000525 if board in ARM64_BOARDS:
526 # Remove '64' suffix from the board name.
527 board = board[:-2]
Xixuan Wub4b2f412019-05-03 11:22:31 -0700528 return board