[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 <[email protected]>
Reviewed-by: Dan Shi <[email protected]>
Commit-Queue: Fang Deng <[email protected]>
Tested-by: Fang Deng <[email protected]>
diff --git a/scheduler/rdb_hosts.py b/scheduler/rdb_hosts.py
index 849a6fb..2bca914 100644
--- a/scheduler/rdb_hosts.py
+++ b/scheduler/rdb_hosts.py
@@ -106,6 +106,7 @@
# Platform needs to be a method, not an attribute, for
# backwards compatibility with the rest of the host model.
self.platform_name = platform.name if platform else None
+ self.shard_id = host.shard_id
def refresh(self, fields=None):