[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>
diff --git a/frontend/afe/rpc_interface.py b/frontend/afe/rpc_interface.py
index 193389d..232af52 100644
--- a/frontend/afe/rpc_interface.py
+++ b/frontend/afe/rpc_interface.py
@@ -636,7 +636,8 @@
run_verify=False, email_list='', dependencies=(),
reboot_before=None, reboot_after=None,
parse_failed_repair=None, hostless=False,
- keyvals=None, drone_set=None, run_reset=True):
+ keyvals=None, drone_set=None, run_reset=True,
+ require_ssq=None):
"""
Creates and enqueues a parameterized job.
@@ -743,8 +744,8 @@
run_verify=False, email_list='', dependencies=(),
reboot_before=None, reboot_after=None, parse_failed_repair=None,
hostless=False, keyvals=None, drone_set=None, image=None,
- parent_job_id=None, test_retry=0, run_reset=True, args=(),
- **kwargs):
+ parent_job_id=None, test_retry=0, run_reset=True,
+ require_ssp=None, args=(), **kwargs):
"""\
Create and enqueue a job.
@@ -780,6 +781,12 @@
@param test_retry Number of times to retry test if the test did not
complete successfully. (optional, default: 0)
@param run_reset Should the host be reset before running the test?
+ @param require_ssp Set to True to require server-side packaging to run the
+ test. If it's set to None, drone will still try to run
+ the server side with server-side packaging. If the
+ autotest-server package doesn't exist for the build or
+ image is not set, drone will run the test without server-
+ side packaging. Default is None.
@param args A list of args to be injected into control file.
@param kwargs extra keyword args. NOT USED.