History log of /external/autotest/frontend/afe/rpc_interface.py
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4c0d2904152d2c8f3fc748f53cd9fd26f6aeab5d 13-Jan-2016 Shuqian Zhao <shuqianz@chromium.org> [autotest] Forcefully modify host locking status via cli

When host locking status is inconsistent between masterDB and shardDB for some
unknown rpc reasons, we may need to forcefully lock the host both in
masterDB and shardDB gaurantee the lab reliability.

BUG=chromium:568193
TEST=Test locally. Test in puppetlab to lock an already locked host and
unlock an already unlocked host.

Change-Id: I83f53da0a2e76dedfc8e58deb609073efec5f369
Reviewed-on: https://chromium-review.googlesource.com/321792
Commit-Ready: Shuqian Zhao <shuqianz@chromium.org>
Tested-by: Shuqian Zhao <shuqianz@chromium.org>
Reviewed-by: Shuqian Zhao <shuqianz@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
8e2c2d0cbfb7ac2f1226a59cbbeaffb00288b8df 07-Jan-2016 MK Ryu <mkryu@google.com> [autotest] Change DB update order.

Originally, we update shard DBs first and then the master DB, and
use the shard DB as ground truth when inconsistency between the
master DB and a shard DB is detected. This incurs a tricky bug
as explained in crbug.com/574966.

We should change the order. Update the master DB first and then
shard DBs, and use the master DB as ground truth for fixing
DB inconsistency.

BUG=chromium:574966
TEST=Test updated RPCs in puppylab.

Change-Id: Ic785f9f3c677bea997d4637266c8c223618070d9
Reviewed-on: https://chromium-review.googlesource.com/320599
Commit-Ready: Mungyung Ryu <mkryu@google.com>
Tested-by: Mungyung Ryu <mkryu@google.com>
Reviewed-by: Dan Shi <dshi@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
9316171a2181b950cad906b8bb9a3ebc2d9a7840 21-Dec-2015 MK Ryu <mkryu@google.com> [autotest] Bug fix for modify_hosts RPC.

'update_data' is an argument of 'modify_hosts', and it is updated within
'modify_hosts'. That means the original variable passed as 'update_data'
is updated, and it seems to cause an error.
To be safe, it's better to make a copy for 'update_data' and updates the
copied one.

BUG=chromium:535651
TEST=Try lock/unlock multiple hosts.

Change-Id: I65e62158df55ff0b9d6d942e1ba9ab11730413dc
Reviewed-on: https://chromium-review.googlesource.com/319189
Reviewed-by: Dan Shi <dshi@chromium.org>
Tested-by: Mungyung Ryu <mkryu@google.com>
/external/autotest/frontend/afe/rpc_interface.py
d53e1492e481c3e9d07ba790577914ba20d7631a 15-Dec-2015 MK Ryu <mkryu@google.com> [autotest] Consistent lock_time for a host

In the old code, 'lock_time' field for a host is recorded
when django saves the modified host record. It can sometimes
generate a slight lag (a couple seconds) for lock_time
between the master and a shard DB. This CL makes it always
consistent.

BUG=chromium:535651
TEST=Puppylab. Try locking a sharded host with a test code that
delays the message (modify_host_local) forwarding to a shard.

Change-Id: I33885f659c7511ae136493228380b459dae001d5
Reviewed-on: https://chromium-review.googlesource.com/318387
Commit-Ready: Mungyung Ryu <mkryu@google.com>
Tested-by: Mungyung Ryu <mkryu@google.com>
Reviewed-by: Mungyung Ryu <mkryu@google.com>
/external/autotest/frontend/afe/rpc_interface.py
37df54d11d7598f6b7192b5a397d6e9ca05bf8e3 14-Dec-2015 Dan Shi <dshi@google.com> [autotest] Add a currently running job/task of a host on cautotest AFE

Add a new argument include_current_job in get_hosts RPC. If it's set to True,
include the currently running job/task info in the host details. It's default
to False, since the call is used for other callers, and the extra db query will
add unnecessary load to the caller, e.g., shard heartbeat.

BUG=chromium:549193
TEST=local verify
host with no running job/task: http://dshi.mtv/afe/#tab_id=view_host&object_id=1
host with running job/task: http://dshi.mtv/afe/#tab_id=view_host&object_id=8

DEPLOY=afe, apache

Change-Id: Ifc86db3486efafe9a2f3f17f00ea0640f3f1e0ba
Reviewed-on: https://chromium-review.googlesource.com/318260
Commit-Ready: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@google.com>
Reviewed-by: Fang Deng <fdeng@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
6157e8e83719c618d48b7a36bbc9f80c39c381f5 08-Dec-2015 Simran Basi <sbasi@google.com> [autotest] Support using *-LATEST builds for single job runs.

We support build names like peppy-release/LATEST for suites but not
single jobs from the AFE. This CL introduces this support for single
job runs.

BUG=chromium:431060
TEST=moblab.
DEPLOY=apache

Change-Id: I86ce34a79508d34bacbcfa4de655f13d1f14648c
Reviewed-on: https://chromium-review.googlesource.com/316683
Commit-Ready: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
Reviewed-by: Dan Shi <dshi@google.com>
/external/autotest/frontend/afe/rpc_interface.py
01984f506453723cb63b2d39947017c62ba06047 13-Oct-2015 Simran Basi <sbasi@google.com> Brillo Tier 1 PTS: Add job monitoring and result processing.

Now after the PTS sequence is launched, the tier1 kickoff script
will monitor the PTS job and its child jobs until either they
complete or the host goes into a bad state.

Then the results are processed via the same ResultCollector
we use for running suites.

Also fixed the get_jobs RPC to work properly when finished=False,
before it ignored this value when set to false.

BUG=b:24774860
TEST=Ran against a local moblab. PTS is kicked off, monitored and
results are properly fetched. Links outputted by the ResultCollector
also work as expected.

Change-Id: Ie179b54aa5b380fdd78b803e8e4c922003805759
Reviewed-on: https://chromium-review.googlesource.com/305263
Commit-Ready: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
3388961364ed423bb3f7e9addcf83283e9e8b2ef 04-Sep-2015 MK Ryu <mkryu@google.com> [autotest] Route modify_host RPC to master when called on a shard.

Users mistakenly lock/unlock on a shard AFE page.
It incurs database inconsistency between master DB and the shard DB.
This CL makes modify_host / modify_hosts RPCs routed to the master
if they are called on a shard.

BUG=chromium:444600
TEST=Puppylab and unittest.

Change-Id: I97d0cfcd85fe8a399224028a4c5fdbe32910fb88
Reviewed-on: https://chromium-review.googlesource.com/297595
Commit-Ready: Mungyung Ryu <mkryu@google.com>
Tested-by: Mungyung Ryu <mkryu@google.com>
Reviewed-by: Fang Deng <fdeng@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
65351d6f17ba32b942a18c42ca149dd154eebce7 03-Aug-2015 Dan Shi <dshi@chromium.org> [autotest] Hide firmware labels from AFE

fwrw-version and fwro-version are the version label just like cros-version,
they don't need to be listed in Host List tab's label listbox.

BUG=None
TEST=local afe

Change-Id: Icb98d432df11bb1baced12a1763c3efd2aa2b0c0
Reviewed-on: https://chromium-review.googlesource.com/290351
Trybot-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
5aa2504a6947eda0943689ca55ed6bd4dce8444f 29-Jul-2015 MK Ryu <mkryu@google.com> [autotest] Support repair_hosts RPC in sharding

BUG=chromium:482192
TEST=Use testing master and shard machines.
Run Reverify and Repair tasks on both master DUTs
and shard DUTs via frontend web ui.
DEPLOY=apache

Change-Id: Iac88eb72e0fcc8993a6bccbf53a91575ce8623b2
Reviewed-on: https://chromium-review.googlesource.com/289304
Trybot-Ready: Mungyung Ryu <mkryu@google.com>
Tested-by: Mungyung Ryu <mkryu@google.com>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Mungyung Ryu <mkryu@google.com>
/external/autotest/frontend/afe/rpc_interface.py
2a5297bf96c1d3eec4c71931c9cebba0737fef36 24-Jul-2015 Dan Shi <dshi@chromium.org> [autotest] Fix a typo in create_parameterized_job RPC

The RPC is not used any where, so no damage is done so far.

BUG=None
TEST=None

Change-Id: I9f616f61c0af2dc7c064bd346ceb121787145af0
Reviewed-on: https://chromium-review.googlesource.com/288042
Commit-Queue: Dan Shi <dshi@chromium.org>
Trybot-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Laurence Goodby <lgoodby@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
e019aae6c55e7e31acaf291370c6a48d5792cd79 07-Jul-2015 MK Ryu <mkryu@google.com> [autotest] Keep platform bit for a label in shards

When we add a label to a host that is in a shard,
the platform bit of the label should be forwarded as well.

BUG=chromium:502337
TEST=puppylab. Add a platform label to a host in stumpy shard.
DEPLOY=apache

Change-Id: I12c1dfc7d9a46cda5982d687a2fd160d187582a0
Reviewed-on: https://chromium-review.googlesource.com/283943
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Mungyung Ryu <mkryu@google.com>
Tested-by: Mungyung Ryu <mkryu@google.com>
/external/autotest/frontend/afe/rpc_interface.py
78f281ab42f1afb28977e13a9c1be107b897db0f 29-Jun-2015 J. Richard Barnette <jrbarnette@chromium.org> [autotest] Fix get_host_diagnosis_interval() for shards.

The call detected "host has a shard", but didn't detect "... and
I'm the shard for the host", leading to infinite RPC recursion.
Very Bad.

BUG=chromium:492662
TEST=test on the .cbf shard

Change-Id: I6dc2c615bae4fe8266b8fcb6bedeb7647024c83c
Reviewed-on: https://chromium-review.googlesource.com/282580
Reviewed-by: Dan Shi <dshi@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
e301eb76e56ffbf958cceded3920808a29912510 25-Jun-2015 MK Ryu <mkryu@google.com> [autotest] Reroute some RPCs called to a shard to master

create_job and create_suite_job RPCs should not be handled by a shard.
They should be redirected to the master.

BUG=chromium:503188
TEST=puppylab. Submit a dummy suite in a stumpy shard.

Change-Id: Ibe432655c677024e9eee1f4aca118ef6db7951f7
Reviewed-on: https://chromium-review.googlesource.com/281818
Reviewed-by: Mungyung Ryu <mkryu@google.com>
Commit-Queue: Mungyung Ryu <mkryu@google.com>
Tested-by: Mungyung Ryu <mkryu@google.com>
/external/autotest/frontend/afe/rpc_interface.py
1043809018daa39812a64805c04456ce7b706d08 24-Jun-2015 Matthew Sartori <msartori@chromium.org> [autotest] Fixes for 'Create Job' page when using 'Fetch Tests from Build'

'Fetch Tests from Build' correctly populated the test selector with
the tests supported by the provided image, however, when communicating
with the backend, default test information from the database was being
used. This resulted in the wrong control file being used for the
selected test. In addition, the get_tests_by_build rpc reponse was
missing information required by certain AFE functions, this resulted
in the auto-selection for hostless jobs to break when fetching tests
for an image.

This CL makes it so that when tests are fetched for a particular image,
client state describing the control file is used to find/build
the control file rather than pulling from the default test database.
It also corrects the get_tests_by_build rpc so that the missing
attributes are provided.

BUG=chromium:503385,chromium:503731
DEPLOY=afe
TEST=Tested changes on a moblab.

Change-Id: I54739a4bb6e96cd2517ea59dc0a937d0d81cc000
Reviewed-on: https://chromium-review.googlesource.com/281760
Tested-by: Matthew Sartori <msartori@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Matthew Sartori <msartori@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
0723bf5ed7ff506e15fea180547cb6a8ae9102eb 24-Jun-2015 Dan Shi <dshi@chromium.org> [autotest] Rename provision.FW_VERSION_PREFIX to provision.FW_RW_VERSION_PREFIX

To make it clear that the build is for updating RW firmware.

BUG=chromium:270258
TEST=local run_suite
./run_suite.py -b veyron_jerry -i trybot-veyron_jerry-paladin/R45-7122.0.0-b11 \
--firmware_rw_build veyron_jerry-firmware/R41-6588.106.0 --test_source_build \
veyron_jerry-firmware/R41-6588.106.0 -p suites -s dummy

Change-Id: I842f348bc1ba567c5622ac126e8ca35392506774
Reviewed-on: https://chromium-review.googlesource.com/281623
Trybot-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
8abbfd638af09a39bb65fc28e819fc46199a8281 23-Jun-2015 J. Richard Barnette <jrbarnette@chromium.org> [autotest] Add dut-status --diagnosis.

This adds a new --diagnosis option to the dut-status command that
automatically displays all logs in a sequence leading to a DUT
failure.

This change also plumbs in a new RPC call needed to support the
feature.

BUG=chromium:492662
TEST=Run the command with the new option using a local RPC server

Change-Id: Ibb7431199bd0f8bbfe06fb8fffcb59512b01ab5b
Reviewed-on: https://chromium-review.googlesource.com/281205
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
d215dbe17369b0781b1a0ceb4a70b25f120670fd 19-Jun-2015 Dan Shi <dshi@chromium.org> [autotest] Add more build option in autotest create_job tab for FAFT

Add an Advanced Build Options panel for user to specify:
firmware build (RW), firmware RO build, and test source build.

Then create a suite job from AFE to update both CrOS and firmware.

BUG=chromium:493429
TEST=local test
http://dshi.mtv/afe/#tab_id=create_job
1. check AFE shows the Advanced Build Options panel
2. Confirm the builds specified in the options are used in the sutie job run.
3. Confirm non-suite job can't be created with firmware image specified.
sample cros build: veyron_jerry-release/R45-7201.0.0
sample firmware build: veyron_jerry-firmware/R41-6588.106.0
DEPLOY=afe,apache

