Skip to content

Fixes to search docs snippets #140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 13 additions & 0 deletions .evergreen-functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,20 @@ functions:
aws_secret: ${enterprise_aws_secret_access_key}
local_files_include_filter:
- src/github.com/mongodb/mongodb-kubernetes/public/architectures/**/*.log
- src/github.com/mongodb/mongodb-kubernetes/docs/**/*.log
remote_file: logs/${task_id}/${execution}/
bucket: operator-e2e-artifacts
permissions: private
visibility: signed
content_type: text/plain
- command: s3.put
params:
aws_key: ${enterprise_aws_access_key_id}
aws_secret: ${enterprise_aws_secret_access_key}
local_files_include_filter:
- src/github.com/mongodb/mongodb-kubernetes/public/architectures/**/*.out
- src/github.com/mongodb/mongodb-kubernetes/docs/**/*.out
preserve_path: true
remote_file: logs/${task_id}/${execution}/
bucket: operator-e2e-artifacts
permissions: public-read
Expand Down
19 changes: 18 additions & 1 deletion .evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1862,13 +1862,30 @@ buildvariants:

- name: private_kind_code_snippets
display_name: private_kind_code_snippets
allowed_requesters: ["patch"]
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: publish_om60_images
Expand Down
6 changes: 1 addition & 5 deletions docs/community-search/quick-start/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ First, add the MongoDB Helm repository. This repository contains the Helm chart
```shell copy
helm repo add mongodb https://mongodb.github.io/helm-charts
helm repo update mongodb
if [[ "${OPERATOR_HELM_CHART}" != "helm_chart" ]]; then helm search repo "${OPERATOR_HELM_CHART}"; fi;
```
After adding the repository, update your local Helm chart repository cache:
```shell
helm repo update
helm search repo mongodb/mongodb-kubernetes
```

### 3. Install MongoDB Kubernetes Operator
Expand Down
4 changes: 0 additions & 4 deletions docs/community-search/quick-start/README.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ First, add the MongoDB Helm repository. This repository contains the Helm chart
```shell copy
{% include "code_snippets/090_helm_add_mogodb_repo.sh" %}
```
After adding the repository, update your local Helm chart repository cache:
```shell
helm repo update
```

### 3. Install MongoDB Kubernetes Operator

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
echo "Verifying mongodb-kubernetes-database-pods contains proper pull secret"
echo "Verifying mongodb-kubernetes-database-pods service account contains proper pull secret"
if ! kubectl get --context "${K8S_CLUSTER_0_CONTEXT_NAME}" -n "${MDB_NAMESPACE}" -o json \
sa mongodb-kubernetes-database-pods -o=jsonpath='{.imagePullSecrets[*]}' | \
grep community-private-preview-pullsecret; then
Expand All @@ -7,3 +7,4 @@ if ! kubectl get --context "${K8S_CLUSTER_0_CONTEXT_NAME}" -n "${MDB_NAMESPACE}"
sa mongodb-kubernetes-database-pods -o=yaml
return 1
fi
echo "SUCCESS: mongodb-kubernetes-database-pods service account contains proper pull secret"
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
helm repo add mongodb https://mongodb.github.io/helm-charts
helm repo update mongodb
if [[ "${OPERATOR_HELM_CHART}" != "helm_chart" ]]; then helm search repo "${OPERATOR_HELM_CHART}"; fi;
helm search repo mongodb/mongodb-kubernetes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export K8S_CLUSTER_0_CONTEXT_NAME="${CLUSTER_NAME}"

export PRIVATE_PREVIEW_IMAGE_PULLSECRET="${COMMUNITY_PRIVATE_PREVIEW_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
@@ -0,0 +1,2 @@
export K8S_CLUSTER_0_CONTEXT_NAME="${CLUSTER_NAME}"
export PRIVATE_PREVIEW_IMAGE_PULLSECRET="${COMMUNITY_PRIVATE_PREVIEW_PULLSECRET_DOCKERCONFIGJSON}"
5 changes: 3 additions & 2 deletions scripts/code_snippets/sample_commit_output.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
set -Eeou pipefail
source scripts/dev/set_env_context.sh

