Skip to content

Commit 4189042

Browse files
committed
Merge branch 'master' into maciejk/pss-warn
# Conflicts: # helm_chart/templates/operator.yaml # scripts/evergreen/deployments/test-app/templates/mongodb-enterprise-tests.yaml
2 parents 2d2bb43 + 0617759 commit 4189042

File tree

305 files changed

+5073
-4509
lines changed

Some content is hidden

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

305 files changed

+5073
-4509
lines changed

.evergreen-functions.yml

Lines changed: 56 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ variables:
4545
- community_private_preview_pullsecret_dockerconfigjson
4646
- RELEASE_INITIAL_VERSION
4747
- RELEASE_INITIAL_COMMIT_SHA
48-
- RELEASE_OPERATOR_VERSION
48+
- OPERATOR_VERSION
49+
- READINESS_PROBE_VERSION
50+
- VERSION_UPGRADE_HOOK_VERSION
51+
- BUILD_SCENARIO
4952

5053
functions:
5154

@@ -77,19 +80,15 @@ functions:
7780
echo "Finished initializing to the root context"
7881
7982
switch_context: &switch_context
80-
command: shell.exec
83+
command: subprocess.exec
8184
type: setup
8285
params:
83-
shell: bash
8486
working_dir: src/github.com/mongodb/mongodb-kubernetes
8587
<<: *e2e_include_expansions_in_env
8688
add_to_path:
8789
- ${workdir}/bin
8890
- ${workdir}/google-cloud-sdk/bin
89-
script: |
90-
echo "Switching context"
91-
scripts/dev/switch_context.sh "${build_variant}"
92-
echo "Finished switching context"
91+
command: scripts/dev/switch_context.sh "${build_variant}"
9392

9493
python_venv: &python_venv
9594
command: subprocess.exec
@@ -223,6 +222,19 @@ functions:
223222
working_dir: src/github.com/mongodb/mongodb-kubernetes
224223
binary: scripts/evergreen/setup_docker_sbom.sh
225224

225+
helm_registry_login:
226+
command: subprocess.exec
227+
type: setup
228+
params:
229+
working_dir: src/github.com/mongodb/mongodb-kubernetes
230+
include_expansions_in_env:
231+
- quay_prod_username
232+
- quay_prod_robot_token
233+
add_to_path:
234+
- ${workdir}/bin
235+
- ${PROJECT_DIR}/bin
236+
binary: scripts/release/helm_registry_login.sh
237+
226238
# Logs into all used registries
227239
configure_docker_auth: &configure_docker_auth
228240
command: subprocess.exec
@@ -249,7 +261,7 @@ functions:
249261
working_dir: src/github.com/mongodb/mongodb-kubernetes
250262
add_to_path:
251263
- ${workdir}/bin
252-
command: scripts/dev/setup_chart_testing_cli.sh
264+
command: scripts/dev/setup_chart_testing_cli.sh
253265

254266
lint_repo:
255267
- command: subprocess.exec
@@ -271,7 +283,6 @@ functions:
271283

272284
# Configures docker authentication to ECR and RH registries.
273285
setup_building_host:
274-
- *switch_context
275286
- *python_venv
276287
- *setup_aws
277288
- *setup_evg_host
@@ -280,7 +291,6 @@ functions:
280291
# This differs for normal evg_host as we require minikube instead of kind for
281292
# IBM machines also install aws cli via pip instead and use podman
282293
setup_building_host_minikube:
283-
- *switch_context
284294
- command: subprocess.exec
285295
type: setup
286296
params:
@@ -305,7 +315,6 @@ functions:
305315
# the task configures the set of tools necessary for any task working with K8 cluster:
306316
# installs kubectl, jq, kind (if necessary), configures docker authentication
307317
download_kube_tools:
308-
- *switch_context
309318
- *setup_kubectl
310319
- *setup_jq
311320
# we need aws to configure docker authentication
@@ -355,7 +364,6 @@ functions:
355364
command: "docker login quay.io -u ${quay_prod_username} -p ${quay_prod_robot_token}"
356365