Change-Id: I81e1f5f81aaa9dfb5fe7b9f2f3677b8fb437130c
Reviewed-on: https://chromium-review.googlesource.com/281021
Trybot-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
8c554cf044be8993824bf7159cd0a4ac2fb2ec78 12-Jun-2015 MK Ryu <mkryu@google.com> [autotest] Forward modify_label and delete_label RPCs

BUG=chromium:499660
TEST=puppylab. Let test_host1 and test_host11 have a label l1.
test_host1 is in master and test_host11 is in stumpy shard.
Send modify_label and delete_label RPCs for the label l1,
and check master DB and stumpy shard's DB if they are
updated in the same way.
DEPLOY=apache

Change-Id: I1d7b0f06a4aeb0b2470a677cea12d195535d154f
Reviewed-on: https://chromium-review.googlesource.com/277143
Tested-by: Mungyung Ryu <mkryu@google.com>
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Mungyung Ryu <mkryu@google.com>
/external/autotest/frontend/afe/rpc_interface.py
fbb002cb354904aa7b318dced5baa0042d8dc357 08-Jun-2015 MK Ryu <mkryu@google.com> [autotest] Forward RPCs that update host labels to shards

Other than label_add_hosts and label_remove_hosts,
we have 2 more RPCs that updates host labels.
They are host_add_labels and host_remove_labels.
These RPCs should be forwarded to shards.

BUG=chromium:497887
TEST=puppylab. test_host13 is a host in a shard.
>>> import common
>>> from autotest_lib.server import frontend
>>> afe = frontend.AFE()
>>> h = afe.get_hosts(['test_host13'])[0]
>>> h.add_labels(['l1','l3'])
Adding labels ['l1', 'l3'] to host test_host13
>>> h.remove_labels(['l1'])
DEPLOY=apache

Change-Id: Ic37c026efa009eff3aa5276cbbef8c3e1d62e508
Reviewed-on: https://chromium-review.googlesource.com/276211
Reviewed-by: Mungyung Ryu <mkryu@google.com>
Commit-Queue: Mungyung Ryu <mkryu@google.com>
Tested-by: Mungyung Ryu <mkryu@google.com>
/external/autotest/frontend/afe/rpc_interface.py
26f0c9397777f98bdfdf5e5b4e6374cbb9131264 29-May-2015 MK Ryu <mkryu@google.com> [autotest] Forward set_host_attribute RPC

set_host_attribute RPC should be forwarded to shards of affected
hosts to update not only master DB but also the shards' DB.

BUG=chromium:492822
TEST=puppylab. Run ./atest/host mod -a testattr=hello1 test_host11
on the master VM. test_host11 is a host of stumpy shard.
Check if its host attribute has been affected in both master DB
and stumpy shard DB.
DEPLOY=apache

Change-Id: I1fb940ce92df8ca9afe1986cccc517b09c96f43e
Reviewed-on: https://chromium-review.googlesource.com/273947
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Mungyung Ryu <mkryu@google.com>
Tested-by: Mungyung Ryu <mkryu@google.com>
/external/autotest/frontend/afe/rpc_interface.py
0c1a37dd9b1237fe8d43c7f911ce601104806339 30-Apr-2015 MK Ryu <mkryu@google.com> [autotest] Support sharding for getting HQEs and special tasks

Following 2 RPCs that are used by AFE java client are improved
to support sharding.

get_host_queue_entries_and_special_tasks
get_num_host_queue_entries_and_special_tasks

BUG=chromium:462819
DEPLOY=afe,apache
TEST=puppylab. Get HQEs and special tasks for a lumpy host
which is sharded from the master AFE.

Change-Id: I68c0d1a70fb6b61034c755d3a2b7f26475994bb0
Reviewed-on: https://chromium-review.googlesource.com/268523
Reviewed-by: Mungyung Ryu <mkryu@google.com>
Commit-Queue: Mungyung Ryu <mkryu@google.com>
Tested-by: Mungyung Ryu <mkryu@google.com>
/external/autotest/frontend/afe/rpc_interface.py
4d7e6e6eedc3a021c98a289ce156c279e0d4a737 01-May-2015 J. Richard Barnette <jrbarnette@chromium.org> [autotest] Fix the RPC interface for get_status_task().

The interface failed to provide termination when the call chain
reached the shard that owned the target host. This splits the
API into two parts: `get_status_task()` and `get_host_status_task()`.
The former actually gets the status task from the local shard
(without forwarding). The latter merely converts to a call to
`get_status_task()` targeted at the proper shard.

BUG=chromium:483485
TEST=test using local instance pointed at production database

Change-Id: I64411cab8a8b3f4bae0bf378c459099f32545a93
Reviewed-on: https://chromium-review.googlesource.com/268790
Reviewed-by: Mungyung Ryu <mkryu@google.com>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
6818633834ad52c3de153235639ea9299a6e9a6d 28-Apr-2015 Matthew Sartori <msartori@chromium.org> [autotest] Require lock reason to lock device

When locking a device, a locking reason now must be provided.
This applies to both adding a new device, and modifying an
existing device from both the web frontend and the atest
command-line tool.

BUG=chromium:336805
DEPLOY=migrate
TEST=Tested adding locked/unlocked devices and locking/unlocking devices
from both the web frontend and using the 'atest host ...' command-line tools.

Change-Id: I3a8cd8891a2999f026dd709ae8a79e2b8cbc251a
Reviewed-on: https://chromium-review.googlesource.com/267595
Tested-by: Matthew Sartori <msartori@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Matthew Sartori <msartori@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
39255faa9eebb1b64da7b21fc5874414ad6bad83 15-Apr-2015 J. Richard Barnette <jrbarnette@chromium.org> [autotest] Create a new get_status_task RPC to improve dut_status.

Previously, status was determined by fetching all jobs in a given
time range, and then searching back through the returned list for
a job that indicated host status. This had two drawbacks:
* If the job indicating status was earlier than the start time
of the query, no status could be determined.
* The extra data returned in the query slowed it down.

This adds a new RPC that finds the task through a single database
query searching for the specific necessary condition. This should
largely eliminate the '--' status, and is notably faster (possibly 4
times faster, or more).

This also changes the rules for what constitues a diagnostic job or
task, by changing the diagnosis associated with test jobs. This
is done because
* It makes determining status possible with a query to a single
table.
* The experience has been that test jobs don't indicate a
diagnosis anyway.

This is the first of two parts; this change creates the server
side of the new RPC. This change must be pushed to prod before
the follow-on change for the client side.

BUG=chromium:463632
TEST=Run dut_status using a local instance pointed at the prod database

Change-Id: Ifc61387f0cdc46ceb32062663c6a73c5d4bcfb4f
Reviewed-on: https://chromium-review.googlesource.com/265783
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
fdfcd664b69e585d47b518ab41ae6621ab50c0de 14-Apr-2015 J. Richard Barnette <jrbarnette@chromium.org> [autotest] Drop compatibility for the old dut-status.

This is the last of three stages to update the RPC API for special
tasks. This change drops the compatibility behaviors from the
get_special_tasks() RPC call.

This change cannot be pushed to prod until all old versions of
dut-status have been updated.

BUG=None
TEST=Test dut-status on a local instance using the prod database

Change-Id: I2680f2541c363975518b0fbe33f9bc312236ec8c
Reviewed-on: https://chromium-review.googlesource.com/265575
Reviewed-by: Fang Deng <fdeng@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Mungyung Ryu <mkryu@google.com>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
b5164d69f540b9f64413d43fb462aa3da73c58e0 13-Apr-2015 J. Richard Barnette <jrbarnette@chromium.org> [autotest] Create the get_host_special_tasks() RPC.

