History log of /external/autotest/site_utils/suite_scheduler/timed_event.py
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
9b1534252f52030b8ec0e480afcf502db39f4936 07-Feb-2017 xixuan <xixuan@chromium.org> autotest: Hardcode a since_date due to a previous manifest_version repo
squash.

This CL will be reverted in the future.

BUG=chromium:688018
TEST=Run 'suite_scheduler.py --sanity'.

Change-Id: Iaea47380c19ecb9d43040be385b3b34374ff3159
Reviewed-on: https://chromium-review.googlesource.com/438784
Reviewed-by: Xixuan Wu <xixuan@chromium.org>
Tested-by: Xixuan Wu <xixuan@chromium.org>
Commit-Queue: Xixuan Wu <xixuan@chromium.org>
/external/autotest/site_utils/suite_scheduler/timed_event.py
2121a3382d70bfb60284a830f341d78d6d555519 25-Feb-2016 Dan Shi <dshi@google.com> [autotest] Support scheduling Launch Control builds from suite scheduler.

This change adds the support of scheduling Launch Control builds from
suite scheduler.

For task defined like:
[brollo_test]
run_on: nightly
hour: 17
suite: dummy
os_type: brillo
branches: git_mnc-brillo-dev
targets: dragonboard-userdebug
pool: suites

Suite scheduler will try to schedule the latest build as of
git_mnc-brillo-dev/dragonboard-userdebug/LATEST
for dragonbard daily at 5PM, to run a duts in suites pool.

BUG=chromium:585628
TEST=unittest, local suite scheduler run:
/usr/local/autotest/site_utils/suite_scheduler/suite_scheduler.py \
-d /usr/local/autotest/logs -f /usr/local/autotest/ss_test.ini \
-e nightly -i git_mnc-brillo-dev/dragonboard-userdebug/2636090 \
-r /tmp/_autotmp_0pjXWQ_suite_scheduler -o brillo

Also test existing cros build can be scheduled:
/usr/local/autotest/site_utils/suite_scheduler/suite_scheduler.py \
-d /usr/local/autotest/logs -f /usr/local/autotest/ss_test.ini \
-e nightly -i veyron_jerry-release/R49-7834.3.0 \
-r /tmp/_autotmp_0pjXWQ_suite_scheduler

Change-Id: I6dc8ecb95ff0d353a1e8a96f98183945216f9a50
Reviewed-on: https://chromium-review.googlesource.com/329362
Commit-Ready: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@google.com>
Reviewed-by: Dan Shi <dshi@google.com>
/external/autotest/site_utils/suite_scheduler/timed_event.py
ce1f20a4e96037420687565df3fce7a218120a16 26-Jan-2016 Dan Shi <dshi@google.com> [autotest] Allow weekly suite to be scheduled at any day of a week.

This change is similar to CL 323331. It enables suite scheduler to run weekly
task at a given day of the week. This allows the weekly suites to be distributed
across the week, rather than all run at once, which causes a spike of load on
devservers and lab network.

BUG=chromium:245937
TEST=unittest, suite_scheduler.py --sanity

Change-Id: I20cdc8abae30a552aed6d3f00a2b2e283a287a52
Reviewed-on: https://chromium-review.googlesource.com/323805
Commit-Ready: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@google.com>
Reviewed-by: Paul Hobbs <phobbs@google.com>
Reviewed-by: Fang Deng <fdeng@chromium.org>
/external/autotest/site_utils/suite_scheduler/timed_event.py
f308a148fa82244a01d4ebe2edf1fff570a103cd 26-Jan-2016 Dan Shi <dshi@google.com> [autotest] Fix a bug for nightly run in suite scheduler

suite scheduler parses the config file in every loop (about 5min), and merge
the new config to the existing ones. During the merge, deadline is updated.
CL 323331 changed the logic of nightly run for it to be able to trigger at
every hour. This also change how deadline should be updated.

The deadline should be unchanged in merge, otherwise the deadline will be
changed to the next hour, thus no nightly run will be scheduled as deadline
will always be pushed an hour in the future.

This change removes the Merge override in Nightly class so the dealine can
stay unchanged during Merge.

