SERVER-114734 Add extension_options configurations to archive-dist-test tarball (#45319)

GitOrigin-RevId: 38bf252551888380bd5dc3a9ca555ed0946580ef
This commit is contained in:
Zac Codiamat 2026-01-13 11:08:20 -06:00 committed by MongoDB Bot
parent 44305876da
commit a305a20b3a
7 changed files with 122 additions and 0 deletions

View File

@ -302,6 +302,12 @@ mongo_install(
"//src/mongo/db/shard_role/lock_manager:lock_gdb_test.py": "//src/mongo/db:mongod",
"//src/mongo/db/query/stage_builder/sbe/abt:optimizer_gdb_test.py": "//src/mongo/db/query/stage_builder/sbe/abt:optimizer_gdb_test_program",
},
root_files = select({
"@platforms//os:linux": {
"//src/mongo/db/extension/test_examples:extension_options_configs": "etc/mongo/extensions",
},
"//conditions:default": {},
}),
try_zstd = True,
deps = [
"//src/mongo/db/modules/atlas:dist-test",

View File

@ -164,6 +164,9 @@ tasks:
- func: "fetch packages"
- func: "fetch msi files"
- func: "fetch dist tarball"
- func: "fetch binaries"
vars:
local_file: src/mongo-dist-test.tgz
# Fetch mongocryptd
- command: s3.get
params:
@ -189,6 +192,18 @@ tasks:
args:
- "./src/evergreen/garasign_gpg_sign.sh"
# Put the dist-test binaries tarball/zipfile
- command: s3.put
params:
aws_secret: ${aws_secret}
local_file: src/mongodb-dist-test-${push_name}-${push_arch}-${suffix}.${ext|tgz}
aws_key: ${aws_key}
bucket: ${push_bucket}
permissions: ${mciuploads_binary_permissions|public-read}
visibility: ${mciuploads_binary_visibility|public}
content_type: ${content_type|application/gzip}
remote_file: ${push_path}/mongodb-dist-test-${push_name}-${push_arch}-${suffix}.${ext|tgz}
skip_existing: ${is_release}
# Put the binaries tarball/zipfile
- command: s3.put
params:
@ -231,6 +246,18 @@ tasks:
optional: true
# Put the binaries tarball signature
- command: s3.put
params:
aws_secret: ${aws_secret}
local_file: src/mongodb-dist-test-${push_name}-${push_arch}-${suffix}.${ext|tgz}.sig
aws_key: ${aws_key}
bucket: ${push_bucket}
permissions: ${mciuploads_binary_permissions|public-read}
visibility: ${mciuploads_binary_visibility|public}
content_type: ${content_type|application/gzip}
remote_file: ${push_path}/mongodb-dist-test-${push_name}-${push_arch}-${suffix}.${ext|tgz}.sig
skip_existing: ${is_release}
# Put the binaries tarball signature
- command: s3.put
params:
aws_secret: ${aws_secret}
@ -627,6 +654,16 @@ tasks:
content_type: text/plain
# Put the binaries tarball md5
- command: s3.put
params:
role_arn: ${push_role_arn}
local_file: src/mongodb-dist-test-${push_name}-${push_arch}-${suffix}.${ext|tgz}.md5
bucket: ${push_bucket_new}
permissions: private
content_type: text/plain
remote_file: ${push_path}/mongodb-${push_name}-${push_arch}-${suffix}.${ext|tgz}.md5
skip_existing: ${is_release}
# Put the binaries tarball md5
- command: s3.put
params:
role_arn: ${push_role_arn}
@ -680,6 +717,8 @@ tasks:
env:
SERVER_TARBALL_PATH: src/mongodb-${push_name}-${push_arch}-${suffix}.${ext|tgz}
SERVER_TARBALL_KEY: ${version_id}/${build_id}/push/${push_path}/mongodb-${push_name}-${push_arch}-${suffix}.${ext|tgz}
DIST_TEST_TARBALL_PATH: src/mongodb-dist-test-${push_name}-${push_arch}-${suffix}.${ext|tgz}
DIST_TEST_TARBALL_KEY: ${version_id}/${build_id}/push/${push_path}/mongodb-dist-test-${push_name}-${push_arch}-${suffix}.${ext|tgz}
CRYPTD_TARBALL_PATH: src/mongodb-cryptd-${push_name}-${push_arch}-${suffix}.${ext|tgz}
CRYPTD_TARBALL_KEY: ${version_id}/${build_id}/push/${push_path}/mongodb-cryptd-${push_name}-${push_arch}-${suffix}.${ext|tgz}
SOURCE_TARBALL_PATH: src/mongodb-src-${src_suffix}.${ext|tar.gz}
@ -688,6 +727,8 @@ tasks:
DEBUG_SYMBOLS_TARBALL_KEY: ${version_id}/${build_id}/push/${push_path}/mongodb-${push_name}-${push_arch}-debugsymbols-${suffix}.${ext|tgz}
SERVER_TARBALL_SIGNATURE_PATH: src/mongodb-${push_name}-${push_arch}-${suffix}.${ext|tgz}.sig
SERVER_TARBALL_SIGNATURE_KEY: ${version_id}/${build_id}/push/${push_path}/mongodb-${push_name}-${push_arch}-${suffix}.${ext|tgz}.sig
DIST_TEST_TARBALL_SIGNATURE_PATH: src/mongodb-dist-test-${push_name}-${push_arch}-${suffix}.${ext|tgz}.sig
DIST_TEST_TARBALL_SIGNATURE_KEY: ${version_id}/${build_id}/push/${push_path}/mongodb-dist-test-${push_name}-${push_arch}-${suffix}.${ext|tgz}.sig
CRYPTD_TARBALL_SIGNATURE_PATH: src/mongodb-cryptd-${push_name}-${push_arch}-${suffix}.${ext|tgz}.sig
CRYPTD_TARBALL_SIGNATURE_KEY: ${version_id}/${build_id}/push/${push_path}/mongodb-cryptd-${push_name}-${push_arch}-${suffix}.${ext|tgz}.sig
SOURCE_TARBALL_SIGNATURE_PATH: src/mongodb-src-${src_suffix}.${ext|tar.gz}.sig
@ -698,6 +739,8 @@ tasks:
MSI_KEY: ${version_id}/${build_id}/push/${push_path}/mongodb-${push_name}-${push_arch}-${suffix}-signed.msi
SERVER_TARBALL_SHA1_PATH: src/mongodb-${push_name}-${push_arch}-${suffix}.${ext|tgz}.sha1
SERVER_TARBALL_SHA1_KEY: ${version_id}/${build_id}/push/${push_path}/mongodb-${push_name}-${push_arch}-${suffix}.${ext|tgz}.sha1
DIST_TEST_TARBALL_SHA1_PATH: src/mongodb-dist-test-${push_name}-${push_arch}-${suffix}.${ext|tgz}.sha1
DIST_TEST_TARBALL_SHA1_KEY: ${version_id}/${build_id}/push/${push_path}/mongodb-dist-test-${push_name}-${push_arch}-${suffix}.${ext|tgz}.sha1
CRYPTD_TARBALL_SHA1_PATH: src/mongodb-cryptd-${push_name}-${push_arch}-${suffix}.${ext|tgz}.sha1
CRYPTD_TARBALL_SHA1_KEY: ${version_id}/${build_id}/push/${push_path}/mongodb-cryptd-${push_name}-${push_arch}-${suffix}.${ext|tgz}.sha1
SOURCE_TARBALL_SHA1_PATH: src/mongodb-src-${src_suffix}.${ext|tar.gz}.sha1
@ -708,6 +751,9 @@ tasks:
MSI_SHA1_KEY: ${version_id}/${build_id}/push/${push_path}/mongodb-${push_name}-${push_arch}-${suffix}-signed.msi.sha1
SERVER_TARBALL_SHA256_PATH: src/mongodb-${push_name}-${push_arch}-${suffix}.${ext|tgz}.sha256
SERVER_TARBALL_SHA256_KEY: ${version_id}/${build_id}/push/${push_path}/mongodb-${push_name}-${push_arch}-${suffix}.${ext|tgz}.sha256
DIST_TEST_TARBALL_SHA256_PATH: src/mongodb-dist-test-${push_name}-${push_arch}-${suffix}.${ext|tgz}.sha256
DIST_TEST_TARBALL_SHA256_KEY: ${version_id}/${build_id}/push/${push_path}/mongodb-dist-test-${push_name}-${push_arch}-${suffix}.${ext|tgz}.sha256
CRYPTD_TARBALL_SHA256_PATH: src/mongodb-cryptd-${push_name}-${push_arch}-${suffix}.${ext|tgz}.sha256
CRYPTD_TARBALL_SHA256_KEY: ${version_id}/${build_id}/push/${push_path}/mongodb-cryptd-${push_name}-${push_arch}-${suffix}.${ext|tgz}.sha256
SOURCE_TARBALL_SHA256_PATH: src/mongodb-src-${src_suffix}.${ext|tar.gz}.sha256
@ -718,6 +764,8 @@ tasks:
MSI_SHA256_KEY: ${version_id}/${build_id}/push/${push_path}/mongodb-${push_name}-${push_arch}-${suffix}-signed.msi.sha256
SERVER_TARBALL_MD5_PATH: src/mongodb-${push_name}-${push_arch}-${suffix}.${ext|tgz}.md5
SERVER_TARBALL_MD5_KEY: ${version_id}/${build_id}/push/${push_path}/mongodb-${push_name}-${push_arch}-${suffix}.${ext|tgz}.md5
DIST_TEST_TARBALL_MD5_PATH: src/mongodb-dist-test-${push_name}-${push_arch}-${suffix}.${ext|tgz}.md5
DIST_TEST_TARBALL_MD5_KEY: ${version_id}/${build_id}/push/${push_path}/mongodb-dist-test-${push_name}-${push_arch}-${suffix}.${ext|tgz}.md5
CRYPTD_TARBALL_MD5_PATH: src/mongodb-cryptd-${push_name}-${push_arch}-${suffix}.${ext|tgz}.md5
CRYPTD_TARBALL_MD5_KEY: ${version_id}/${build_id}/push/${push_path}/mongodb-cryptd-${push_name}-${push_arch}-${suffix}.${ext|tgz}.md5
SOURCE_TARBALL_MD5_PATH: src/mongodb-src-${src_suffix}.${ext|tar.gz}.md5

View File

@ -15,6 +15,7 @@ if [ "$long_ext" == "tgz" ]; then
fi
mv mongo-binaries.tgz mongodb-${push_name}-${push_arch}-${suffix}.${ext}
mv mongo-dist-test.tgz mongodb-dist-test-${push_name}-${push_arch}-${suffix}.${ext}
mv mongo-cryptd.tgz mongodb-cryptd-${push_name}-${push_arch}-${suffix}.${ext} || true
mv mh.tgz mh-${push_name}-${push_arch}-${suffix}.${ext} || true
mv mongo-debugsymbols.tgz mongodb-${push_name}-${push_arch}-debugsymbols-${suffix}.${ext} || true
@ -32,6 +33,7 @@ function gen_checksums() {
}
gen_checksums mongodb-$push_name-$push_arch-$suffix.$ext
gen_checksums mongodb-dist-test-$push_name-$push_arch-$suffix.$ext
gen_checksums mongodb-$push_name-$push_arch-debugsymbols-$suffix.$ext
gen_checksums mongodb-src-$src_suffix.$long_ext
gen_checksums mongodb-cryptd-$push_name-$push_arch-$suffix.$ext
@ -52,6 +54,7 @@ EOF
cat <<EOF >>gpg_signing_commands.sh
sign mongodb-$push_name-$push_arch-$suffix.$ext
sign mongodb-dist-test-$push_name-$push_arch-$suffix.$ext
sign mongodb-$push_name-$push_arch-debugsymbols-$suffix.$ext
sign mongodb-src-$src_suffix.$long_ext
sign mongodb-cryptd-$push_name-$push_arch-$suffix.$ext

View File

@ -8,14 +8,19 @@
# there first
declare -A ARTIFACTS=(
[${SERVER_TARBALL_PATH}]=${SERVER_TARBALL_KEY}
[${DIST_TEST_TARBALL_PATH}]=${DIST_TEST_TARBALL_KEY}
[${SOURCE_TARBALL_PATH}]=${SOURCE_TARBALL_KEY}
[${SERVER_TARBALL_SIGNATURE_PATH}]=${SERVER_TARBALL_SIGNATURE_KEY}
[${DIST_TEST_TARBALL_SIGNATURE_PATH}]=${DIST_TEST_TARBALL_SIGNATURE_KEY}
[${SOURCE_TARBALL_SIGNATURE_PATH}]=${SOURCE_TARBALL_SIGNATURE_KEY}
[${SERVER_TARBALL_SHA1_PATH}]=${SERVER_TARBALL_SHA1_KEY}
[${DIST_TEST_TARBALL_SHA1_PATH}]=${DIST_TEST_TARBALL_SHA1_KEY}
[${SOURCE_TARBALL_SHA1_PATH}]=${SOURCE_TARBALL_SHA1_KEY}
[${SERVER_TARBALL_SHA256_PATH}]=${SERVER_TARBALL_SHA256_KEY}
[${DIST_TEST_TARBALL_SHA256_PATH}]=${DIST_TEST_TARBALL_SHA256_KEY}
[${SOURCE_TARBALL_SHA256_PATH}]=${SOURCE_TARBALL_SHA256_KEY}
[${SERVER_TARBALL_MD5_PATH}]=${SERVER_TARBALL_MD5_KEY}
[${DIST_TEST_TARBALL_MD5_PATH}]=${DIST_TEST_TARBALL_MD5_KEY}
[${SOURCE_TARBALL_MD5_PATH}]=${SOURCE_TARBALL_MD5_KEY}
)

View File

@ -1,5 +1,7 @@
load("//bazel/install_rules:install_rules.bzl", "extensions_with_config")
load("//bazel:mongo_src_rules.bzl", "mongo_cc_extension_shared_library")
load("@poetry//:dependencies.bzl", "dependency")
load("//bazel/config:render_template.bzl", "render_template")
package(default_visibility = ["//visibility:public"])
@ -95,6 +97,44 @@ pkg_name = "//" + package_name() + "/"
]
]
[
render_template(
name = extension_name + "_conf",
srcs = [
"configurations.yml",
":gen_conf.py",
],
cmd = [
"$(location :gen_conf.py)",
"$(location " + extension_name + ".conf)",
"$(location configurations.yml)",
extension_name,
],
output = extension_name + ".conf",
python_libs = [
dependency(
"pyyaml",
group = "core",
),
],
)
for extension_name in [
"test_options",
"parse_options",
"toaster",
]
]
filegroup(
name = "extension_options_configs",
srcs = [
"parse_options_conf",
"test_options_conf",
"toaster_conf",
":aggregation_stage_fallback_parsers.json",
],
)
# Extensions under test_examples/extension_options/
[
mongo_cc_extension_shared_library(

View File

@ -0,0 +1,20 @@
import sys
import yaml
def get_extension_confs(file_path, extension_name):
with open(file_path, "r") as file:
data = yaml.safe_load(file)
return data["extensions"][extension_name]
if __name__ == "__main__":
output = sys.argv[1]
conf_file = sys.argv[2]
extension_name = sys.argv[3]
conf_data = get_extension_confs(conf_file, extension_name)
new_conf = dict(conf_data)
new_conf["sharedLibraryPath"] = f"lib/lib{extension_name}_mongo_extension.so"
with open(output, "w") as stream:
yaml.dump(new_conf, stream)