Skip to content

Commit d801c48

Browse files
committed
Merge branch 'master' into CLOUDP-336718_om_image_version_bump
# Conflicts: # docker/mongodb-agent-non-matrix/Dockerfile.builder
2 parents c9ebd7a + 3e482c3 commit d801c48

File tree

57 files changed

+1810
-877
lines changed

Some content is hidden

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

57 files changed

+1810
-877
lines changed

.evergreen-functions.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,43 @@ functions:
505505
- ${workdir}
506506

507507
pipeline:
508+
- *switch_context
509+
- command: shell.exec
510+
type: setup
511+
params:
512+
shell: bash
513+
script: |
514+
# Docker Hub workaround
515+
# docker buildx needs the moby/buildkit image when setting up a builder so we pull it from our mirror
516+
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
517+
docker buildx inspect --bootstrap
518+
- command: ec2.assume_role
519+
display_name: Assume IAM role with permissions to pull Kondukto API token
520+
params:
521+
role_arn: ${kondukto_role_arn}
522+
- command: shell.exec
523+
display_name: Pull Kondukto API token from AWS Secrets Manager and write it to file
524+
params:
525+
silent: true
526+
shell: bash
527+
include_expansions_in_env: [AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN]
528+
script: |
529+
set -e
530+
# use AWS CLI to get the Kondukto API token from AWS Secrets Manager
531+
kondukto_token=$(aws secretsmanager get-secret-value --secret-id "kondukto-token" --region "us-east-1" --query 'SecretString' --output text)
532+
# write the KONDUKTO_TOKEN environment variable to Silkbomb environment file
533+
echo "KONDUKTO_TOKEN=$kondukto_token" > ${workdir}/silkbomb.env
534+
- command: subprocess.exec
535+
retry_on_failure: true
536+
type: setup
537+
params:
538+
shell: bash
539+
<<: *e2e_include_expansions_in_env
540+
working_dir: src/github.com/mongodb/mongodb-kubernetes
541+
binary: scripts/dev/run_python.sh scripts/release/pipeline_main.py --parallel ${image_name}
542+
543+
# TODO: CLOUDP-335471 ; once all image builds are made with the new atomic pipeline, remove the following function
544+
legacy_pipeline:
508545
- *switch_context
509546
- command: shell.exec
510547
type: setup

.evergreen-periodic-builds.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ variables:
2121
tasks:
2222
- name: periodic_build_operator
2323
commands:
24-
- func: pipeline
24+
- func: legacy_pipeline
2525
vars:
2626
image_name: operator-daily
2727

@@ -35,49 +35,49 @@ tasks:
3535

3636
- name: periodic_build_init_appdb
3737
commands:
38-
- func: pipeline
38+
- func: legacy_pipeline
3939
vars:
4040
image_name: init-appdb-daily
4141

4242
- name: periodic_build_init_database
4343
commands:
44-
- func: pipeline
44+
- func: legacy_pipeline
4545
vars:
4646
image_name: init-database-daily
4747

4848
- name: periodic_build_init_opsmanager
4949
commands:
50-
- func: pipeline
50+
- func: legacy_pipeline
5151
vars:
5252
image_name: init-ops-manager-daily
5353

5454
- name: periodic_build_database
5555
commands:
56-
- func: pipeline
56+
- func: legacy_pipeline
5757
vars:
5858
image_name: database-daily
5959

6060
- name: periodic_build_sbom_cli
6161
commands:
62-
- func: pipeline
62+
- func: legacy_pipeline
6363
vars:
6464
image_name: cli
6565

6666
- name: periodic_build_ops_manager_6
6767
commands:
68-
- func: pipeline
68+
- func: legacy_pipeline
6969
vars:
7070
image_name: ops-manager-6-daily
7171

7272
- name: periodic_build_ops_manager_7
7373
commands:
74-
- func: pipeline
74+
- func: legacy_pipeline
7575
vars:
7676
image_name: ops-manager-7-daily
7777

7878
- name: periodic_build_ops_manager_8
7979
commands:
80-
- func: pipeline
80+
- func: legacy_pipeline
8181
vars:
8282
image_name: ops-manager-8-daily
8383

@@ -91,15 +91,15 @@ tasks:
9191
exec_timeout_secs: 43200
9292
commands:
9393
- func: enable_QEMU
94-
- func: pipeline
94+
- func: legacy_pipeline
9595
vars:
9696
image_name: mongodb-agent-daily
9797

9898
- name: periodic_build_agent_1
9999
exec_timeout_secs: 43200
100100
commands:
101101
- func: enable_QEMU
102-
- func: pipeline
102+
- func: legacy_pipeline
103103
vars:
104104
image_name: mongodb-agent-1-daily
105105

@@ -123,19 +123,19 @@ tasks:
123123
- name: periodic_build_community_operator
124124
commands:
125125
- func: enable_QEMU
126-
- func: pipeline
126+
- func: legacy_pipeline
127127
vars:
128128
image_name: mongodb-kubernetes-operator-daily
129129

