Skip to content

Commit d12a1fd

Browse files
committed
Update utask-main-scheduler to use RemoteTaskGate
- Refactor run_bot.py to use RemoteTaskGate instead of GcpBatchService for task scheduling. - Revert default job frequency to 0% Kubernetes in job_frequency.py. Signed-off-by: Javan Lacerda <[email protected]>
1 parent cdd140f commit d12a1fd

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/clusterfuzz/_internal/base/tasks/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
TASK_END_TIME_KEY = 'task_end_time'
8888

8989
POSTPROCESS_QUEUE = 'postprocess'
90-
UTASK_MAIN_QUEUE = 'test-utask-main'
90+
UTASK_MAIN_QUEUE = 'utask_main'
9191
PREPROCESS_QUEUE = 'preprocess'
9292

9393
# See https://github.com/google/clusterfuzz/issues/3347 for usage

src/clusterfuzz/_internal/remote_task/job_frequency.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# By default, all jobs are sent to the GCP Batch backend. This can be
2424
# overridden on a per-job basis by setting the `K8S_JOBS_FREQUENCY`
2525
# environment variable.
26-
DEFAULT_FREQUENCY = {'gcp_batch': 0.5, 'kubernetes': 0.5}
26+
DEFAULT_FREQUENCY = {'gcp_batch': 1.0, 'kubernetes': 0.0}
2727

2828

2929
def _get_job_frequencies_from_env():

src/python/bot/startup/run_bot.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
# to be able to import dependencies directly, but we must store these in
1818
# subdirectories of common so that they are shared with App Engine.
1919
from clusterfuzz._internal.base import modules
20-
from clusterfuzz._internal.batch.service import GcpBatchService
2120
from clusterfuzz._internal.remote_task import RemoteTask
21+
from clusterfuzz._internal.remote_task import RemoteTaskGate
2222

2323
modules.fix_module_search_paths()
2424

@@ -86,9 +86,6 @@ def lease_all_tasks(task_list):
8686
yield
8787

8888

89-
gcp_batch_service = GcpBatchService()
90-
91-
9289
def schedule_utask_mains():
9390
"""Schedules utask_mains from preprocessed utasks on Google Cloud Batch."""
9491

@@ -105,7 +102,7 @@ def schedule_utask_mains():
105102
RemoteTask(task.command, task.job, task.argument)
106103
for task in utask_mains
107104
]
108-
gcp_batch_service.create_uworker_main_batch_jobs(batch_tasks)
105+
RemoteTaskGate().create_uworker_main_batch_jobs(batch_tasks)
109106

110107

111108
def task_loop():

0 commit comments

Comments
 (0)