mirror of https://github.com/mongodb/mongo
SERVER-114674 Add support for scheduling antithesis images to run from patch builds (#44821)
GitOrigin-RevId: 7d91026fa516d6802270d0abf50fdcb6e5916872
This commit is contained in:
parent
1bdf7aa5e3
commit
56b8b1bb8e
|
|
@ -359,6 +359,9 @@ WORKSPACE.bazel @10gen/devprod-build @svc-auto-approve-bot
|
|||
/docs/**/poetry_execution.md @10gen/devprod-correctness @svc-auto-approve-bot
|
||||
/docs/**/server_parameters.md @10gen/server-programmability @svc-auto-approve-bot
|
||||
|
||||
# The following patterns are parsed from ./docs/antithesis/OWNERS.yml
|
||||
/docs/antithesis/ @10gen/devprod-correctness @svc-auto-approve-bot
|
||||
|
||||
# The following patterns are parsed from ./docs/branching/OWNERS.yml
|
||||
/docs/branching/**/* @10gen/server-release @svc-auto-approve-bot
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
version: 2.0.0
|
||||
filters:
|
||||
- "*":
|
||||
approvers:
|
||||
- 10gen/devprod-correctness
|
||||
|
|
@ -191,6 +191,14 @@ This should be done with care to ensure we are using our limited resources effic
|
|||
|
||||
Create a new task extending the `antithesis_task_template`, tagged with `antithesis`, passing the specified `suite` to the `antithesis image build and push` task. See other examples to get started.
|
||||
|
||||
## How do I test my suite in antithesis?
|
||||
|
||||
If you provide the evergreen parameter `schedule_antithesis_tests` to your evergreen patch, once we build the antithesis images in your evergreen patch we send antithesis an api request to run your newly created images for an hour. You will get emailed the report when it finishes running in antithesis.
|
||||
|
||||
Important Note: This will happen for every antithesis task you schedule in your patch. Please do not schedule more than 1 or 2 tasks with this parameter at a time or it will use up a lot of our testing time allocated with antithesis.
|
||||
|
||||
`evergreen patch --param schedule_antithesis_tests=true`
|
||||
|
||||
## Additional Resources
|
||||
|
||||
If you are interested in leveraging Antithesis feel free to reach out to #server-testing on Slack.
|
||||
|
|
@ -54,6 +54,11 @@ parameters:
|
|||
description: >-
|
||||
Automatically disables symbolizing stack traces from Resmoke tasks. If this is set to false, the steps on how to manually symbolize the unsymbolized stacktraces will not be generated.
|
||||
|
||||
- key: schedule_antithesis_tests
|
||||
description: >-
|
||||
Automatically schedules your antithesis tasks to run in antithesis.
|
||||
Please only schedule one or two antithesis tasks when specifying this parameter.
|
||||
|
||||
## Cron parameters.
|
||||
- key: project_required_suggested_cron
|
||||
value: "0 */4 * * *" # Every 4 hours starting at 0000 UTC
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ buildvariants:
|
|||
expansions:
|
||||
<<: *enterprise-ubuntu2204-64-libvoidstar-expansions-template
|
||||
compile_variant: *enterprise-ubuntu2204-64-libvoidstar
|
||||
antithesis_endpoint: core_server_vanilla
|
||||
bazel_compile_flags: >-
|
||||
${antithesis_bazel_compile_flags}
|
||||
--define=MONGO_DISTMOD=ubuntu2204
|
||||
|
|
@ -51,6 +52,7 @@ buildvariants:
|
|||
<<: *enterprise-ubuntu2204-64-libvoidstar-expansions-template
|
||||
antithesis_build_type: aubsan
|
||||
compile_variant: *enterprise-ubuntu2204-64-aubsan-libvoidstar
|
||||
antithesis_endpoint: core_server_aubsan
|
||||
bazel_compile_flags: >-
|
||||
${antithesis_bazel_compile_flags}
|
||||
--config=dbg_aubsan
|
||||
|
|
@ -77,6 +79,7 @@ buildvariants:
|
|||
<<: *enterprise-ubuntu2204-64-libvoidstar-expansions-template
|
||||
antithesis_build_type: tsan
|
||||
compile_variant: *enterprise-ubuntu2204-64-tsan-libvoidstar
|
||||
antithesis_endpoint: core_server_tsan
|
||||
bazel_compile_flags: >-
|
||||
${antithesis_bazel_compile_flags}
|
||||
--config=dbg_tsan
|
||||
|
|
|
|||
|
|
@ -87,3 +87,40 @@ sudo docker push "$antithesis_repo/workload:$tag"
|
|||
|
||||
# Logout
|
||||
sudo docker logout https://us-central1-docker.pkg.dev
|
||||
|
||||
# Skip triggering tests for patch builds
|
||||
if [ "${is_patch}" != "true" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Parameter was not passed to schedule antithesis tests
|
||||
if [ "${schedule_antithesis_tests}" != "true" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
params=$(jq -n \
|
||||
--arg config_image "${task_name}:$tag" \
|
||||
--arg images "mongo-binaries:$tag;workload:$tag" \
|
||||
--arg description "Patch Test: ${task_name} for ${tag}" \
|
||||
--arg author_email "${author_email}" \
|
||||
'{
|
||||
params: {
|
||||
"antithesis.description": $description,
|
||||
"custom.duration": "1",
|
||||
"antithesis.config_image": $config_image,
|
||||
"antithesis.images": $images,
|
||||
"antithesis.report.recipients": $author_email,
|
||||
"antithesis.is_ephemeral": "true"
|
||||
}
|
||||
}')
|
||||
|
||||
echo "Calling Antithesis API endpoint: https://mongo.antithesis.com/api/v1/launch/${antithesis_endpoint}"
|
||||
echo "With parameters:"
|
||||
echo "$params" | jq .
|
||||
|
||||
curl --fail -u "mongodb:${antithesis_api_password}" \
|
||||
-X POST "https://mongo.antithesis.com/api/v1/launch/${antithesis_endpoint}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$params"
|
||||
|
||||
echo -e "\nSuccessfully triggered Antithesis ${antithesis_endpoint} test"
|
||||
|
|
|
|||
Loading…
Reference in New Issue