Skip to content

Commit 749c1a3

Browse files
authored
CLOUDP-295785 - staging support for image building (#336)
# Summary PR integrates `staging` build scenario with `atomic_pipeline.py` and the e2e tests. `staging` repositories are created in AWS ECR under `/staging` dir. List of new `staging/` repositories: <img width="2239" height="756" alt="Screenshot 2025-08-13 at 14 39 55" src="https://github.com/user-attachments/assets/a23a500f-d0bd-4f39-9a74-72a2ca3ad6f6" /> Example AWS page with details: <img width="1654" height="994" alt="Screenshot 2025-08-11 at 21 26 51" src="https://github.com/user-attachments/assets/4e059aeb-fac3-4208-8cd0-a00692f7d673" /> Previously all of the evergreen patch builds were targeting `268558157000.dkr.ecr.us-east-1.amazonaws.com/dev` repository. Now, depending on the `BUILD_SCENARIO` environment variable images will be pushed to and pulled from different registry: - PATCH_REGISTRY="268558157000.dkr.ecr.us-east-1.amazonaws.com/dev" - STAGING_REGISTRY="268558157000.dkr.ecr.us-east-1.amazonaws.com/staging" - RELEASE_REGISTRY="quay.io/mongodb" Additional changes: - re-added missing `latest` tag for staging builds. This is used for local testing - moved all registry variables declarations to `root-context`. Previously they were duplicated in both `scripts/dev/contexts/evg-private-context` and `scripts/dev/contexts/local-defaults-context` - fixes multi arch smoke tests configuration. We can now run them also for released images (tbd) - started to use `OPERATOR_VERSION` instead of `VERSION_ID`. `VERSION_ID` was only related to patch builds, which did not apply for staging and release builds - BASE_REPO_URL_SHARED is now `268558157000.dkr.ecr.us-east-1.amazonaws.com/staging` because all latest tags are pushed on master builds - `build_scenario` now needs to be passed explicitly to `pipeline.py` as well as `version` (apart from `agent` image) ## Proof of Work Building all images is passing for staging scenario -> https://spruce.mongodb.com/version/68c7ce53672666000716401a/tasks?page=0&sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC Building all images is passing for release scenario (apart from kubectl which requires tag) -> https://spruce.mongodb.com/version/68c911ef8d38f100074fa2db/tasks?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC Example image stored together with signature -> https://us-east-1.console.aws.amazon.com/ecr/repositories/private/268558157000/staging/mongodb-kubernetes-init-database?region=us-east-1 ## Remaining work - [ ] Add guide on how to run `development` scenario for building the images using evergreen and directly `pipeline.py` - [ ] Fix `dummy` version in the `release_info.json` - this is already planned in [here](https://docs.google.com/document/d/1eJ8iKsI0libbpcJakGjxcPfbrTn8lmcZDbQH1UqMR_g/edit?tab=t.p76ry15gwmkk#bookmark=id.egtg1p95d1) ## Checklist - [ ] Have you linked a jira ticket and/or is the ticket in the title? - [ ] Have you checked whether your jira ticket required DOCSP changes? - [ ] 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
1 parent 6538475 commit 749c1a3

Some content is hidden

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

58 files changed

+502
-734
lines changed

.evergreen-functions.yml

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ variables:
4545
- community_private_preview_pullsecret_dockerconfigjson
4646
- RELEASE_INITIAL_VERSION
4747
- RELEASE_INITIAL_COMMIT_SHA
48-
- RELEASE_OPERATOR_VERSION
48+
- OPERATOR_VERSION
49+
- BUILD_SCENARIO
4950

5051
functions:
5152

@@ -509,43 +510,63 @@ functions:
509510
params:
510511
shell: bash
511512
working_dir: src/github.com/mongodb/mongodb-kubernetes
512-
include_expansions_in_env:
513-
- version_id
514513
add_to_path:
515514
- ${workdir}/bin
516515
binary: scripts/evergreen/e2e/build_tests_image_ibm.sh
517516

518-
pipeline_migrate_agents:
517+
pipeline:
519518
- command: subprocess.exec
520-
retry_on_failure: false
519+
retry_on_failure: true
521520
type: setup
522521
params:
523522
shell: bash
524523
<<: *e2e_include_expansions_in_env
525524
working_dir: src/github.com/mongodb/mongodb-kubernetes
526-
binary: scripts/release/pipeline_migrate_agent.sh
525+
binary: scripts/release/pipeline.sh
526+
env:
527+
IMAGE_NAME: ${IMAGE_NAME}
527528

528-
pipeline:
529+
pipeline_agent:
530+
- command: subprocess.exec
531+
retry_on_failure: true
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_agent.sh
538+
env:
539+
FLAGS: ${FLAGS}
540+
541+
pipeline_ops_manager:
542+
- command: subprocess.exec
543+
retry_on_failure: true
544+
type: setup
545+
params:
546+
shell: bash
547+
<<: *e2e_include_expansions_in_env
548+
working_dir: src/github.com/mongodb/mongodb-kubernetes
549+
binary: scripts/release/pipeline_ops_manager.sh
550+
551+
pipeline_readiness_probe:
529552
- command: subprocess.exec
530553
retry_on_failure: true
531554
type: setup
532555
params:
533556
shell: bash
534557
<<: *e2e_include_expansions_in_env
535558
working_dir: src/github.com/mongodb/mongodb-kubernetes
536-
binary: scripts/dev/run_python.sh scripts/release/pipeline_main.py --parallel ${image_name} ${all_agents} ${build_scenario}
559+
binary: scripts/release/pipeline_readiness_probe.sh
537560

538-
# TODO: this function is very similar to pipeline and it will joined with it in the future
539-
release_operator_pipeline:
561+
pipeline_version_upgrade_hook:
540562
- command: subprocess.exec
541563
retry_on_failure: true
542564
type: setup
543565
params:
544566
shell: bash
545567
<<: *e2e_include_expansions_in_env
546568
working_dir: src/github.com/mongodb/mongodb-kubernetes
547-
# By default, use the git tag that triggered the task which can be overridden with RELEASE_OPERATOR_VERSION
548-
binary: scripts/dev/run_python.sh scripts/release/pipeline_main.py ${image_name} --build-scenario release --version ${RELEASE_OPERATOR_VERSION|*triggered_by_git_tag}
569+
binary: scripts/release/pipeline_version_upgrade_hook.sh
549570

550571
teardown_cloud_qa_all:
551572
- command: shell.exec
@@ -846,7 +867,7 @@ functions:
846867
- macos_notary_secret
847868
- workdir
848869
- triggered_by_git_tag
849-
- RELEASE_OPERATOR_VERSION
870+
- OPERATOR_VERSION
850871
env:
851872
XDG_CONFIG_HOME: ${go_base_path}${workdir}
852873
GO111MODULE: "on"
@@ -856,7 +877,7 @@ functions:
856877
# shell.exec EVG Task doesn't have add_to_path, so we need to explicitly add the path export below.
857878
script: |
858879
set -Eeu pipefail
859-
export GORELEASER_CURRENT_TAG=${RELEASE_OPERATOR_VERSION|*triggered_by_git_tag}
880+
export GORELEASER_CURRENT_TAG=${OPERATOR_VERSION|*triggered_by_git_tag}
860881
export PATH=$GOROOT/bin:$PATH
861882
export GITHUB_TOKEN=${generated_token}
862883
${workdir}/goreleaser release --clean

.evergreen-release.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ tasks:
1212
- func: build_multi_cluster_binary
1313
- func: pipeline
1414
vars:
15-
image_name: meko-tests
16-
build_scenario: --build-scenario patch
15+
IMAGE_NAME: meko-tests
1716

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

2928
# Releases init images to Quay
3029
- name: release_init_appdb
@@ -34,9 +33,9 @@ tasks:
3433
- func: clone
3534
- func: setup_building_host
3635
- func: quay_login
37-
- func: release_operator_pipeline
36+
- func: pipeline
3837
vars:
39-
image_name: init-appdb
38+
IMAGE_NAME: init-appdb
4039

4140
- name: release_init_database
4241
tags: [ "image_release" ]
@@ -45,9 +44,9 @@ tasks:
4544
- func: clone
4645
- func: setup_building_host
4746
- func: quay_login
48-
- func: release_operator_pipeline
47+
- func: pipeline
4948
vars:
50-
image_name: init-database
49+
IMAGE_NAME: init-database
5150

5251
- name: release_init_ops_manager
5352
tags: [ "image_release" ]
@@ -56,9 +55,9 @@ tasks:
5655
- func: clone
5756
- func: setup_building_host
5857
- func: quay_login
59-
- func: release_operator_pipeline
58+
- func: pipeline
6059
vars:
61-
image_name: init-ops-manager
60+
IMAGE_NAME: init-ops-manager
6261

6362
- name: release_database
6463
tags: [ "image_release" ]
@@ -67,9 +66,9 @@ tasks:
6766
- func: clone
6867
- func: setup_building_host
6968
- func: quay_login
70-
- func: release_operator_pipeline
69+
- func: pipeline
7170
vars:
72-
image_name: database
71+
IMAGE_NAME: database
7372

7473
- name: prepare_and_upload_openshift_bundles
7574
tags: [ "openshift_bundles" ]

0 commit comments

Comments
 (0)