BUG=chromium:581113
TEST=local run, unittest

Change-Id: If602c477692e6a862db4e3ed432fc890ec410bdd
Reviewed-on: https://chromium-review.googlesource.com/324100
Commit-Ready: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@google.com>
Reviewed-by: Kevin Cheng <kevcheng@chromium.org>
/external/autotest/site_utils/suite_scheduler/timed_event.py
9f256d91d378cdc0bbffa607ef3572f006d0b0dc 22-Jan-2016 Dan Shi <dshi@google.com> [autotest] Allow nightly event to specify the hour to run in suite scheduler

This change add a new config `hour` in nightly task. The value specifies the
hour of a day the nightly task should run. This allows the suite jobs for
nightly runs to be distributed across the day to avoid nightly spike on network
load, as each suite job starts with staging images on devserver.

BUG=chromium:580254
TEST=unittest, local run
/usr/local/autotest/site_utils/suite_scheduler/suite_scheduler.py \
-d /usr/local/autotest/logs -f /usr/local/autotest/test_suite_scheduler.ini \
-r /tmp/_autotmp_d2jtlh_suite_scheduler -e nightly \
-i veyron_jerry-release/R49-7834.3.0

DEPLOY=suite scheduler

Change-Id: I8fd8e078b8c5524dc0c0e6453458b730adcdddd3
Reviewed-on: https://chromium-review.googlesource.com/323331
Commit-Ready: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@google.com>
Reviewed-by: Dan Shi <dshi@google.com>
/external/autotest/site_utils/suite_scheduler/timed_event.py
33ea03b85c3f3b40be2813b4e5a87c8a2f3e9f8d 18-Feb-2015 Fang Deng <fdeng@chromium.org> [autotest] Suite scheduler looks at the correct window for builds

Suite scheduler runs the following git command to find
candidate builds.

git log build-name/samus-release/pass/ --since='1 days ago'

As more and more boards are added, by the time a board is
evaluated, it might have been a couple of hours away from
the original deadline. And using '1 days ago' which is relative
to current timestamp is not accurate. This CL
makes suite scheduler calculate the window using 'deadline'.
E.g. '1 days ago' would mean the window between
|deadline - 1 day| and |deadline|.

BUG=chromium:458236
TEST=unittest;Run suite scheduler

Change-Id: I7495d6fd2668cf84a9f5159e7b6353325a5b2614
Reviewed-on: https://chromium-review.googlesource.com/250600
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Fang Deng <fdeng@chromium.org>
Tested-by: Fang Deng <fdeng@chromium.org>
/external/autotest/site_utils/suite_scheduler/timed_event.py
c7bcf8bf70d6e40aa4d37528f75b5a98b0f7a00e 08-Sep-2013 Alex Miller <milleral@chromium.org> [autotest] Set timeout and priority based on frequency of scheduling.

Out-of-band suites now have variable priority and duration based on the
event that kicks off the task.

Event | Priority | Duration
new_build | PostBuild | 12 hours
nightly | Daily | One day
weekly | Weekly | One week

This will mean that out-of-band suites will have lower priority than
user-created jobs in the lab (which are made with the Default priority)
and much lower than the inline build processes. The ability for a
Weekly suite to live for a whole week is to compensate for this drop in
priority.

I expect that this will fix a lot of the problems we have with
overlapping pools. Now if we overlapped pool:bvt with pool:suites, we
wouldn't see out-of-band suites starving the BVT out of machines, as BVT
would have a higher priority and thus preempt the out-of-band suites.

BUG=chromium:221264
DEPLOY=suite_scheduler
TEST=unit, force build and saw timeouts and priorities appear correctly

Change-Id: I604b7869d7fe16859f09a9effb11cbcb33980e99
Reviewed-on: https://chromium-review.googlesource.com/168569
Reviewed-by: Alex Miller <milleral@chromium.org>
Commit-Queue: Alex Miller <milleral@chromium.org>
Tested-by: Alex Miller <milleral@chromium.org>
/external/autotest/site_utils/suite_scheduler/timed_event.py
99d32b8031c21e1142a4b828729fb756ee668bfe 11-Jul-2012 Chris Masone <cmasone@chromium.org> [autotest] suite_scheduler: ShouldHandle() does not respect always_handle

