Skip to content

Conversation

@MaciejKaras
Copy link
Collaborator

@MaciejKaras MaciejKaras commented Oct 14, 2025

Summary

Publish agent images to staging repo automatically. Whenever new version of agent appears in the release.json, build_agent_images_ubi will build and push it to appropriate registry. For PRs it will appear in the dev registry, but when the commit is merged to master, same build_agent_images_ubi will publish agent image to staging registry. This is possible, because now agent images utilise skip-if-exists flag that makes sure we only build and publish agent image that is not yet published for particular registry, others are skipped.

Renamed manual_release scenario to existing release. manual_release was only used by agent and ops_manager release process and was unnecessary distinction from release scenario. This also helps to run agent and ops_manager release tasks from EVG, because evg_private_context was not aware of manual_release scenario:

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"
case $BUILD_SCENARIO in
"${BUILD_SCENARIO_RELEASE}")
REGISTRY="${REGISTRY:-$RELEASE_REGISTRY}"
OPERATOR_VERSION="${OPERATOR_VERSION:-$GIT_TAG}"
READINESS_PROBE_VERSION_FROM_RELEASE_JSON="$(jq -r '.readinessProbeVersion' "${PROJECT_DIR}/release.json")"
READINESS_PROBE_VERSION="${READINESS_PROBE_VERSION:-$READINESS_PROBE_VERSION_FROM_RELEASE_JSON}"
VERSION_UPGRADE_HOOK_VERSION_FROM_RELEASE_JSON="$(jq -r '.versionUpgradeHookVersion' "${PROJECT_DIR}/release.json")"
VERSION_UPGRADE_HOOK_VERSION="${VERSION_UPGRADE_HOOK_VERSION:-$VERSION_UPGRADE_HOOK_VERSION_FROM_RELEASE_JSON}"
;;
"${BUILD_SCENARIO_STAGING}")
COMMIT_SHA_SHORT=$(git rev-parse --short=8 HEAD)
REGISTRY="${REGISTRY:-$STAGING_REGISTRY}"
OPERATOR_VERSION="${OPERATOR_VERSION:-$COMMIT_SHA_SHORT}"
READINESS_PROBE_VERSION="${READINESS_PROBE_VERSION:-$COMMIT_SHA_SHORT}"
VERSION_UPGRADE_HOOK_VERSION="${VERSION_UPGRADE_HOOK_VERSION:-$COMMIT_SHA_SHORT}"
;;
"${BUILD_SCENARIO_PATCH}")
REGISTRY="${REGISTRY:-$PATCH_REGISTRY}"
OPERATOR_VERSION="${OPERATOR_VERSION:-$VERSION_ID}"
READINESS_PROBE_VERSION="${READINESS_PROBE_VERSION:-$VERSION_ID}"
VERSION_UPGRADE_HOOK_VERSION="${VERSION_UPGRADE_HOOK_VERSION:-$VERSION_ID}"
;;
*)
echo "Unknown BUILD_SCENARIO=${BUILD_SCENARIO}, exiting"
exit 1
;;
esac

Proof of Work

publish_om80_images was triggered manually. No images were published, because all of them exist already in quay.io/mongodb registry. The build scenario however was properly inferred as release

[2025/10/14 10:58:08.340] INFO 2025-10-14 08:58:08,340 [pipeline] Building image: ops-manager
[2025/10/14 10:58:08.340] INFO 2025-10-14 08:58:08,340 [pipeline] Build configuration: ImageBuildConfiguration(scenario=<BuildScenario.RELEASE: 'release'>, version='8.0.14', latest_tag=False, olm_tag=True, registries=['quay.io/mongodb/mongodb-enterprise-ops-manager-ubi'], dockerfile_path='docker/mongodb-enterprise-ops-manager/Dockerfile', platforms=['linux/amd64'], sign=False, skip_if_exists=True, parallel=False, parallel_factor=0, all_agents=False, currently_used_agents=False)
[2025/10/14 10:58:08.340] INFO 2025-10-14 08:58:08,340 [image_build_process] Ensuring buildx builder 'multiarch' exists...
[2025/10/14 10:58:16.775] INFO 2025-10-14 08:58:16,774 [image_build_process] Created new buildx builder: multiarch
[2025/10/14 10:58:17.358] INFO 2025-10-14 08:58:17,358 [atomic_pipeline] Image with tag quay.io/mongodb/mongodb-enterprise-ops-manager-ubi:8.0.14 already exists. Skipping it.
[2025/10/14 10:58:17.358] INFO 2025-10-14 08:58:17,358 [atomic_pipeline] All specified image tags already exist. Skipping build.

[2025/10/14 10:59:14.284] INFO 2025-10-14 08:59:14,284 [pipeline] Building image: agent
[2025/10/14 10:59:14.284] INFO 2025-10-14 08:59:14,284 [pipeline] Build configuration: ImageBuildConfiguration(scenario=<BuildScenario.RELEASE: 'release'>, version=None, latest_tag=False, olm_tag=True, registries=['quay.io/mongodb/mongodb-agent-ubi', 'quay.io/mongodb/mongodb-agent'], dockerfile_path='docker/mongodb-agent/Dockerfile', platforms=['linux/arm64', 'linux/amd64', 'linux/s390x', 'linux/ppc64le'], sign=False, skip_if_exists=True, parallel=True, parallel_factor=0, all_agents=False, currently_used_agents=False)
[2025/10/14 10:59:14.284] INFO 2025-10-14 08:59:14,284 [image_build_process] Ensuring buildx builder 'multiarch' exists...
[2025/10/14 10:59:18.493] INFO 2025-10-14 08:59:18,493 [image_build_process] Created new buildx builder: multiarch
[2025/10/14 10:59:18.493] 2025-10-14 08:59:18,493 - scripts.release.agent.detect_ops_manager_changes - INFO - === Detecting OM Mapping Changes (Local vs Base) ===
[2025/10/14 10:59:18.496] INFO 2025-10-14 08:59:18,496 [atomic_pipeline] building agents for changed OM versions
[2025/10/14 10:59:18.496] INFO 2025-10-14 08:59:18,496 [atomic_pipeline] No changes detected, skipping agent build

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?

@MaciejKaras MaciejKaras added the skip-changelog Use this label in Pull Request to not require new changelog entry file label Oct 14, 2025
@MaciejKaras MaciejKaras changed the base branch from master to maciejk/ar-skip-if-exists October 14, 2025 08:24
@github-actions
Copy link

⚠️ (this preview might not be accurate if the PR is not rebased on current master branch)

MCK 1.5.1 Release Notes

Bug Fixes

  • Fixed parsing of the customEnvVars Helm value when values contain = characters.

@MaciejKaras MaciejKaras force-pushed the maciejk/ar-agent-rebuild branch from 4661aa2 to 2698e0f Compare October 14, 2025 08:40
@MaciejKaras MaciejKaras marked this pull request as ready for review October 14, 2025 09:02
@MaciejKaras MaciejKaras requested a review from a team as a code owner October 14, 2025 09:02
@MaciejKaras MaciejKaras requested review from Julien-Ben, filipcirtog and m1kola and removed request for a team October 14, 2025 09:02
Base automatically changed from maciejk/ar-skip-if-exists to master October 14, 2025 14:23
# Conflicts:
#	scripts/release/tests/build_info_test.py
@MaciejKaras MaciejKaras merged commit c021609 into master Oct 15, 2025
37 checks passed
@MaciejKaras MaciejKaras deleted the maciejk/ar-agent-rebuild branch October 15, 2025 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Use this label in Pull Request to not require new changelog entry file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants