@@ -338,23 +338,22 @@ def build_upgrade_hook_image(build_configuration: BuildConfiguration):
338338
339339def build_agent_pipeline (
340340 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 ,
346346):
347+ image_version = f"{ agent_version } _{ operator_version } "
348+
347349 build_configuration_copy = copy (build_configuration )
348350 build_configuration_copy .version = image_version
349351 args = {
350352 "version" : image_version ,
351353 "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 ,
358357 }
359358
360359 build_image (
@@ -392,15 +391,14 @@ def build_agent_default_case(build_configuration: BuildConfiguration):
392391 with ProcessPoolExecutor (max_workers = max_workers ) as executor :
393392 logger .info (f"Running with factor of { max_workers } " )
394393 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 ):
396395 # We don't need to keep create and push the same image on every build.
397396 # 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 )} )" )
399398 _build_agent_operator (
400- agent_version ,
399+ agent_tools_version ,
401400 build_configuration ,
402401 executor ,
403- build_configuration .version ,
404402 tasks_queue ,
405403 )
406404
@@ -420,31 +418,25 @@ def queue_exception_handling(tasks_queue):
420418
421419
422420def _build_agent_operator (
423- agent_version : Tuple [str , str ],
421+ agent_tools_version : Tuple [str , str ],
424422 build_configuration : BuildConfiguration ,
425423 executor : ProcessPoolExecutor ,
426- operator_version : str ,
427424 tasks_queue : Queue ,
428425):
426+ agent_version = agent_tools_version [0 ]
429427 agent_distro = "rhel9_x86_64"
430- tools_version = agent_version [1 ]
428+ tools_version = agent_tools_version [1 ]
431429 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 } "
438430
439431 tasks_queue .put (
440432 executor .submit (
441433 build_agent_pipeline ,
442434 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 ,
448440 )
449441 )
450442
0 commit comments