In the suite_scheduler, we provide a mechanism for asserting that an
event should always be 'handled', for the purposes of testing. The
code was not respecting this.

BUG=None
TEST=new unit tests
TEST=run suite_scheduler with a config that specifies always_handle: True in a [nightly_params] section; see that it schedules any suites that 'run_on nightly' every 5 minutes.

Change-Id: I2403636a1790ca76c57ad29404d7b136eb46436f
Reviewed-on: https://gerrit.chromium.org/gerrit/27170
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Commit-Ready: Chris Masone <cmasone@chromium.org>
Reviewed-by: Alex Miller <milleral@chromium.org>
/external/autotest/site_utils/suite_scheduler/timed_event.py
075aafa4c4508d73087f62189e5cf339ca15dc2e 09-May-2012 Chris Masone <cmasone@chromium.org> [autotest] Fix deadline handling in TimedEvent.Merge()

Currently, the scheduler checks if it should handle each event,
sleeps, and then re-reads the config and merges newly-created events
with the existing ones. This entails updating the deadlines of existing
TimedEvents. Prior to this CL we were doing this unconditionally.

Here's why this is bad:
When the deadline passes while we're sleeping, the new TimedEvents
created during config re-loading decide that it's too late to run
today, so they set their deadline for the next possible time; e.g. the
new Nightly would set its deadline for tomorrow night. The scheduler
would then merge that into the existing Nightly event and clobber its
deadline. _Then_ we check if we should handle the TimedEvents. Since
the new deadline hasn't passed yet -- because we _just_ changed
it to be tomorrow -- we don't handle the event.

This CL updates the Merge() logic in TimedEvent subclasses to check
whether relevant portions of the deadline have changed, and clobber
the deadline iff they have. So, Nightly checks to see if the deadline
time of day has changed and merges that in iff it has. Weekly checks
time of day and day of week.

BUG=chromium-os:30742
TEST=unit
TEST=run the scheduler with Nightly set to run some tasks. They should get scheduled.
STATUS=Fixed

Change-Id: I859376ea45be5733b65720185f37d6d237da6dc5
Reviewed-on: https://gerrit.chromium.org/gerrit/22286
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Commit-Ready: Chris Masone <cmasone@chromium.org>
/external/autotest/site_utils/suite_scheduler/timed_event.py
855d86f838faccb4ad112a222412e29c047b7d3e 07-May-2012 Chris Masone <cmasone@chromium.org> [autotest] Reload scheduler config file every time we loop

The suite scheduler uses a config file to tell it what tasks to perform.
Until now, that config was read at startup and then never again. Now,
the scheduler will re-read this config every time it's about to go through
and decide which events to handle, updating task lists and event parameters
prior to using them.

BUG=chromium-os:30521
TEST=unit
TEST=run the scheduler. Change the config file as it's running and observe
TEST=that the changes are honored. An easy change is to add a task configured
TEST=to run_on an event, and then set that event to always_handle.

Change-Id: Idfa9085503f97cd9f099161fd2d4d43ed139c26f
Reviewed-on: https://gerrit.chromium.org/gerrit/22070
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Commit-Ready: Chris Masone <cmasone@chromium.org>
/external/autotest/site_utils/suite_scheduler/timed_event.py
73a7838db228a1b4a6141b5ba9efa4d1d1cf6251 20-Apr-2012 Chris Masone <cmasone@chromium.org> [autotest] Implement BuildEvent.ShouldHandle() for real

BuildEvent.ShouldHandle() should check with ManifestVersions to determine
if a new build has appeared since last time we checked for new builds
(i.e. the previous call to ShouldHandle()).

BUG=chromium-os:27586
TEST=unit

Change-Id: I3a69ee7c8e8e7be81e818e5105a8aaf2052c7dd4
Reviewed-on: https://gerrit.chromium.org/gerrit/20740
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Chris Masone <cmasone@chromium.org>
/external/autotest/site_utils/suite_scheduler/timed_event.py
e8bebaf10711ca802d40c0b7f412e3910999159e 24-Apr-2012 Chris Masone <cmasone@chromium.org> [autotest] Update deadline for TimedEvent classes

