@@ -88,6 +88,7 @@ class Integration(BaseModel):
8888 target_method : Optional [str ]
8989 setup_dir : Optional [str ]
9090 target_env : Optional [Dict [str , str ]]
91+ pool : PoolName
9192
9293
9394TARGETS : Dict [str , Integration ] = {
@@ -97,6 +98,7 @@ class Integration(BaseModel):
9798 target_exe = "fuzz.exe" ,
9899 inputs = "seeds" ,
99100 wait_for_files = {ContainerType .unique_reports : 1 },
101+ pool = "linux" ,
100102 ),
101103 "linux-libfuzzer" : Integration (
102104 template = TemplateType .libfuzzer ,
@@ -124,6 +126,7 @@ class Integration(BaseModel):
124126 "--only_asan_failures" ,
125127 "--write_test_file={extra_output_dir}/test.txt" ,
126128 ],
129+ pool = "linux" ,
127130 ),
128131 "linux-libfuzzer-with-options" : Integration (
129132 template = TemplateType .libfuzzer ,
@@ -137,6 +140,7 @@ class Integration(BaseModel):
137140 },
138141 reboot_after_setup = True ,
139142 fuzzing_target_options = ["-runs=10000000" ],
143+ pool = "linux" ,
140144 ),
141145 "linux-libfuzzer-dlopen" : Integration (
142146 template = TemplateType .libfuzzer ,
@@ -150,6 +154,7 @@ class Integration(BaseModel):
150154 },
151155 reboot_after_setup = True ,
152156 use_setup = True ,
157+ pool = "linux" ,
153158 ),
154159 "linux-libfuzzer-linked-library" : Integration (
155160 template = TemplateType .libfuzzer ,
@@ -163,6 +168,7 @@ class Integration(BaseModel):
163168 },
164169 reboot_after_setup = True ,
165170 use_setup = True ,
171+ pool = "linux" ,
166172 ),
167173 "linux-libfuzzer-dotnet" : Integration (
168174 template = TemplateType .libfuzzer_dotnet ,
@@ -180,6 +186,7 @@ class Integration(BaseModel):
180186 ContainerType .unique_reports : 1 ,
181187 },
182188 test_repro = False ,
189+ pool = "linux" ,
183190 ),
184191 "linux-libfuzzer-aarch64-crosscompile" : Integration (
185192 template = TemplateType .libfuzzer_qemu_user ,
@@ -189,13 +196,15 @@ class Integration(BaseModel):
189196 use_setup = True ,
190197 wait_for_files = {ContainerType .inputs : 2 , ContainerType .crashes : 1 },
191198 test_repro = False ,
199+ pool = "linux" ,
192200 ),
193201 "linux-libfuzzer-rust" : Integration (
194202 template = TemplateType .libfuzzer ,
195203 os = OS .linux ,
196204 target_exe = "fuzz_target_1" ,
197205 wait_for_files = {ContainerType .unique_reports : 1 , ContainerType .coverage : 1 },
198206 fuzzing_target_options = ["--test:{extra_setup_dir}" ],
207+ pool = "linux" ,
199208 ),
200209 "linux-trivial-crash" : Integration (
201210 template = TemplateType .radamsa ,
@@ -204,6 +213,7 @@ class Integration(BaseModel):
204213 inputs = "seeds" ,
205214 wait_for_files = {ContainerType .unique_reports : 1 },
206215 inject_fake_regression = True ,
216+ pool = "linux" ,
207217 ),
208218 "linux-trivial-crash-asan" : Integration (
209219 template = TemplateType .radamsa ,
@@ -213,6 +223,28 @@ class Integration(BaseModel):
213223 wait_for_files = {ContainerType .unique_reports : 1 },
214224 check_asan_log = True ,
215225 disable_check_debugger = True ,
226+ pool = "linux" ,
227+ ),
228+ # TODO: Don't install OMS extension on linux anymore
229+ # TODO: Figure out why non mariner work is being scheduled to the mariner pool
230+ "mariner-libfuzzer" : Integration (
231+ template = TemplateType .libfuzzer ,
232+ os = OS .linux ,
233+ target_exe = "fuzz.exe" ,
234+ inputs = "seeds" ,
235+ wait_for_files = {
236+ ContainerType .unique_reports : 1 ,
237+ ContainerType .coverage : 1 ,
238+ ContainerType .inputs : 2 ,
239+ ContainerType .extra_output : 1 ,
240+ },
241+ reboot_after_setup = True ,
242+ inject_fake_regression = True ,
243+ fuzzing_target_options = [
244+ "--test:{extra_setup_dir}" ,
245+ "--write_test_file={extra_output_dir}/test.txt" ,
246+ ],
247+ pool = PoolName ("mariner" )
216248 ),
217249 "windows-libfuzzer" : Integration (
218250 template = TemplateType .libfuzzer ,
@@ -234,6 +266,7 @@ class Integration(BaseModel):
234266 "--only_asan_failures" ,
235267 "--write_test_file={extra_output_dir}/test.txt" ,
236268 ],
269+ pool = "windows" ,
237270 ),
238271 "windows-libfuzzer-linked-library" : Integration (
239272 template = TemplateType .libfuzzer ,
@@ -246,6 +279,7 @@ class Integration(BaseModel):
246279 ContainerType .coverage : 1 ,
247280 },
248281 use_setup = True ,
282+ pool = "windows" ,
249283 ),
250284 "windows-libfuzzer-load-library" : Integration (
251285 template = TemplateType .libfuzzer ,
@@ -258,6 +292,7 @@ class Integration(BaseModel):
258292 ContainerType .coverage : 1 ,
259293 },
260294 use_setup = True ,
295+ pool = "windows" ,
261296 ),
262297 "windows-libfuzzer-dotnet" : Integration (
263298 template = TemplateType .libfuzzer_dotnet ,
@@ -275,6 +310,7 @@ class Integration(BaseModel):
275310 ContainerType .unique_reports : 1 ,
276311 },
277312 test_repro = False ,
313+ pool = "windows" ,
278314 ),
279315 "windows-trivial-crash" : Integration (
280316 template = TemplateType .radamsa ,
@@ -283,6 +319,7 @@ class Integration(BaseModel):
283319 inputs = "seeds" ,
284320 wait_for_files = {ContainerType .unique_reports : 1 },
285321 inject_fake_regression = True ,
322+ pool = "windows" ,
286323 ),
287324}
288325
@@ -351,14 +388,23 @@ def try_info_get(data: Any) -> None:
351388
352389 self .inject_log (self .start_log_marker )
353390 for entry in os_list :
354- name = PoolName ( f"testpool- { entry .name } - { self . test_id } " )
391+ name = self . build_pool_name ( entry .name )
355392 self .logger .info ("creating pool: %s:%s" , entry .name , name )
356393 self .of .pools .create (name , entry )
357394 self .logger .info ("creating scaleset for pool: %s" , name )
358395 self .of .scalesets .create (
359396 name , pool_size , region = region , initial_size = pool_size
360397 )
361398
399+ name = self .build_pool_name ("mariner" )
400+ self .logger .info ("creating pool: %s:%s" , "mariner" , name )
401+ self .of .pools .create (name , OS .linux )
402+ self .logger .info ("creating scaleset for pool: %s" , name )
403+ self .of .scalesets .create (
404+ name , pool_size , region = region , initial_size = pool_size , image = "MicrosoftCBLMariner:cbl-mariner:cbl-mariner-2-gen2:latest"
405+ )
406+
407+
362408 class UnmanagedPool :
363409 def __init__ (
364410 self ,
@@ -560,12 +606,9 @@ def launch(
560606 ) -> List [UUID ]:
561607 """Launch all of the fuzzing templates"""
562608
563- pools : Dict [ OS , Pool ] = {}
609+ pool = None
564610 if unmanaged_pool is not None :
565- pools [unmanaged_pool .the_os ] = self .of .pools .get (unmanaged_pool .pool_name )
566- else :
567- for pool in self .of .pools .list ():
568- pools [pool .os ] = pool
611+ pool = unmanaged_pool .pool_name
569612
570613 job_ids = []
571614
@@ -576,8 +619,8 @@ def launch(
576619 if config .os not in os_list :
577620 continue
578621
579- if config . os not in pools . keys () :
580- raise Exception ( f"No pool for target: { target } ,os: { config .os } " )
622+ if pool is None :
623+ pool = self . build_pool_name ( config .pool )
581624
582625 self .logger .info ("launching: %s" , target )
583626
@@ -601,8 +644,9 @@ def launch(
601644 setup = Directory (os .path .join (setup , config .nested_setup_dir ))
602645
603646 job : Optional [Job ] = None
647+
604648 job = self .build_job (
605- duration , pools , target , config , setup , target_exe , inputs
649+ duration , pool , target , config , setup , target_exe , inputs
606650 )
607651
608652 if config .inject_fake_regression and job is not None :
@@ -618,7 +662,7 @@ def launch(
618662 def build_job (
619663 self ,
620664 duration : int ,
621- pools : Dict [ OS , Pool ] ,
665+ pool : PoolName ,
622666 target : str ,
623667 config : Integration ,
624668 setup : Optional [Directory ],
@@ -634,7 +678,7 @@ def build_job(
634678 self .project ,
635679 target ,
636680 BUILD ,
637- pools [ config . os ]. name ,
681+ pool ,
638682 target_exe = target_exe ,
639683 inputs = inputs ,
640684 setup_dir = setup ,
@@ -659,7 +703,7 @@ def build_job(
659703 self .project ,
660704 target ,
661705 BUILD ,
662- pools [ config . os ]. name ,
706+ pool ,
663707 target_dll = File (config .target_exe ),
664708 inputs = inputs ,
665709 setup_dir = setup ,
@@ -675,7 +719,7 @@ def build_job(
675719 self .project ,
676720 target ,
677721 BUILD ,
678- pools [ config . os ]. name ,
722+ pool ,
679723 inputs = inputs ,
680724 target_exe = target_exe ,
681725 duration = duration ,
@@ -688,7 +732,7 @@ def build_job(
688732 self .project ,
689733 target ,
690734 BUILD ,
691- pool_name = pools [ config . os ]. name ,
735+ pool_name = pool ,
692736 target_exe = target_exe ,
693737 inputs = inputs ,
694738 setup_dir = setup ,
@@ -703,7 +747,7 @@ def build_job(
703747 self .project ,
704748 target ,
705749 BUILD ,
706- pool_name = pools [ config . os ]. name ,
750+ pool_name = pool ,
707751 target_exe = target_exe ,
708752 inputs = inputs ,
709753 setup_dir = setup ,
@@ -1233,6 +1277,9 @@ def check_logs_for_errors(self) -> None:
12331277
12341278 if seen_errors :
12351279 raise Exception ("logs included errors" )
1280+
1281+ def build_pool_name (self , os_type : str ) -> PoolName :
1282+ return PoolName (f"testpool-{ os_type } -{ self .test_id } " )
12361283
12371284
12381285class Run (Command ):
0 commit comments