The existing get_special_tasks() RPC has two distinct callers:
Callers that only need tasks from the current shard, and callers
that need tasks for a specific host (and therefore, require the
RPC to be forwarded to the host's shard). This change splits that
function into two separate RPC calls: get_special_tasks() is used
for the local shard case, and get_host_special_tasks() is used for
single-host queries.

The only caller affected by this change is the status_history
module. To preserve compatibility with older versions of dut-status
this change is rolling out in three stages. This change provides
temporary support for both old and new versions of dut-status until
all the old versions of dut-status can be updated.

BUG=None
TEST=Test dut-status on a local instance using the prod database

Change-Id: I06f239d011d20f5a6357c35121951f9ecf34f61e
Reviewed-on: https://chromium-review.googlesource.com/265486
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
2d107567ded9b824b26bfd82e63c004f5f71314e 25-Feb-2015 MK Ryu <mkryu@google.com> [autotest] Consult appropriate shard AFE for special tasks

Special tasks are updated in the local DB of a shard.
RPCs hitting a master AFE that are getting special tasks
should consult an appropriate shard AFE.

BUG=chromium:461637
DEPLOY=apache
TEST=puppylab.
./site_utils/dut_status.py test_host41, where test_host41 is the dut
in master.
./site_utils/dut_status.py test_host51, where test_host51 is the dut
in lumpyshard.

Change-Id: I118ed5f4f20eba14c2e4c2c056e217c31f334aac
Reviewed-on: https://chromium-review.googlesource.com/254420
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Mungyung Ryu <mkryu@google.com>
Tested-by: Mungyung Ryu <mkryu@google.com>
/external/autotest/frontend/afe/rpc_interface.py
ec1d47d85cc83f30631518d8fbb6406036a3ac39 13-Feb-2015 Dan Shi <dshi@chromium.org> [autotest] Add support for scheduler to honor require_ssp attribute in control file

This CL adds changes to pipe require_ssp attribute in control file to autoserv
command. Following are the work flow:

1. The control file parser stores require_ssp attribute value in afe_jobs table.
2. QueueTask compiles command line list, --require-ssp option will be added to
the command line list if following conditions are met:
a. AUTOSERV/enable_ssp_container in global config is True
b. The test is a server-side test
c. require_ssp for the job entry is None or True.
3. When agent_task tries to call run method to run the command, it will check if
there is any drone supporting server-side packaging first. If no drone is found,
the agent task will will run the command in a drone without using server-side
packaging. A warning will be posted in the autoserv log.
4. If a drone without SSP supported is assigned to a test requires SSP, the test
will be run without ssp.

BUG=chromium:453624
TEST=unittest, local test:
set AUTOSERV/enable_ssp_container to True in shadow config;
Create a job for dummy_PassServer in AFE, check require SSP, confirm the job
succeeds but with a warning in the autoserv log.

Create a job for dummy_PassServer_nossp in AFE, uncheck require SSP, confirm
the job passes without warning in the autoserv log.

set AUTOSERV/enable_ssp_container to False in shadow config, restart scheduler.
Create a job for dummy_PassServer in AFE, check require SSP, confirm the job
succeeds without warning in the autoserv log.

also run test_that in local chroot to make sure test_that is not affected.

DEPLOY=apache,scheduler, db migrate must be done before push this CL to prod.

Change-Id: I02f3d137186676ae570e8380d975a1bcd9ffbb94
Reviewed-on: https://chromium-review.googlesource.com/249841
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
Trybot-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
cf027c67cbe849fe39dc876bde3057fd3677f997 04-Mar-2015 MK Ryu <mkryu@google.com> [autotest] Forward label_remove_hosts RPC to master

Master should coordinate label removal from hosts just
like label addition to hosts.

BUG=chromium:463977
DEPLOY=apache
TEST=puppylab.
afe = frontend.AFE(server='localhost:8004')
kwargs = {
'id': 'newlabel',
'hosts': ['test_host5','test_host51','test_host52','test_host53']
}
afe.run('label_remove_hosts', **kwargs)

Test on shard testing nodes, testing-shard-master.fra and
testing-shard-1.cbf.

Change-Id: I31798b7e01dd23ff281ed773f78295063dda6191
Reviewed-on: https://chromium-review.googlesource.com/255952
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Mungyung Ryu <mkryu@google.com>
Tested-by: Mungyung Ryu <mkryu@google.com>
/external/autotest/frontend/afe/rpc_interface.py
9c5fbbe29ab7ca7f8b69687de08a55c518378ae7 12-Feb-2015 MK Ryu <mkryu@google.com> [autotest] Send labels to shards preserving their ids.

We were allowing deviations between a shard and the master
by not specifying the label id for forwarded label create
rpcs. This cl breaks down the forwarding into 2 phases,
the first to create the label and the second to add the label
to the host, and sends the label id as part of the packet for
label creation.

TEST=atest label add -m host_not_on_shard new_label1
atest label add -m host_on_shard new_label2
checked that new_label2 have the same id on the master and shard.
BUG=chromium:448367
DEPLOY=apache

Change-Id: I29c99ca3fa25a0a3cb2cd91b759db009ee346799
Reviewed-on: https://chromium-review.googlesource.com/248835
Tested-by: Mungyung Ryu <mkryu@google.com>
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Mungyung Ryu <mkryu@google.com>
/external/autotest/frontend/afe/rpc_interface.py
1e1c41b1b4a1b97c0b7086b8430856ed45e064d3 05-Feb-2015 Gabe Black <gabeblack@chromium.org> graphite: Separate out configuration from the statsd classes.

The new version of the statsd classes should be created using an instance of
the new Statsd class which sets up some defaults without having to specify
them over and over. This makes it essentially compatible with the existing
usage in autotest, but will allow chromite to configure things differently and
avoid having side effects from importing the module or global state.

BUG=chromium:446291
TEST=Ran unit tests, ran stats_es_functionaltest.py, ran the
stats_mock_unittest, ran a butterfly-paladin tryjob with --hwtest, testing by
fdeng.
DEPLOY=apache,scheduler,host-scheduler

Change-Id: I1071813db197c0e5e035b4d8db615030386f1c1c
Reviewed-on: https://chromium-review.googlesource.com/246428
Reviewed-by: Fang Deng <fdeng@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
d893df09d301e00e59e75266b7af3d1c4b9a4bcf 05-Feb-2015 Mungyung Ryu <mkryu@google.com> Revert "[autotest] Send labels to shards preserving their ids."

This reverts commit 744898f7e2fe4a3d90659d2183119b0d1fddcb28.

Change-Id: I8c8611b1b3095223e527fb465c2030e743ab6152
Reviewed-on: https://chromium-review.googlesource.com/246274
Reviewed-by: Mungyung Ryu <mkryu@google.com>
Commit-Queue: Mungyung Ryu <mkryu@google.com>
Tested-by: Mungyung Ryu <mkryu@google.com>
/external/autotest/frontend/afe/rpc_interface.py
744898f7e2fe4a3d90659d2183119b0d1fddcb28 13-Jan-2015 Prashanth Balasubramanian <beeps@google.com> [autotest] Send labels to shards preserving their ids.

We were allowing deviations between a shard and the master
by not specifying the label id for forwarded label create
rpcs. This cl breaks down the forwarding into 2 phases,
the first to create the label and the second to add the label
to the host, and sends the label id as part of the packet for
label creation.

TEST=atest label add -m host_not_on_shard new_label1
atest label add -m host_on_shard new_label2
checked that new_label2 have the same id on the master and shard.
BUG=chromium:448367
DEPLOY=apache

Change-Id: I9773def43b94ad77e85bfeadcb69bbddf9e02460
Reviewed-on: https://chromium-review.googlesource.com/240348
Tested-by: Mungyung Ryu <mkryu@google.com>
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Mungyung Ryu <mkryu@google.com>
/external/autotest/frontend/afe/rpc_interface.py
8c98ac10beaa08bfb975c412b0b3bda23178763a 23-Dec-2014 Prashanth Balasubramanian <beeps@google.com> [autotest] Send frontend jobs to shards.

Frontend jobs on hosts that are on the shard are disallowed
currently, because the host-scheduler on master currently
ignore jobs based on meta-host, but frontend jobs have no
meta-host. This CL have the following changes:
- Make host-scheduler ignore frontend jobs that are supposed
to be picked by shard.
- Send such frontend jobs in heartbeat.
- Allow creation of frontend jobs in rpc.

TEST=Test the follows:
- Create a job on a host on shard from AFE frontend.
Observe it runs on shards and completes on master.
- Create a job on two hosts (one host on shard, the other on master)
from AFE frontend. Make sure exception is railed with correct
message.
- Run a normal dummy suite on shard, make sure normal flow still
works. Heartbeat contains the right information.
- Run a normal dummy suite on master, make sure it works.
BUG=chromium:444790
DEPLOY=apache, host-scheduler

Change-Id: Ibca3d36cb59fed695233ffdc89506364c402cc37
Reviewed-on: https://chromium-review.googlesource.com/240396
Reviewed-by: Mungyung Ryu <mkryu@google.com>
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Fang Deng <fdeng@chromium.org>
Tested-by: Fang Deng <fdeng@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
63b0e4558330e57db5ed11f5a925c4769802c502 19-Dec-2014 Fang Deng <fdeng@chromium.org> [autotest] Optimize queries in abort_suites

abort_suites is called by buildbots.
The way it currently aborts suite is very slow.
This CL makes it faster by aborting the suite jobs
given a build name and a suite name, and rely on autotest
scheduler to aborts the subjobs.

TEST=Scheduler synchronous/asynchronous suites. Abort
them when the suite status is Queued/Running/Complete.
Confirm any Queued/Running subjobs are aborted.
BUG=chromium:444151
DEPLOY=apache

Change-Id: I182913e0dad08bcba8a4c05b904ba7a2d2a6c61b
Reviewed-on: https://chromium-review.googlesource.com/236943
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Fang Deng <fdeng@chromium.org>
Trybot-Ready: Fang Deng <fdeng@chromium.org>
Tested-by: Fang Deng <fdeng@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
4098123fc6d2adcaf12ed6d19203228fed3b0b22 17-Dec-2014 Prashanth Balasubramanian <beeps@google.com> [autotest] Redirect reverification of hosts.

All reverifications sent to the master through the
frontend or otherwise will get redirected to hosts
on shards.

TEST=Reverified hosts through the frontend of the master.
BUG=chromium:423225
DEPLOY=apache

Change-Id: I66e242d4987a35e7aefd204d280371d3bdfb68a2
Reviewed-on: https://chromium-review.googlesource.com/236172
Reviewed-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Prashanth B <beeps@chromium.org>
Commit-Queue: Prashanth B <beeps@chromium.org>
Trybot-Ready: Prashanth B <beeps@chromium.org>
Tested-by: Prashanth B <beeps@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
0a03f9d6232427110cca384ffd8451507bc9d47b 16-Dec-2014 Dan Shi <dshi@chromium.org> [autotest] enable running special task from AFE on shard

Only raise error if the special task is queued from master AFE for a host
belongs to a shard.

BUG=None
TEST=vms
DEPLOY=apache

Change-Id: I917a2727c6c7b115c4765b2fccfc71ed8db7589f
Reviewed-on: https://chromium-review.googlesource.com/236020
Reviewed-by: Prashanth B <beeps@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
Trybot-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
2dc7a1026c14859ebb8d5a1477e77bdd4602c93b 03-Dec-2014 Moises Osorio <moisesosorio@chromium.org> Add new fast endpoint method to get test status counts.
This method deprecates get_tests_summary and get_tests_summary_with_wildcards
in TKO, by outperforming them and making use of more efficient Django queries.
The new method works by first getting the IDs of the Jobs matching a search
criteria and then counting the number of tests ran by such jobs with a passing
or a failing status, returning a summary that can be easily digested by the
caller.

BUG=chromium:437096
TEST=Manually on local setup of Autotest
DEPLOY=apache

Change-Id: I3a053c660774a0aa58eadbdf7d328304d539f61d
Reviewed-on: https://chromium-review.googlesource.com/232805
Reviewed-by: Prashanth B <beeps@chromium.org>
Commit-Queue: Moises Osorio <moisesosorio@google.com>
Tested-by: Moises Osorio <moisesosorio@google.com>
/external/autotest/frontend/afe/rpc_interface.py
6edaaf9f5d10cda21d1c7f2401eb1d0bef2192fa 25-Nov-2014 Prashanth Balasubramanian <beeps@google.com> [autotest] Disallow frontend jobs on hosts given to shards.

TEST=Ran jobs and checked exceptions.
Ran jobs on non-shard hosts.
BUG=chromium:431789
DEPLOY=apache
Change-Id: Ide385ed1db135a7e98ab0385df1f9a64d97bd631
Reviewed-on: https://chromium-review.googlesource.com/231735
Tested-by: Prashanth B <beeps@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Prashanth B <beeps@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
5949b4af7a872aeb58e7ad29090812d648725ed5 23-Nov-2014 Prashanth Balasubramanian <beeps@google.com> [Autotest] Allow the syncing of labels added/removed.

This allows us to perform label add/remove actions
on the master and have it pass down to the shards those hosts
are on by introducing a generic decorator.

The cl also fixes some logging issues with the shard-client,
and a bug with propogating the invalid bit of a host.

TEST=Added/removed labels.
BUG=chromium:431786
DEPLOY=apache

Change-Id: Ic176054e04a5508bb3e967ecc902422628446d32
Reviewed-on: https://chromium-review.googlesource.com/231558
Reviewed-by: Prashanth B <beeps@chromium.org>
Tested-by: Prashanth B <beeps@chromium.org>
Commit-Queue: Prashanth B <beeps@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
50e91f7aa792af0a5f25ab718027de59963f4790 01-Oct-2014 Jakob Juelich <jakobjuelich@chromium.org> [autotest] Forward calls to modify_host(s) to shards.

If a host gets locked after it was assigned to a shard, right now
only the master will know about it.

With this commit, calls to modify_host and modify_hosts will be
forwarded to the relevant shards, so locking of hosts will propagate.

BUG=None
DEPLOY=apache
TEST=Ran suites and called rpcs manually, also with failing shard rpcs.

Change-Id: I90ca34a4cefbdf55acd47ee6e8df872527b27285
Reviewed-on: https://chromium-review.googlesource.com/220850
Tested-by: Jakob Jülich <jakobjuelich@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Jakob Jülich <jakobjuelich@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
acf359283e28219cc42ff3fe82b8a53f6a2d90f3 03-Oct-2014 MK Ryu <mkryu@google.com> [autotest] Add a new RPC interface, get_host_attribute.

Retrieve a host's attribute from afe_host_attributes table.
When you need to get only attribute info of a host, this RPC call is
lighter than using get_hosts RPC call.

DEPLOY=apache
BUG=chromium:215160
TEST=AUTOTEST_ROOT$ python
>>import common
>>from autotest_lib.server.cros.dynamic_suite import tools, frontend_wrappers
>>afe = frontend_wrappers.RetryingAFE(timeout_min=5, delay_sec=10)
>>afe.get_host_attribute('need_crash_logs', hostname=<host ip>)

Change-Id: I86bc17091c078823c270206d80bd572f2fbbeb95
Reviewed-on: https://chromium-review.googlesource.com/221510
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Mungyung Ryu <mkryu@google.com>
Tested-by: Mungyung Ryu <mkryu@google.com>
/external/autotest/frontend/afe/rpc_interface.py
71206ef92012e5a5c36bbd1ae47e9176be04036d 13-Aug-2014 Simran Basi <sbasi@chromium.org> [MobLab] Moblab Setup page.

* Adds a new page located at /moblab_setup
* 2 are on this page: 1 to upload a Boto Key and 1 to edit the config values.
* Link to /moblab_setup is visible only on a moblab system.
* RPC's that execute moblab_setup's actions are gated by a decorator that
limits them to only run on a moblab_system.
* Unittests for new RPC's.
* Editting the config values, writes the full config to shadow_config.ini and
reboots the system so changes takes effort.
* Resetting the config values, makes shadow_config.ini an empty file and
reboots the system so it is restored.
* Uploading the boto key uses shutil.copyfile to write in the new boto file's
contents to the boto file location.

BUG=chromium:396694
TEST=unittests, Uploaded a boto key and successfully ran a suite, editted
config and ensured changes were written into shadow_config, & reset config
and ensured that the default settings were restored.
DEPLOY=afe,apache
CQ-DEPEND=CL:212322
CQ-DEPEND=CL:212323
CQ-DEPEND=CL:212295

Change-Id: Ie354a2df310393045f3116e93004f58ea671de36
Reviewed-on: https://chromium-review.googlesource.com/209685
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
57bc195c551d71c5268d7630aa6e872aaad242bf 23-Jul-2014 Jiaxi Luo <jiaxiluo@chromium.org> [autotest] Add time segmented filter on job table on View Host page.

Modified the frontend to provide a start time and an end time with
datetime pickers. The place holder values are set to midnight "today".
Please note that the place holder values are not default values.
They are equivalent to empty strings, but exist to avoid making users
have to fill in all six segments (year, month, day, hour, minute, am/pm).

On the rpc side, added start_time and end_time parameters to
get_host_queue_entries, get_num_host_queue_entries,
get_host_queue_entries_and_special_tasks,
and get_num_host_queue_entries_and_special_tasks.

A helper function inject_start_end_time_to_dict is used to inject start_time
and end_time to filter_datas.

BUG=chromium:362240
TEST=ran afe, passed rpc_interface_unittest and frontend_unittest
DEPLOY=afe, apache

Change-Id: I44d59124cc104cf55d2ac3838be983286e270195
Reviewed-on: https://chromium-review.googlesource.com/209389
Tested-by: Jiaxi Luo <jiaxiluo@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Jiaxi Luo <jiaxiluo@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
dd67bebb78d9b00e6b14106fef9fa711b97044cd 19-Jul-2014 Jiaxi Luo <jiaxiluo@chromium.org> [autotest] Enforce control file when creating a "standard" test.

Control file will only be enforced on creating non-suite
and non-parameterized jobs.

BUG=chromium:394989
TEST=ran afe
DEPLOY=apache

Change-Id: I6e263c5de77be832db13a5032312a9f4204af391
Reviewed-on: https://chromium-review.googlesource.com/209161
Tested-by: Jiaxi Luo <jiaxiluo@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Jiaxi Luo <jiaxiluo@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
15cbf37cebd87112bb493d12330e123d1b007c23 02-Jul-2014 Jiaxi Luo <jiaxiluo@chromium.org> [autotest] filter suite and individual jobs on AFE.

Modified rpc_interface get_jobs and get_num_jobs to take in three extra
filters, suite, sub, and standalone. Add a rpc_util to add a where clause
to SQL, and add a unittest accordingly.

On GWT, add a group of radiobuttons as filters.

BUG=chromium:390345
TEST=ran afe, ran Job List, use filters
DEPLOY=afe,apache

Change-Id: Ibce875b47bef7e89bcc94972e23261290f0ac0e0
Reviewed-on: https://chromium-review.googlesource.com/206415
Tested-by: Jiaxi Luo <jiaxiluo@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Jiaxi Luo <jiaxiluo@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
421608e2ae505cdb9d57bc1d5bbd198bdb9b6243 07-Jul-2014 Jiaxi Luo <jiaxiluo@chromium.org> [autotest] WMatrix link on AFE.

RPC get_static_data will get wmatrix_url from config file and send to frontend.
If wmatrix_url is not present or set to empty, the WMatrix link will not show
up on AFE. Otherwise, it will on the top-right corner.

BUG=chromium:391851
TEST=edit config files, ran afe
DEPLOY=afe,apache

Change-Id: I29948ec59d203ac84d60e68d2c5a9b612b9a4cbc
Reviewed-on: https://chromium-review.googlesource.com/206896
Tested-by: Jiaxi Luo <jiaxiluo@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Jiaxi Luo <jiaxiluo@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
aac545784cea51dbe230c6c126b52987b7906fb5 04-Jun-2014 Jiaxi Luo <jiaxiluo@chromium.org> [autotest] AFE child jobs table on parent job.

Add a table to list all the child jobs of a parent job on Job View tab.
One can click on and navigate between child and parent.

BUG=chromium:379959
DEPLOY=afe,apache
TEST=ran afe, viewed a job, navigated between parent and child jobs

Change-Id: Id70c41c8f7cee40bd71a206e1f3e08a68efe054f
Reviewed-on: https://chromium-review.googlesource.com/202579
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Jiaxi Luo <jiaxiluo@chromium.org>
Tested-by: Jiaxi Luo <jiaxiluo@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
79ce642210e581dc2b5cc1df1876e98dae38b286 14-Jun-2014 Jiaxi Luo <jiaxiluo@chromium.org> [autotest] Speed up jobs table on View Host tab on AFE.

AFE was using hostname as key to fetch host and related jobs, which is slow
since afe_host_queue_entries and afe_special_tasks tables are using host_id
instead of hostname as foreign key.

I changed to use host id instead, which largely reduced the latency.
Host table's click listeners on View Job and Host List tabs are also changed
to fetch host by id. The arguments of rpc interfaces
get_host_queue_entries_and_special_tasks and
get_num_host_queue_entries_and_special_tasks are also changed to accept host_id
instead of hostname.

BUG=chromium:383589
DEPLOY=afe,apache
TEST=ran afe, ran View Job and Host List tab and cliked host, ran View Host tab

Change-Id: I7e7d1dd195fec211b6eb867976397d1e643b91ce
Reviewed-on: https://chromium-review.googlesource.com/203843
Tested-by: Jiaxi Luo <jiaxiluo@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Jiaxi Luo <jiaxiluo@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
90190c94bcf29f43601989f75b20cd228eef5428 18-Jun-2014 Jiaxi Luo <jiaxiluo@chromium.org> [autotest] Be able to pass in args when creating job from the AFE.

A number of tests require args to run. I added a textbox which takes a list of
comma seperated args. The client side will split and trim the input and send
it to RPC. I added a optional argument "args" to the rpc interface
"create_job". To ensure the RPC interface backward compatible,
I added the argument at the end.

BUG=chromium:374918
DEPLOY=afe,apache
TEST=ran afe, create job and type in args

Change-Id: I59df10d4d03dd23181623afdda29c3a683d3685e
Reviewed-on: https://chromium-review.googlesource.com/203011
Tested-by: Jiaxi Luo <jiaxiluo@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Jiaxi Luo <jiaxiluo@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
3187459dfd0dccbf5c1a94461263c07245aece79 11-Jun-2014 Jiaxi Luo <jiaxiluo@chromium.org> [autotest] Stops rpc get_static_data from fetching cros- and fw-version labels.

Both the rpc interface get_static_data and afe pages loads slow as they need
to read all 60000+ labels. From a user friendly perspective, it's not easy to
find a desired label from this long list on afe.

This will leave only 188 labels. The afe page load time is reduced from 10s to
less than 1s, and the db query time was reduced from 2.37s to 0.07s (both
tested on my local machine with a dump prod db copy).

BUG=chromium:368308
DEPLOY=apache
TEST=ran afe, ran Create Job and Host List tab, selected label from label list

Change-Id: Ifd0e8bc91b2cce8e453f93eec94bb132c2442744
Reviewed-on: https://chromium-review.googlesource.com/203444
Tested-by: Jiaxi Luo <jiaxiluo@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Jiaxi Luo <jiaxiluo@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
ab5a1bf348f22cf0c995cf7d43bfab141d4c2e10 29-May-2014 Simran Basi <sbasi@chromium.org> [autotest]: Restore create_job parameterized job functionality.

Turns out the lab admin's use parameterized jobs to reimage devices
through the AFE. We deleted this logic as we thought it was not used.
This is restoring the same code we deleted.

Logic originally removed in:
https://chromium-review.googlesource.com/#/c/194349/

BUG=chromium:372640
TEST=Able to specify an image and kick off a non-suite job and have
the device be reimaged.
DEPLOY=apache

Change-Id: I7c2f0e752362257da3aadb5a3b167b1847840f09
Reviewed-on: https://chromium-review.googlesource.com/201963
Tested-by: Simran Basi <sbasi@chromium.org>
Reviewed-by: Jay Kim <yongjaek@chromium.org>
Commit-Queue: Jay Kim <yongjaek@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
b6ec8ae8b13902110f664cf51e3a1d9b43c9f8f3 23-Apr-2014 Simran Basi <sbasi@chromium.org> [autotest]: Run suites from AFE.

* Updated the AFE to allow for suite runs. When an image is provided
the create_job RPC will redirect to the create_suite_job RPC instead.

* Updated create_suite_job to allow for a control_file to be supplied.
create_suite_job will use this control file rather than what the
devserver stages when it creates the suite job.

* Removed the parameterized job code from create_job as it is not used
and broken.

* The create_job page now includes a 'Pool' text box to specify for
these jobs.

BUG=chromium:358579
TEST=Able to launch suite jobs from run_suite and AFE. And regular tests
kicked off via the AFE still work as well. rpc_interface and
site_rpc_interface unittests, suite_scheduler unittests.
DEPLOY=apache,afe,suite_scheduler

Change-Id: I53312419c32740e78fc07598babeb497c162ba81
Reviewed-on: https://chromium-review.googlesource.com/194349
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
7e60574f3baa0b3928623216a74a770f19d2c316 12-Nov-2013 Simran Basi <sbasi@chromium.org> Autotest: Update RPC, Scheduler and AFE to use timeout_mins.

Now that timeout_mins is in the database, we need to update the
infrastructure to display and utilize timeout_mins rather than
timeout.

The scheduler now aborts based off of timeout_mins.

The afe displays/creates jobs using timeout_mins rather than timeout.

The RPC's take in timeout and timeout_min depending on what is inputted
to the system. Note the value supplied for timeout_mins takes precedence
over timeout.

BUG=chromium:221264
TEST=Created job through AFE, run_suite with smoke suite, job_unittest
and rpc_unittests.
DEPLOY=apache, afe, scheduler

CQ-DEPEND=I09f8b6023a31dcef37e98c298dc0d63b37bc0a9e

Change-Id: I838cd1ff85a2ce6bd49fe96bf18fd82be608c758
Reviewed-on: https://chromium-review.googlesource.com/176605
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
1b2493186b54a7707e9e3c731021049d49932c75 13-Nov-2013 Alex Miller <milleral@chromium.org> [autotest] Move rpc stats down the stack to cover all attempted RPCs.

This will log all RPCs, afe and tko, and even ones that error out or
don't make sense. This should let us get a realistic view of the RPC
load on our systems.

TEST=restarted apache, saw stats on chromeos-stats/
DEPLOY=apache
BUG=None

Change-Id: I8223347e86b358fa97c44f956c656a380edb3c48
Reviewed-on: https://chromium-review.googlesource.com/176591
Reviewed-by: Alex Miller <milleral@chromium.org>
Commit-Queue: Alex Miller <milleral@chromium.org>
Tested-by: Alex Miller <milleral@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
faecbce48bd329dcefe23516b2cd21603f8e6fb5 29-Oct-2013 beeps <beeps@chromium.org> [autotest] Fix parent/child and multiple aborts.

The queue_entry_id is a primary key in afe_aborted_host_queue_entries, which
should precludes us from trying to abort the same job multiple times. It will
happen if we abort a parent job (which leads to the abortion of its children),
and then abort a child in that set before the scheduler sets the complete bit.

The complete bit is set when we abort the hqe, so depending on where the
scheduler is in the tick, this leaves a ~30 second window within which our
second child abort will lead to an IntegrityError. This window is actually much
longer if the HQE is already in PARSING, since we won't set the complete bit
till the epilog of the PostJobTask.

TEST=Aborted suites, then their children. Tried to abort complete jobs.
BUG=chromium:308010
DEPLOY=Apache

Change-Id: Ib112502e966f5575c523ac053e94d44bd92359d6
Reviewed-on: https://chromium-review.googlesource.com/174988
Tested-by: Prashanth B <beeps@chromium.org>
Reviewed-by: Alex Miller <milleral@chromium.org>
Commit-Queue: Prashanth B <beeps@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
7d658cf6bade565c1098fd7b47075e96e7b542ca 05-Sep-2013 Alex Miller <milleral@chromium.org> [autotest] Thread priority from create_suite_job through to create_job.

This schedules a suite job itself at the same priority level of its
tests, and also injects the priority value into the suite control files.

The change to thread priority through from dynamic_suite into create_job
needs to happen concurrently, because the type of `priority` is changing
from a string to an int. This also means everything that passes in a
priority gets fixed up in this CL.

suite_scheduler has also been tweaked to schedule all tests at the
PostBuild priority (for now...).

This also does all of the work to get priority to show up by name
instead of by integral value. In the create_job pane, we disallow
anyone to schedule a job at a priority that would preempt major build
processes (anything coming from a waterfall). However, all old jobs are
shown at the integral value, because showing two seperate priority
scales at the same time would be incredibly confusing. (Especially
since URGENT would be incredibly low priority)

BUG=chromium:250583
DEPLOY=afe, apache, suite_scheduler
TEST=unit, run_suite with a priority level

Change-Id: I9ecf5ceed5c58bd8ee0815c6d15f4aba300082fe
Reviewed-on: https://chromium-review.googlesource.com/168143
Reviewed-by: Alex Miller <milleral@chromium.org>
Tested-by: Alex Miller <milleral@chromium.org>
Commit-Queue: Alex Miller <milleral@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
8bb1f7d8766d202d220879642a7d5c40e2775e52 05-Aug-2013 beeps <beeps@chromium.org> [autotest] Teach the scheduler to abort SpecialTasks.

1. Database migration that adds a column to afe_special_tasks.
2. An rpc that modifies the db with the abort bit.
3. A scheduler method that polls the database for aborted jobs
and handles the agent.

TEST=Scheduled a job and aborted it's special tasks. Checked that
subsequent special tasks were scheduled.
Aborted Repair->host goes into repair fail.
Aborted (Reset, Verify, Cleanup)->Repair queued.
Checked that the Hqe is requeued through PreJobTask epilog.
Aborted SpecialTasks without hqes.
Aborted jobs normally through the frontend.

BUG=chromium:234223
DEPLOY=migrate, apache, scheduler

Change-Id: I1a47bc2d801486a8abdffb44091c59a8f5bdbefc
Reviewed-on: https://gerrit.chromium.org/gerrit/64753
Commit-Queue: Prashanth Balasubramanian <beeps@chromium.org>
Reviewed-by: Prashanth Balasubramanian <beeps@chromium.org>
Tested-by: Prashanth Balasubramanian <beeps@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
dfff2fdc8477be3ba89fd915fde2afe8d3716624 28-May-2013 Alex Miller <milleral@chromium.org> [autotest] Add a provision special task.

We now insert a special task which calls |autoserv --provision| with the
host that the HQE is about to run on to provision the machine correctly
before the test runs. If the provisioning fails, the HQE will also be
marked as failed. No provisioning special task will be queued if no
provisioning needs to be done to the host before the job can/will run.

With *just* this CL, no provisioning tasks should actually get
scheduled, because the part of the scheduler that maps HQEs to hosts
hasn't been taught about provisioning yet. That will come in a later
CL.

Once this CL goes in, it should not be reverted. The scheduler will
become very unhappy if it sees special tasks in its database, but can't
find a corresponding AgentTask definition for them. One would need to
do manual database cleanup to revert this CL. However, since one can
disable provisioning by reverting the (future) scheduling change CL,
this shouldn't be an issue.

BUG=chromium:249437
DEPLOY=scheduler
TEST=lots:
* Ran a job on a host with a non-matching cros-version:* label, and
a provision special task was correctly created. It ran after Reset,
and correctly kicked off the HQE after it finished.
* Ran a job on a host with a matching cros-version:* label, and no
provision special task was created.
* Ran a job on a host with a non-matching cros-version:* label, and
modified Reset so that it would fail. When reset failed, it canceled
the provision task, and the HQE was still rescheduled.
* Ran a job on a host with a non-matching cros-version:* label, and
modified the cros-version provisioning test to throw an exception.
The provision special task aborted the HQE with the desired semantics
(see comments in the ProvisionTask class in monitor_db), and scheduled
a repair to run after its failure.
The provision failures were all deduped against each other when bug
filing was enabled. See
https://code.google.com/p/autotest-bug-filing-test/issues/detail?id=1678
* Successfully debugged an autoupdate/devserver issue from provision
logs, thus proving that sufficient information is collected for debug.

Change-Id: I96dbfc7b001b90e7dc09e1196c0901adf35ba4d8
Reviewed-on: https://gerrit.chromium.org/gerrit/58385
Reviewed-by: Prashanth Balasubramanian <beeps@chromium.org>
Tested-by: Alex Miller <milleral@chromium.org>
Commit-Queue: Prashanth Balasubramanian <beeps@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
07e09aff0baf871b33e5479e337e5e3e0523b729 12-Apr-2013 Dan Shi <dshi@chromium.org> [Autotest] merge cleanup and verify

The objective of this CL is to merge cleanup and verify into a single job to
reduce run time of each test. In existing design, by default, a cleanup job is
scheduled after a test is finished, and a verify job is scheduled before a
test is started. By merging these two jobs together, we are seeing the total
run time of these two jobs is reduced from about 47s to 37s, around 10s saving.
That does not include the saving on scheduler to schedule two jobs, which may
take another 5-10s.

The design is to create a new special task, reset, which runs at the beginning
of a job by default. Verify task is changed to not to run by default before a
job starts. Cleanup job will only be run if a job is scheduled to reboot and
any test failed in that job.

BUG=chromium:220679
TEST=tested with run_suite in local machine
DEPLOY=afe,apache,scheduler,change all users' preference on reboot_after to
Never, sql: |update chromeos_autotest_db.afe_users set reboot_after=0|

Change-Id: Ia38baf6b73897b7e09fdf635eadedc752b5eba2f
Reviewed-on: https://gerrit.chromium.org/gerrit/48685
Commit-Queue: Dan Shi <dshi@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
c1b26769845fe59168f2d9b7d6b1d37d93ea4bf1 26-Jun-2013 Simran Basi <sbasi@chromium.org> Fix duplicate entry Integrity Error when aborting from AFE

Currently aborting a suite job and its sub jobs from the afe causes
the AFE to spit out duplicate entry errors.

This is do the suite job aborting before a child job does and aborts
the child job. However the model object for that child job has not
been updated so we try to abort it as well and create a new
aborted host queue entry for it but it already exists.

Refactored the logic from abort to a class method that takes in a list
of HQE's to abort. This can be shared between abort and the rpc_interface
code.

BUG=chromium:242040
TEST=Started a suite, did a bulk abort and the error no longer occured.

Change-Id: I0d82506234bac5fea9307b5cd20c836cdf7ccb9c
Reviewed-on: https://gerrit.chromium.org/gerrit/60138
Commit-Queue: Simran Basi <sbasi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
9658a95c995f3fbba9612276e61297a31bc18677 15-May-2013 Alex Miller <milleral@chromium.org> [autotest] Check host locking on batch most modifications.

If a batch host modify RPC would lock a host that is already locked,
fail hard and do not modify any of the hosts.

BUG=chromium:238025
TEST=restarted apache, modify_hosts now throws ValidationError
DEPLOY=apache

Change-Id: Ia12ba1346743c6b9608ca497ba60cb5cd25e829e
Reviewed-on: https://gerrit.chromium.org/gerrit/51227
Tested-by: Alex Miller <milleral@chromium.org>
Reviewed-by: Tan Gao <tgao@chromium.org>
Commit-Queue: Alex Miller <milleral@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
3dd8beb386f7298ffe84d7410d00cce26973e170 14-May-2013 Aviv Keshet <akeshet@chromium.org> [autotest] make a consistent CONTROL_TYPE enum across the codebase

Prior to this CL, there were a multitude of duplicate defitions of the
two control files types (Client or Server), incluiding a difference
between the afe Job model (1 = Server) and the afe Test model (1 =
Client). This CL introduces enums CONTROL_TYPE and CONTROL_TYPE_NAMES to
control_data, to act as the central and consistent defition across the
codebase. In order to avoid needing to mangle the running Jobs table, we
have adopted the existing Job model convention (1 = Server); the Test
table will be re-written with the new consistent convention during test
import.

BUG=chromium:240643
TEST=All existing unit tests pass;
In local autotest without this patch applied, started a suite. Halfway
through suite, applied this patch, ran test importer, restarted apache,
and restarted scheduler. Suite finished successfully.
Verified manually that Client/Server type control files show up
correctly in afe Create Job view.
DEPLOY=scheduler
DEPLOY=apache
DEPLOY=test_importer

Change-Id: Ia5b2573e1d08d96b3826f2837903ef407dcae303
Reviewed-on: https://gerrit.chromium.org/gerrit/51191
Commit-Queue: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
4df3925d82e8155afd465ed0ec408e0796e9602e 19-Mar-2013 Dan Shi <dshi@chromium.org> [Autotest] Add stat to create_job and create_suite_job RPCs

Count rpc calls, including create_job and create_suite_job using
site_utils/graphite/stats.

BUG=chromium-os:196374
TEST=manually run in local machine

Change-Id: I632fb73a64f6360066ce6594761886d1f44f0607
Reviewed-on: https://gerrit.chromium.org/gerrit/45876
Reviewed-by: Alex Miller <milleral@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
cd1ff9b72bd73c7308145750f07908b26c5d08da 01-Mar-2013 Aviv Keshet <akeshet@chromium.org> [autotest] Add test_retry field to afe_jobs table

Does what it says on the tin.

CQ-DEPEND=If8134fe263bb33ee5d52bc92e78faee05388b239

BUG=chromium-os:37158
TEST=database/migrate.py sync, ensure that jobs can still be viewed in
afe. Ensure that new column exists and is zeroed out for all jobs
already in db. Kick off a smoke suite and ensure that it runs.

Change-Id: I0790d60d7c86d9278507b46ae1579a7b72b20c5a
Reviewed-on: https://gerrit.chromium.org/gerrit/44427
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Commit-Queue: Scott Zawalski <scottz@chromium.org>
Tested-by: Scott Zawalski <scottz@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
73dae55766b9c8b6922194901e334c4e52f67d14 25-Feb-2013 Simran Basi <sbasi@chromium.org> Autotest AFE: Replace Reinstall button with Repair.

It is sometimes useful to kick off a repair job from the AFE, added
a new repair button to the host info page.

BUG=chromium:39213
TEST=compiled locally and verified that when I click repair a repair
job is kicked off. Also added a new unittest and ensured the old
ones still worked.

Change-Id: I71533987eb353e52b2b7fd32725adf00df017bc9
Reviewed-on: https://gerrit.chromium.org/gerrit/43975
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
a713e2575a9ea59db59444deb29a951a395aec7e 01-Mar-2013 Alex Miller <milleral@chromium.org> [autotest] Do not allow unicode control files.

Our system does not properly handle non-ascii characters. Therefore,
rather than having the scheduler explode somewhere down the line, let's
just explicitly disallow control files that contain unicode characters.

BUG=chromium-os:39337
TEST=local run_suite

Change-Id: Id2dcee75087803f1bd4236872f75e71039ae034b
Reviewed-on: https://gerrit.chromium.org/gerrit/44401
Tested-by: Alex Miller <milleral@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Commit-Queue: Alex Miller <milleral@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
0b9cfc93f17ec81535de54e3bae4f5f0e8d8595b 05-Feb-2013 Aviv Keshet <akeshet@chromium.org> [autotest] Add parent_job field to database and models

Adds a parent_job field to dbmodels, and a parent_job_id column to the
afe jobs table, allowing jobs to have some notion of referring to parent
jobs that may have kicked them off (for instance, in a dynamic suite --
to be implemented in future commit).

BUG=chromium-os:38253
TEST=Ran database/migrate.py sync . Ensuree that previous jobs can still
be viewed in the afe, and than a new parent_job_id column has been
created in afe jobs table (via mysql client). Ran a smoke suite
successfully.
CQ-DEPEND=CL:Ie45aac1b741b1282ddf792812480bc1f4d35278a

Change-Id: Iadfedc2a9e8f603ab223c87ed7c1510a46622216
Reviewed-on: https://gerrit.chromium.org/gerrit/42673
Commit-Queue: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
34217022229b755bc1ee52f83665acba76bd5044 06-Nov-2012 Simran Basi <sbasi@chromium.org> Autotest: Increase run timeout granularity

This CL modifies all references to max_runtime_hrs to instead be
max_runtime_mins. This includes the django models, rpc interfaces, the
cleanup timeout code, and the frontend java views.

The frontend java code will need to be recompiled once this commits to
prevent the frontend from breaking.

The cleanup timeout pathway has been adjusted to find all timedout jobs
by minute, and has been changed to run every 5 minutes vs every hour as
before.

BUG=chromium-os:36067
TEST=Ran on my local afe, ensure that jobs can still be created correctly,
and jobs with short timeouts do indeed get aborted when expected.

Change-Id: Idfdeb3f1d4947d6b2e6b48127a31db535704e972
Reviewed-on: https://gerrit.chromium.org/gerrit/37827
Tested-by: Simran Basi <sbasi@chromium.org>
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Ready: Simran Basi <sbasi@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
a8a0d75c2591ab872f695d7b8f22f2ca10493dab 08-Nov-2012 Scott Zawalski <scottz@chromium.org> Revert "Autotest: Increase run timeout granularity"

This causes autoupdate problems, see bug crosbug.com/36183

This reverts commit daffa57a6738c2a80caee1f311a527313ece1207

Change-Id: Iad65be9bf1b0ea329866bfdc764b0089c4f9b2a5
Reviewed-on: https://gerrit.chromium.org/gerrit/37657
Commit-Ready: Scott Zawalski <scottz@chromium.org>
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Tested-by: Scott Zawalski <scottz@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
daffa57a6738c2a80caee1f311a527313ece1207 06-Nov-2012 Simran Basi <sbasi@chromium.org> Autotest: Increase run timeout granularity

This CL modifies all references to max_runtime_hrs to instead be
max_runtime_mins. This includes the django models, rpc interfaces, the
cleanup timeout code, and the frontend java views.

The frontend java code will need to be recompiled once this commits to
prevent the frontend from breaking.

The cleanup timeout pathway has been adjusted to find all timedout jobs
by minute, and has been changed to run every 5 minutes vs every hour as
before.

BUG=chromium-os:36067
TEST=Ran on my local afe, ensure that jobs can still be created correctly,
and jobs with short timeouts do indeed get aborted when expected.

Change-Id: Id7668bbd05a9b02c22e7c549fac232fae02fc728
Reviewed-on: https://gerrit.chromium.org/gerrit/37479
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Commit-Ready: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
/external/autotest/frontend/afe/rpc_interface.py
d23bc19b7d23b3bde3d5bc43447445ca118bf786 09-Feb-2011 Eric Li <ericli@chromium.org> Add --image support for autotest web frontend.

An easy extension based on Paul's dean recent work.

Change-Id: I1117f779297b6f12a8abd3688718a0480548ccf2

BUG=none
TEST=Tested with the frontend web gui.
1. Create Job w/o image update url.
2. View Job details w/o image update url.
3. Clone Job w/o image update url.

Verified job with image parameter was properly saved in db.

What else I missed?

Review URL: http://codereview.chromium.org/6460003
/external/autotest/frontend/afe/rpc_interface.py
5a8c6ad7e67d86090ed6c4ef216b82e45c0f9283 01-Feb-2011 Paul Pendlebury <pauldean@chromium.org> Add support for an --image flag to atest.

This enables creating jobs from the CLI that use autoserv to install a new OS image before running the requested test.

This was not added to the database like the reboot before/reboot after flags to maintain backward compatibility and avoid any changes to the database schema.

Also it is not working as a pure parameterized job as the current implementation is not 100% complete and would require more work to finish. And since mixed jobs are not allowed it would also mean moving existing control file jobs to parameterized jobs.

So the implementation of adding a parameterized id to control jobs and using a known test to hold the OS image path is the most straight forward of the options.

Change-Id: I77cdda0c50c222a4c594da2626a71fa55f5957cb

BUG=chromium-os:11486
TEST=Manual testing using atest cli to create jobs with --image parameters and verifying the value is passed to autoserv.

Review URL: http://codereview.chromium.org/6181003
/external/autotest/frontend/afe/rpc_interface.py
4a41e0145c2ede3605d19cdfacb779ca6aca1ccc 17-Jul-2010 jamesren <jamesren@592f7852-d20e-0410-864c-8624ca9c26a4> Begin adding support for parameterized jobs.

This will allow test developers to specify certain parameters that a test
control file may take, so that users can then easily set those parameters
on job create. Enabling this feature removes the ability to edit the
control file directly on job creation.

Feature is currently INCOMPLETE. Do not attempt to use. This feature will
be committed in small pieces for the sake of having smaller code reviews.

Signed-off-by: James Ren <jamesren@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@4720 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
f8c6307dc5abe8013a9824b1f45dcbe3f7a59f87 15-May-2010 jamesren <jamesren@592f7852-d20e-0410-864c-8624ca9c26a4> Replace case-sensitive logic in create_job with case-insensitive logic. The
MySQL database performs case-insensitive searches by default.

Signed-off-by: James Ren <jamesren@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@4490 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
76fcf19ec42d5c7580d2e7891e4610e5fe725286 21-Apr-2010 jamesren <jamesren@592f7852-d20e-0410-864c-8624ca9c26a4> Add ability to associate drone sets with jobs. This restricts a job to
running on a specified set of drones.

Signed-off-by: James Ren <jamesren@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4439 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
2275ef1f0f92093cd9bb406acf5c3fbc0bd47b6b 12-Apr-2010 jamesren <jamesren@592f7852-d20e-0410-864c-8624ca9c26a4> Implement creation and cloning of hostless jobs from AFE Create Job tab

Signed-off-by: James Ren <jamesren@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4405 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
dd855244f44b65d0508345c6fef74846652c8c26 02-Mar-2010 jamesren <jamesren@592f7852-d20e-0410-864c-8624ca9c26a4> Abstract out common models used in the frontend's models.py so that django is not required to interact with non Django portions of the code.

This includes the enums RebootBefore, RebootAfter and Test.Type


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4280 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
4d23375ff9b95e95e9f1d8443d20122f7270c1f4 20-Jan-2010 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Move logic for job reboot before/after defaults from RPC method to job model. Also adding a reference to the host protections enum in the Host model as a convenience for some other code I'm working on.

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4157 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
c1a98d1e146080bd3e4f034cb13d740dfb1535f4 15-Jan-2010 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Support for job keyvals
* can be passed as an argument to create_job, stored in AFE DB
* scheduler reads them from the AFE DB and writes them to the job-level keyval file before the job starts
* parser reads them from the keyval file and writes them to the TKO DB in a new table

Since the field name "key" happens to be a MySQL keyword, I went ahead and made db.py support proper quoting of field names. Evetually it'd be really nice to deprecate db.py and use Django models exclusively, but that is a far-off dream.

Still lacking support in the AFE and TKO web clients and CLIs, at least the TKO part will be coming soon

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4123 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
c510344e16543a6f810be1608e1a879c3d3bbcde 15-Jan-2010 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Slight change to SpecialTask scheduling code. This is to support my work on a new AFE interface.

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4118 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
64a9595406f2884fb3ece241190b10aa054439a9 13-Jan-2010 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> When using Django models from a script, make the current user default to an actual database user named "autotest_system". This allows for simpler, more consistent code.

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4114 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
4608b005f15444d2ec4601b8274828ad52b5ea51 05-Jan-2010 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Add a new Archiving stage to the scheduler, which runs after Parsing. This stage is responsible for copying results to the results server in a drone setup, a task currently performed directly by the scheduler, and allows for site-specific archiving functionality, replacing the site_parse functionality. It does this by running autoserv with a special control file (scheduler/archive_results.control.srv), which loads and runs code from the new scheduler.archive_results module. The implementation was mostly straightfoward, as the archiving stage is fully analogous to the parser stage. I did make a couple of refactorings:
* factored out the parser throttling code into a common superclass that the ArchiveResultsTask could share
* added some generic flags to Autoserv to duplicate special-case functionality we'd added for the --collect-crashinfo option -- namely, specifying a different pidfile name and specifying that autoserv should allow (and even expect) an existing results directory. in the future, i think it'd be more elegant to make crashinfo collection run using a special control file (as archiving works), rather than a hard-coded command-line option.
* moved call to server_job.init_parser() out of the constructor, since this was an easy source of exceptions that wouldn't get logged.

Note I believe some of the functional test changes slipped into my previous change there, which is why that looks smaller than you'd expect.

Signed-off-by: Steve Howard <showard@google.com>

==== (deleted) //depot/google_vendor_src_branch/autotest/tko/site_parse.py ====


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4070 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
4e545a5ef263106c2d5316ad02c6c14b8d28e5b2 19-Dec-2009 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Adds a command line tool to reverify all Repair Failed hosts.
Also adds a convenience function to server.frontend to make this RPC call.
The reverify_hosts RPC now returns a list of hostnames sent to be
reverified so that the command line tool can print a list.

Signed-off-by: Gregory Smith <gps@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4028 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
a9545c0ab3d8f3e36efadaefdcf37393708666d9 18-Dec-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> backend support for hostless jobs
* support in rpc_interface.create_job() and models for creating a hostless job -- a job with one queue entry with no host, meta_host or atomic_group
* support in scheduler for recognizing and executing such a job. the bulk of the work was in extracting an AbstractQueueTask class from QueueTask, containing all the logic not pertaining to hosts. I then added a simple HostlessQueueTask class also inheriting from it.
Also got rid of HostQueueEntry.get_host() and added an extra log line when AgentTasks finish (used to be for QueueTasks only).

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4018 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
232b7aecb0df153af9e6dca62bb6194acbfd709c 10-Nov-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Added a upload_kernel_config (default False) keyword parameter to
generate_control_file RPC that produces server side code to download and
transfer on the client the kernel config (if it's an URL) and point the
client to the new location. This allows to have kernel config URLs point
to servers that are reachable on the server side but not on the client
side.

Signed-off-by: Mihai Rusu <dizzy@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3920 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
91f8510c0fabcdbc3108034ce4d573a3f68fe567 12-Oct-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> NOTE: This depends on the (not yet committed) patches mailed out to add default_profile_only support to the job classes.

Add a new parameter to the control file generation RPCs to generate
control files that make use of the new set_default_profile_only
API.

Risk: Low
Visibility: Adds a new optional parameter to generate_control_file

Signed-off-by: John Admanski <jadmanski@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3829 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
8aa84fcb18489265208f291a7fc3c33799696eae 16-Sep-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> make invalid hosts viewable in the AFE view host tab

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3729 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
ce7c092dd0d866eb0c81eb795e9372267e04c7f9 11-Sep-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Added checking to RPC modify_host() to fail if locking/unlocking has
been requested on an already locked/unlocked host. Updated frontend
doctests.

Visibility: Since this RPC seems to be used only by the CLI (the web
interface uses modify_hosts() RPC) the change will be visible to the CLI
when you try to lock/unlock hosts that are already locked/unlocked.

Signed-off-by: Mihai Rusu <dizzy@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3705 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
8cc058f50a46976e0a446aa3054f7f2349d6291a 08-Sep-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Make scheduler more stateless. Agents are now scheduled only by the
dispatcher, and agents no longer use in-memory state to remember
multiple tasks. All state is managed by the database.

Risk: high (large scheduler change)
Visibility: medium (scheduler restarts are now more stable)

Signed-off-by: James Ren <jamesren@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3664 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
a3c58d20be69a292bdfafbea735c7503f4995b4c 25-Aug-2009 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Added support to specify cmdline for the booted kernels for both the CLI
and the frontend. For the CLI there is a new "--kernel-cmdline" option
that will be used for all the kernels configured to be booted with the
"-k" parameter. For the frontend there's a new textbox under the kernel
version one where cmdline can be provided.

Signed-off-by: Mihai Rusu <dizzy@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3599 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
be0d8692a68c879c4d03a39789bf249b8178114e 21-Aug-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Remove the ability for host status to be modified via the frontend.
This interferes with the monitor_db scheduler as it owns the field.

Signed-off-by: Gregory Smith <gps@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3584 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
87cc38ffa581c0b82e6e69ffd8538db15f9f393a 21-Aug-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Add the ability to exclude hosts in an atomic group from the get_hosts RPC.

Signed-off-by: Gregory Smith <gps@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3581 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
1a5a408d993bd406b58395904a4bcfe2c993cce7 28-Jul-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> add get_special_tasks() RPC, useful for scripts looking at repairs on a machine etc

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3452 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
c0ac3a79cceec87873257a8b6d41d19c9fb02ec6 08-Jul-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> add the option to include verify/repair/cleanups in the job table on the host detail page.
* added RPC get_host_queue_entries_and_special_tasks, which returns both HQEs and SpecialTasks for a host in a carefully interleaved manner.
* added appropriate frontend unit tests
* added support to HostDetailView to include these entries, but have them not be selectable. this required changes to SelectionManager. I also added a utility method to Utils for opening a new window, and changed all sites that do that to call the new method.

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3385 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
909c914c55da05961c46621da856fecc73168ccb 07-Jul-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Return the atomic group name as part of the RPC interface get_hosts() call.

Signed-off-by: Gregory Smith <gps@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3382 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
2fe3f1df42f5fd1dc6296219df289851dcf77025 06-Jul-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Enter all Verify/Cleanup/Repair tasks into the special_tasks table. Also
keep track of which Host Queue Entry (if any) each Verify/Cleanup/Repair
task belongs to. Additionally, implement recovery for jobs in
Verify/Cleanup/Repair (i.e., do not simply reverify the host and requeue
the job).

Risk: medium (scheduler changes)
Visibility: medium (functionality change)

Signed-off-by: James Ren <jamesren@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3372 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
e9450c934d860f154175abfee19389bf1a114305 30-Jun-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Change the default for the max_number_of_machines in atomicgroups to be infinite*. (* see definition of INFINITE_MACHINES).
The common use for rack tests is to want all machines in the group to be used.

Signed-off-by: Gregory Smith <gps@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3328 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
c873032a61c06fb21e5caf9466b412321e2d5a49 30-Jun-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Infer the atomic group automatically by looking at the meta host when
creating a job.

This means that the -G atomicgroupname parameter on cli/atest is unnecessary
when giving an atomic group label name directly.

It also makes it possible to schedule onto atomic group labels via the GUI
rather than getting an error message.

Signed-off-by: Gregory Smith <gps@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3324 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
d86debefb7364d0f4631bb6772594642a5da2782 10-Jun-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> fix a typo in generate_control_file that was messing up the check for no tests but not erroring due to a funny coincidence

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3242 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
6d7b2ff05b2232b1b225a4cb3521d76c0152cad9 10-Jun-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Redesign the reverify hosts feature. Host status is no longer changed
from the frontend; scheduler deals with all status changes.

Risk: medium (scheduler behavior change)
Visibility: low

Signed-off-by: James Ren <jamesren@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3238 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
bc93f0f9e11345d39ac655612e8697a2e07ed70c 10-Jun-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Make launching jobs on atomicgroups more user friendly:
Allow atomic group names to be specified on create_job as meta_hosts without
demanding that they be supplied in the atomic_group_name parameter.

Signed-off-by: Gregory Smith <gps@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3237 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
8765816bbc4055458169db9c9bf9977322172acc 29-May-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Creating a job from the command line now inherits reboot before/after
settings specified in the AFE User Preferences.

Risk: low
Visibility: medium (minor functionality change)

Signed-off-by: James Ren <jamesren@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3182 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
cafd16e33f658f63fcbe09b0f232bbeb354ae3c2 29-May-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Check for multiple platforms on a machine when modifying labels.

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3179 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
276f9443bbfc12c781d86f51dab5d8988e2090f5 20-May-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Added ability to lock/unlock machines from the AFE Host List view

Risk: low
Visibility: medium (UI change)

Signed-off-by: James Ren <jamesren@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3150 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
a965cef89e47cf2ceb5742ce8948d4f4f5e759ba 16-May-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Added ability to clone jobs on all failed hosts.

Risk: low
Visbility: medium (UI change)

Signed-off-by: James Ren <jamesren@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3144 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
1ff7b2e88ae7a382f85ab76e786a471134e8a6a0 16-May-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Add ability to reverify a host from the Host List.

Risk: low
Visilibity: medium (UI change)

Signed-off-by: James Ren <jamesren@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3143 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
12f3e3212795a539d95973f893ac570e669e3a22 13-May-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Add job maximum runtime, a new per-job timeout that counts time since the job actually started.
* added started_on field to host_queue_entries, so that we could actually compute this timeout
* added max_runtime_hrs to jobs, with default in global config, and added option to create_job() RPC
* added the usual controls to AFE and the CLI for the new job option
* added new max runtime timeout method to
* added migration to add new fields and set a safe default max runtime for existing jobs

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3132 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
a1e74b3e9d68792fae0c926f89b6de1736b1fe21 12-May-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Add job option for whether or not to parse failed repair results as part of a job, with a default value in global_config. Since the number of options associated with a job is getting out of hand, I packaged them up into a dict in the RPC entry point and passed them around that way from then on.

Signed-off-by: Steve Howard <showard@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@3110 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
f8b19046c4496f570c776b65288382108a633ab4 12-May-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Add the ability for users to add test attributes. Non-user-created attributes (added by the parser) are still immutable.
* add boolean column user_created to TestAttribute to keep track of which are user created, so we can preserve immutability
* add id primary key field to test attributes. Django requires this and we've been squeezing by without it, but we can't anymore.
* declare some PK fields AutoFields in TKO models, as they should be. this didn't matter before but does now that we have a TKO unit test, since these models determine how the test DB gets created.
* add set_test_attribute RPC to set/delete attributes
* modify get_detailed_test_views() to use the new populate_relationships() method to gather attributes and labels much more efficiently
* add rpc_interface_unittest, a unit test for the TKO rpc interface. TKO was previously completely untested, so this is the first unit test of any kind for it. since the doctests on AFE turned out to be quite unpopular, I'm using the unittest framework this time. this required some changes to AFE testing code.
* various fixes to model_logic to account for assumptions we were previously making that aren't true in TKO (mostly about PK fields being named "id").

Note that the migration may be slow, as it's adding two columns to test_attributes, a potentially large table.

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3109 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
0957a848a17b726836aaf9b5532bbfac691d983d 11-May-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Add host attributes to AFE. Nothing actually uses them; they're purely for users and scripts to use. Initial implementation is minimal - new migration, new model, RPCs to set and delete, and inclusion of attributes in get_hosts() results. No CLI or frontend support.

The change to get_hosts() is of primary interest here, since it involves a general problems that occurs many places in Autotest -- gathering relationships over many items. This has been solved in two ways previously:
* inefficiently in most places, by doing a query for each object (i.e. get_hosts()).
* efficiently in one place (JobManager.populate_dependencies()), by doing a single query to get a pivot table and then postprocessing to gather relationships for each object.

This time, I went ahead and implemented a general solution, a generalized version of JobManager.populate_dependencies(). I removed populate_dependencies() and made get_jobs() use the new general version instead, and I made get_hosts() use the new version for all its relationships, including the new attributes relationship. This should speed up get_hosts() considerably. In a future change I'll apply this solution to get_test_views() over in TKO land, since that would also greatly benefit in performance.

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3102 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
4d07756ac199e75f9303eb32fdade43277bc8848 08-May-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Added ability to clone a job on specific hosts.

Risk: low
Visibility: medium (UI change)

Signed-off-by: James Ren <jamesren@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3100 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
29f7cd27e51add2648fb62ab2a0c588f9acb1ec4 29-Apr-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Here is a patch, which extends the autotest system with recurring job
executions. When you create a new recurring job, you can specify:
- start time (on server)
- loop count (0 means infinite): how many times it will executed
- loop period: how many time will wait between two execution

Added features:
- Create job: can create Template job.
- View job: added "Create recurring job"
- New tab "Recurring job"
- list of recurring jobs
- can click on it to view the executed job
- selection support
- Action -> remove
- creation panel (can be accessible thru "Create recurring job")
- submit/create
- reset
- data validity check

From: Zoltan Sogor <weth@inf.u-szeged.hu>
Signed-off-by: Steve Howard <showard@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@3064 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
d04b4b6cdb0a22b0f7b2c1b150c6834f065d76c7 27-Apr-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Changed get_hosts() rpc call to return the acls to which the hosts
belong as well. This info is then used to display the ACLS to
which a host belongs in the HostDetailView tab in AFE.

Signed-off-by: Travis Miller <raphtee@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3041 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
b7a52fd2431275381b3ecab7d631a135fb613866 27-Apr-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> globalInitialize() starts a timer and every 10 minutes requests
the motd again and sets the string in the dom.

Signed-off-by: Travis Miller <raphtee@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3040 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
d3dc199703bfb8784a2f8f072d0514532c86c0a9 22-Apr-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Add support to the scheduler to run autoserv --collect_crashinfo after a job finishes or is aborted.
* added new state "Gathering" for when we're running collect_crashinfo and copying logs to the results repository
* added new GatherLogsTask to the scheduler to perform these two tasks, and made it get run either after a job finishes or after a job is aborted. this task shares a lot with FinalReparseTask, so extracted common code into a new PostJobTask.
* made changes to scheduler/drone code to support generic monitoring and recovery of processes via pidfiles, since we need to be able to recover the collect_crashinfo processes too. this will also made the scheduler recover parse processes instead of just killing them as it does now, which is nice.
* changed abort logic significantly. since we now need to put aborted jobs through the gathering and parsing stages, but then know to put them into "aborted" afterwards, we can't depend on the old path of abort -> aborting -> aborted statuses. instead, we need to add an "aborted" flag to the HQE DB table and use that. this actually makes things generally cleaner in my opinion -- for one, we can get rid of the "Abort" and "Aborting" statuses altogether. added a migration to add this flag, edited model and relevant logic appropriately, including changing how job statuses are reported for aborted entries.

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3031 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
3181c7baa64106cb176f26dcc6b1f9ea87141382 20-Apr-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Prevent jobs from being created via the RPC interface that will be impossible
to schedule due to labels that conflict with the supplied atomic group (or
lack thereof) being specified as meta_hosts or dependencies.

Signed-off-by: Gregory Smith <gps@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3018 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
47d9e7dae3d9edfc8bd153f627307b44801d31fb 20-Apr-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Prevent creating jobs via the frontend directly on hosts in an atomic group
if the atomic group was not requested for that job.

Signed-off-by: Gregory Smith <gps@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3017 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
3562a064089d02e86e40a5ccca2f753afc341a83 13-Apr-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Fix get_info_for_clone() when the HQE has no atomic_group.

Signed-off-by: Gregory Smith <gps@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@2984 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
c92da83b2dd5b7992a58081c6005b3dfb3dc5f3a 07-Apr-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Add support for atomic groups to the frontend RPC interface.

Signed-off-by: Gregory Smith <gps@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@2967 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
451954477f807e31a3b82a85d914807f4cf66a80 17-Feb-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> When cloning a job with preserve_metahosts=False, keep all entries, even if the eventually assigned host when then deleted.

Signed-off-by: Steve Howard <showard@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2810 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
93c80e69e7f3547d722d4ec3719c83895d52b1f7 03-Feb-2009 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Filename for rpc_test.txt is wrong

Signed-off-by: Martin Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2733 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
94ae6d6686befa237773954bda9e721dbd6595be 03-Feb-2009 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Add help text for the new reboot before/after rpc params.

Signed-off-by: Jeremy Orlow <jorlow@google.com>




git-svn-id: http://test.kernel.org/svn/autotest/trunk@2732 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
120351e0c9a9b3e7c7a4aa51477a5ae2366214c4 24-Jan-2009 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Allow control file body text to be supplied as an alternative to a list
of test names for the generate_control_file AFE rpc.

This allows the command line client to let people specify a kernel along with
their own client-side control file.

It adds the kernel installation steps to the supplied control file before
scheduling it (using the same code as the GUI when a kernel is specified
there).

Signed-off-by: Gregory Smith <gps@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2684 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
65c267df570f3e827c8a700f3746c26fcab0da77 21-Jan-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Check synch_count in RPC method, before job gets created. Also remove a call to save() which was redundant (it gets called in add_object()). It was misleading and was probably what led to the erroneously placed check on synch_count.

Signed-off-by: Steve Howard <showard@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2661 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
8fbae65f091151643460b14a1fd0c933b7090d43 21-Jan-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> First pass at an implementation of a message of the day. Decided
that storing the motd in a file called motd.txt in the same dir
as rpc_interface.py was the simplest solution.

Signed-off-by: Travis Miller <raphtee@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2659 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
0c18519078035741b9f86c3db65b7cb98e9d4e09 16-Jan-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> When aborting host queue entries, completely ignore completed entries. They get ignored eventually anyway, but if we include them here, we can end up erroneously rejecting abort requests for synchronous jobs.

This happens because entries that fail verify get their execution_subdir set to their hostname. Then, when we see the abort, we find only one entry with that execution tag while the sync_count is >1, so we think the user is aborting part of a synchronous execution and throw an exception.

Signed-off-by: Steve Howard <showard@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2658 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
5a198b91a2d3ca37943d02628886aac19ee04283 11-Dec-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Add 'Verifying' to class Job so that View Job allows users to view machines
that are 'stuck' in verify or taking a long time in cleaning

Signed-off-by: Scott Zawalski <scottz@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2560 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
2e9415ff78190fcc6f1c6c9cb6ca5529316b7248 05-Dec-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Preparation for adding a widget to edit job dependencies in the create job view in AFE. I haven't quite finalized how to add the widget so it's not there yet, but this puts the piece in place, and also fixes a bug with job cloning and dependencies.

Signed-off-by: Steve Howard <showard@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2547 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
25087accde32cf921991e6a20aea35986141cec4 24-Nov-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Return a decent error message when an invalid label is passed to create_job() as a metahost.



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2505 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
43a3d26e49662d06e145ed94a0c2dfb2b455126f 12-Nov-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Add a checkbox 'exclude "only if needed" labels' to host lists in AFE, checked by default in the create job view.
-add exclude_only_if_needed_labels argument to get_hosts() and get_num_hosts() RPCs
-move some code from tko.models.TestViewManager up into model_logic, since AFE now needs it to create a custom join for doing many-valued exclusion



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2405 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
dc8175153fc559d1e7ae605b15ceef66e25e7cde 12-Nov-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> allow users to abort other users' jobs, but only for machines that are both ACL-accessible and *not* in the "Everyone" ACL.



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2404 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
be3ec04ed2053527e19c1593eda0184f18799868 12-Nov-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Return an actually useful error when one of the bulk RPCs is called (i.e. label_add_hosts) and some of the objects (hosts in this case) do not exist.



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2403 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
2bab8f45adedeacbf2d62d37b90255581adc3c7d 12-Nov-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Implement sync_count. The primary change here is replacing the job.synch_type field with a synch_count field. There is no longer just a distinction between synchronous and asynchronous jobs. Instead, every job as a synch_count, with synch_count = 1 corresponding to the old concept of synchronous jobs. This required:
-changes to the job creation RPC and corresponding client code in AFE and the CLI
-massive changes to the scheduler to schedule all jobs in groups based on synch_count (this unified the old synch and async code paths)
-changed results directory structure to accomodate synchronous groups, as documented at http://autotest.kernel.org/wiki/SchedulerSpecification, including widespread changes to monitor_db and a change in AFE
-changes to AFE abort code to handle synchronous groups instead of just synchronous jobs
-also got rid of the "synchronizing" field in the jobs table, since I was changing the table anyway and it seems very likely now that that field will never be used

other changes included:
-add some logging to afe/models.py to match what the scheduler code does, since the scheduler is starting to use the models more
-added checks for aborts of synchronous groups to abort_host_queue_entries RPC



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2402 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
5deb67762f941ba8c8a5810795d7a2d8a55575da 04-Nov-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Add two missing status descriptions to the AFE dictionary of status messages, for "Parsing" and "Stopped".



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2375 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
0fc3830f17d644bab74bfe38556299f5e58bc0fa 23-Oct-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Add user preferences for reboot options, including simple user preferences tab which could later be expanded to include more options.


git-svn-id: http://test.kernel.org/svn/autotest/trunk@2330 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
21baa459ea14f96e06212f1f35fcddab9442b3fc 21-Oct-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Add options to control reboots before and after a job.

-add reboot_before and reboot_after fields to Job, along with enums for each
-add options to create_job RPC for reboot_before and reboot_after
-add options to job create CLI for these fields, and made job stat -v display them
-add widgets to job create page in AFE for these fields and made job detail view display them

-add dirty field to Hosts, defaulting to True, and set to True when a host is locked
-made scheduler set this field when a job runs and clear it when a host is rebooted

-updated scheduler's PidfileRunMonitor to read a new three-line .autoserv_execute format, where the third line contains the number of tests that failed
-made scheduler Job.run() include a RebootTask before the verify task according to the reboot_before option
-made QueueTask.epilog() launch a RebootTask for each host according to the reboot_after option

-updated autoserv to write out a third line to .autoserv_execute containing the number of failed tests.

Other changes:
-added support for displaying Job.run_verify in the CLI (job stat -v) and job detail page on AFE
-updated ModelExtensions to convert BooleanField values to actual booleans. The MySQL Django backend just leaves them as ints (as they are represented in the DB), and it's stupid and annoying (Yes, bool is a subclass of int, so it's often not a problem. But yes, it can be.).
-get rid of use of Job.synch_count since we don't actually support it. I think this was meant for inclusion in a previous change and got left out.
-made the scheduler use the new setup_django_environment stuff to import and use the django models. It doesn't *really* use the models yet -- it just uses the Job.Reboot{Before,After} enum objects -- but this shows we could easily start using the models, and that's definitely the direction I want to go long term.
-refactored PidfileRunMonitor generally and made it a bit more robust by having it email errors for corrupt pidfiles and continue gracefully, instead of just crashing the scheduler
-changed the way Agent.tick() works. now, it basically runs through as much work as it can in a single call. for example, if there's a RebootTask and a VerifyTask, and the RebootTask has just finished, in a single call it will finish up the RebootTask and start the VerifyTask. this used to take two cycles and that was problematic for cases like this one -- the RebootTask would like to set host.status=Ready, but then the host could get snatched up on the next scheduling round, before the VerifyTask got started. This was sort of solved previously by keeping the HostQueueEntry active, and we could apply that approach here by making a new status for HostQueueEntries like "Rebooting". But I prefer this approach as I think it's more efficient, more powerful and easier to work with.

Risk: extremely high
Visibility: new reboot options for jobs, skip verify now displayed in AFE + CLI

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@2308 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
9dbdcda5104991cbf344ea5cba1aa58e1af444f3 14-Oct-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Add feature to abort individual host queue entries the job detail and host detail pages. Performed a few other cleanups along the way.
-refactor TableActionsPanel, extract separate TableSelectionPanel
-make TableDecorator support a SelectionManager and a TableActionsPanel (or selection panel or other such control) just above the paginator. this makes it really easy to add selection capability, selection checkboxes, and an actions menu to any table.
-refactor TableDecorator in general since it kinda sucked
-change all existing code that does table selection to use the new TableDecorator support. this include job list view, the create job host selector (which now uses the common selection links instead of its old buttons), and tko.TableView.
-add selection support + a bulk abort action to the tables in job detail view and host detail view. this itself was easy given the above refactorings.


git-svn-id: http://test.kernel.org/svn/autotest/trunk@2283 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
b1e5187f9aa303c4fc914f07312286d302b46a0e 07-Oct-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Get the scheduler unittest to run against SQLite!

* get rid of monitor_db.DatabaseConn, and make monitor_db use the new DatabaseConnection
* modify some queries in monitor_db that weren't SQLite-compatible (SQLite doesn't support TRUE and FALSE literals)
* add frontend/django_test_utils.py, which contains utilities to
* setup a django environment (something manage.py normally does for you)
* replace the configured DB with a SQLite one, either in-memory or on disk
* run syncdb on the test DB
* backup and restore the test DB, handy because then we can syncdb once, save the fresh DB, and quickly restore it between unittests without having to run syncdb again (syncdb is terribly slow for whatever reason)
* modify monitor_db_unittest to use these methods to set up a temporary SQLite DB, run syncdb on it, and test against it
* replace much of the data modification code in monitor_db_unittest with use of the django models. The INSERTs were very problematic with SQLite because syncdb doesn't set database defaults, but using the models solves that (django inserts the defaults itself). using the models is much cleaner anyway as you can see. it was just difficult to do before, but now that we've got the infrastructure to setup the environment anyway, it's easy. this is a good model for how we can make the scheduler use the django models eventually.
* reorder fields of Label model to match actual DB ordering; this is necessary since monitor_db depends on field ordering
* add defaults to some fields in AFE models that should've had them
* make DatabaseConnection.get_test_database support SQLite in files, which gives us persistence that is necessary and handy in the scheduler unittest
* add a fix to _SqliteBackend for pysqlite2 crappiness

