Support graceful failover/aggregation for autotest devserver pool.
This change implements the graceful failover/aggregation designed in
crosbug.com/26451. This required a large re-work of how other modules
interact with the dev_server module. Instead of always relying on being
able to pass in the "build" to any dev_server RPC, a caller must start
by using the static resolve method that resolves a build to an ip addr
and creating a DevServer instance from that hostname.
i.e.
ds = Devserver.create()
ds.trigger_download('build')
turns into
ds = ImageServer.resolve('build')
ds.trigger_download()
In order to guarantee the re-use of the same hostname throughout the life-cycle
of a suite run, we keep the hostname as part of the suitespec and also parse
the package_url based on the image_url -- not the build.
As noted, I've also separated the imaging / crash components into their
own DevServer subclasses to simplify the interaction and modified
callers.
BUG=chromium-os:26451
TEST=Unittests so far + local autotest setup with running bvt suite on one
host in the lab + ran suite_enumerator with/without -l
Change-Id: I4760e4033bb347259e3bb30f2fac31f321654c6f
Reviewed-on: https://gerrit.chromium.org/gerrit/32006
Commit-Ready: Chris Sosa <sosa@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
diff --git a/frontend/afe/site_rpc_interface.py b/frontend/afe/site_rpc_interface.py
index f3bc206..bfd02e6 100644
--- a/frontend/afe/site_rpc_interface.py
+++ b/frontend/afe/site_rpc_interface.py
@@ -115,7 +115,7 @@
# Ensure components of |build| necessary for installing images are staged
# on the dev server. However set synchronous to False to allow other
# components to be downloaded in the background.
- ds = dev_server.DevServer.create()
+ ds = dev_server.ImageServer.resolve(build)
timings[constants.DOWNLOAD_STARTED_TIME] = formatted_now()
try:
ds.trigger_download(build, synchronous=False)