Skip to content

Conversation

@viveksinghggits
Copy link
Contributor

@viveksinghggits viveksinghggits commented Oct 8, 2025

Summary

In an effort to start using OCI compatible container registries as our helm chart repos, this PR makes the change package and publish our helm chart to ECR registry. A new task publish_helm_chart is introduced in the build variant init_test_run which packages and publishes the chart.

The details about the versioning of the chart can be found in the document here.

There were two wrappers (shell scripts) introduced as part of this and the reason was we wanted to call the python scripts (helm_registry_login.py and publish_helm_chart.py) from .evergreen-function.yaml passing an argument that's build scenario. Build scenario is already set as env var in the evg host, but there isn't a way to do this, in other words, we couldn't do below from the .evergreen-functions.yaml file

binary: binary: run_python.sh scripts/release/helm_registry_login.sh $build_scenario_that_is_set_as_env_on_host

And because of that we had to write the wrapper that would call the python script with correct argument after reading the env var.

Proof of Work

patch and staging evg runs. Notice at the end of the log that dev workflow is pushing to diff repository and staging to different.

Successful run of init_test_run variant in this PR would also work.

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?

@viveksinghggits viveksinghggits requested a review from a team as a code owner October 8, 2025 14:12
@viveksinghggits viveksinghggits marked this pull request as draft October 8, 2025 14:12
@github-actions
Copy link

github-actions bot commented Oct 8, 2025

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

MCK 1.6.0 Release Notes

New Features

  • MongoDBCommunity: Added support to configure custom cluster domain via newly introduced spec.clusterDomain resource field. If spec.clusterDomain is not set, environment variable CLUSTER_DOMAIN is used as cluster domain. If the environment variable CLUSTER_DOMAIN is also not set, operator falls back to cluster.local as default cluster domain.

Bug Fixes

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

@viveksinghggits viveksinghggits added the skip-changelog Use this label in Pull Request to not require new changelog entry file label Oct 8, 2025
@viveksinghggits viveksinghggits force-pushed the publish-chart-oci-prpatches branch 2 times, most recently from 5f0938b to 1b61956 Compare October 10, 2025 14:28
@viveksinghggits viveksinghggits changed the title Publish helm chart to OCI registry for PR patches Publish helm chart to OCI registry for dev/staging workflows Oct 10, 2025
@viveksinghggits viveksinghggits changed the title Publish helm chart to OCI registry for dev/staging workflows [CLOUDP-350669]Publish helm chart to OCI registry for dev/staging workflows Oct 10, 2025
@viveksinghggits viveksinghggits changed the title [CLOUDP-350669]Publish helm chart to OCI registry for dev/staging workflows [CLOUDP-350669] Publish helm chart to OCI registry for dev/staging workflows Oct 10, 2025
@viveksinghggits viveksinghggits marked this pull request as ready for review October 10, 2025 14:39
@viveksinghggits viveksinghggits force-pushed the publish-chart-oci-prpatches branch from e885549 to 92d2fe6 Compare October 14, 2025 08:22
1. Move file from scripts to scripts/relese
2. call python files from .sh files so that we can use build_scenario env var
@viveksinghggits
Copy link
Contributor Author

Hi @MaciejKaras,
This can be looked into again as well.

@viveksinghggits
Copy link
Contributor Author

@anandsyncs can you please have a look as well?

@anandsyncs
Copy link
Contributor

@viveksinghggits It would also be great if you can mention in the PR description what exactly is the issue that prevents us from calling publish_helm_chart.py directly from .evergreen-functions.yaml

@viveksinghggits
Copy link
Contributor Author

@viveksinghggits It would also be great if you can mention in the PR description what exactly is the issue that prevents us from calling publish_helm_chart.py directly from .evergreen-functions.yaml

I can do that.

@viveksinghggits viveksinghggits merged commit ea816dd into master Oct 17, 2025
37 checks passed
@viveksinghggits viveksinghggits deleted the publish-chart-oci-prpatches branch October 17, 2025 11:34
MaciejKaras added a commit that referenced this pull request Nov 14, 2025
)

