@@ -118,7 +118,7 @@ def build_operator_image(build_configuration: BuildConfiguration):
118
118
image_name = "mongodb-kubernetes"
119
119
build_image (
120
120
image_name = image_name ,
121
- dockerfile_path = "docker/mongodb-kubernetes-operator/Dockerfile" ,
121
+ dockerfile_path = "docker/mongodb-kubernetes-operator/Dockerfile.atomic " ,
122
122
build_configuration = build_configuration ,
123
123
extra_args = args ,
124
124
)
@@ -131,7 +131,7 @@ def build_database_image(build_configuration: BuildConfiguration):
131
131
args = {"version" : build_configuration .version }
132
132
build_image (
133
133
image_name = "mongodb-kubernetes-database" ,
134
- dockerfile_path = "docker/mongodb-kubernetes-database/Dockerfile" ,
134
+ dockerfile_path = "docker/mongodb-kubernetes-database/Dockerfile.atomic " ,
135
135
build_configuration = build_configuration ,
136
136
extra_args = args ,
137
137
)
@@ -182,7 +182,7 @@ def build_init_om_image(build_configuration: BuildConfiguration):
182
182
args = {"version" : build_configuration .version }
183
183
build_image (
184
184
image_name = "mongodb-kubernetes-init-ops-manager" ,
185
- dockerfile_path = "docker/mongodb-kubernetes-init-ops-manager/Dockerfile" ,
185
+ dockerfile_path = "docker/mongodb-kubernetes-init-ops-manager/Dockerfile.atomic " ,
186
186
build_configuration = build_configuration ,
187
187
extra_args = args ,
188
188
)
@@ -206,7 +206,7 @@ def build_om_image(build_configuration: BuildConfiguration):
206
206
207
207
build_image (
208
208
image_name = "mongodb-enterprise-ops-manager-ubi" ,
209
- dockerfile_path = "docker/mongodb-enterprise-ops-manager/Dockerfile" ,
209
+ dockerfile_path = "docker/mongodb-enterprise-ops-manager/Dockerfile.atomic " ,
210
210
build_configuration = build_configuration ,
211
211
extra_args = args ,
212
212
)
@@ -268,7 +268,7 @@ def build_init_appdb(build_configuration: BuildConfiguration):
268
268
args = {"version" : build_configuration .version , "mongodb_tools_url_ubi" : mongodb_tools_url_ubi }
269
269
build_image (
270
270
image_name = "mongodb-kubernetes-init-appdb" ,
271
- dockerfile_path = "docker/mongodb-kubernetes-init-appdb/Dockerfile" ,
271
+ dockerfile_path = "docker/mongodb-kubernetes-init-appdb/Dockerfile.atomic " ,
272
272
build_configuration = build_configuration ,
273
273
extra_args = args ,
274
274
)
@@ -282,7 +282,7 @@ def build_init_database(build_configuration: BuildConfiguration):
282
282
args = {"version" : build_configuration .version , "mongodb_tools_url_ubi" : mongodb_tools_url_ubi }
283
283
build_image (
284
284
"mongodb-kubernetes-init-database" ,
285
- "docker/mongodb-kubernetes-init-database/Dockerfile" ,
285
+ "docker/mongodb-kubernetes-init-database/Dockerfile.atomic " ,
286
286
build_configuration = build_configuration ,
287
287
extra_args = args ,
288
288
)
@@ -299,10 +299,10 @@ def build_community_image(build_configuration: BuildConfiguration, image_type: s
299
299
300
300
if image_type == "readiness-probe" :
301
301
image_name = "mongodb-kubernetes-readinessprobe"
302
- dockerfile_path = "docker/mongodb-kubernetes-readinessprobe/Dockerfile"
302
+ dockerfile_path = "docker/mongodb-kubernetes-readinessprobe/Dockerfile.atomic "
303
303
elif image_type == "upgrade-hook" :
304
304
image_name = "mongodb-kubernetes-operator-version-upgrade-post-start-hook"
305
- dockerfile_path = "docker/mongodb-kubernetes-upgrade-hook/Dockerfile"
305
+ dockerfile_path = "docker/mongodb-kubernetes-upgrade-hook/Dockerfile.atomic "
306
306
else :
307
307
raise ValueError (f"Unsupported community image type: { image_type } " )
308
308
@@ -338,28 +338,27 @@ 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 (
361
360
image_name = "mongodb-agent-ubi" ,
362
- dockerfile_path = "docker/mongodb-agent/Dockerfile" ,
361
+ dockerfile_path = "docker/mongodb-agent/Dockerfile.atomic " ,
363
362
build_configuration = build_configuration_copy ,
364
363
extra_args = args ,
365
364
)
@@ -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