buildscripts/resmokelib/extensions/README.md
This module provides utilities for setting up and configuring MongoDB extensions in resmoke test suites.
Extensions are dynamically loaded shared objects (.so files) that provide additional functionality to MongoDB. The utilities in this folder can handle:
.so files in build directories.conf configuration files for extensionsmongot-extension) from S3.Extension .conf files are YAML configuration files that tell the server how to load an extension. They contain:
sharedLibraryPath: Path to the .so fileextensionOptions: Optional configuration parameters for the extensionFor example:
# foo.conf
sharedLibraryPath: /path/to/libfoo_mongo_extension.so
extensionOptions:
someSetting: <value>
The generate_extension_configs.py module creates .conf files:
.so file paths (either from automatic discovery via find_and_generate_extension_configs.py, or manually via --so-files command-line argument).so, creates a .conf file in the temp directory (/tmp/mongo/extensions/)src/mongo/db/extension/test_examples/configurations.yml, if any are specifiedsharedLibraryPath and any extensionOptionsThe find_and_generate_extension_configs.py module combines discovery and generation:
*_mongo_extension.so files in build directories:
dist-test/lib/bazel-bin/install-dist-test/lib/ or bazel-bin/install-extensions/lib/.conf files with a unique UUID suffix to avoid collisionsloadExtensions parameter to mongod/mongos optionsmongot-extension SetupThe setup_mongot_extension.py script downloads and configures the Rust mongot-extension binary for extension $vectorSearch testing.
All vector_search_extension_* test suites use this framework to run server Extensions code with the Rust mongot-extension.so.
MONGOT_EXTENSION_VERSION in setup_mongot_extension.py).
We use the release/ path (e.g. release/mongot-extension-1.0.0-{platform}-{arch}.tgz), not latest/, so normal mongot-extension pushes do not overwrite the artifact.
Only sign-and-publish-release will change the content when run.buildscripts/s3_binary/hashes.py..so file and creates a configuration fileThe mongot-extension binaries are stored in S3 and verified using hardcoded SHA256 checksums in buildscripts/s3_binary/hashes.py.
When a new version is released (by running sign-and-publish-release), update MONGOT_EXTENSION_VERSION in setup_mongot_extension.py and the hashes in hashes.py.
This ensures every change is explicitly documented in the commit history and no component changes without an auditable commit.
This cross-repo test infrastructure is temporary for the initial rollout of extension $vectorSearch. Long-term, all extension testing will live outside the server repository.
To update the checksums:
VERSION=1.0.0 # replace with the new version
for s in amazon2023-x86_64 amazon2023-aarch64 amazon2-x86_64 amazon2-aarch64; do
url="https://mongot-extension.s3.amazonaws.com/release/mongot-extension-${VERSION}-${s}.tgz"
curl -sL -o "/tmp/mongot-${s}.tgz" "$url"
echo "$url"
sha256sum "/tmp/mongot-${s}.tgz" | awk '{print $1}'
done
buildscripts/s3_binary/hashes.py, replace the four mongot-extension hash values with the four printed hashes in the same order:amazon2023-x86_64amazon2023-aarch64amazon2-x86_64amazon2-aarch64hashes.py so Evergreen and others use the new checksums.For local development or testing with a custom-built mongot-extension, you can set the MONGOT_EXTENSION_PATH environment variable:
export MONGOT_EXTENSION_PATH=/path/to/your/mongot-extension.so
buildscripts/resmoke.py run --suites=vector_search_extension_* ...
This bypasses the S3 download and instead uses your local binary when generating mongot-extension.conf.