The following are extras that weren't strictly necessary to get things working:
* add a debug feature to DatabaseConnection to print all queries
* add an execute_script method to DatabaseConnection (it was duplicated in migrate and monitor_db_unittest)
* rename "arguments" to "parameters" in _GenericBackend.execute, to match the DB-API names
* get rid of some debug code that was left in monitor_db, and one unnecessary statement

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@2252 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
56e9377c6d618ba478bc2ca92679830ece8dff52 06-Oct-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Get the frontend unittest to run against SQLite. This required scattered changes:
* change frontend_unittest to tell django to use an in-memory SQLite database. ideally this would've been the only change necessary, but it wasn't.
* change long to ints in the doctests, as that's what pysqlite2 returns
* change several imports to use autotest_lib; that's the way everything should be, and the other way breaks things when trying to run stuff without using manage.py
* make readonly_connection better support testing by changing its connection attribute into a method, and adding the capability to disable the module completely during testing
* get rid of use of GROUP_CONCAT in models.py; SQLite doesn't support it (not in our old version anyhow), and it;s really not necessary anyway



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2244 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
989f25dcbb6361218f0f84d1c8404761b4c39d96 01-Oct-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> two new major features:

(1) added test and job dependencies
-added M2M relationship between tests and labels and between jobs and labels, for tracking the labels on which a test/job depends
-modified test_importer to read the DEPENDENCIES field and create the right M2M relationships
-modified generate_control_file() RPC to compute and return the union of test dependencies. since generate_control_file now returns four pieces of information, i converted its return type from tuple to dict, and changed clients accordingly.
-modified job creation clients (GWT and CLI) to pass this dependency list to the create_job() RPC
-modified the create_job() RPC to check that hosts satisfy job dependencies, and to create M2M relationships
-modified the scheduler to check dependencies when scheduling jobs
-modified JobDetailView to show a job's dependencies

