Skip to content
Draft
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
05b06cd
Enterprise Search snippets
fealebenpae Aug 1, 2025
4ca29ca
setup cloudqa for enterprise snippets
fealebenpae Aug 1, 2025
29f5bab
Fix races in pre-commit checks and improve error handling
lsierant Aug 23, 2025
6309cff
Refactor of existing snippets on master
lsierant Aug 24, 2025
10f35fe
Refactor of snippets (enterprise search)
lsierant Aug 24, 2025
a6abfbb
Refactor of existing snippets on master
lsierant Aug 24, 2025
c000b5a
Review fixes
lsierant Aug 26, 2025
8aebe18
evg fix
lsierant Aug 26, 2025
80f5fb0
Merge remote-tracking branch 'origin/fealebenpae/enterprise-search' i…
fealebenpae Aug 28, 2025
67ff517
Merge branch 'fealebenpae/enterprise-search' into fealebenpae/enterpr…
lsierant Aug 28, 2025
9921f63
Merge remote-tracking branch 'origin/fealebenpae/enterprise-search' i…
fealebenpae Aug 28, 2025
7bf4672
update patch version in enterprise quick start
fealebenpae Aug 28, 2025
46750bd
Merge branch 'fealebenpae/enterprise-search-snippets' into lsierant/s…
lsierant Aug 28, 2025
69e6b5d
Merge branch 'search/public-preview' into fealebenpae/enterprise-search
lsierant Aug 28, 2025
7204c7a
Merge branch 'fealebenpae/enterprise-search-snippets' into lsierant/s…
lsierant Aug 28, 2025
6bf7105
Merge branch 'fealebenpae/enterprise-search' into fealebenpae/enterpr…
lsierant Aug 28, 2025
72277ca
Merge branch 'fealebenpae/enterprise-search-snippets' into lsierant/s…
lsierant Aug 28, 2025
f70e49c
Merge branch 'fealebenpae/enterprise-search' into fealebenpae/enterpr…
lsierant Aug 28, 2025
e1a79d3
Merge branch 'fealebenpae/enterprise-search-snippets' into lsierant/s…
lsierant Aug 28, 2025
5d9ffdf
Lint
lsierant Aug 28, 2025
3653724
Temporarily restoring ent search readme.md
lsierant Aug 29, 2025
bb03cd2
Enterprise snippets -wip
lsierant Aug 29, 2025
fe32610
Running snippets with prerelease flavor
lsierant Aug 31, 2025
d7906ba
wip
lsierant Sep 1, 2025
ca1a717
Merge branch 'fealebenpae/enterprise-search' into fealebenpae/enterpr…
lsierant Sep 1, 2025
73107ed
wip
lsierant Sep 1, 2025
aea65d6
wip
lsierant Sep 1, 2025
a6400a5
Removed unnecessary files
lsierant Sep 2, 2025
3517c95
Updated community image
lsierant Sep 2, 2025
188d258
Injected error to fix diagnostics
lsierant Sep 2, 2025
ff648d4
Fixed dumping diagnostics
lsierant Sep 2, 2025
474d491
Revert "Injected error to fix diagnostics"
lsierant Sep 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .evergreen-functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ functions:
working_dir: src/github.com/mongodb/mongodb-kubernetes
binary: scripts/code_snippets/sample_commit_output.sh

# it executes a script by convention: ./scripts/code_snippets/${task_name}_test.sh
# it executes a script by convention: ./scripts/code_snippets/tests/${task_name}
test_code_snippets:
- *switch_context
- command: shell.exec
Expand All @@ -844,4 +844,4 @@ functions:
- code_snippets_reset
- task_name
script: |
./scripts/code_snippets/${task_name}_test.sh
./scripts/code_snippets/tests/${task_name}
151 changes: 151 additions & 0 deletions .evergreen-snippets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
variables:
- &setup_and_teardown_group_gke_code_snippets
setup_task_can_fail_task: true
setup_group:
- func: clone
- func: setup_gcloud_cli
- func: setup_mongosh
- func: download_kube_tools
- func: build_multi_cluster_binary
teardown_task:
- func: upload_e2e_logs
- func: upload_code_snippets_logs

- &setup_and_teardown_group_kind_code_snippets
setup_task_can_fail_task: true
setup_group:
- func: clone
- func: cleanup_exec_environment
- func: download_kube_tools
- func: configure_docker_auth
- func: setup_kubernetes_environment
- func: setup_cloud_qa
teardown_task:
- func: upload_e2e_logs
- func: upload_code_snippets_logs
- func: teardown_kubernetes_environment
- func: teardown_cloud_qa

# This variable is copied over from .evergreen.yml because anchors don't work for included files
- &base_om8_dependency
depends_on:
- name: build_om_images
variant: build_om80_images
- name: build_operator_ubi
variant: init_test_run
- name: build_init_database_image_ubi
variant: init_test_run
- name: build_database_image_ubi
variant: init_test_run
- name: build_test_image
variant: init_test_run
- name: build_init_appdb_images_ubi
variant: init_test_run
- name: build_init_om_images_ubi
variant: init_test_run
- name: build_agent_images_ubi
variant: init_test_run

