diff options
author | Zhizhou Yang <zhizhouy@google.com> | 2019-07-16 16:23:02 -0700 |
---|---|---|
committer | Zhizhou Yang <zhizhouy@google.com> | 2019-07-22 20:59:50 +0000 |
commit | 7aa250ecfc39d4ceca8ccc302f37261fc133bb45 (patch) | |
tree | 7bb6eead6b6fef097d041c23956b04097da20342 /crosperf/experiment.py | |
parent | d6b61669352054206b4ed1e524a6487c78555143 (diff) | |
download | toolchain-utils-7aa250ecfc39d4ceca8ccc302f37261fc133bb45.tar.gz |
crosperf: introduce skylab field and pass to experiment and label
This is the initial patch to migrate crosperf from autotest to skylab
for lab runs. This patch introduces skylab field in experiment, parsed
it in settings_factory and restructured label class and experiment class
so that further steps can use skylab field.
TEST=Passed all unit tests
BUG=chromium:984790
Change-Id: I1104fea739977c522938790012f4f3f522f9d65f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1705234
Reviewed-by: Caroline Tice <cmtice@chromium.org>
Tested-by: Zhizhou Yang <zhizhouy@google.com>
Auto-Submit: Zhizhou Yang <zhizhouy@google.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Diffstat (limited to 'crosperf/experiment.py')
-rw-r--r-- | crosperf/experiment.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/crosperf/experiment.py b/crosperf/experiment.py index 63e6a104..80674b4b 100644 --- a/crosperf/experiment.py +++ b/crosperf/experiment.py @@ -2,6 +2,7 @@ # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. + """The experiment setting module.""" from __future__ import print_function @@ -29,7 +30,7 @@ class Experiment(object): cache_conditions, labels, benchmarks, experiment_file, email_to, acquire_timeout, log_dir, log_level, share_cache, results_directory, locks_directory, cwp_dso, enable_aslr, - ignore_min_max): + ignore_min_max, skylab): self.name = name self.working_directory = working_directory self.remote = remote @@ -58,13 +59,15 @@ class Experiment(object): self.cwp_dso = cwp_dso self.enable_aslr = enable_aslr self.ignore_min_max = ignore_min_max + self.skylab = skylab + self.l = logger.GetLogger(log_dir) - if not remote: - raise RuntimeError('No remote hosts specified') if not self.benchmarks: raise RuntimeError('No benchmarks specified') if not self.labels: raise RuntimeError('No labels specified') + if not remote and not self.skylab: + raise RuntimeError('No remote hosts specified') # We need one chromeos_root to run the benchmarks in, but it doesn't # matter where it is, unless the ABIs are different. @@ -124,7 +127,7 @@ class Experiment(object): benchmark_runs = [] for label in self.labels: for benchmark in self.benchmarks: - for iteration in xrange(1, benchmark.iterations + 1): + for iteration in range(1, benchmark.iterations + 1): benchmark_run_name = '%s: %s (%s)' % (label.name, benchmark.name, iteration) @@ -213,6 +216,6 @@ class Experiment(object): lock_mgr = afe_lock_machine.AFELockManager( all_machines, '', self.labels[0].chromeos_root, None) machine_states = lock_mgr.GetMachineStates('unlock') - for k, state in machine_states.iteritems(): + for k, state in machine_states.items(): if state['locked']: lock_mgr.UpdateLockInAFE(False, k) |