130130
- name: periodic_build_readiness_probe
131131
commands:
132-
- func: pipeline
132+
- func: legacy_pipeline
133133
vars:
134134
image_name: readinessprobe-daily
135135

136136
- name: periodic_build_version_upgrade_post_start_hook
137137
commands:
138-
- func: pipeline
138+
- func: legacy_pipeline
139139
vars:
140140
image_name: operator-version-upgrade-post-start-hook-daily
141141

.evergreen.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ tasks:
283283
- func: setup_building_host
284284
- func: quay_login
285285
- func: setup_docker_sbom
286-
- func: pipeline
286+
- func: legacy_pipeline
287287
vars:
288288
image_name: operator
289289
include_tags: release
@@ -297,7 +297,7 @@ tasks:
297297
- func: setup_building_host
298298
- func: quay_login
299299
- func: setup_docker_sbom
300-
- func: pipeline
300+
- func: legacy_pipeline
301301
vars:
302302
image_name: init-appdb
303303
include_tags: release
@@ -310,7 +310,7 @@ tasks:
310310
- func: setup_building_host
311311
- func: quay_login
312312
- func: setup_docker_sbom
313-
- func: pipeline
313+
- func: legacy_pipeline
314314
vars:
315315
image_name: init-database
316316
include_tags: release
@@ -323,7 +323,7 @@ tasks:
323323
- func: setup_building_host
324324
- func: quay_login
325325
- func: setup_docker_sbom
326-
- func: pipeline
326+
- func: legacy_pipeline
327327
vars:
328328
image_name: init-ops-manager
329329
include_tags: release
@@ -336,7 +336,7 @@ tasks:
336336
- func: setup_building_host
337337
- func: quay_login
338338
- func: setup_docker_sbom
339-
- func: pipeline
339+
- func: legacy_pipeline
340340
vars:
341341
image_name: agent
342342
include_tags: release
@@ -350,7 +350,7 @@ tasks:
350350
- func: setup_building_host
351351
- func: quay_login
352352
- func: setup_docker_sbom
353-
- func: pipeline
353+
- func: legacy_pipeline
354354
vars:
355355
image_name: agent-pct
356356
include_tags: release
@@ -395,7 +395,7 @@ tasks:
395395
commands:
396396
- func: clone
397397
- func: setup_building_host
398-
- func: pipeline
398+
- func: legacy_pipeline
399399
vars:
400400
image_name: agent-pct
401401
skip_tags: release
@@ -410,7 +410,7 @@ tasks:
410410
commands:
411411
- func: clone
412412
- func: setup_building_host
413-
- func: pipeline
413+
- func: legacy_pipeline
414414
vars:
415415
image_name: agent-pct
416416
skip_tags: release
@@ -462,9 +462,6 @@ tasks:
462462
skip_tags: ubuntu,release
463463

464464
- name: build_agent_images_ubi
465-
depends_on:
466-
- name: build_init_database_image_ubi
467-
variant: init_test_run
468465
commands:
469466
- func: clone
470467
- func: setup_building_host
@@ -554,7 +551,7 @@ tasks:
554551
- func: setup_building_host
555552
- func: quay_login
556553
- func: setup_docker_sbom
557-
- func: pipeline
554+
- func: legacy_pipeline
558555
vars:
559556
image_name: database
560557

@@ -573,7 +570,7 @@ tasks:
573570
- func: setup_building_host
574571
- func: quay_login
575572
- func: setup_docker_sbom
576-
- func: pipeline
573+
- func: legacy_pipeline
577574
vars:
578575
image_name: ops-manager
579576
include_tags: release

Makefile

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ operator: configure-operator build-and-push-operator-image
7575

7676
# build-push, (todo) restart database
7777
database: aws_login
78-
@ scripts/dev/run_python.sh pipeline.py --include database
78+
@ scripts/dev/run_python.sh scripts/release/pipeline_main.py database
7979

8080
readiness_probe: aws_login
81-
@ scripts/dev/run_python.sh pipeline.py --include readiness-probe
81+
@ scripts/dev/run_python.sh scripts/release/pipeline_main.py readiness-probe
8282

8383
upgrade_hook: aws_login
84-
@ scripts/dev/run_python.sh pipeline.py --include upgrade-hook
84+
@ scripts/dev/run_python.sh scripts/release/pipeline_main.py upgrade-hook
8585

8686
# ensures cluster is up, cleans Kubernetes + OM, build-push-deploy operator,
8787
# push-deploy database, create secrets, config map, resources etc
@@ -90,7 +90,7 @@ full: build-and-push-images
9090

9191
# build-push appdb image
9292
appdb: aws_login
93-
@ scripts/dev/run_python.sh pipeline.py --include appdb
93+
@ scripts/dev/run_python.sh scripts/release/pipeline_main.py --include appdb
9494