(2) added "only_if_needed" bit to labels; if true, a machine with this label can only be used if the label is requested (either by job dependencies or by the metahost label)
-added boolean field to Labels
-modified CLI label creation/viewing to support this new field
-made create_job() RPC and scheduler check for hosts with such a label that was not requested, and reject such hosts

also did some slight refactoring of other code in create_job() to simplify it while I was changing things there.

a couple notes:
-an only_if_needed label can be used if either the job depends on the label or it's a metahost for that label. we assume that if the user specifically requests the label in a metahost, then it's OK, even if the job doesn't depend on that label.
-one-time-hosts are assumed to satisfy job dependencies.

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@2215 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
542e840486b02b5025d26da16f98fed97898a601 19-Sep-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Added email_list field to front end. On job completion emails on this
list will be notified of the completion. Also the function send_email
in manage_db.py adds the ability to put a delimited email list in
global_settings.py rather than just a single email.

Signed-off-by: Bryce Boe <bboe@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@2173 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
945072fbd2a19409649de3afe2074c3f09fe8e0a 03-Sep-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Change the Clone Job button to show options to keep the specific
metahost assignments.

Signed-off-by: James Ren <jamesren@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@2090 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
bad4f2df9af76d1fb9dafe832fd48b500b71e60e 15-Aug-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Fixed removing hosts from a cloned job. Hosts can now be removed correctly.
Also cleaned up some code in the RPC interface method for job cloning.