TimedEvent classes have a deadline. if it's later than that deadline,
ShouldHandle() will return True. We set that deadline initially when the Event
is constructed, and then we weren't ever updating it.

This Cl introduces UpdateCriteria(), which in TimedEvent classes will move the
deadline forward the appropriate amount of time.

BUG=chromium-os:29848
TEST=unit

Change-Id: Icb54bd6c386d2088d1d6fe2885ddd5c920ae9eed
Reviewed-on: https://gerrit.chromium.org/gerrit/20962
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Chris Masone <cmasone@chromium.org>
Reviewed-by: Scott Zawalski <scottz@chromium.org>
/external/autotest/site_utils/suite_scheduler/timed_event.py
d17d185d7abd68584f3756a89a7475a5b6109f34 20-Apr-2012 Chris Masone <cmasone@chromium.org> [autotest] Pass ManifestVersions instance to Event constructors, not methods.

BuildEvent subclasses need a ManifestVersions right away, so pass
an instance of this class to the *Event constructors, then use it
throughout all methods of the classes.

BUG=chromium-os:27586
TEST=unit
TEST=./suite_scheduler.py -f suite_scheduler_test.ini

Change-Id: Ic0278765e01995deb770523c187a6a4c9a0dd2f0
Reviewed-on: https://gerrit.chromium.org/gerrit/20727
Commit-Ready: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/external/autotest/site_utils/suite_scheduler/timed_event.py
93f51d4da152538007d5b44a2dc9d2bbb1fe3429 18-Apr-2012 Chris Masone <cmasone@chromium.org> [autotest] Add BuildEvent and derived NewBuild event class

The NewBuild event will allow us to Run() tasks whenever a new build appears
for a supported board.

BUG=chromium-os:27586
TEST=unit

Change-Id: I3432ecde38397fde6e0d7d675bf302a796c117f5
Reviewed-on: https://gerrit.chromium.org/gerrit/20524
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Chris Masone <cmasone@chromium.org>
/external/autotest/site_utils/suite_scheduler/timed_event.py
83af70c9fbb25953187e24d0b04c4506bce50693 18-Apr-2012 Chris Masone <cmasone@chromium.org> [autotest] Fix up parsing of 'should_handle' in config file

Also, add some more debug-level logging.

BUG=chromium-os:27586
TEST=unit
TEST=./suite_scheduler.py -f suite_scheduler_test.ini --log_dir .

Change-Id: Ic5e1b90f248ff8a01923948061378c494e913cfb
Reviewed-on: https://gerrit.chromium.org/gerrit/20503
Commit-Ready: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/external/autotest/site_utils/suite_scheduler/timed_event.py
9ee3eca81228c4479e4b1b0af11d9b69547b1ca7 17-Apr-2012 Chris Masone <cmasone@chromium.org> [autotest] GetBranchBuilds logic should return actual lists

I screwed up the logic in my last CL and was passing lists to the wrong stuff.

BUG=chromium-os:27586
TEST=unit

Change-Id: I6262d3dc511405fe33b872eace1446b3a96b3450
Reviewed-on: https://gerrit.chromium.org/gerrit/20409
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Chris Masone <cmasone@chromium.org>
/external/autotest/site_utils/suite_scheduler/timed_event.py
05b1944ebcb8a62ee0cc38a7f90b4131ededab8f 17-Apr-2012 Chris Masone <cmasone@chromium.org> [autotest] Change GetBranchBuildsForBoard() to return a dict of lists

Unlike TimedEvents, BuildEvents might see multiple new builds that need testing
appear between calls to ShouldHandle(). As such, we should be able to handle
multiple builds being ready for a given branch at the same time.

BUG=chromium-os:27586
TEST=unit