# Summary

As part of our work to move towards OCI compatible container registries
for our helm chart, we are also planning to run our E2E tests against
the helm chart that we publish to OCI. This will make sure that we are
testing in our E2E what we are providing to our customers.
As part of this effort we have already [raised a
PR](#507) that starts
publishing our helm chart to the OCI container registry during
dev/staging workflows.
This PR goes and changes our E2E tests to start consuming the helm chart
from OCI registry instead of the local helm chart repo.

Additional unrelated change is to fix `kubectl-mongodb` location that is
used for gke code snippets. The fix is to add missing `workdir` path
suffix.

## Proof of Work

Successful CI on this PR.
I also ran the test `e2e_replica_set_migration` locally and it was
successful. The logs are
[here](https://gist.github.com/viveksinghggits/1b6403ffd43d53759a1714aa9cf04f30).

`publish_helm_chart` example output:
```
[2025/11/05 22:11:19.857] Running command 'subprocess.exec' in function 'publish_helm_chart' (step 7 of 7).
[2025/11/05 22:11:19.919] INFO     2025-11-05 21:11:19,919 [publish_helm_chart]  Packaging chart: mongodb-kubernetes with Version: 0.0.0+690bbc0f836fbf0007154375
[2025/11/05 22:11:19.959] INFO     2025-11-05 21:11:19,959 [publish_helm_chart]  Successfully executed: helm package --version 0.0.0+690bbc0f836fbf0007154375 helm_chart
[2025/11/05 22:11:19.959] INFO     2025-11-05 21:11:19,959 [publish_helm_chart]  Successfully packaged chart and saved it to: /data/mci/55da5d1be5488b41a9ec4e7d02041a86/src/github.com/mongodb/mongodb-kubernetes/mongodb-kubernetes-0.0.0+690bbc0f836fbf0007154375.tgz
[2025/11/05 22:11:19.959] INFO     2025-11-05 21:11:19,959 [publish_helm_chart]  Determined OCI Registry: oci://268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb/helm-charts
[2025/11/05 22:11:19.959] INFO     2025-11-05 21:11:19,959 [publish_helm_chart]  Pushing chart to registry: oci://268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb/helm-charts
[2025/11/05 22:11:20.848] INFO     2025-11-05 21:11:20,848 [publish_helm_chart]  Successfully executed: helm push mongodb-kubernetes-0.0.0+690bbc0f836fbf0007154375.tgz oci://268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb/helm-charts
[2025/11/05 22:11:20.848] INFO     2025-11-05 21:11:20,848 [publish_helm_chart]  Helm Chart mongodb-kubernetes:0.0.0+690bbc0f836fbf0007154375 was published successfully!
[2025/11/05 22:11:20.858] Finished command 'subprocess.exec' in function 'publish_helm_chart' (step 7 of 7) in 1.001053371s.
```

Downloading the chart with `helm pull
oci://268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb/helm-charts/mongodb-kubernetes
--untar --version 0.0.0+690bbc0f836fbf0007154375` you can see that the
`Chart.yaml` version was properly updated:
```yaml
apiVersion: v2
description: 'MongoDB Controllers for Kubernetes translate the human knowledge of
  creating a MongoDB instance into a scalable, repeatable, and standardized method. '
home: https://github.com/mongodb/mongodb-kubernetes
icon: https://mongodb-images-new.s3.eu-west-1.amazonaws.com/leaf-green-dark.png
keywords:
  - mongodb
  - database
  - nosql
kubeVersion: '>=1.16-0'
maintainers:
  - email: [email protected]
    name: MongoDB
name: mongodb-kubernetes
type: application
version: 0.0.0+690bbc0f836fbf0007154375
```

Also [run
release](https://evergreen.mongodb.com/version/690cf486c59aec0007dd2ba4?redirect_spruce_users=true)
test and e2e smoke tests are also passing (ignore `ibm_power`, they are
fixed in #573)
## 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: Maciej Karaś <[email protected]>
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