357366
setup_cloud_qa:
358-
- *switch_context
359367
- command: shell.exec
360368
type: setup
361369
params:
@@ -486,7 +494,6 @@ functions:
486494
files: [ "src/github.com/mongodb/mongodb-kubernetes/logs/*.suite" ]
487495

488496
preflight_image:
489-
- *switch_context
490497
- command: subprocess.exec
491498
params:
492499
working_dir: src/github.com/mongodb/mongodb-kubernetes
@@ -497,13 +504,19 @@ functions:
497504
- rh_pyxis
498505
binary: scripts/dev/run_python.sh scripts/preflight_images.py --image ${image_name} --submit "${preflight_submit}"
499506

500-
build_multi_cluster_binary:
507+
# publish_helm_chart packages and publishes the MCK helm chart to the OCI container registry
508+
publish_helm_chart:
501509
- command: subprocess.exec
502-
type: setup
503510
params:
504511
working_dir: src/github.com/mongodb/mongodb-kubernetes
505-
binary: scripts/evergreen/build_multi_cluster_kubeconfig_creator.sh
512+
binary: scripts/release/publish_helm_chart.sh
506513

514+
build_multi_cluster_binary:
515+
- command: subprocess.exec
516+
params:
517+
working_dir: src/github.com/mongodb/mongodb-kubernetes
518+
binary: scripts/dev/run_python.sh scripts/release/kubectl_mongodb/python/build_kubectl_plugin.py
519+
507520
build_and_push_appdb_database:
508521
- command: subprocess.exec
509522
params:
@@ -514,54 +527,29 @@ functions:
514527
- ${workdir}
515528

516529
build_test_image_ibm:
517-
- *switch_context
518530
- command: subprocess.exec
519531
params:
520532
shell: bash
521533
working_dir: src/github.com/mongodb/mongodb-kubernetes
522-
include_expansions_in_env:
523-
- version_id
524534
add_to_path:
525535
- ${workdir}/bin
526536
binary: scripts/evergreen/e2e/build_tests_image_ibm.sh
527537

528-
pipeline_migrate_agents:
529-
- *switch_context
530-
- command: subprocess.exec
531-
retry_on_failure: false
532-
type: setup
533-
params:
534-
shell: bash
535-
<<: *e2e_include_expansions_in_env
536-
working_dir: src/github.com/mongodb/mongodb-kubernetes
537-
binary: scripts/release/pipeline_migrate_agent.sh
538-
539538
pipeline:
540-
- *switch_context
541-
- command: subprocess.exec
542-
retry_on_failure: true
543-
type: setup
544-
params:
545-
shell: bash
546-
<<: *e2e_include_expansions_in_env
547-
working_dir: src/github.com/mongodb/mongodb-kubernetes
548-
binary: scripts/dev/run_python.sh scripts/release/pipeline_main.py --parallel ${image_name} ${all_agents} ${build_scenario}
549-
550-
# TODO: this function is very similar to pipeline and it will joined with it in the future
551-
release_operator_pipeline:
552-
- *switch_context
553539
- command: subprocess.exec
554540
retry_on_failure: true
555541
type: setup
556542
params:
557543
shell: bash
558544
<<: *e2e_include_expansions_in_env
559545
working_dir: src/github.com/mongodb/mongodb-kubernetes
560-
# By default, use the git tag that triggered the task which can be overridden with RELEASE_OPERATOR_VERSION
561-
binary: scripts/dev/run_python.sh scripts/release/pipeline_main.py ${image_name} --build-scenario release --version ${RELEASE_OPERATOR_VERSION|*triggered_by_git_tag}
546+
binary: scripts/release/pipeline.sh
547+
env:
548+
IMAGE_NAME: ${image_name}
549+
BUILD_SCENARIO_OVERRIDE: ${build_scenario}
550+
FLAGS: ${flags}
562551

