@@ -316,35 +316,6 @@ def build_upgrade_hook_image(build_configuration: ImageBuildConfiguration):
316
316
)
317
317
318
318
319
- def build_agent_pipeline (
320
- build_configuration : ImageBuildConfiguration ,
321
- image_version ,
322
- init_database_image ,
323
- mongodb_tools_url_ubi ,
324
- mongodb_agent_url_ubi : str ,
325
- agent_version ,
326
- ):
327
- build_configuration_copy = copy (build_configuration )
328
- build_configuration_copy .version = image_version
329
- print (
330
- f"======== Building agent pipeline for version { image_version } , build configuration version: { build_configuration .version } "
331
- )
332
- args = {
333
- "version" : image_version ,
334
- "agent_version" : agent_version ,
335
- "release_version" : image_version ,
336
- "init_database_image" : init_database_image ,
337
- "mongodb_tools_url_ubi" : mongodb_tools_url_ubi ,
338
- "mongodb_agent_url_ubi" : mongodb_agent_url_ubi ,
339
- }
340
-
341
- pipeline_process_image (
342
- dockerfile_path = "docker/mongodb-agent/Dockerfile" ,
343
- build_configuration = build_configuration_copy ,
344
- dockerfile_args = args ,
345
- )
346
-
347
-
348
319
def build_agent_default_case (build_configuration : ImageBuildConfiguration ):
349
320
"""
350
321
Build the agent only for the latest operator for patches and operator releases.
@@ -388,48 +359,6 @@ def build_agent_default_case(build_configuration: ImageBuildConfiguration):
388
359
queue_exception_handling (tasks_queue )
389
360
390
361
391
- def queue_exception_handling (tasks_queue ):
392
- exceptions_found = False
393
- for task in tasks_queue .queue :
394
- if task .exception () is not None :
395
- exceptions_found = True
396
- logger .fatal (f"The following exception has been found when building: { task .exception ()} " )
397
- if exceptions_found :
398
- raise Exception (
399
- f"Exception(s) found when processing Agent images. \n See also previous logs for more info\n Failing the build"
400
- )
401
-
402
-
403
- def _build_agent_operator (
404
- agent_version : Tuple [str , str ],
405
- build_configuration : ImageBuildConfiguration ,
406
- executor : ProcessPoolExecutor ,
407
- operator_version : str ,
408
- tasks_queue : Queue ,
409
- ):
410
- agent_distro = "rhel9_x86_64"
411
- tools_version = agent_version [1 ]
412
- tools_distro = get_tools_distro (tools_version )["amd" ]
413
- image_version = f"{ agent_version [0 ]} _{ operator_version } "
414
- mongodb_tools_url_ubi = (
415
- f"https://downloads.mongodb.org/tools/db/mongodb-database-tools-{ tools_distro } -{ tools_version } .tgz"
416
- )
417
- mongodb_agent_url_ubi = f"https://mciuploads.s3.amazonaws.com/mms-automation/mongodb-mms-build-agent/builds/automation-agent/prod/mongodb-mms-automation-agent-{ agent_version [0 ]} .{ agent_distro } .tar.gz"
418
- init_database_image = f"{ build_configuration .registry } /mongodb-kubernetes-init-database:{ operator_version } "
419
-
420
- tasks_queue .put (
421
- executor .submit (
422
- build_agent_pipeline ,
423
- build_configuration ,
424
- image_version ,
425
- init_database_image ,
426
- mongodb_tools_url_ubi ,
427
- mongodb_agent_url_ubi ,
428
- agent_version [0 ],
429
- )
430
- )
431
-
432
-
433
362
def gather_all_supported_agent_versions (release : Dict ) -> List [Tuple [str , str ]]:
434
363
# This is a list of a tuples - agent version and corresponding tools version
435
364
agent_versions_to_build = list ()
@@ -489,3 +418,74 @@ def gather_latest_agent_versions(release: Dict) -> List[Tuple[str, str]]:
489
418
agent_versions_to_build .append (("107.0.12.8669-1" , "100.10.0" ))
490
419
491
420
return sorted (list (set (agent_versions_to_build )))
421
+
422
+
423
+ def _build_agent_operator (
424
+ agent_version : Tuple [str , str ],
425
+ build_configuration : ImageBuildConfiguration ,
426
+ executor : ProcessPoolExecutor ,
427
+ operator_version : str ,
428
+ tasks_queue : Queue ,
429
+ ):
430
+ agent_distro = "rhel9_x86_64"
431
+ tools_version = agent_version [1 ]
432
+ tools_distro = get_tools_distro (tools_version )["amd" ]
433
+ image_version = f"{ agent_version [0 ]} _{ operator_version } "
434
+ mongodb_tools_url_ubi = (
435
+ f"https://downloads.mongodb.org/tools/db/mongodb-database-tools-{ tools_distro } -{ tools_version } .tgz"
436
+ )
437
+ mongodb_agent_url_ubi = f"https://mciuploads.s3.amazonaws.com/mms-automation/mongodb-mms-build-agent/builds/automation-agent/prod/mongodb-mms-automation-agent-{ agent_version [0 ]} .{ agent_distro } .tar.gz"
438
+ init_database_image = f"{ build_configuration .registry } /mongodb-kubernetes-init-database:{ operator_version } "
439
+
440
+ tasks_queue .put (
441
+ executor .submit (
442
+ build_agent_pipeline ,
443
+ build_configuration ,
444
+ image_version ,
445
+ init_database_image ,
446
+ mongodb_tools_url_ubi ,
447
+ mongodb_agent_url_ubi ,
448
+ agent_version [0 ],
449
+ )
450
+ )
451
+
452
+
453
+ def build_agent_pipeline (
454
+ build_configuration : ImageBuildConfiguration ,
455
+ image_version ,
456
+ init_database_image ,
457
+ mongodb_tools_url_ubi ,
458
+ mongodb_agent_url_ubi : str ,
459
+ agent_version ,
460
+ ):
461
+ build_configuration_copy = copy (build_configuration )
462
+ build_configuration_copy .version = image_version
463
+ print (
464
+ f"======== Building agent pipeline for version { image_version } , build configuration version: { build_configuration .version } "
465
+ )
466
+ args = {
467
+ "version" : image_version ,
468
+ "agent_version" : agent_version ,
469
+ "release_version" : image_version ,
470
+ "init_database_image" : init_database_image ,
471
+ "mongodb_tools_url_ubi" : mongodb_tools_url_ubi ,
472
+ "mongodb_agent_url_ubi" : mongodb_agent_url_ubi ,
473
+ }
474
+
475
+ pipeline_process_image (
476
+ dockerfile_path = "docker/mongodb-agent/Dockerfile" ,
477
+ build_configuration = build_configuration_copy ,
478
+ dockerfile_args = args ,
479
+ )
480
+
481
+
482
+ def queue_exception_handling (tasks_queue ):
483
+ exceptions_found = False
484
+ for task in tasks_queue .queue :
485
+ if task .exception () is not None :
486
+ exceptions_found = True
487
+ logger .fatal (f"The following exception has been found when building: { task .exception ()} " )
488
+ if exceptions_found :
489
+ raise Exception (
490
+ f"Exception(s) found when processing Agent images. \n See also previous logs for more info\n Failing the build"
491
+ )
0 commit comments