You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CLOUDP-338084 - removing and refactoring agent matrix from pipeline.py and atomic_pipeline.py (#346)
# Summary
## Why we do this
- since we don't do an agent matrix release anymore, there is no need to
release all the agents we see on `release.json`. Instead we should only
release the agent if PCT adds a new agent. That happens during OM and CM
bumps, the new detection script should handle this and release the
images
## What changes
- adding a detection script that detects agent changes between `local`
vs `origin/master` for `release.json` and uses that as a base to do the
release
- streamline evergreen.yml and remove matrix builds/releases
- streamline agent builds on pipeline.py
**Evergreen configuration cleanup and simplification:**
* Removed obsolete tasks and buildvariants related to agent image
releases, such as `release_agent_operator_release`,
`release_agents_on_ecr_conditional`, and `init_release_agents_on_ecr`,
to streamline the release process.
**Pipeline logic refactoring:**
* Refactored the `build_agent_default_case` function in `pipeline.py` to
use the new `detect_ops_manager_changes` function for determining which
agent versions to build, and eliminated the separate
`build_agent_on_agent_bump` logic.
* Simplified agent in `pipeline.py` to match `atomic_pipeline.py`
* Updated the image builder function mapping so that both `"agent"` and
`"agent-pct"` use the unified `build_agent_default_case` function.
## Proof of Work
- no agent needed to be released - patch:
[Link](https://spruce.mongodb.com/task/mongodb_kubernetes_init_test_run_build_agent_images_ubi_patch_0786a90d4034657a11c9289e917c62691bc2500f_689da41126d25300077a269a_25_08_14_08_53_40/logs?execution=0)
```
[2025/08/14 10:56:13.642] === Detecting OM Mapping Changes (Local vs Base) ===
[2025/08/14 10:56:13.643] INFO 2025-08-14 08:56:13,642 [atomic_pipeline] No changes detected, skipping agent build
[2025/08/14 10:56:13.725] Finished command 'subprocess.exec' in function 'pipeline' (step 3.5 of 3) in 4.209554597s.
```
- manual changing release.json ([the changeset, its a manual rsynced
patch](https://evergreen.mongodb.com/filediff/689e037a1e4cc8000785a0fd/?file_name=release.json&patch_number=0&commit_number=4)),
leading to an agent release/build. Note; the task is not passing because
I am releasing a non existant image
-[Link](https://spruce.mongodb.com/task/mongodb_kubernetes_init_test_run_build_agent_images_ubi_patch_f0df6f42547f5602c5c4ab120d1d7e3d0db05797_689e037a1e4cc8000785a0fd_25_08_14_15_40_44/logs?execution=0)
```
[2025/08/14 17:42:50.558] INFO 2025-08-14 15:42:50,558 [atomic_pipeline] ======= Agent versions to build [('13.30.0.9590-1', '100.12.2')] =======
[2025/08/14 17:42:50.558] INFO 2025-08-14 15:42:50,558 [atomic_pipeline] ======= Building Agent ('13.30.0.9590-
```
- cm bump worked with this changeset
[link](#311) + [the
related
patch](https://spruce.mongodb.com/task/mongodb_kubernetes_init_test_run_build_agent_images_ubi_patch_f0df6f42547f5602c5c4ab120d1d7e3d0db05797_689dcf5b0e81480007929ddc_25_08_14_11_58_22/logs?execution=0)
- this caused in init_test_run agent build to release the agent to ecr
as release.json has changed
```
[2025/08/14 13:59:35.068] === Detecting OM Mapping Changes (Local vs Base) ===
[2025/08/14 13:59:35.068] INFO 2025-08-14 11:59:35,067 [atomic_pipeline] Building Agent versions: [('13.38.0.9654-1', '100.12.2')]
[2025/08/14 13:59:35.068] INFO 2025-08-14 11:59:35,068 [atomic_pipeline] Running with factor of None
[2025/08/14 13:59:35.068] INFO 2025-08-14 11:59:35,068 [atomic_pipeline] ======= Agent versions to build [('13.38.0.9654-1', '100.12.2')] =======
[2025/08/14 13:59:35.068] INFO 2025-08-14 11:59:35,068 [atomic_pipeline] ======= Building Agent ('13.38.0.9654-1', '100.12.2') (0/1)
```
- we have a dedicated variant that can also release all agents:
[link](https://parsley.mongodb.com/evergreen/mongodb_kubernetes_manual_ecr_release_agent_release_all_agents_on_ecr_patch_0786a90d4034657a11c9289e917c62691bc2500f_689dea314fcada00075dd3c4_25_08_14_13_52_51/0/task?bookmarks=0,6038)
### Example Cases
**A new OM/CM bump workflow**
- publish_om/cm and release_agent variants are getting triggered
- detection script detects a change in release.json
- release the new agent
## Checklist
- [x] Have you linked a jira ticket and/or is the ticket in the title?
- [x] Have you checked whether your jira ticket required DOCSP changes?
- [x] Have you added changelog file?
- use `skip-changelog` label if not needed
- refer to [Changelog files and Release
Notes](https://github.com/mongodb/mongodb-kubernetes/blob/master/CONTRIBUTING.md#changelog-files-and-release-notes)
section in CONTRIBUTING.md for more details
0 commit comments