Skip to content

Commit 774bbac

Browse files
authored
Move run_python.sh to scripts/dev/ (#269)
# Summary Moves `run_python.sh` script from `scripts/evergreen/` to `scripts/dev/`. The script should not be limited for evergreen use case. Running in GitHub Actions or locally should be considered. ## Proof of Work Passing CI. ## 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 checked for release_note changes? ## Reminder (Please remove this when merging) - Please try to Approve or Reject Changes the PR, keep PRs in review as short as possible - Our Short Guide for PRs: [Link](https://docs.google.com/document/d/1T93KUtdvONq43vfTfUt8l92uo4e4SEEvFbIEKOxGr44/edit?tab=t.0) - Remember the following Communication Standards - use comment prefixes for clarity: * **blocking**: Must be addressed before approval. * **follow-up**: Can be addressed in a later PR or ticket. * **q**: Clarifying question. * **nit**: Non-blocking suggestions. * **note**: Side-note, non-actionable. Example: Praise * --> no prefix is considered a question
1 parent 64ca2a8 commit 774bbac

File tree

5 files changed

+27
-27
lines changed

5 files changed

+27
-27
lines changed

.evergreen-functions.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ functions:
392392
add_to_path:
393393
- ${workdir}/bin
394394
working_dir: src/github.com/mongodb/mongodb-kubernetes
395-
binary: scripts/evergreen/run_python.sh scripts/update_supported_dockerfiles.py
395+
binary: scripts/dev/run_python.sh scripts/update_supported_dockerfiles.py
396396
- command: subprocess.exec
397397
type: setup
398398
params:
@@ -486,7 +486,7 @@ functions:
486486
include_expansions_in_env:
487487
- image_version
488488
- rh_pyxis
489-
binary: scripts/evergreen/run_python.sh scripts/preflight_images.py --image ${image_name} --submit "${preflight_submit}"
489+
binary: scripts/dev/run_python.sh scripts/preflight_images.py --image ${image_name} --submit "${preflight_submit}"
490490

491491
build_multi_cluster_binary:
492492
- command: subprocess.exec
@@ -538,7 +538,7 @@ functions:
538538
shell: bash
539539
<<: *e2e_include_expansions_in_env
540540
working_dir: src/github.com/mongodb/mongodb-kubernetes
541-
binary: scripts/evergreen/run_python.sh pipeline.py --include ${image_name} --parallel --sign
541+
binary: scripts/dev/run_python.sh pipeline.py --include ${image_name} --parallel --sign
542542

543543
teardown_cloud_qa_all:
544544
- *switch_context
@@ -549,7 +549,7 @@ functions:
549549
working_dir: src/github.com/mongodb/mongodb-kubernetes
550550
script: |
551551
source .generated/context.export.env
552-
scripts/evergreen/run_python.sh scripts/evergreen/e2e/setup_cloud_qa.py delete_all
552+
scripts/dev/run_python.sh scripts/evergreen/e2e/setup_cloud_qa.py delete_all
553553
554554
# Updates current expansions with variables from release.json file.
555555
# Use e.g. ${mongoDbOperator} afterwards.
@@ -596,7 +596,7 @@ functions:
596596
add_to_path:
597597
- ${workdir}/bin
598598
# Below script deletes agent images created for an Evergreen patch older than 1 day
599-
command: scripts/evergreen/run_python.sh scripts/evergreen/periodic-cleanup-aws.py
599+
command: scripts/dev/run_python.sh scripts/evergreen/periodic-cleanup-aws.py
600600

601601
### Test Functions ###
602602

@@ -695,7 +695,7 @@ functions:
695695
working_dir: src/github.com/mongodb/mongodb-kubernetes
696696
script: |
697697
source .generated/context.export.env
698-
scripts/evergreen/run_python.sh scripts/evergreen/e2e/performance/create_variants.py ${variant} ${size}> evergreen_tasks.json
698+
scripts/dev/run_python.sh scripts/evergreen/e2e/performance/create_variants.py ${variant} ${size}> evergreen_tasks.json
699699
echo "tasks to run:"
700700
cat evergreen_tasks.json
701701
- command: generate.tasks

Makefile

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ operator: configure-operator build-and-push-operator-image
7575

7676
# build-push, (todo) restart database
7777
database: aws_login
78-
@ scripts/evergreen/run_python.sh pipeline.py --include database
78+
@ scripts/dev/run_python.sh pipeline.py --include database
7979

8080
readiness_probe: aws_login
81-
@ scripts/evergreen/run_python.sh pipeline.py --include readiness-probe
81+
@ scripts/dev/run_python.sh pipeline.py --include readiness-probe
8282

8383
upgrade_hook: aws_login
84-
@ scripts/evergreen/run_python.sh pipeline.py --include upgrade-hook
84+
@ scripts/dev/run_python.sh pipeline.py --include upgrade-hook
8585

8686
# ensures cluster is up, cleans Kubernetes + OM, build-push-deploy operator,
8787
# push-deploy database, create secrets, config map, resources etc
@@ -90,7 +90,7 @@ full: build-and-push-images
9090

9191
# build-push appdb image
9292
appdb: aws_login
93-
@ scripts/evergreen/run_python.sh pipeline.py --include appdb
93+
@ scripts/dev/run_python.sh pipeline.py --include appdb
9494

9595
# runs the e2e test: make e2e test=e2e_sharded_cluster_pv. The Operator is redeployed before the test, the namespace is cleaned.
9696
# The e2e test image is built and pushed together with all main ones (operator, database, init containers)
@@ -112,7 +112,7 @@ mco-e2e: aws_login build-and-push-mco-test-image
112112

113113
generate-env-file: ## generates a local-test.env for local testing
114114
mkdir -p .generated
115-
{ scripts/evergreen/run_python.sh mongodb-community-operator/scripts/dev/get_e2e_env_vars.py ".generated/config.json" | tee >(cut -d' ' -f2 > .generated/mco-test.env) ;} > .generated/mco-test.export.env
115+
{ scripts/dev/run_python.sh mongodb-community-operator/scripts/dev/get_e2e_env_vars.py ".generated/config.json" | tee >(cut -d' ' -f2 > .generated/mco-test.env) ;} > .generated/mco-test.export.env
116116
. .generated/mco-test.export.env
117117

118118
reset-helm-leftovers: ## sometimes you didn't cleanly uninstall a helm release, this cleans the existing helm artifacts
@@ -154,19 +154,19 @@ aws_cleanup:
154154
@ scripts/evergreen/prepare_aws.sh
155155

156156
build-and-push-operator-image: aws_login
157-
@ scripts/evergreen/run_python.sh pipeline.py --include operator-quick
157+
@ scripts/dev/run_python.sh pipeline.py --include operator-quick
158158

159159
build-and-push-database-image: aws_login
160160
@ scripts/dev/build_push_database_image
161161

162162
build-and-push-test-image: aws_login build-multi-cluster-binary
163163
@ if [[ -z "$(local)" ]]; then \
164-
scripts/evergreen/run_python.sh pipeline.py --include test; \
164+
scripts/dev/run_python.sh pipeline.py --include test; \
165165
fi
166166

167167
build-and-push-mco-test-image: aws_login
168168
@ if [[ -z "$(local)" ]]; then \
169-
scripts/evergreen/run_python.sh pipeline.py --include mco-test; \
169+
scripts/dev/run_python.sh pipeline.py --include mco-test; \
170170
fi
171171

172172
build-multi-cluster-binary:
@@ -181,27 +181,27 @@ build-and-push-images: build-and-push-operator-image appdb-init-image om-init-im
181181
build-and-push-init-images: appdb-init-image om-init-image database-init-image
182182

183183
database-init-image:
184-
@ scripts/evergreen/run_python.sh pipeline.py --include init-database
184+
@ scripts/dev/run_python.sh pipeline.py --include init-database
185185

186186
appdb-init-image:
187-
@ scripts/evergreen/run_python.sh pipeline.py --include init-appdb
187+
@ scripts/dev/run_python.sh pipeline.py --include init-appdb
188188

189189
# Not setting a parallel-factor will default to 0 which will lead to using all CPUs, that can cause docker to die.
190190
# Here we are defaulting to 6, a higher value might work for you.
191191
agent-image:
192-
@ scripts/evergreen/run_python.sh pipeline.py --include agent --all-agents --parallel --parallel-factor 6
192+
@ scripts/dev/run_python.sh pipeline.py --include agent --all-agents --parallel --parallel-factor 6
193193

194194
agent-image-slow:
195-
@ scripts/evergreen/run_python.sh pipeline.py --include agent --parallel-factor 1
195+
@ scripts/dev/run_python.sh pipeline.py --include agent --parallel-factor 1
196196

197197
operator-image:
198-
@ scripts/evergreen/run_python.sh pipeline.py --include operator
198+
@ scripts/dev/run_python.sh pipeline.py --include operator
199199

200200
om-init-image:
201-
@ scripts/evergreen/run_python.sh pipeline.py --include init-ops-manager
201+
@ scripts/dev/run_python.sh pipeline.py --include init-ops-manager
202202

203203
om-image:
204-
@ scripts/evergreen/run_python.sh pipeline.py --include ops-manager
204+
@ scripts/dev/run_python.sh pipeline.py --include ops-manager
205205

206206
configure-operator:
207207
@ scripts/dev/configure_operator.sh
@@ -284,16 +284,16 @@ golang-tests-race:
284284
USE_RACE=true scripts/evergreen/unit-tests.sh
285285

286286
sbom-tests:
287-
@ scripts/evergreen/run_python.sh -m pytest generate_ssdlc_report_test.py
287+
@ scripts/dev/run_python.sh -m pytest generate_ssdlc_report_test.py
288288

289289
# e2e tests are also in python and we will need to ignore them as they are in the docker/mongodb-kubernetes-tests folder
290290
# additionally, we have one lib which we want to test which is in the =docker/mongodb-kubernetes-tests folder.
291291
python-tests:
292-
@ scripts/evergreen/run_python.sh -m pytest docker/mongodb-kubernetes-tests/kubeobject
293-
@ scripts/evergreen/run_python.sh -m pytest --ignore=docker/mongodb-kubernetes-tests
292+
@ scripts/dev/run_python.sh -m pytest docker/mongodb-kubernetes-tests/kubeobject
293+
@ scripts/dev/run_python.sh -m pytest --ignore=docker/mongodb-kubernetes-tests
294294

295295
generate-ssdlc-report:
296-
@ scripts/evergreen/run_python.sh generate_ssdlc_report.py
296+
@ scripts/dev/run_python.sh generate_ssdlc_report.py
297297

298298
# test-race runs golang test with race enabled
299299
test-race: generate fmt vet manifests golang-tests-race
File renamed without changes.

scripts/dev/switch_context_by_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ main() {
5858
find_variant_arg="--task-name"
5959
fi
6060

61-
if ! contexts=$(scripts/evergreen/run_python.sh scripts/python/find_test_variants.py "${find_variant_arg}" "${test}"); then
61+
if ! contexts=$(scripts/dev/run_python.sh scripts/python/find_test_variants.py "${find_variant_arg}" "${test}"); then
6262
echo "Couldn't find any test contexts running test: ${test}"
6363
echo "${contexts}"
6464
exit 1

scripts/evergreen/e2e/e2e.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ run_e2e_mco_tests() {
2121
docker exec kind-control-plane mkdir -p /opt/data/mongo-data-{0..2} /opt/data/mongo-logs-{0..2}
2222

2323
set +e # let's not fail here, such that we can still dump all information
24-
scripts/evergreen/run_python.sh mongodb-community-operator/scripts/dev/e2e.py --test "${TEST_NAME}" --distro ubi --cluster-wide "${cluster_wide}"
24+
scripts/dev/run_python.sh mongodb-community-operator/scripts/dev/e2e.py --test "${TEST_NAME}" --distro ubi --cluster-wide "${cluster_wide}"
2525
local test_results=$?
2626
set -e
2727

0 commit comments

Comments
 (0)