Skip to content

Commit 1e90170

Browse files
nammnlucian-tosaJulien-BenMaciejKarasmms-build-account
authored
CLOUDP-311484 - add support for arm and ibm machines (#330)
# Summary Related TD: [Link](https://docs.google.com/document/d/1wzwtRTaivKCnCpOobeZRMccC2u8ygO2DNE3DQghTvuU/edit?tab=t.0#bookmark=id.5jh2f6g25k1x) This pull request adds support for running end-to-end (E2E) tests and building images on IBM Power (ppc64le), IBM Z (s390x), and ARM (arm64) architectures. It introduces new Evergreen build variants, tasks, and setup logic to enable cross-platform testing and image creation. Additionally, it removes the legacy agent image build dependencies and updates scripts to use more generic container authentication. There are also improvements to how multi-architecture images are defined in the build info. **Multi-architecture E2E test and build support:** * Added new Evergreen build variants, task groups, and setup logic for IBM Power (`ppc64le`), IBM Z (`s390x`), and ARM (`arm64`) to enable E2E smoke tests and image builds on these platforms. This includes new setup groups, test image build tasks, and test group definitions for each architecture. [[1]](diffhunk://#diff-9a7744843f307953832ec106e8d49be546037475db24ec6873e5fec6249c236dR74-R80) [[2]](diffhunk://#diff-9a7744843f307953832ec106e8d49be546037475db24ec6873e5fec6249c236dR1183-R1198) [[3]](diffhunk://#diff-9a7744843f307953832ec106e8d49be546037475db24ec6873e5fec6249c236dR1462-R1573) [[4]](diffhunk://#diff-9a7744843f307953832ec106e8d49be546037475db24ec6873e5fec6249c236dR1787-R1804) [[5]](diffhunk://#diff-9a7744843f307953832ec106e8d49be546037475db24ec6873e5fec6249c236dR409-R423) [[6]](diffhunk://#diff-ad8722e626fc7bc08be6765b8268550446b1fb934c1a7eb6a5766d6446f92ad1R532-R543) * Updated `build_info.json` to specify that images for `mongodb-kubernetes` and `mongodb-kubernetes-init-database` are built for `linux/amd64`, `linux/arm64`, `linux/s390x`, and `linux/ppc64le` across all release channels. [[1]](diffhunk://#diff-ac3b10589f332066db566cb08c01afea746d5f16e704beef946107a0c5de5225L8-R31) [[2]](diffhunk://#diff-ac3b10589f332066db566cb08c01afea746d5f16e704beef946107a0c5de5225L50-R80) **Evergreen pipeline and function improvements:** * Added new setup functions for installing required tools (`jq`, minikube, etc.) and improved host setup logic for IBM architectures, including conditional logic for Docker/Podman and AWS CLI installation. [[1]](diffhunk://#diff-ad8722e626fc7bc08be6765b8268550446b1fb934c1a7eb6a5766d6446f92ad1R54-R69) [[2]](diffhunk://#diff-ad8722e626fc7bc08be6765b8268550446b1fb934c1a7eb6a5766d6446f92ad1R118) [[3]](diffhunk://#diff-ad8722e626fc7bc08be6765b8268550446b1fb934c1a7eb6a5766d6446f92ad1L115-L121) [[4]](diffhunk://#diff-ad8722e626fc7bc08be6765b8268550446b1fb934c1a7eb6a5766d6446f92ad1R265-R293) * Refactored E2E setup and teardown calls to use a wrapper script (`run_python.sh`) for better environment handling. [[1]](diffhunk://#diff-ad8722e626fc7bc08be6765b8268550446b1fb934c1a7eb6a5766d6446f92ad1L330-R355) [[2]](diffhunk://#diff-ad8722e626fc7bc08be6765b8268550446b1fb934c1a7eb6a5766d6446f92ad1L343-R367) * Added a manual Evergreen task and build variant to allow manual ECR agent image releases for testing. [[1]](diffhunk://#diff-9a7744843f307953832ec106e8d49be546037475db24ec6873e5fec6249c236dR388-R399) [[2]](diffhunk://#diff-9a7744843f307953832ec106e8d49be546037475db24ec6873e5fec6249c236dR1977-R1986) **Cleanup and modernization:** * Updated references from `configure_docker_auth.sh` to a more generic `configure_container_auth.sh` in both Evergreen and Makefile to support Podman as well as Docker. [[1]](diffhunk://#diff-ad8722e626fc7bc08be6765b8268550446b1fb934c1a7eb6a5766d6446f92ad1L228-R234) [[2]](diffhunk://#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52L150-R150) These changes collectively enable robust multi-architecture support in both CI and release pipelines, modernize setup scripts, and remove obsolete dependencies. ## Proof of Work - green ci (no changes to currently running e2e patches) - green ci on master merges (simulated [here](https://spruce.mongodb.com/version/68a4bd9f74629000078b930e/tasks?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC) which runs multi arch tests on master merges) - manually released the agents to ecr as multi-arch ``` ❯ docker buildx imagetools inspect 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-agent-ubi:108.0.4.8770-1 Name: 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-agent-ubi:108.0.4.8770-1 MediaType: application/vnd.docker.distribution.manifest.list.v2+json Digest: sha256:6c30ad0325aeac074538976094e0a5b8a69bdb819fc95496c6f52acefd028188 Manifests: Name: 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-agent-ubi:108.0.4.8770-1@sha256:38494a7b753ce8b9965332e12c195d56f143aa2b4505352237c6cdf757916475 MediaType: application/vnd.docker.distribution.manifest.v2+json Platform: linux/arm64 Name: 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-agent-ubi:108.0.4.8770-1@sha256:bb28cdbd9b9cc97cb2a8168c7c00897a93b96c02e51a8611361829a1349da2f5 MediaType: application/vnd.docker.distribution.manifest.v2+json Platform: linux/amd64 Name: 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-agent-ubi:108.0.4.8770-1@sha256:0ca9e958a6ac0a86541861bdfb39ae930f5b4dd588f9a8df1c9289579b020aa8 MediaType: application/vnd.docker.distribution.manifest.v2+json Platform: linux/s390x Name: 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-agent-ubi:108.0.4.8770-1@sha256:bdeb9b00a666500b336a4dc33a34f40992ee5ff1d57fbff62a6511bcd4cacad3 MediaType: application/vnd.docker.distribution.manifest.v2+json Platform: linux/ppc64le ``` ## 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 --------- Co-authored-by: Lucian Tosa <[email protected]> Co-authored-by: Julien Benhaim <[email protected]> Co-authored-by: Maciej Karaś <[email protected]> Co-authored-by: Maciej Karaś <[email protected]> Co-authored-by: mms-build-account <[email protected]> Co-authored-by: Evergreen <[email protected]> Co-authored-by: Vivek Singh <[email protected]>
1 parent 637923f commit 1e90170

File tree

72 files changed

+2294
-473
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+2294
-473
lines changed

.evergreen-functions.yml

Lines changed: 50 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,22 @@ functions:
5151

5252
### Setup Functions ###
5353

54+
setup_jq: &setup_jq
55+
command: subprocess.exec
56+
type: setup
57+
params:
58+
<<: *e2e_include_expansions_in_env
59+
add_to_path:
60+
- ${workdir}/bin
61+
working_dir: src/github.com/mongodb/mongodb-kubernetes
62+
binary: scripts/evergreen/setup_jq.sh
63+
5464
setup_context: &setup_context # Running the first switch is important to fill the workdir and other important initial env vars
5565
command: shell.exec
5666
type: setup
5767
params:
68+
add_to_path:
69+
- ${workdir}/bin
5870
shell: bash
5971
working_dir: src/github.com/mongodb/mongodb-kubernetes
6072
<<: *e2e_include_expansions_in_env
@@ -103,6 +115,7 @@ functions:
103115
type: setup
104116
params:
105117
command: "git config --global user.email '[email protected]'"
118+
- *setup_jq # we need jq in the context
106119
- *setup_context
107120

108121
setup_kubectl: &setup_kubectl
@@ -112,13 +125,6 @@ functions:
112125
working_dir: src/github.com/mongodb/mongodb-kubernetes
113126
binary: scripts/evergreen/setup_kubectl.sh
114127

115-
setup_jq: &setup_jq
116-
command: subprocess.exec
117-
type: setup
118-
params:
119-
working_dir: src/github.com/mongodb/mongodb-kubernetes
120-
binary: scripts/evergreen/setup_jq.sh
121-
122128
setup_shellcheck:
123129
command: subprocess.exec
124130
type: setup
@@ -225,7 +231,7 @@ functions:
225231
working_dir: src/github.com/mongodb/mongodb-kubernetes
226232
add_to_path:
227233
- ${workdir}/bin
228-
binary: scripts/dev/configure_docker_auth.sh
234+
binary: scripts/dev/configure_container_auth.sh
229235

230236
setup_evg_host: &setup_evg_host
231237
command: subprocess.exec
@@ -256,16 +262,35 @@ functions:
256262
# Configures docker authentication to ECR and RH registries.
257263
setup_building_host:
258264
- *switch_context
265+
- *python_venv
259266
- *setup_aws
260-
- *configure_docker_auth
261267
- *setup_evg_host
262-
- *python_venv
268+
- *configure_docker_auth
263269

264-
prune_docker_resources:
270+
# This differs for normal evg_host as we require minikube instead of kind for
271+
# IBM machines also install aws cli via pip instead and use podman
272+
setup_building_host_minikube:
273+
- *switch_context
265274
- command: subprocess.exec
266275
type: setup
267276
params:
268-
command: "docker system prune -a -f"
277+
working_dir: src/github.com/mongodb/mongodb-kubernetes
278+
add_to_path:
279+
- ${workdir}/bin
280+
command: scripts/evergreen/setup_minikube_host.sh
281+
282+
prune_docker_resources:
283+
- command: shell.exec
284+
type: setup
285+
params:
286+
shell: bash
287+
script: |
288+
if command -v docker >/dev/null 2>&1; then
289+
echo "Docker found, pruning docker resources..."
290+
docker system prune -a -f
291+
else
292+
echo "Docker not found, skipping docker resource pruning"
293+
fi
269294
270295
# the task configures the set of tools necessary for any task working with K8 cluster:
271296
# installs kubectl, jq, kind (if necessary), configures docker authentication
@@ -327,8 +352,7 @@ functions:
327352
shell: bash
328353
working_dir: src/github.com/mongodb/mongodb-kubernetes
329354
script: |
330-
source .generated/context.export.env
331-
scripts/evergreen/e2e/setup_cloud_qa.py create
355+
scripts/dev/run_python.sh scripts/evergreen/e2e/setup_cloud_qa.py create
332356
# The additional switch is needed, since we now have created the needed OM exports.
333357
- *switch_context
334358

@@ -340,8 +364,7 @@ functions:
340364
shell: bash
341365
working_dir: src/github.com/mongodb/mongodb-kubernetes
342366
script: |
343-
source .generated/context.export.env
344-
scripts/evergreen/e2e/setup_cloud_qa.py delete
367+
scripts/dev/run_python.sh scripts/evergreen/e2e/setup_cloud_qa.py delete
345368
346369
dump_diagnostic_information_from_all_namespaces:
347370
- command: subprocess.exec
@@ -506,17 +529,20 @@ functions:
506529
- ${workdir}/bin
507530
- ${workdir}
508531

509-
pipeline:
532+
build_test_image_ibm:
510533
- *switch_context
511-
- command: shell.exec
512-
type: setup
534+
- command: subprocess.exec
513535
params:
514536
shell: bash
515-
script: |
516-
# Docker Hub workaround
517-
# docker buildx needs the moby/buildkit image when setting up a builder so we pull it from our mirror
518-
docker buildx create --driver=docker-container --driver-opt=image=268558157000.dkr.ecr.eu-west-1.amazonaws.com/docker-hub-mirrors/moby/buildkit:buildx-stable-1 --use
519-
docker buildx inspect --bootstrap
537+
working_dir: src/github.com/mongodb/mongodb-kubernetes
538+
include_expansions_in_env:
539+
- version_id
540+
add_to_path:
541+
- ${workdir}/bin
542+
binary: scripts/evergreen/e2e/build_tests_image_ibm.sh
543+
544+
pipeline:
545+
- *switch_context
520546
- command: subprocess.exec
521547
retry_on_failure: true
522548
type: setup

.evergreen.yml

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ variables:
7171
- func: download_kube_tools
7272
- func: setup_building_host
7373

74+
- &setup_group_ibm
75+
setup_group_can_fail_task: true
76+
setup_group:
77+
- func: clone
78+
- func: setup_building_host_minikube
79+
- func: build_multi_cluster_binary
80+
7481
- &setup_group_multi_cluster
7582
setup_group_can_fail_task: true
7683
setup_group:
@@ -379,6 +386,18 @@ tasks:
379386
image_name: agent
380387
all_agents: "--all-agents"
381388

389+
- name: release_all_currently_used_agents_on_ecr
390+
# this enables us to run this manually (patch) and release all agent versions to ECR to verify
391+
# Dockerfile, script changes etc.
392+
allowed_requesters: [ "patch" ]
393+
commands:
394+
- func: clone
395+
- func: setup_building_host
396+
- func: pipeline
397+
vars:
398+
image_name: agent
399+
all_agents: "--current-agents"
400+
382401
- name: build_test_image
383402
commands:
384403
- func: clone
@@ -388,6 +407,21 @@ tasks:
388407
vars:
389408
image_name: meko-tests
390409

410+
- name: build_test_image_ibm
411+
commands:
412+
- func: clone
413+
- command: subprocess.exec
414+
type: setup
415+
params:
416+
env:
417+
SKIP_MINIKUBE_SETUP: "true"
418+
working_dir: src/github.com/mongodb/mongodb-kubernetes
419+
add_to_path:
420+
- ${workdir}/bin
421+
command: scripts/evergreen/setup_minikube_host.sh
422+
- func: build_multi_cluster_binary
423+
- func: build_test_image_ibm
424+
391425
- name: build_mco_test_image
392426
commands:
393427
- func: clone
@@ -1147,6 +1181,22 @@ task_groups:
11471181
- e2e_om_ops_manager_backup
11481182
<<: *teardown_group
11491183

1184+
- name: e2e_smoke_arm_task_group
1185+
max_hosts: -1
1186+
<<: *setup_group
1187+
<<: *setup_and_teardown_task_cloudqa
1188+
tasks:
1189+
- e2e_replica_set
1190+
<<: *teardown_group
1191+
1192+
- name: e2e_smoke_ibm_task_group
1193+
max_hosts: -1
1194+
<<: *setup_group_ibm
1195+
<<: *setup_and_teardown_task_cloudqa
1196+
tasks:
1197+
- e2e_replica_set
1198+
<<: *teardown_group
1199+
11501200
- name: e2e_ops_manager_kind_5_0_only_task_group
11511201
max_hosts: -1
11521202
<<: *setup_group
@@ -1410,6 +1460,118 @@ buildvariants:
14101460
tasks:
14111461
- name: e2e_smoke_task_group
14121462

1463+
- name: e2e_smoke_ibm_power
1464+
display_name: e2e_smoke_ibm_power
1465+
tags: [ "e2e_test_suite", "e2e_smoke_release_test_suite" ]
1466+
run_on:
1467+
- rhel9-power-small
1468+
- rhel9-power-large
1469+
allowed_requesters: [ "patch", "github_tag" ]
1470+
depends_on:
1471+
- name: build_operator_ubi
1472+
variant: init_test_run
1473+
- name: build_init_database_image_ubi
1474+
variant: init_test_run
1475+
- name: build_database_image_ubi
1476+
variant: init_test_run
1477+
- name: build_init_appdb_images_ubi
1478+
variant: init_test_run
1479+
- name: build_init_om_images_ubi
1480+
variant: init_test_run
1481+
- name: build_test_image_ibm
1482+
variant: init_test_run_ibm_power
1483+
tasks:
1484+
- name: e2e_smoke_ibm_task_group
1485+
1486+
- name: e2e_smoke_ibm_z
1487+
display_name: e2e_smoke_ibm_z
1488+
tags: [ "e2e_test_suite", "e2e_smoke_release_test_suite" ]
1489+
run_on:
1490+
- rhel9-zseries-small
1491+
- rhel9-zseries-large
1492+
allowed_requesters: [ "patch", "github_tag" ]
1493+
depends_on:
1494+
- name: build_operator_ubi
1495+
variant: init_test_run
1496+
- name: build_init_database_image_ubi
1497+
variant: init_test_run
1498+
- name: build_database_image_ubi
1499+
variant: init_test_run
1500+
- name: build_init_appdb_images_ubi
1501+
variant: init_test_run
1502+
- name: build_init_om_images_ubi
1503+
variant: init_test_run
1504+
- name: build_test_image_ibm
1505+
variant: init_test_run_ibm_z
1506+
tasks:
1507+
- name: e2e_smoke_ibm_task_group
1508+
1509+
- name: e2e_smoke_arm
1510+
display_name: e2e_smoke_arm
1511+
tags: [ "e2e_test_suite", "e2e_smoke_release_test_suite" ]
1512+
run_on:
1513+
- ubuntu2204-arm64-large
1514+
allowed_requesters: [ "patch", "github_tag" ]
1515+
<<: *base_no_om_image_dependency
1516+
tasks:
1517+
- name: e2e_smoke_arm_task_group
1518+
1519+
- name: e2e_static_smoke_arm
1520+
display_name: e2e_smoke_arm
1521+
tags: [ "e2e_test_suite", "e2e_smoke_release_test_suite" ]
1522+
run_on:
1523+
- ubuntu2204-arm64-large
1524+
allowed_requesters: [ "patch", "github_tag" ]
1525+
<<: *base_no_om_image_dependency
1526+
tasks:
1527+
- name: e2e_smoke_arm_task_group
1528+
1529+
- name: e2e_static_smoke_ibm_z
1530+
display_name: e2e_static_smoke_ibm_z
1531+
tags: [ "e2e_test_suite", "e2e_smoke_release_test_suite" ]
1532+
run_on:
1533+
- rhel9-zseries-small
1534+
- rhel9-zseries-large
1535+
allowed_requesters: [ "patch", "github_tag" ]
1536+
depends_on:
1537+
- name: build_operator_ubi
1538+
variant: init_test_run
1539+
- name: build_init_database_image_ubi
1540+
variant: init_test_run
1541+
- name: build_database_image_ubi
1542+
variant: init_test_run
1543+
- name: build_init_appdb_images_ubi
1544+
variant: init_test_run
1545+
- name: build_init_om_images_ubi
1546+
variant: init_test_run
1547+
- name: build_test_image_ibm
1548+
variant: init_test_run_ibm_z
1549+
tasks:
1550+
- name: e2e_smoke_ibm_task_group
1551+
1552+
- name: e2e_static_smoke_ibm_power
1553+
display_name: e2e_static_smoke_ibm_power
1554+
tags: [ "e2e_test_suite", "e2e_smoke_release_test_suite" ]
1555+
run_on:
1556+
- rhel9-power-small
1557+
- rhel9-power-large
1558+
allowed_requesters: [ "patch", "github_tag" ]
1559+
depends_on:
1560+
- name: build_operator_ubi
1561+
variant: init_test_run
1562+
- name: build_init_database_image_ubi
1563+
variant: init_test_run
1564+
- name: build_database_image_ubi
1565+
variant: init_test_run
1566+
- name: build_init_appdb_images_ubi
1567+
variant: init_test_run
1568+
- name: build_init_om_images_ubi
1569+
variant: init_test_run
1570+
- name: build_test_image_ibm
1571+
variant: init_test_run_ibm_power
1572+
tasks:
1573+
- name: e2e_smoke_ibm_task_group
1574+
14131575
- name: e2e_static_smoke
14141576
display_name: e2e_static_smoke
14151577
tags: [ "e2e_test_suite", "e2e_smoke_release_test_suite" ]
@@ -1623,6 +1785,24 @@ buildvariants:
16231785
- name: build_upgrade_hook_image
16241786
- name: prepare_aws
16251787

1788+
- name: init_test_run_ibm_power
1789+
display_name: init_test_run_ibm_power
1790+
max_hosts: -1
1791+
run_on:
1792+
- rhel9-power-small
1793+
- rhel9-power-large
1794+
tasks:
1795+
- name: build_test_image_ibm
1796+
1797+
- name: init_test_run_ibm_z
1798+
display_name: init_test_run_ibm_z
1799+
max_hosts: -1
1800+
run_on:
1801+
- rhel9-zseries-small
1802+
- rhel9-zseries-large
1803+
tasks:
1804+
- name: build_test_image_ibm
1805+
16261806
- name: run_pre_commit
16271807
priority: 70
16281808
display_name: run_pre_commit
@@ -1795,6 +1975,16 @@ buildvariants:
17951975
tasks:
17961976
- name: release_all_agents_on_ecr
17971977

1978+
# Only called manually, It's used for testing the task release_agents_on_ecr in case the release.json
1979+
# has not changed, and you still want to push the images to ecr.
1980+
- name: manual_ecr_release_agent_currently_used
1981+
display_name: manual_ecr_release_agent_currently_used
1982+
tags: [ "release_all_agents_manually" ]
1983+
run_on:
1984+
- ubuntu2204-large
1985+
tasks:
1986+
- name: release_all_currently_used_agents_on_ecr
1987+
17981988
# These variants are used to test the code snippets and each one can be used in patches
17991989
# Prerelease is especially used when the repo is tagged
18001990
# More details in the TD: https://docs.google.com/document/d/1fuTxfRtP8QPtn7sKYxQM_AGcD6xycTZH8svngGxyKhc/edit?tab=t.0#bookmark=id.e8uva0393mbe

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ ac:
147147
# in parallel and both call 'aws_login') then Docker login may return an error "Error saving credentials:..The
148148
# specified item already exists in the keychain". Seems this allows to ignore the error
149149
aws_login:
150-
@ scripts/dev/configure_docker_auth.sh
150+
@ scripts/dev/configure_container_auth.sh
151151

152152
# cleans up aws resources, including s3 buckets which are older than 5 hours
153153
aws_cleanup:

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,3 @@ Migration from [MongoDB Community Operator](https://github.com/mongodb/mongodb-k
5757
See our detailed migration guides:
5858
- [Migrating from MongoDB Community Operator](docs/migration/community-operator-migration.md)
5959
- [Migrating from MongoDB Enterprise Kubernetes Operator](https://www.mongodb.com/docs/kubernetes/current/tutorial/migrate-to-mck/)
60-

0 commit comments

Comments
 (0)