Risk: low
Visibility: medium (bug fix on Create Job tab)

Signed-off-by: James Ren <jamesren@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1997 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
95128e53c4e807e98c2cd3588198a6a686e45e52 04-Aug-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Forgot a status in my mappings.

Signed-off-by: Travis Miller <raphtee@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1958 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
e0b6362a94cd9ca1146fbdd93d04fa144d42122d 04-Aug-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Add a basic "echo" function to the afe rpc interface, to allow for a
lightweight connection test.

Risk: Low
Visibility: Adds an echo() function to the frontend rpc interface.

Signed-off-by: John Admanski <jadmanski@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1957 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
d9992fe7281bdcd9c99f85b1fc89c65131b49c45 31-Jul-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Cloning a job now also clones the one-time hosts correctly.

Risk: low
Visibility: medium (UI bug fix)

Signed-off-by: James Ren <jamesren@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1937 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
3d9899a76a88cd4dea4cb819b8b9eb2165ede4e0 31-Jul-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Provides a mechanism in the UI to choose to skip the verification stage.

Signed-off-by: Travis Miller <raphtee@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1934 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
04f2cd81b1776c12085d9314ec27c3a7f755a843 25-Jul-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Automatically add the current user to new ACL groups. Also add the user
to the group if all users are removed from the ACL group.