9595
# runs the e2e test: make e2e test=e2e_sharded_cluster_pv. The Operator is redeployed before the test, the namespace is cleaned.
9696
# The e2e test image is built and pushed together with all main ones (operator, database, init containers)
@@ -154,19 +154,19 @@ aws_cleanup:
154154
@ scripts/evergreen/prepare_aws.sh
155155

156156
build-and-push-operator-image: aws_login
157-
@ scripts/dev/run_python.sh pipeline.py --include operator-quick
157+
@ scripts/dev/run_python.sh scripts/release/pipeline_main.py operator
158158

159159
build-and-push-database-image: aws_login
160160
@ scripts/dev/build_push_database_image
161161

162162
build-and-push-test-image: aws_login build-multi-cluster-binary
163163
@ if [[ -z "$(local)" ]]; then \
164-
scripts/dev/run_python.sh pipeline.py --include test; \
164+
scripts/dev/run_python.sh scripts/release/pipeline_main.py test; \
165165
fi
166166

167167
build-and-push-mco-test-image: aws_login
168168
@ if [[ -z "$(local)" ]]; then \
169-
scripts/dev/run_python.sh pipeline.py --include mco-test; \
169+
scripts/dev/run_python.sh scripts/release/pipeline_main.py mco-test; \
170170
fi
171171

172172
build-multi-cluster-binary:
@@ -181,27 +181,27 @@ build-and-push-images: build-and-push-operator-image appdb-init-image om-init-im
181181
build-and-push-init-images: appdb-init-image om-init-image database-init-image
182182

183183
database-init-image:
184-
@ scripts/dev/run_python.sh pipeline.py --include init-database
184+
@ scripts/dev/run_python.sh scripts/release/pipeline_main.py init-database
185185

186186
appdb-init-image:
187-
@ scripts/dev/run_python.sh pipeline.py --include init-appdb
187+
@ scripts/dev/run_python.sh scripts/release/pipeline_main.py init-appdb
188188

189189
# Not setting a parallel-factor will default to 0 which will lead to using all CPUs, that can cause docker to die.
190190
# Here we are defaulting to 6, a higher value might work for you.
191191
agent-image:
192-
@ scripts/dev/run_python.sh pipeline.py --include agent --all-agents --parallel --parallel-factor 6
192+
@ scripts/dev/run_python.sh scripts/release/pipeline_main.py --parallel --parallel-factor 6 agent
193193

194194
agent-image-slow:
195-
@ scripts/dev/run_python.sh pipeline.py --include agent --parallel-factor 1
195+
@ scripts/dev/run_python.sh scripts/release/pipeline_main.py --parallel-factor 1 agent
196196

197197
operator-image:
198-
@ scripts/dev/run_python.sh pipeline.py --include operator
198+
@ scripts/dev/run_python.sh scripts/release/pipeline_main.py operator
199199

200200
om-init-image:
201-
@ scripts/dev/run_python.sh pipeline.py --include init-ops-manager
201+
@ scripts/dev/run_python.sh scripts/release/pipeline_main.py init-ops-manager
202202

203203
om-image:
204-
@ scripts/dev/run_python.sh pipeline.py --include ops-manager
204+
@ scripts/dev/run_python.sh scripts/release/pipeline_main.py ops-manager
205205

206206
configure-operator:
207207
@ scripts/dev/configure_operator.sh
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Changing container setup of static architecture
3+
kind: fix
4+
date: 2025-08-06
5+
---
6+
7+
* This change fixes the current complex and difficult-to-maintain architecture for stateful set containers, which relies on an "agent matrix" to map operator and agent versions which led to a sheer amount of images.
8+
* We solve this by shifting to a 3-container setup. This new design eliminates the need for the operator-version/agent-version matrix by adding one additional container containing all required binaries. This architecture maps to what we already do with the mongodb-database container.

controllers/operator/common_controller.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ import (
4747
"github.com/mongodb/mongodb-kubernetes/pkg/util/architectures"
4848
"github.com/mongodb/mongodb-kubernetes/pkg/util/env"
4949
"github.com/mongodb/mongodb-kubernetes/pkg/util/stringutil"
50-
"github.com/mongodb/mongodb-kubernetes/pkg/util/versionutil"
5150
"github.com/mongodb/mongodb-kubernetes/pkg/vault"
5251
)
5352

@@ -684,9 +683,7 @@ func (r *ReconcileCommonController) getAgentVersion(conn om.Connection, omVersio
684683
return "", err
685684
} else {
686685
log.Debugf("Using agent version %s", agentVersion)
687-
currentOperatorVersion := versionutil.StaticContainersOperatorVersion()
688-
log.Debugf("Using Operator version: %s", currentOperatorVersion)
689-
return agentVersion + "_" + currentOperatorVersion, nil
686+
return agentVersion, nil
690687
}
691688
}
692689

0 commit comments

Comments
 (0)