devserver: download individual image tarballs if they exist

Instead of always downloading image.zip and extract a target image
file from it, devserver should check whether there are individual image
tarballs (e.g. chromiumos_test_image.tar.xz) and download them. This
speeds up staging one image file significantly.

This CL also folds TarballBuildArtifact and ZipfileBuildArtifact into
their base class, BundledBuildArtifact, and use the artifact name to
decide how to extract the file.

BUG=chromium:343189
TEST=`build_artifact_unittest.py`
TEST=ran a local devserver and download base/test images

Change-Id: Ifd6a276a3d257f9bd513d48d1a6ddce6d5c8befd
Reviewed-on: https://chromium-review.googlesource.com/186130
Reviewed-by: Yu-Ju Hong <yjhong@chromium.org>
Commit-Queue: Yu-Ju Hong <yjhong@chromium.org>
Tested-by: Yu-Ju Hong <yjhong@chromium.org>
2 files changed