Risk: low
Visibility: medium (changing behavior)

Signed-off-by: James Ren <jamesren@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1904 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
517f205cb5dfbe5d52a4ab7a3811c93a97af4c46 25-Jul-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Remove requeue_job from the RPC interface. Neither the CLI nor the web
frontend uses it anymore. Also updated the frontend unit test.

Risk: low
Visibility: low

Signed-off-by: James Ren <jamesren@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1903 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
d823b3648911ef831e75c9d645bba5cfbfed4dc4 24-Jul-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Added handling in the frontend for the 'Starting' job status.

Risk: low
Visibility: medium (UI bug fix)

Signed-off-by: James Ren <jamesren@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1896 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
e48cef5ec134a54dec94e5a201227680cb30b6b9 24-Jul-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Fixed the "Clone job" button's behavior with metahosts. Now clones only
the metahost, not the individual hosts assigned for it.

Risk: low
Visibility: medium (UI bug fix)

Signed-off-by: James Ren <jamesren@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1893 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
8ac29b478ab364b28573791e5f22c73830dda95a 17-Jul-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Add code to perform a translation on the status field to provide a more informative string for the UI.

Signed-off-by: Travis Miller <raphtee@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1863 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
909c7a661e6739c110690e70e2f4421ffc4e5433 15-Jul-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Initial release of test auto importer
Update models.py to reflect database changes
Add the following columns to autotests table:
* author
* dependencies
* experimental
* run_verify
* test_time
* test_category
* sync_count
Add run_verify to jobs table
Update scheduler to assert with run_verify

