@@ -135,7 +135,7 @@ def build_operator_image(build_configuration: ImageBuildConfiguration):
135
135
logger .info (f"Building Operator args: { args } " )
136
136
137
137
build_image (
138
- dockerfile_path = "docker/mongodb-kubernetes-operator/Dockerfile" ,
138
+ dockerfile_path = "docker/mongodb-kubernetes-operator/Dockerfile.atomic " ,
139
139
build_configuration = build_configuration ,
140
140
build_args = args ,
141
141
)
@@ -148,7 +148,7 @@ def build_database_image(build_configuration: ImageBuildConfiguration):
148
148
args = {"version" : build_configuration .version }
149
149
150
150
build_image (
151
- dockerfile_path = "docker/mongodb-kubernetes-database/Dockerfile" ,
151
+ dockerfile_path = "docker/mongodb-kubernetes-database/Dockerfile.atomic " ,
152
152
build_configuration = build_configuration ,
153
153
build_args = args ,
154
154
)
@@ -199,7 +199,7 @@ def build_init_om_image(build_configuration: ImageBuildConfiguration):
199
199
args = {"version" : build_configuration .version }
200
200
201
201
build_image (
202
- dockerfile_path = "docker/mongodb-kubernetes-init-ops-manager/Dockerfile" ,
202
+ dockerfile_path = "docker/mongodb-kubernetes-init-ops-manager/Dockerfile.atomic " ,
203
203
build_configuration = build_configuration ,
204
204
build_args = args ,
205
205
)
@@ -225,7 +225,7 @@ def build_om_image(build_configuration: ImageBuildConfiguration):
225
225
}
226
226
227
227
build_image (
228
- dockerfile_path = "docker/mongodb-enterprise-ops-manager/Dockerfile" ,
228
+ dockerfile_path = "docker/mongodb-enterprise-ops-manager/Dockerfile.atomic " ,
229
229
build_configuration = build_configuration ,
230
230
build_args = args ,
231
231
)
@@ -238,7 +238,7 @@ def build_init_appdb_image(build_configuration: ImageBuildConfiguration):
238
238
args = {"version" : build_configuration .version , "mongodb_tools_url_ubi" : mongodb_tools_url_ubi }
239
239
240
240
build_image (
241
- dockerfile_path = "docker/mongodb-kubernetes-init-appdb/Dockerfile" ,
241
+ dockerfile_path = "docker/mongodb-kubernetes-init-appdb/Dockerfile.atomic " ,
242
242
build_configuration = build_configuration ,
243
243
build_args = args ,
244
244
)
@@ -252,7 +252,7 @@ def build_init_database_image(build_configuration: ImageBuildConfiguration):
252
252
args = {"version" : build_configuration .version , "mongodb_tools_url_ubi" : mongodb_tools_url_ubi }
253
253
254
254
build_image (
255
- "docker/mongodb-kubernetes-init-database/Dockerfile" ,
255
+ "docker/mongodb-kubernetes-init-database/Dockerfile.atomic " ,
256
256
build_configuration = build_configuration ,
257
257
build_args = args ,
258
258
)
@@ -264,7 +264,7 @@ def build_readiness_probe_image(build_configuration: ImageBuildConfiguration):
264
264
"""
265
265
266
266
build_image (
267
- dockerfile_path = "docker/mongodb-kubernetes-readinessprobe/Dockerfile" ,
267
+ dockerfile_path = "docker/mongodb-kubernetes-readinessprobe/Dockerfile.atomic " ,
268
268
build_configuration = build_configuration ,
269
269
)
270
270
@@ -275,7 +275,7 @@ def build_upgrade_hook_image(build_configuration: ImageBuildConfiguration):
275
275
"""
276
276
277
277
build_image (
278
- dockerfile_path = "docker/mongodb-kubernetes-upgrade-hook/Dockerfile" ,
278
+ dockerfile_path = "docker/mongodb-kubernetes-upgrade-hook/Dockerfile.atomic " ,
279
279
build_configuration = build_configuration ,
280
280
)
281
281
@@ -308,15 +308,14 @@ def build_agent_default_case(build_configuration: ImageBuildConfiguration):
308
308
with ProcessPoolExecutor (max_workers = max_workers ) as executor :
309
309
logger .info (f"Running with factor of { max_workers } " )
310
310
logger .info (f"======= Agent versions to build { agent_versions_to_build } =======" )
311
- for idx , agent_version in enumerate (agent_versions_to_build ):
311
+ for idx , agent_tools_version in enumerate (agent_versions_to_build ):
312
312
# We don't need to keep create and push the same image on every build.
313
313
# It is enough to create and push the non-operator suffixed images only during releases to ecr and quay.
314
- logger .info (f"======= Building Agent { agent_version } ({ idx } /{ len (agent_versions_to_build )} )" )
314
+ logger .info (f"======= Building Agent { agent_tools_version } ({ idx } /{ len (agent_versions_to_build )} )" )
315
315
_build_agent_operator (
316
- agent_version ,
316
+ agent_tools_version ,
317
317
build_configuration ,
318
318
executor ,
319
- build_configuration .version ,
320
319
tasks_queue ,
321
320
)
322
321
@@ -385,43 +384,39 @@ def gather_latest_agent_versions(release: Dict) -> List[Tuple[str, str]]:
385
384
386
385
387
386
def _build_agent_operator (
388
- agent_version : Tuple [str , str ],
387
+ agent_tools_version : Tuple [str , str ],
389
388
build_configuration : ImageBuildConfiguration ,
390
389
executor : ProcessPoolExecutor ,
391
- operator_version : str ,
392
390
tasks_queue : Queue ,
393
391
):
392
+ agent_version = agent_tools_version [0 ]
394
393
agent_distro = "rhel9_x86_64"
395
- tools_version = agent_version [1 ]
394
+ tools_version = agent_tools_version [1 ]
396
395
tools_distro = get_tools_distro (tools_version )["amd" ]
397
- image_version = f"{ agent_version [0 ]} _{ operator_version } "
398
- mongodb_tools_url_ubi = (
399
- f"https://downloads.mongodb.org/tools/db/mongodb-database-tools-{ tools_distro } -{ tools_version } .tgz"
400
- )
401
- 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"
402
- init_database_image = f"{ build_configuration .base_registry ()} /mongodb-kubernetes-init-database:{ operator_version } "
403
396
404
397
tasks_queue .put (
405
398
executor .submit (
406
399
build_agent_pipeline ,
407
400
build_configuration ,
408
- image_version ,
409
- init_database_image ,
410
- mongodb_tools_url_ubi ,
411
- mongodb_agent_url_ubi ,
412
- agent_version [ 0 ] ,
401
+ build_configuration . version ,
402
+ agent_version ,
403
+ agent_distro ,
404
+ tools_version ,
405
+ tools_distro ,
413
406
)
414
407
)
415
408
416
409
417
410
def build_agent_pipeline (
418
411
build_configuration : ImageBuildConfiguration ,
419
- image_version ,
420
- init_database_image ,
421
- mongodb_tools_url_ubi ,
422
- mongodb_agent_url_ubi : str ,
423
- agent_version ,
412
+ operator_version : str ,
413
+ agent_version : str ,
414
+ agent_distro : str ,
415
+ tools_version : str ,
416
+ tools_distro : str ,
424
417
):
418
+ image_version = f"{ agent_version } _{ operator_version } "
419
+
425
420
build_configuration_copy = copy (build_configuration )
426
421
build_configuration_copy .version = image_version
427
422
print (
@@ -430,10 +425,9 @@ def build_agent_pipeline(
430
425
args = {
431
426
"version" : image_version ,
432
427
"agent_version" : agent_version ,
433
- "release_version" : image_version ,
434
- "init_database_image" : init_database_image ,
435
- "mongodb_tools_url_ubi" : mongodb_tools_url_ubi ,
436
- "mongodb_agent_url_ubi" : mongodb_agent_url_ubi ,
428
+ "agent_distro" : agent_distro ,
429
+ "tools_version" : tools_version ,
430
+ "tools_distro" : tools_distro ,
437
431
}
438
432
439
433
build_image (
0 commit comments