Skip to content

Commit 7fa6687

Browse files
lsierantfealebenpaeSimonBaeumer
authored
CLOUDP-318518: Community private-preview docs (#102)
# Summary This PR provides testable code snippets for deploying MongoDBCommunity with MongoDBSearch. Code snippets are created in the same way as the reference architecture ones, but located under docs/community/quick-start. The difference is that the article and snippets are assuming existence of the k8s cluster and for e2e tests kind cluster is used as in other e2e tests. **Important for code review**: for now, this PR contains two commits that are to be included in search-main branch separately, but are necessary for this work to pass the tests. To review, please view only commits excluding two first commits ("Temporary private quay search image", "Handle pull secret for community search private preview"): [link to diff](775908a) ## File structure - `docs/community/quick-start` - main community search snippets directory, intended for end-users to look into: With the following files: - `code_snippets/` - shell scripts - `output/` - outputs gathered from e2e test run - `env_variables.sh` - env variables intended for end-users to adjust - `env_variables_e2e_private.sh` - env variables adjusted for a "e2e_private" flavor (running in e2e test so with additional helm chart variables for specifying images built in pipeline). - `test.sh` - automated execution entry point defining all the steps - `README.md` - rendered, final docs article intended for end-user consumption. It will be immediately rendered on page upon entering `docs/community/quick-start` folder in GH UI. - `README.md.j2` - the source of the docs article, with jinja's include directives to include snippets in markdown's code blocks. It is not possible to include files directly in markdown files. - `scripts/code_snippets/kind_community_search_snippets_render_template.sh` - render `README.md.j2` into `README.md` - `scripts/code_snippets/task_kind_community_search_snippets_test.sh` - entrypoint for running in e2e test. It's using `CODE_SNIPPETS_FLAVOR` env var (defined in the context file) for choosing the flavor (sourcing `env_variables${CODE_SNIPPETS_FLAVOR}.sh` file) Code snippets are hooked into PR tests under `private_kind_code_snippets` variant. "Public" variant will be added as a followup. Snippets in e2e tests are executed by ## General changes to snippets and reference architectures Additionally, some changes were made to GKE code snipets for Reference Architectures: * all e2e entrypoint scripts were renamed with a prefix `test_`, to quickly identify which of those scripts are really entrypoints: * task_gke_multi_cluster_no_mesh_snippets_test.sh * task_gke_multi_cluster_snippets_test.sh * task_kind_community_search_snippets_test.sh * All snippets tasks in evergreen uses one `test_code_snippets` evergreen function, that is executing entrypoint by naming convention `./scripts/code_snippets/${task_name}_test.sh`. * **Note:** using `CODE_SNIPPETS_FLAVOR` env var and defining flavor's env vars directly in the snippets directory (`env_variables${CODE_SNIPPETS_FLAVOR}.sh) makes a different mechanism than what we have in reference architectures. We should decide which mechanism is a better one and unify. The documentation article is provided [README.md](docs/community/quick-start/README.md) and is rendered from the README.md.j2 ## Proof of Work * Green code snippets e2e tests (including GKE-based reference architectures): [link](https://spruce.mongodb.com/version/68210e1e8f1de0000798909a/tasks?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC) * Rendered markdown file, visible when entering the folder in UI: [link](https://github.com/mongodb/mongodb-kubernetes/tree/lsierant/search-docs/docs/community-search/quick-start) ## 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 checked for release_note changes? --------- Co-authored-by: Yavor Georgiev <[email protected]> Co-authored-by: Simon Bäumer <[email protected]>
1 parent ba0ddb1 commit 7fa6687

File tree

46 files changed

+1782
-24
lines changed

Some content is hidden

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

46 files changed

+1782
-24
lines changed

.evergreen-functions.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,14 @@ functions:
333333
source .generated/context.export.env
334334
scripts/evergreen/e2e/setup_cloud_qa.py delete
335335
336+
dump_diagnostic_information_from_all_namespaces:
337+
- command: subprocess.exec
338+
params:
339+
working_dir: src/github.com/mongodb/mongodb-kubernetes
340+
add_to_path:
341+
- bin
342+
binary: scripts/evergreen/e2e/dump_diagnostic_information_from_all_namespaces.sh
343+
336344
### Publish and release image ###
337345

338346
# Tags and pushes an image into an external Docker registry. The source image
@@ -733,25 +741,12 @@ functions:
733741
params:
734742
include_expansions_in_env:
735743
- GH_TOKEN
744+
- code_snippets_commit_output
736745
working_dir: src/github.com/mongodb/mongodb-kubernetes
737746
binary: scripts/code_snippets/sample_commit_output.sh
738747

739-
gke_multi_cluster_snippets:
740-
- *switch_context
741-
- command: shell.exec
742-
params:
743-
shell: bash
744-
working_dir: src/github.com/mongodb/mongodb-kubernetes
745-
include_expansions_in_env:
746-
- version_id
747-
- code_snippets_teardown
748-
- code_snippets_reset
749-
- task_name
750-
script: |
751-
./scripts/code_snippets/gke_multi_cluster_test.sh
752-
753-
754-
gke_multi_cluster_no_mesh_snippets:
748+
# it executes a script by convention: ./scripts/code_snippets/${task_name}_test.sh
749+
test_code_snippets:
755750
- *switch_context
756751
- command: shell.exec
757752
params:
@@ -763,4 +758,4 @@ functions:
763758
- code_snippets_reset
764759
- task_name
765760
script: |
766-
./scripts/code_snippets/gke_multi_cluster_no_mesh_test.sh
761+
./scripts/code_snippets/${task_name}_test.sh

.evergreen-tasks.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,24 @@ tasks:
7070
vars:
7171
image_name: ops-manager
7272

73-
- name: gke_multi_cluster_snippets
73+
# Code snippets tasks
74+
# Each task is selected by convention by running scripts/code_snippets/${task_name}_test.sh
75+
- name: task_gke_multi_cluster_snippets
7476
tags: [ "code_snippets" ]
7577
commands:
76-
- func: gke_multi_cluster_snippets
78+
- func: test_code_snippets
7779
- func: sample_commit_output
7880

79-
- name: gke_multi_cluster_no_mesh_snippets
81+
- name: task_gke_multi_cluster_no_mesh_snippets
8082
tags: [ "code_snippets" ]
8183
commands:
82-
- func: gke_multi_cluster_no_mesh_snippets
84+
- func: test_code_snippets
85+
- func: sample_commit_output
86+
87+
- name: task_kind_community_search_snippets
88+
tags: [ "code_snippets", "patch-run" ]
89+
commands:
90+
- func: test_code_snippets
8391
- func: sample_commit_output
8492

8593
## Below are only e2e runs for .evergreen.yml ##

.evergreen.yml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ variables:
8686
- func: build_multi_cluster_binary
8787

8888
- &setup_and_teardown_group_gke_code_snippets
89+
setup_task_can_fail_task: true
8990
setup_group:
9091
- func: clone
9192
- func: setup_gcloud_cli
@@ -95,6 +96,18 @@ variables:
9596
teardown_group:
9697
- func: upload_code_snippets_logs
9798

99+
- &setup_and_teardown_group_kind_code_snippets
100+
setup_task_can_fail_task: true
101+
setup_group:
102+
- func: clone
103+
- func: cleanup_exec_environment
104+
- func: download_kube_tools
105+
- func: configure_docker_auth
106+
- func: setup_kubernetes_environment
107+
teardown_task:
108+
- func: upload_e2e_logs
109+
- func: upload_code_snippets_logs
110+
98111
- &setup_and_teardown_task_cloudqa
99112
setup_task_can_fail_task: true
100113
setup_task:
@@ -183,6 +196,10 @@ parameters:
183196
value: "false"
184197
description: set this to true if you would like to delete the resources created in the code snippet tests, but keep the clusters
185198

199+
- key: code_snippets_commit_output
200+
value: "false"
201+
description: set this to true if you would like the pipeline to automatically push a branch with updated snippets outputs
202+
186203

187204
# Triggered manually or by PCT.
188205
patch_aliases:
@@ -608,8 +625,14 @@ task_groups:
608625
<<: *setup_and_teardown_group_gke_code_snippets
609626
max_hosts: -1
610627
tasks:
611-
- gke_multi_cluster_snippets
612-
- gke_multi_cluster_no_mesh_snippets
628+
- task_gke_multi_cluster_snippets
629+
- task_gke_multi_cluster_no_mesh_snippets
630+
631+
- name: kind_code_snippets_task_group
632+
<<: *setup_and_teardown_group_kind_code_snippets
633+
max_hosts: -1
634+
tasks:
635+
- task_kind_community_search_snippets
613636

614637
# Task group for deploying mongodbcommunity resources and testing the (former) MCO
615638
- name: e2e_mdb_community_task_group
@@ -1837,6 +1860,15 @@ buildvariants:
18371860
tasks:
18381861
- name: gke_code_snippets_task_group
18391862

1863+
- name: private_kind_code_snippets
1864+
display_name: private_kind_code_snippets
1865+
allowed_requesters: ["patch"]
1866+
run_on:
1867+
- ubuntu2204-large
1868+
<<: *base_om8_dependency
1869+
tasks:
1870+
- name: kind_code_snippets_task_group
1871+
18401872
### Build variants for manual patch only
18411873

18421874
- name: publish_om60_images

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,6 @@ docker/mongodb-kubernetes-tests/.test_identifiers*
9191
logs-debug/
9292
/ssdlc-report/*
9393
.gocache/
94+
95+
docs/**/log/*
96+
docs/**/test.sh.run.log

RELEASE_NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
* **MongoDBSearch (Community Private Preview)**: Added support for deploying MongoDB Search (Community Private Preview Edition) that enables full-text and vector search capabilities for MongoDBCommunity deployments.
99
* Added new MongoDB CRD which is watched by default by the operator.
10-
* For more information please see: `TBD LINK TO DOC MARKDOWN`
10+
* For more information please see: [docs/community-search/quick-start/README.md](docs/community-search/quick-start/README.md)
1111
* Private Preview phase comes with some limitations:
1212
* minimum MongoDB Community version: 8.0.
1313
* TLS must be disabled in MongoDB (communication between mongot and mongod is in plaintext for now).

0 commit comments

Comments
 (0)