Risk: Medium
Visibility: High, people addings tests will now see more fields via the admin frontend

Signed-off-by: Scott Zawalski <scottz@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1837 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
9d821ab7d97c677a63589e6d71ee3c9da46f7077 11-Jul-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Made use of the new Widget functionality in DataTable and added checkboxes to
JobTable. JobListView now makes use of the SelectionManager and its checkboxes
to allow mulitple persistent selection of entries. This required some small
change to the behvavior of SelectionManager -- namely that it no longer
subscribes to the table itsef. This required some change to HostSelector which
acts on HostTable (it now does the listening to the table and calls the
SelectionManager methods directly). Added hyperlinks for "Select All" "DeSelect
All" and "Abort Selected" to the JobListView. Added a new rpc call "abort_jobs"
which takes a list of ids of jobs to abort.

Signed-off-by: Travis Miller <raphtee@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1809 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
1e935f132c1a1d2aad7bad28bfa9d030f5d9393d 11-Jul-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> -modify django-directives to support multiple Django servers
-modify JsonRpcProxy to support multiple proxies to different URLs
-add AFE RPC get_hqe_percentage_complete to get percentage of HQE's matching some filter that are complete
-ensure user-supplied WHERE conditions have %'s escaped


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1806 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
ff9013885970838cb7b2e868ff7f8b762757b989 08-Jul-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> -move logged-in user tracking to separate thread_local module. models.py will soon depend on it, so it had to be moved to avoid circular dependencies.
-made apache_auth set the logged-in user, rather than the rpc handling view. this way the user will be set when the admin interface is accessed as well.



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1776 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
09096d82f1f71cddf2165a9e169e4249cc0fd82a 08-Jul-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> -added readonly_connection.py, which opens a second DB connection using readonly credentials found in the global config
-added special QuerySet subclasses to model_logic that wrap DB access in a readonly connection
-made query_objects wrap the DB access in a readonly connection when given extra_args or extra_where (which can contain arbitrary SQL from the user)
-got rid of unnecessary call to query_objects


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1775 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
df062569a6407ec084c4ee05b9390f8a0183d37b 03-Jul-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Adding protection levels to hosts. Allows the user to specify how much
the repair operation is allowed to do on the host (e.g., do not repair,
repair filesystem only, allow reimaging).

Risk: low
Visbility: medium (adding a new input field)


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1771 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
b8471e33ed22512001ec4cec8c33fdf01f32eb62 03-Jul-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Added a new input that allows used to specify a one-time host when
creating a job. The job will be run against that host once, and the
host will not appear in the "Available hosts" selector.

Risk: medium (deleting records from database)
Visibility: medium (adding an input field)


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1768 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
a8709c5d47fa6a2dfed0604c187afe86a72587a0 03-Jul-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Changing the Requeue Job button to redirect and populate the Create Job
interface so that the user can modify the cloned job.


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1766 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
3bb499f74c04acec1f802a531cdfcba8f5ac0164 03-Jul-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Adding a timeout field to the "Create Job" tab, modified the create_job
RPC to handle a "timeout" argument, and added a "timeout" column to the
AUTOTEST_WEB database. Sets how long a job should run until it is
automatically aborted.


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1765 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
ba872901576ffb821ce28c00b5a8a8cc98ce44bd 28-Jun-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Added a check for the number of hosts available under a label, if a
test is filed against a metahost. Raises a ValidationError if the user
has requested more hosts than there are in a label.


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1749 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
08f981bddc5f1a199d789d177cbf583dee9f6c17 24-Jun-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> -every time an ACL group is edited, automatically
-add hosts to everyone if they aren't a member of any group
-remove hosts from everyone if they're a member of any other group
-simplify job block logic in models.py back to the way it used to be.
-get rid of some dead code in model_logic. we can resurrect it later if we need it later.



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1738 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
ec5546d44e555d597258aed66c630bd96ac4e997 16-Jun-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Fix a few erroneous references to ValidationError found by pylint.

Signed-off-by: Steve Howard <showard@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1707 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
2b9a88bcd336233fa483490892338e29f0a5fa67 13-Jun-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> -allow users to select profilers in the create job view
-create profilers table + model
-create RPCs for managing profilers
-modify control file generation code to accept profilers
-modify create job view
-some refactoring to create job view to allow code sharing and do things more cleanly with some sweet generics
-get rid of rpc_utils.sorted. who knew there was a builtin?


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1703 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
0afbb6369aa5aa9a75ea67dd9e95ec4b21c0c181 06-Jun-2008 jadmanski <jadmanski@592f7852-d20e-0410-864c-8624ca9c26a4> Convert all python code to use four-space indents instead of eight-space tabs.

Signed-off-by: John Admanski <jadmanski@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1658 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
ee94ab1de622e7f491a3ee716b8f1e34bbfe5b8a 06-Jun-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Change new RPCs to be more consistent with rest of RPCs.


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1639 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
bbabf50501415156d84e526b27ea4a8b2c2206e9 06-Jun-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Added 2 RPC interfaces to add multiple hosts to a label.
This will be needed by the new CLI.


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1625 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
20f47064be6855277e251cee7611d8336bcc9149 05-Jun-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> -check ACLs directly in the scheduler (bypassing ineligible_host_queues)

-rewrite scheduler queries to avoid all subqueries. they are just bad in mysql.

-rip out all that code related to using ineligible_host_queues to enforce ACLs. good riddance!

-update scheduler unit test to reflect this new policy (no ineligible_host_queue blocks for ACLs)

-minor bugfixes to scheduler unit test. this sucks, but i did go back and ensure the old scheduler passed the fixed up unit test suite as well.

-remove a blanket except: block from the scheduler. it wasn't necessary, it was inconsistent, and it was interfering with unit testing.



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1608 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
c2992ba854878443b7b7ca0f424edc3c06f1cfd8 06-May-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Speed up ineligible host queue computations, to speed up ACL
operations. This involved:
-extending filter_in_subquery() to be a bit more flexible
-added create_in_bulk() and delete_in_bulk() to create/delete many
rows with one SQL query. I don't think Django has a built-in way to
create in bulk, and it had become a major performance issue. The bulk
delete capabilities of Django were unnecessarily inefficient for the
present purposes, so I added that as well since it was pretty simple,
although it's a less significant performance increase.
-make job block recomputation upon ACL change a bit more focused (only
recompute for possibly affected jobs)

Also added a new doctest for block computation since it is
particularly error-prone, but it's kind of behind-the-scenes so I
didn't want it cluttering the main rpc_test.txt doctest.


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1492 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
b8d3424d02cfdc6c3eeda788e3527c5ec50ad8f9 25-Apr-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> -make get_host_queue_entries return full info on related objects (host + job)
-display said info in job detail + host detail pages



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1469 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
34dc5fa61c425389f9b931d3970c7556baf44dca 24-Apr-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> -instead of that stupid job_status RPC, just provide get_host_queue_entries directly.
-improve reporting of metahost entries in web frontend
-fix bugs in models code which didn't surface until I started querying host queue entries
-fix bug with job detail page refreshing



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1464 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
eb3be4d9b4c1bb292723ea1d52612aec5967ca0e 21-Apr-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> -include acl-inaccessible hosts in ineligible_host_queues blocks. This should make metahosts obey ACLs.
-recompute blocks for all non-complete jobs after any acl changes
-make the scheduler clear out blocks for completed jobs

This is messier than I would've liked because it required two things Django is not very good at - subqueries and notification of every time a many-to-many relationship changes. I used a custom manager and a custom manipulator to get around the two, respectively, in as clean a way I could find.



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1459 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
8e3aa5e027e28d8fdcb12083e0b30a80767a35cf 08-Apr-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> -support filtering on multiple labels
-fix problem mostly related to history handling that was causing unnecessary RPCs to be executed



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1414 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
4f536598ef682ff6105f55533ba925c7d63b5872 08-Apr-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Need to use job filters in get_num_jobs.


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1413 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
1c8c2215e525de8813c375e796354f8ffb811a08 03-Apr-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Change all tables to be server-side. This required a lot of work, but I think I ended up cleaning up the frontend code a lot and providing room for more powerful features to be added in the future. It is a huge change though.


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1396 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
1385b161fa9391242a2121027878e4943ce3c81f 13-Mar-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> On the frontend, only show hosts to which this user has ACL access.


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1343 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
1d445e9d9bc140b685b10a9fdd53cb5e92c0883e 12-Mar-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Support kernel install for server-side control files


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1338 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
8fd5824df1310058af6b8b503b800d575ddd3787 10-Mar-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> -associate a synch type with each test in the DB (defaults to asynchronous for all)
-make frontend default to synch type for selected tests, and disable selecting tests of different synch types
-allow synchronous client-side tests


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1322 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
cca3b63aaa31c87f90323083cdc9aead8367e25b 06-Mar-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Remove comment on removed arg.



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1309 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
3cab4a71760ef833f9549778f09197d1ffbe724c 06-Mar-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Requeue support for the frontend. Requeue creates and enqueues a copy of the job. Added support to Job model, new RPC method, and new button to job detail page.

Also fixing a little bug involving the is_dead() method.

Signed-off-by: Steve Howard <showard@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1305 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py
e8819cdf80ca0e0602d22551a50f970aa68e108d 15-Feb-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Add frontend and scheduler for Autotest

The attached tarball includes the new Autotest web frontend for creating
and monitoring jobs and the new scheduler for executing jobs. We've
been working hard to get these complete and stabilized, and although
they still have a long, long way to go in terms of features, we believe
they are now stable and powerful enough to be useful.

The frontend consists of two parts, the server and the client. The
server is implemented in Python using the Django web framework, and is
contained under frontend/ and frontend/afe. The client is implemented
using Google Web Toolkit and is contained under frontend/client. We
tried to use Dojo initially, as was generally agreed on, but it proved
to be too young and poorly documented of a framework, and developing in
it was just too inefficient.

The scheduler is contained entirely in the scheduler/monitor_db Python
file. It looks at the database used by the web frontend and spawns
autoserv processes to run jobs, monitoring them and recording status.
The scheduler was developed by Paul Turner, who will be sending out some
detailed documentation of it soon.

I've also included the DB migrations code for which I recently submitted
a patch to the mailing list. I've included this code because it is
necessary to create the frontend DB, but it will (hopefully) soon be
part of the SVN repository.

Lastly, there is an apache directory containing configuration files for
running the web server through Apache.

I've put instructions for installing a full Autotest server, including
the web frontend, the scheduler, and the existing "tko" results backend,
at http://test.kernel.org/autotest/AutotestServerInstall. I've also
created a brief guide to using the web frontend, with plenty of
screenshots, at http://test.kernel.org/autotest/WebFrontendHowTo.
Please let me know if you find any problems with either of these pages.

Take a look, try it out, send me comments, complaints, and bugs, and I
hope you find it useful!

Steve Howard, and the rest of the Google Autotest team

From: Steve Howard <showard@google.com>




git-svn-id: http://test.kernel.org/svn/autotest/trunk@1242 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/afe/rpc_interface.py