Skip to content

Commit bc23827

Browse files
committed
Remove agent unused functions
1 parent 832ce61 commit bc23827

File tree

2 files changed

+0
-125
lines changed

2 files changed

+0
-125
lines changed

scripts/release/atomic_pipeline.py

Lines changed: 0 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -525,57 +525,6 @@ def build_agent_pipeline(
525525
)
526526

527527

528-
def build_multi_arch_agent_in_sonar(
529-
build_configuration: BuildConfiguration,
530-
image_version,
531-
tools_version,
532-
):
533-
"""
534-
Creates the multi-arch non-operator suffixed version of the agent.
535-
This is a drop-in replacement for the agent
536-
release from MCO.
537-
This should only be called during releases.
538-
Which will lead to a release of the multi-arch
539-
images to quay and ecr.
540-
"""
541-
542-
logger.info(f"building multi-arch base image for: {image_version}")
543-
args = {
544-
"version": image_version,
545-
"tools_version": tools_version,
546-
}
547-
548-
arch_arm = {
549-
"agent_distro": "amzn2_aarch64",
550-
"tools_distro": get_tools_distro(tools_version=tools_version)["arm"],
551-
"architecture": "arm64",
552-
}
553-
arch_amd = {
554-
"agent_distro": "rhel9_x86_64",
555-
"tools_distro": get_tools_distro(tools_version=tools_version)["amd"],
556-
"architecture": "amd64",
557-
}
558-
559-
new_rhel_tool_version = "100.10.0"
560-
if Version(tools_version) >= Version(new_rhel_tool_version):
561-
arch_arm["tools_distro"] = "rhel93-aarch64"
562-
arch_amd["tools_distro"] = "rhel93-x86_64"
563-
564-
joined_args = [args | arch_amd]
565-
566-
# Only include arm64 if we shouldn't skip it
567-
if not should_skip_arm64():
568-
joined_args.append(args | arch_arm)
569-
570-
build_image_generic(
571-
image_name="mongodb-agent-ubi",
572-
dockerfile_path="docker/mongodb-agent-non-matrix/Dockerfile",
573-
build_configuration=build_configuration,
574-
is_multi_arch=True,
575-
multi_arch_args_list=joined_args,
576-
)
577-
578-
579528
def build_agent_default_case(build_configuration: BuildConfiguration):
580529
"""
581530
Build the agent only for the latest operator for patches and operator releases.
@@ -619,78 +568,6 @@ def build_agent_default_case(build_configuration: BuildConfiguration):
619568
queue_exception_handling(tasks_queue)
620569

621570

622-
def build_agent_on_agent_bump(build_configuration: BuildConfiguration):
623-
"""
624-
Build the agent matrix (operator version x agent version), triggered by PCT.
625-
626-
We have three cases where we need to build the agent:
627-
- e2e test runs
628-
- operator releases
629-
- OM/CM bumps via PCT
630-
631-
We don’t require building a full matrix on e2e test runs and operator releases.
632-
"Operator releases" and "e2e test runs" require only the latest operator x agents
633-
634-
In OM/CM bumps, we release a new agent which we potentially require to release to older operators as well.
635-
This function takes care of that.
636-
"""
637-
release = load_release_file()
638-
is_release = build_configuration.is_release_step_executed()
639-
640-
if build_configuration.all_agents:
641-
# We need to release [all agents x latest operator] on operator releases to make e2e tests work
642-
# This was changed previously in https://github.com/mongodb/mongodb-kubernetes/pull/3960
643-
agent_versions_to_build = gather_all_supported_agent_versions(release)
644-
else:
645-
# we only need to release the latest images, we don't need to re-push old images, as we don't clean them up anymore.
646-
agent_versions_to_build = gather_latest_agent_versions(release)
647-
648-
legacy_agent_versions_to_build = release["supportedImages"]["mongodb-agent"]["versions"]
649-
650-
tasks_queue = Queue()
651-
max_workers = 1
652-
if build_configuration.parallel:
653-
max_workers = None
654-
if build_configuration.parallel_factor > 0:
655-
max_workers = build_configuration.parallel_factor
656-
with ProcessPoolExecutor(max_workers=max_workers) as executor:
657-
logger.info(f"running with factor of {max_workers}")
658-
659-
# We need to regularly push legacy agents, otherwise ecr lifecycle policy will expire them.
660-
# We only need to push them once in a while to ecr, so no quay required
661-
if not is_release:
662-
for legacy_agent in legacy_agent_versions_to_build:
663-
tasks_queue.put(
664-
executor.submit(
665-
build_multi_arch_agent_in_sonar,
666-
build_configuration,
667-
legacy_agent,
668-
# we assume that all legacy agents are build using that tools version
669-
"100.9.4",
670-
)
671-
)
672-
673-
for agent_version in agent_versions_to_build:
674-
# We don't need to keep create and push the same image on every build.
675-
# It is enough to create and push the non-operator suffixed images only during releases to ecr and quay.
676-
if build_configuration.is_release_step_executed() or build_configuration.all_agents:
677-
tasks_queue.put(
678-
executor.submit(
679-
build_multi_arch_agent_in_sonar,
680-
build_configuration,
681-
agent_version[0],
682-
agent_version[1],
683-
)
684-
)
685-
for operator_version in get_supported_operator_versions():
686-
logger.info(f"Building Agent versions: {agent_version} for Operator versions: {operator_version}")
687-
_build_agent_operator(
688-
agent_version, build_configuration, executor, operator_version, tasks_queue, is_release
689-
)
690-
691-
queue_exception_handling(tasks_queue)
692-
693-
694571
def queue_exception_handling(tasks_queue):
695572
exceptions_found = False
696573
for task in tasks_queue.queue:

scripts/release/main.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from scripts.evergreen.release.images_signing import mongodb_artifactory_login
2121
from scripts.release.atomic_pipeline import (
2222
build_agent_default_case,
23-
build_agent_on_agent_bump,
2423
build_CLI_SBOM,
2524
build_database_image,
2625
build_init_appdb,
@@ -61,7 +60,6 @@ def get_builder_function_for_image_name() -> Dict[str, Callable]:
6160
"upgrade-hook": build_upgrade_hook_image,
6261
"operator-quick": build_operator_image_patch,
6362
"database": build_database_image,
64-
"agent-pct": build_agent_on_agent_bump,
6563
"agent": build_agent_default_case,
6664
#
6765
# Init images

0 commit comments

Comments
 (0)