File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 1616import contextlib
1717
1818from clusterfuzz ._internal .base import tasks
19+ from clusterfuzz ._internal .batch .service import GcpBatchService
1920from clusterfuzz ._internal .metrics import monitoring_metrics
21+ from clusterfuzz ._internal .remote_task import RemoteTask
2022from clusterfuzz ._internal .system import environment
2123
2224
@@ -35,7 +37,6 @@ def lease_all_tasks(task_list):
3537
3638def schedule_utask_mains ():
3739 """Schedules utask_mains from preprocessed utasks on Google Cloud Batch."""
38- from clusterfuzz ._internal .google_cloud_utils import batch
3940
4041 print ('Attempting to combine batch tasks.' )
4142 utask_mains = tasks .get_utask_mains ()
@@ -47,10 +48,10 @@ def schedule_utask_mains():
4748
4849 with lease_all_tasks (utask_mains ):
4950 batch_tasks = [
50- batch . RemoteTask (task .command , task .job , task .argument )
51+ RemoteTask (task .command , task .job , task .argument )
5152 for task in utask_mains
5253 ]
53- return batch .create_uworker_main_batch_jobs (batch_tasks )
54+ return GcpBatchService () .create_uworker_main_batch_jobs (batch_tasks )
5455
5556
5657def execute (* args , ** kwargs ): # pylint: disable=unused-argument
Original file line number Diff line number Diff line change 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.
1919from clusterfuzz ._internal .base import modules
20+ from clusterfuzz ._internal .batch .service import GcpBatchService
21+ from clusterfuzz ._internal .remote_task import RemoteTask
2022
2123modules .fix_module_search_paths ()
2224
@@ -84,9 +86,11 @@ def lease_all_tasks(task_list):
8486 yield
8587
8688
89+ gcp_batch_service = GcpBatchService ()
90+
91+
8792def schedule_utask_mains ():
8893 """Schedules utask_mains from preprocessed utasks on Google Cloud Batch."""
89- from clusterfuzz ._internal .google_cloud_utils import batch
9094
9195 logs .info ('Attempting to combine batch tasks.' )
9296 utask_mains = tasks .get_utask_mains ()
@@ -98,10 +102,10 @@ def schedule_utask_mains():
98102
99103 with lease_all_tasks (utask_mains ):
100104 batch_tasks = [
101- batch . RemoteTask (task .command , task .job , task .argument )
105+ RemoteTask (task .command , task .job , task .argument )
102106 for task in utask_mains
103107 ]
104- batch .create_uworker_main_batch_jobs (batch_tasks )
108+ gcp_batch_service .create_uworker_main_batch_jobs (batch_tasks )
105109
106110
107111def task_loop ():
You can’t perform that action at this time.
0 commit comments