tasks:
# Code snippets tasks
# Each scripts/code_snippets/tests/test_*.sh should have its task defined here.
# TODO: it should be autogenerated
# Each task executes test_code_snippets functon executes scripts/code_snippets/tests/${task_name} by task name convention
- name: test_gke_multi_cluster_snippets.sh
tags: [ "code_snippets" ]
commands:
- func: test_code_snippets
- func: sample_commit_output

- name: test_gke_multi_cluster_no_mesh_snippets.sh
tags: [ "code_snippets" ]
commands:
- func: test_code_snippets
- func: sample_commit_output

- name: test_kind_search_community_snippets.sh
tags: [ "code_snippets", "patch-run" ]
commands:
- func: test_code_snippets
- func: sample_commit_output

- name: test_kind_search_enterprise_snippets.sh
tags: [ "code_snippets", "patch-run" ]
commands:
- func: test_code_snippets
- func: sample_commit_output

task_groups:
- name: gke_code_snippets_task_group
<<: *setup_and_teardown_group_gke_code_snippets
max_hosts: -1
tasks:
- test_gke_multi_cluster_snippets.sh
- test_gke_multi_cluster_no_mesh_snippets.sh

- name: kind_code_snippets_task_group
<<: *setup_and_teardown_group_kind_code_snippets
max_hosts: -1
tasks:
- test_kind_search_community_snippets.sh
- test_kind_search_enterprise_snippets.sh

buildvariants:
# These variants are used to test the code snippets and each one can be used in patches
# Prerelease is especially used when the repo is tagged
# More details in the TD: https://docs.google.com/document/d/1fuTxfRtP8QPtn7sKYxQM_AGcD6xycTZH8svngGxyKhc/edit?tab=t.0#bookmark=id.e8uva0393mbe
- name: public_gke_code_snippets
display_name: public_gke_code_snippets
allowed_requesters: [ "patch" ]
run_on:
- ubuntu2204-small
tasks:
- name: gke_code_snippets_task_group

- name: prerelease_gke_code_snippets
display_name: prerelease_gke_code_snippets
tags: [ "release" ]
allowed_requesters: [ "patch", "github_tag" ]
depends_on:
- variant: release_images
name: '*'
patch_optional: true
run_on:
- ubuntu2204-small
tasks:
- name: gke_code_snippets_task_group

- name: private_gke_code_snippets
display_name: private_gke_code_snippets
allowed_requesters: [ "patch" ]
run_on:
- ubuntu2204-small
<<: *base_om8_dependency
tasks:
- name: gke_code_snippets_task_group

- name: private_kind_code_snippets
display_name: private_kind_code_snippets
tags: [ "e2e_test_suite" ]
allowed_requesters: [ "patch", "github_pr" ]
run_on:
- ubuntu2204-large
<<: *base_om8_dependency
tasks:
- name: kind_code_snippets_task_group

- name: prerelease_kind_code_snippets
display_name: prerelease_kind_code_snippets
allowed_requesters: [ "patch" ]
run_on:
- ubuntu2204-large
tasks:
- name: kind_code_snippets_task_group

- name: public_kind_code_snippets
display_name: public_kind_code_snippets
allowed_requesters: [ "patch" ]
run_on:
- ubuntu2204-large
tasks:
- name: kind_code_snippets_task_group
8 changes: 7 additions & 1 deletion .evergreen-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,13 @@ tasks:
- func: test_code_snippets
- func: sample_commit_output

- name: task_kind_community_search_snippets
- name: task_kind_search_community_snippets
tags: [ "code_snippets", "patch-run" ]
commands:
- func: test_code_snippets
- func: sample_commit_output

- name: task_kind_search_enterprise_snippets
tags: [ "code_snippets", "patch-run" ]
commands:
- func: test_code_snippets
Expand Down
97 changes: 2 additions & 95 deletions .evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ include:
- filename: .evergreen-functions.yml
- filename: .evergreen-tasks.yml
- filename: .evergreen-mco.yml
- filename: .evergreen-snippets.yml

variables:
- &ops_manager_60_latest 6.0.27 # The order/index is important, since these are anchors. Please do not change
Expand Down Expand Up @@ -86,29 +87,6 @@ variables:
- func: setup_building_host
- func: build_multi_cluster_binary

- &setup_and_teardown_group_gke_code_snippets
setup_task_can_fail_task: true
setup_group:
- func: clone
- func: setup_gcloud_cli
- func: setup_mongosh
- func: download_kube_tools
- func: build_multi_cluster_binary
teardown_group:
- func: upload_code_snippets_logs

- &setup_and_teardown_group_kind_code_snippets
setup_task_can_fail_task: true
setup_group:
- func: clone
- func: cleanup_exec_environment
- func: download_kube_tools
- func: configure_docker_auth
- func: setup_kubernetes_environment
teardown_task:
- func: upload_e2e_logs
- func: upload_code_snippets_logs

