Commit da6c026
authored
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 details1 parent 60b9bb0 commit da6c026
File tree
11 files changed
+516
-355
lines changed- inventories
- lib/sonar
- scripts/release
- build
- tests
11 files changed
+516
-355
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | 520 | | |
537 | 521 | | |
538 | 522 | | |
539 | 523 | | |
540 | 524 | | |
541 | 525 | | |
542 | 526 | | |
543 | | - | |
| 527 | + | |
544 | 528 | | |
545 | 529 | | |
546 | 530 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | 64 | | |
67 | 65 | | |
68 | 66 | | |
69 | 67 | | |
70 | 68 | | |
71 | 69 | | |
| 70 | + | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | 350 | | |
364 | 351 | | |
365 | 352 | | |
| |||
371 | 358 | | |
372 | 359 | | |
373 | 360 | | |
374 | | - | |
375 | | - | |
| 361 | + | |
376 | 362 | | |
377 | 363 | | |
378 | 364 | | |
| |||
392 | 378 | | |
393 | 379 | | |
394 | 380 | | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | 381 | | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
| 382 | + | |
| 383 | + | |
428 | 384 | | |
429 | 385 | | |
430 | 386 | | |
431 | 387 | | |
432 | | - | |
| 388 | + | |
433 | 389 | | |
434 | | - | |
435 | | - | |
436 | | - | |
| 390 | + | |
| 391 | + | |
437 | 392 | | |
438 | 393 | | |
439 | 394 | | |
| |||
1334 | 1289 | | |
1335 | 1290 | | |
1336 | 1291 | | |
1337 | | - | |
1338 | | - | |
| 1292 | + | |
1339 | 1293 | | |
1340 | 1294 | | |
1341 | 1295 | | |
| |||
1369 | 1323 | | |
1370 | 1324 | | |
1371 | 1325 | | |
1372 | | - | |
1373 | | - | |
| 1326 | + | |
1374 | 1327 | | |
1375 | 1328 | | |
1376 | 1329 | | |
| |||
1594 | 1547 | | |
1595 | 1548 | | |
1596 | 1549 | | |
| 1550 | + | |
| 1551 | + | |
1597 | 1552 | | |
1598 | 1553 | | |
1599 | 1554 | | |
| |||
1619 | 1574 | | |
1620 | 1575 | | |
1621 | 1576 | | |
| 1577 | + | |
1622 | 1578 | | |
1623 | 1579 | | |
1624 | 1580 | | |
| |||
1683 | 1639 | | |
1684 | 1640 | | |
1685 | 1641 | | |
1686 | | - | |
1687 | | - | |
1688 | | - | |
1689 | | - | |
1690 | | - | |
1691 | | - | |
1692 | | - | |
1693 | | - | |
1694 | | - | |
1695 | | - | |
1696 | | - | |
1697 | | - | |
1698 | 1642 | | |
1699 | 1643 | | |
1700 | 1644 | | |
| |||
1722 | 1666 | | |
1723 | 1667 | | |
1724 | 1668 | | |
1725 | | - | |
1726 | | - | |
| 1669 | + | |
1727 | 1670 | | |
1728 | 1671 | | |
1729 | 1672 | | |
| |||
1809 | 1752 | | |
1810 | 1753 | | |
1811 | 1754 | | |
1812 | | - | |
1813 | | - | |
1814 | | - | |
1815 | | - | |
1816 | | - | |
1817 | | - | |
1818 | | - | |
1819 | 1755 | | |
1820 | 1756 | | |
1821 | 1757 | | |
| |||
1847 | 1783 | | |
1848 | 1784 | | |
1849 | 1785 | | |
1850 | | - | |
| 1786 | + | |
1851 | 1787 | | |
1852 | 1788 | | |
1853 | 1789 | | |
1854 | 1790 | | |
1855 | | - | |
1856 | | - | |
| 1791 | + | |
| 1792 | + | |
1857 | 1793 | | |
1858 | 1794 | | |
1859 | 1795 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
0 commit comments