563552
teardown_cloud_qa_all:
564-
- *switch_context
565553
- command: shell.exec
566554
type: setup
567555
params:
@@ -717,7 +705,6 @@ functions:
717705
make sbom-tests
718706
719707
generate_perf_tests_tasks:
720-
- *switch_context
721708
- command: shell.exec
722709
type: setup
723710
params:
@@ -802,7 +789,6 @@ functions:
802789

803790
# it executes a script by convention: ./scripts/code_snippets/tests/${task_name}
804791
test_code_snippets:
805-
- *switch_context
806792
- command: shell.exec
807793
params:
808794
shell: bash
@@ -829,6 +815,7 @@ functions:
829815
curl -fL "${goreleaser_pro_tar_gz}" --output goreleaser_Linux_x86_64.tar.gz
830816
tar -xf goreleaser_Linux_x86_64.tar.gz
831817
chmod 755 ./goreleaser
818+
sudo cp goreleaser /usr/local/bin/
832819
833820
install_macos_notarization_service:
834821
- command: shell.exec
@@ -843,10 +830,27 @@ functions:
843830
unzip -u macos-notary.zip
844831
chmod 755 ./linux_amd64/macnotary
845832
833+
create_chart_release_pr:
834+
- command: github.generate_token
835+
params:
836+
repo: helm-charts
837+
expansion_name: GH_TOKEN
838+
- command: subprocess.exec
839+
type: setup
840+
params:
841+
working_dir: src/github.com/mongodb/mongodb-kubernetes
842+
include_expansions_in_env:
843+
- GH_TOKEN
844+
- workdir
845+
- OPERATOR_VERSION
846+
env:
847+
GH_TOKEN: ${GH_TOKEN}
848+
binary: scripts/dev/run_python.sh scripts/release/create_chart_release_pr.py --chart_version ${OPERATOR_VERSION|*triggered_by_git_tag}
849+
846850
release_kubectl_mongodb_plugin:
847851
- command: github.generate_token
848852
params:
849-
expansion_name: generated_token
853+
expansion_name: GH_TOKEN
850854
- command: shell.exec
851855
type: setup
852856
params:
@@ -862,17 +866,12 @@ functions:
862866
- macos_notary_secret
863867
- workdir
864868
- triggered_by_git_tag
865-
- RELEASE_OPERATOR_VERSION
869+
- OPERATOR_VERSION
866870
env:
867871
XDG_CONFIG_HOME: ${go_base_path}${workdir}
868872
GO111MODULE: "on"
869873
GOROOT: "/opt/golang/go1.24"
870874
MACOS_NOTARY_KEY: ${macos_notary_keyid}
871875
MACOS_NOTARY_SECRET: ${macos_notary_secret}
872-
# shell.exec EVG Task doesn't have add_to_path, so we need to explicitly add the path export below.
873-
script: |
874-
set -Eeu pipefail
875-
export GORELEASER_CURRENT_TAG=${RELEASE_OPERATOR_VERSION|*triggered_by_git_tag}
876-
export PATH=$GOROOT/bin:$PATH
877-
export GITHUB_TOKEN=${generated_token}
878-
${workdir}/goreleaser release --clean
876+
GH_TOKEN: ${GH_TOKEN}
877+
script: scripts/dev/run_python.sh scripts/release/kubectl_mongodb/python/promote_kubectl_plugin.py

.evergreen-release.yml

Lines changed: 65 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ tasks:
1313
- func: pipeline
1414
vars:
1515
image_name: meko-tests
16-
build_scenario: --build-scenario patch
1716

1817
- name: release_operator
1918
tags: [ "image_release" ]
@@ -22,7 +21,7 @@ tasks:
2221
- func: clone
2322
- func: setup_building_host
2423
- func: quay_login
25-
- func: release_operator_pipeline
24+
- func: pipeline
2625
vars:
2726
image_name: operator
2827

@@ -34,7 +33,7 @@ tasks:
3433
- func: clone
3534
- func: setup_building_host
3635
- func: quay_login
37-
- func: release_operator_pipeline
36+
- func: pipeline
3837
vars:
3938
image_name: init-appdb
4039