- &setup_and_teardown_task_cloudqa
setup_task_can_fail_task: true
setup_task:
Expand Down Expand Up @@ -172,6 +150,7 @@ variables:
- name: build_init_om_images_ubi
variant: init_test_run

# Any change to base_om8_dependency should be reflected to its copy in .evergreen-snippets.yml
- &base_om8_dependency
depends_on:
- name: build_om_images
Expand Down Expand Up @@ -667,19 +646,6 @@ task_groups:
- unit_tests_python
- sbom_tests

- name: gke_code_snippets_task_group
<<: *setup_and_teardown_group_gke_code_snippets
max_hosts: -1
tasks:
- task_gke_multi_cluster_snippets
- task_gke_multi_cluster_no_mesh_snippets

- name: kind_code_snippets_task_group
<<: *setup_and_teardown_group_kind_code_snippets
max_hosts: -1
tasks:
- task_kind_community_search_snippets

# Task group for deploying mongodbcommunity resources and testing the (former) MCO
- name: e2e_mdb_community_task_group
max_hosts: -1
Expand Down Expand Up @@ -1999,65 +1965,6 @@ buildvariants:
tasks:
- name: release_all_currently_used_agents_on_ecr

# These variants are used to test the code snippets and each one can be used in patches
# Prerelease is especially used when the repo is tagged
# More details in the TD: https://docs.google.com/document/d/1fuTxfRtP8QPtn7sKYxQM_AGcD6xycTZH8svngGxyKhc/edit?tab=t.0#bookmark=id.e8uva0393mbe
- name: public_gke_code_snippets
display_name: public_gke_code_snippets
allowed_requesters: ["patch"]
run_on:
- ubuntu2204-small
tasks:
- name: gke_code_snippets_task_group

- name: prerelease_gke_code_snippets
display_name: prerelease_gke_code_snippets
tags: [ "release" ]
allowed_requesters: ["patch", "github_tag"]
depends_on:
- variant: release_images
name: '*'
patch_optional: true
run_on:
- ubuntu2204-small
tasks:
- name: gke_code_snippets_task_group

- name: private_gke_code_snippets
display_name: private_gke_code_snippets
allowed_requesters: ["patch"]
run_on:
- ubuntu2204-small
<<: *base_om8_dependency
tasks:
- name: gke_code_snippets_task_group

- name: private_kind_code_snippets
display_name: private_kind_code_snippets
tags: [ "e2e_test_suite" ]
allowed_requesters: ["patch", "github_pr"]
run_on:
- ubuntu2204-large
<<: *base_om8_dependency
tasks:
- name: kind_code_snippets_task_group

- name: prerelease_kind_code_snippets
display_name: prerelease_kind_code_snippets
allowed_requesters: ["patch"]
run_on:
- ubuntu2204-large
tasks:
- name: kind_code_snippets_task_group

- name: public_kind_code_snippets
display_name: public_kind_code_snippets
allowed_requesters: ["patch"]
run_on:
- ubuntu2204-large
tasks:
- name: kind_code_snippets_task_group

### Build variants for manual patch only

- name: backup_csv_images
Expand Down
5 changes: 5 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ lint_code() {
scripts/evergreen/lint_code.sh
}

function validate_snippets() {
scripts/code_snippets/validate_snippets.py
}

# bg_job_ vars are global; run_job_in_background function is appending to them on each call
bg_job_pids=()
bg_job_pids_with_names=()
Expand Down Expand Up @@ -217,6 +221,7 @@ pre_commit() {
run_job_in_background "regenerate_public_rbac_multi_cluster"
run_job_in_background "python_formatting"
run_job_in_background "check_erroneous_kubebuilder_annotations"
run_job_in_background "validate_snippets"

if wait_for_all_background_jobs; then
echo -e "${GREEN}pre-commit: All checks passed!${NO_COLOR}"
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,5 @@ docs/**/test.sh.run.log

# goreleaser generated files
dist
logs
*.run.log

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export K8S_CLUSTER_0_CONTEXT_NAME="${CLUSTER_NAME}"

export PRIVATE_PREVIEW_IMAGE_PULLSECRET="${COMMUNITY_PRIVATE_PREVIEW_PULLSECRET_DOCKERCONFIGJSON}"
export PRIVATE_PREVIEW_IMAGE_PULLSECRET="${PRERELEASE_PULLSECRET_DOCKERCONFIGJSON}"

export OPERATOR_ADDITIONAL_HELM_VALUES=""
export OPERATOR_HELM_CHART="${PROJECT_DIR}/helm_chart"
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export K8S_CLUSTER_0_CONTEXT_NAME="${CLUSTER_NAME}"
export PRIVATE_PREVIEW_IMAGE_PULLSECRET="${COMMUNITY_PRIVATE_PREVIEW_PULLSECRET_DOCKERCONFIGJSON}"
export PRIVATE_PREVIEW_IMAGE_PULLSECRET="${PRERELEASE_PULLSECRET_DOCKERCONFIGJSON}"
Loading