Change-Id: Ifde4bb35595e5d67ffe25b7d108985b58def9e04
Reviewed-on: https://gerrit.chromium.org/gerrit/20397
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Commit-Ready: Chris Masone <cmasone@chromium.org>
/external/autotest/site_utils/suite_scheduler/timed_event.py
9273c0ddfcdd07a298c2145270d7bf8cb9865e23 13-Apr-2012 Chris Masone <cmasone@chromium.org> [autotest] Fix path-globbing bug in ManifestVersions

As of this CL, I'm able to do an end-to-end test and see suites
get scheduled on my local AFE.

Also added a mechanism to config an event to fire every time the
scheduler loops back around, for testing purposes.

BUG=chromium-os:27586
TEST=unit
TEST=create a config with an event that will run_on=nightly, and a [nightly_params] section with always_fire: True

Change-Id: Ib09e3eeac06ef3eae341434aa465b6bd1d9c8afb
Reviewed-on: https://gerrit.chromium.org/gerrit/20251
Commit-Ready: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/external/autotest/site_utils/suite_scheduler/timed_event.py
67f06d6003bb11f03f925810272f595d79dce44a 13-Apr-2012 Chris Masone <cmasone@chromium.org> [autotest] Enable forcing an event to fire and schedule suites

We need to ability to make the scheduler force an event, so we can backfill
test results, if need be. This is also handy for testing stuff.

Also, fix a bug in comparing build branch names to branch specifications
encoded in Tasks. Before, every Task would run on every release branch,
even if the Task said it should only run on factory and/or firmware.

BUG=chromium-os:27586
TEST=unit
TEST=./suite_scheduler.py -f suite_scheduler_test.ini -e nightly -i x86-mario-release/R20-2130.0.0-a1-b1905

Change-Id: I58217c358d8b85faf49a940d01bca184dc8590e0
Reviewed-on: https://gerrit.chromium.org/gerrit/20124
Commit-Ready: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/external/autotest/site_utils/suite_scheduler/timed_event.py
5bde7dc7d8b0608feb43491d5ac648d11c890f54 10-Apr-2012 Chris Masone <cmasone@chromium.org> [autotest] Add, and begin using, ManifestVersions class.

This CL creates the ManifestVersons class, to enable other
componenets to query info from the manifest-versions git repo.
Abstracts away all git operations from consumers.

Also introduces some basic usage of the class, to discover new manifests that
appeared in a given time frame (used by Nightly and Weekly classes).

BUG=chromium-os:27586
TEST=unit

Change-Id: I07e707112fcca8279b37a5ce4ba2b54a8e150889
Reviewed-on: https://gerrit.chromium.org/gerrit/19867
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Chris Masone <cmasone@chromium.org>
/external/autotest/site_utils/suite_scheduler/timed_event.py
96f1663ecc7d8821e804b0256fc68be0756ba66e 05-Apr-2012 Chris Masone <cmasone@chromium.org> [autotest] Enable creation of Task objects from a config file.

Now that we've started to hash out what we're going to allow in terms of
specifying branches for a given task in the suite scheduler's config file,
we can start creating code to vet the config stanzas and create Task objects.

Also, now that we understand more about how we'll discover builds and run
tasks in a branch-aware fashion, the Event and Task APIs need to change a bit.

BUG=chromium-os:27586
TEST=unit

Change-Id: I19cb9bc8727e53da7a4f16faf630c697f374f28f
Reviewed-on: https://gerrit.chromium.org/gerrit/19628
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/external/autotest/site_utils/suite_scheduler/timed_event.py
2d61ca263d3e571b19604ea4c9d7b55d83c28405 03-Apr-2012 Chris Masone <cmasone@chromium.org> [autotest] Begin adding looping logic to new suite scheduler

driver.Driver will hold the main loop logic for the scheduler. As the
code in event.py started to get too big, I broke it into base_event.py
and timed_event.py. Also, add ForgivingConfigParser, which just wraps
SafeConfigParser to return None on get*() calls.

BUG=chromium-os:27586
TEST=unit tests

Change-Id: I6e69830f176f533a9d448ac4372da68c8c70a14b
Reviewed-on: https://gerrit.chromium.org/gerrit/19488
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Commit-Ready: Chris Masone <cmasone@chromium.org>
/external/autotest/site_utils/suite_scheduler/timed_event.py