if [ "${COMMIT_OUTPUT:-false}" = true ]; then
if [[ "${CODE_SNIPPETS_COMMIT_OUTPUT:-"false"}" == "true" ]]; then
echo "Pushing output files"
branch="meko-snippets-update-$(date "+%Y%m%d%H%M%S")"
git checkout -b "${branch}"
git reset
git add public/architectures/**/*.out
git add docs/**/output/*.out
git add docs/**/*.md
git commit -m "Update code snippets outputs"
git remote set-url origin https://x-access-token:"${GH_TOKEN}"@github.com/mongodb/mongodb-kubernetes.git
git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/mongodb/mongodb-kubernetes.git"
git push origin "${branch}"
else
echo "Not pushing output files"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ trap dump_logs EXIT
test_dir="./docs/community-search/quick-start"

source "${test_dir}/env_variables.sh"
echo "Sourcing env variables for ${CODE_SNIPPETS_FLAVOR} flavor"
# shellcheck disable=SC1090
test -f "${test_dir}/env_variables_${CODE_SNIPPETS_FLAVOR}.sh" && source "${test_dir}/env_variables_${CODE_SNIPPETS_FLAVOR}.sh"


${test_dir}/test.sh
scripts/code_snippets/kind_community_search_snippets_render_template.sh
4 changes: 4 additions & 0 deletions scripts/dev/contexts/evg-private-context
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ export RUNNING_IN_EVG="true"

export DELETE_KIND_NETWORK="true"

# code_snippets_commit_output can be set in evergreen patch by --param code_snippets_commit_output=true
# it's also set explicitly in public_*_snippets variants
export CODE_SNIPPETS_COMMIT_OUTPUT=${code_snippets_commit_output:-"false"}

# MCO
# shellcheck disable=SC2154
export READINESS_PROBE_IMAGE="268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-kubernetes-readinessprobe:${version_id}"
Expand Down
2 changes: 1 addition & 1 deletion scripts/dev/contexts/prerelease_gke_code_snippets
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ source "${script_dir}/root-context"

export MDB_GKE_PROJECT="scratch-kubernetes-team"
export K8S_CLUSTER_SUFFIX="-${version_id}-${RANDOM}"
export COMMIT_OUTPUT=true
export CODE_SNIPPETS_COMMIT_OUTPUT=true

# we reset evg host to use a default ~/.kube/config for GKE instead of the one from evg host
export EVG_HOST_NAME=""
Expand Down
14 changes: 14 additions & 0 deletions scripts/dev/contexts/prerelease_kind_code_snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

# this context file is for code snippets running on GKE clusters
set -Eeou pipefail

# overrides of public env_variables.sh
script_name=$(readlink -f "${BASH_SOURCE[0]}")
script_dir=$(dirname "${script_name}")

source "${script_dir}/root-context"

export NAMESPACE=mongodb
export CODE_SNIPPETS_FLAVOR=e2e_prerelease
export CODE_SNIPPETS_COMMIT_OUTPUT=true
3 changes: 2 additions & 1 deletion scripts/dev/contexts/public_gke_code_snippets
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ script_dir=$(dirname "${script_name}")
source "${script_dir}/root-context"

export MDB_GKE_PROJECT="scratch-kubernetes-team"
# shellcheck disable=SC2154
export K8S_CLUSTER_SUFFIX="-${version_id}-${RANDOM}"

# we reset evg host to use a default ~/.kube/config for GKE instead of the one from evg host
Expand All @@ -18,4 +19,4 @@ export EVG_HOST_NAME=""
# ENV_VARIABLES.SH overrides
export OPERATOR_ADDITIONAL_HELM_VALUES=""
export OPERATOR_HELM_CHART=""
export COMMIT_OUTPUT=true
export CODE_SNIPPETS_COMMIT_OUTPUT=true
14 changes: 14 additions & 0 deletions scripts/dev/contexts/public_kind_code_snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

# this context file is for code snippets running on GKE clusters
set -Eeou pipefail

# overrides of public env_variables.sh
script_name=$(readlink -f "${BASH_SOURCE[0]}")
script_dir=$(dirname "${script_name}")

source "${script_dir}/root-context"

export NAMESPACE=mongodb
export CODE_SNIPPETS_FLAVOR=e2e_public
export CODE_SNIPPETS_COMMIT_OUTPUT=true