@@ -45,7 +44,7 @@ tasks:
4544
- func: clone
4645
- func: setup_building_host
4746
- func: quay_login
48-
- func: release_operator_pipeline
47+
- func: pipeline
4948
vars:
5049
image_name: init-database
5150

@@ -56,7 +55,7 @@ tasks:
5655
- func: clone
5756
- func: setup_building_host
5857
- func: quay_login
59-
- func: release_operator_pipeline
58+
- func: pipeline
6059
vars:
6160
image_name: init-ops-manager
6261

@@ -67,10 +66,32 @@ tasks:
6766
- func: clone
6867
- func: setup_building_host
6968
- func: quay_login
70-
- func: release_operator_pipeline
69+
- func: pipeline
7170
vars:
7271
image_name: database
7372

73+
- name: release_readiness_probe
74+
tags: [ "image_release" ]
75+
allowed_requesters: [ "patch", "github_tag" ]
76+
commands:
77+
- func: clone
78+
- func: setup_building_host
79+
- func: quay_login
80+
- func: pipeline
81+
vars:
82+
image_name: readiness-probe
83+
84+
- name: release_version_upgrade_hook
85+
tags: [ "image_release" ]
86+
allowed_requesters: [ "patch", "github_tag" ]
87+
commands:
88+
- func: clone
89+
- func: setup_building_host
90+
- func: quay_login
91+
- func: pipeline
92+
vars:
93+
image_name: upgrade-hook
94+
7495
- name: prepare_and_upload_openshift_bundles
7596
tags: [ "openshift_bundles" ]
7697
allowed_requesters: [ "patch", "github_tag" ]
@@ -104,8 +125,26 @@ tasks:
104125
- func: clone
105126
- func: install_goreleaser
106127
- func: install_macos_notarization_service
128+
- func: python_venv
107129
- func: release_kubectl_mongodb_plugin
108130

131+
- name: create_chart_release_pr
132+
tags: [ "helm_chart_release_pr" ]
133+
commands:
134+
- func: clone
135+
- func: python_venv
136+
- func: create_chart_release_pr
137+
138+
- name: release_chart_to_oci_registry
139+
tags: [ "release_chart_to_oci_registry" ]
140+
commands:
141+
- func: clone
142+
- func: python_venv
143+
- func: setup_kubectl
144+
- func: setup_aws
145+
- func: helm_registry_login
146+
- func: publish_helm_chart
147+
109148
### Release build variants
110149
buildvariants:
111150

@@ -122,6 +161,8 @@ buildvariants:
122161
- name: release_init_database
123162
- name: release_init_ops_manager
124163
- name: release_database
164+
- name: release_readiness_probe
165+
- name: release_version_upgrade_hook
125166

126167
- name: preflight_release_images
127168
display_name: preflight_release_images
@@ -220,3 +261,21 @@ buildvariants:
220261
allowed_requesters: [ "patch", "github_tag" ]
221262
tasks:
222263
- name: release_kubectl_mongodb_plugin
264+
265+
- name: create_chart_release_pr
266+
display_name: create_chart_release_pr
267+
tags: [ "release" ]
268+
run_on:
269+
- release-ubuntu2404-small # This is required for CISA attestation https://jira.mongodb.org/browse/DEVPROD-17780
270+
allowed_requesters: [ "patch", "github_tag" ]
271+
tasks:
272+
- name: create_chart_release_pr
273+
274+
- name: release_chart_to_oci_registry
275+
display_name: release_chart_to_oci_registry
276+
tags: [ "release" ]
277+
run_on:
278+
- release-ubuntu2404-small # This is required for CISA attestation https://jira.mongodb.org/browse/DEVPROD-17780
279+
allowed_requesters: [ "patch", "github_tag" ]
280+
tasks:
281+
- name: release_chart_to_oci_registry

0 commit comments

Comments
 (0)