@@ -338,23 +338,22 @@ def build_upgrade_hook_image(build_configuration: BuildConfiguration):
338
338
339
339
def build_agent_pipeline (
340
340
build_configuration : BuildConfiguration ,
341
- image_version ,
342
- init_database_image ,
343
- mongodb_tools_url_ubi ,
344
- mongodb_agent_url_ubi : str ,
345
- agent_version ,
341
+ operator_version : str ,
342
+ agent_version : str ,
343
+ agent_distro : str ,
344
+ tools_version : str ,
345
+ tools_distro : str ,
346
346
):
347
+ image_version = f"{ agent_version } _{ operator_version } "
348
+
347
349
build_configuration_copy = copy (build_configuration )
348
350
build_configuration_copy .version = image_version
349
351
args = {
350
352
"version" : image_version ,
351
353
"agent_version" : agent_version ,
352
- "ubi_suffix" : "-ubi" ,
353
- "release_version" : image_version ,
354
- "init_database_image" : init_database_image ,
355
- "mongodb_tools_url_ubi" : mongodb_tools_url_ubi ,
356
- "mongodb_agent_url_ubi" : mongodb_agent_url_ubi ,
357
- "quay_registry" : build_configuration .base_registry ,
354
+ "agent_distro" : agent_distro ,
355
+ "tools_version" : tools_version ,
356
+ "tools_distro" : tools_distro ,
358
357
}
359
358
360
359
build_image (
@@ -392,15 +391,14 @@ def build_agent_default_case(build_configuration: BuildConfiguration):
392
391
with ProcessPoolExecutor (max_workers = max_workers ) as executor :
393
392
logger .info (f"Running with factor of { max_workers } " )
394
393
logger .info (f"======= Agent versions to build { agent_versions_to_build } =======" )
395
- for idx , agent_version in enumerate (agent_versions_to_build ):
394
+ for idx , agent_tools_version in enumerate (agent_versions_to_build ):
396
395
# We don't need to keep create and push the same image on every build.
397
396
# It is enough to create and push the non-operator suffixed images only during releases to ecr and quay.
398
- logger .info (f"======= Building Agent { agent_version } ({ idx } /{ len (agent_versions_to_build )} )" )
397
+ logger .info (f"======= Building Agent { agent_tools_version } ({ idx } /{ len (agent_versions_to_build )} )" )
399
398
_build_agent_operator (
400
- agent_version ,
399
+ agent_tools_version ,
401
400
build_configuration ,
402
401
executor ,
403
- build_configuration .version ,
404
402
tasks_queue ,
405
403
)
406
404
@@ -420,31 +418,25 @@ def queue_exception_handling(tasks_queue):
420
418
421
419
422
420
def _build_agent_operator (
423
- agent_version : Tuple [str , str ],
421
+ agent_tools_version : Tuple [str , str ],
424
422
build_configuration : BuildConfiguration ,
425
423
executor : ProcessPoolExecutor ,
426
- operator_version : str ,
427
424
tasks_queue : Queue ,
428
425
):
426
+ agent_version = agent_tools_version [0 ]
429
427
agent_distro = "rhel9_x86_64"
430
- tools_version = agent_version [1 ]
428
+ tools_version = agent_tools_version [1 ]
431
429
tools_distro = get_tools_distro (tools_version )["amd" ]
432
- image_version = f"{ agent_version [0 ]} _{ operator_version } "
433
- mongodb_tools_url_ubi = (
434
- f"https://downloads.mongodb.org/tools/db/mongodb-database-tools-{ tools_distro } -{ tools_version } .tgz"
435
- )
436
- 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"
437
- init_database_image = f"{ build_configuration .base_registry } /mongodb-kubernetes-init-database:{ operator_version } "
438
430
439
431
tasks_queue .put (
440
432
executor .submit (
441
433
build_agent_pipeline ,
442
434
build_configuration ,
443
- image_version ,
444
- init_database_image ,
445
- mongodb_tools_url_ubi ,
446
- mongodb_agent_url_ubi ,
447
- agent_version [ 0 ] ,
435
+ build_configuration . version ,
436
+ agent_version ,
437
+ agent_distro ,
438
+ tools_version ,
439
+ tools_distro ,
448
440
)
449
441
)
450
442
0 commit comments