55to produce the final images."""
66from .build_context import BuildScenario
77
8- # TODO: test pipeline, e.g with a test registry
9-
10-
11- """
12- State of things
13-
14- All builds are working with reworked Dockerfiles ; except test image
15- From repo root:
16-
17- python -m scripts.release.main \
18- --include upgrade-hook \
19- --include operator \
20- --include init-appdb \
21- --include database \
22- --include mco-test \
23- --include test \
24- --include readiness-probe \
25- --include operator-quick \
26- --include cli \
27- --include init-database \
28- --include init-ops-manager \
29- --include ops-manager
30-
31- Should push images to all staging repositories "julienben/staging-temp/***/" on ECR
32- The base registry is now passed everywhere from one single entry point
33- Currently hardcoded as TEMP_HARDCODED_BASE_REGISTRY in main.py
34-
35-
36- Tried to split into smaller files:
37- - main.py to parse arguments and load image building functions
38- - build_configuration.py to isolate the dataclass
39- - build_images.py to replace sonar (basic interactions with Docker)
40- - optimized_operator_build.py to separate this function which is a mess
41- - atomic_pipeline.py for everything else
42-
43- Made a big cleanup (no daily rebuilds, no inventories, no Sonar...) ; still some work to do
44- The biggest mess is the agent builds
45-
46- TODO:
47- - start using new pipeline into patches build
48- - open PR with the minimal set of changes required to build a simple image
49- - continue to clean pipeline
50- - we don't use readiness probe and version upgrade hook anymore, but they are "base" images for some init image
51- """
52-
538import json
549import os
5510import shutil
@@ -530,7 +485,7 @@ def build_init_appdb(build_configuration: BuildConfiguration):
530485 version = release ["initAppDbVersion" ]
531486 base_url = "https://fastdl.mongodb.org/tools/db/"
532487 mongodb_tools_url_ubi = "{}{}" .format (base_url , release ["mongodbToolsBundle" ]["ubi" ])
533- args = {"version" : version , "mongodb_tools_url_ubi" : mongodb_tools_url_ubi }
488+ args = {"version" : build_configuration . version , "mongodb_tools_url_ubi" : mongodb_tools_url_ubi }
534489 build_image_generic (
535490 image_name = "mongodb-kubernetes-init-appdb" ,
536491 dockerfile_path = "docker/mongodb-kubernetes-init-appdb/Dockerfile" ,
@@ -540,6 +495,22 @@ def build_init_appdb(build_configuration: BuildConfiguration):
540495 )
541496
542497
498+ # TODO: nam static: remove this once static containers becomes the default
499+ def build_init_database (build_configuration : BuildConfiguration ):
500+ release = load_release_file ()
501+ version = release ["initDatabaseVersion" ] # comes from release.json
502+ base_url = "https://fastdl.mongodb.org/tools/db/"
503+ mongodb_tools_url_ubi = "{}{}" .format (base_url , release ["mongodbToolsBundle" ]["ubi" ])
504+ args = {"version" : build_configuration .version , "mongodb_tools_url_ubi" : mongodb_tools_url_ubi }
505+ build_image_generic (
506+ "mongodb-kubernetes-init-database" ,
507+ "docker/mongodb-kubernetes-init-database/Dockerfile" ,
508+ registry_address = build_configuration .base_registry ,
509+ extra_args = args ,
510+ sign = build_configuration .sign ,
511+ )
512+
513+
543514def build_community_image (build_configuration : BuildConfiguration , image_type : str ):
544515 """
545516 Builds image for community components (readiness probe, upgrade hook).
@@ -940,20 +911,3 @@ def get_builder_function_for_image_name() -> Dict[str, Callable]:
940911 }
941912
942913 return image_builders
943-
944-
945- # TODO: nam static: remove this once static containers becomes the default
946- def build_init_database (build_configuration : BuildConfiguration ):
947- release = load_release_file ()
948- version = release ["initDatabaseVersion" ] # comes from release.json
949- base_url = "https://fastdl.mongodb.org/tools/db/"
950- mongodb_tools_url_ubi = "{}{}" .format (base_url , release ["mongodbToolsBundle" ]["ubi" ])
951- version = build_configuration .version # TODO: check how to properly retrieve version
952- args = {"version" : version , "mongodb_tools_url_ubi" : mongodb_tools_url_ubi }
953- build_image_generic (
954- "mongodb-kubernetes-init-database" ,
955- "docker/mongodb-kubernetes-init-database/Dockerfile" ,
956- registry_address = build_configuration .base_registry ,
957- extra_args = args ,
958- sign = build_configuration .sign ,
959- )
0 commit comments