[autotest] Add --offload_failures_only flag for Suites

Adds a new run_suite flag: --offload_failures_only and the required
piping to set it as a job keyval for each subjob of a suite.

Updates the tko_parser to determine if a test was successful or not
and should it be offloaded or not.

Introduces the concept of gs_offloader_instructions json file for
each test. This allows us to improve the intelligence of
gs_offloader by allowing tests to supply information to gs_offloader.

BUG=chromium:471330
TEST=local moblab setup. Ensured that only failed jobs were offloaded.
DEPLOY=gs_offloader,apache

Change-Id: I2310d710f1dce39a70766f6408f6a3c94f493e0d
Reviewed-on: https://chromium-review.googlesource.com/266090
Reviewed-by: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>
diff --git a/server/cros/dynamic_suite/constants.py b/server/cros/dynamic_suite/constants.py
index c10f231..0b75a61 100644
--- a/server/cros/dynamic_suite/constants.py
+++ b/server/cros/dynamic_suite/constants.py
@@ -39,3 +39,8 @@
 REIMAGE_TYPE_OS = 'os'
 REIMAGE_TYPE_FIRMWARE = 'firmware'
 LATEST_BUILD_URL = 'gs://chromeos-image-archive/master-paladin/LATEST-master'
+
+JOB_OFFLOAD_FAILURES_KEY = 'offload_failures_only'
+
+GS_OFFLOADER_INSTRUCTIONS = '.GS_OFFLOADER_INSTRUCTIONS'
+GS_OFFLOADER_NO_OFFLOAD = 'no_offload'
\ No newline at end of file