Skip to content
Open
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
15 changes: 9 additions & 6 deletions .evergreen/config_generator/components/abi_compliance_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
from shrub.v3.evg_command import s3_put
from shrub.v3.evg_task import EvgTask

from config_generator.components.funcs.set_cache_dir import SetCacheDir
from config_generator.components.funcs.install_uv import InstallUV

from config_generator.etc.function import Function
from config_generator.etc.utils import bash_exec


class CheckABICompliance(Function):
name = 'abi-compliance-check'
commands = SetCacheDir.commands + [
commands = [
bash_exec(
command_type=EvgCommandType.SETUP,
working_dir='mongoc',
include_expansions_in_env=['MONGO_C_DRIVER_CACHE_DIR'],
script='.evergreen/scripts/abi-compliance-check-setup.sh'
script='.evergreen/scripts/abi-compliance-check-setup.sh',
),
bash_exec(
command_type=EvgCommandType.TEST,
add_expansions_to_env=True,
working_dir='mongoc',
include_expansions_in_env=['MONGO_C_DRIVER_CACHE_DIR'],
script='.evergreen/scripts/abi-compliance-check.sh'
include_expansions_in_env=['MONGO_C_DRIVER_CACHE_DIR', 'UV_INSTALL_DIR'],
script='.evergreen/scripts/abi-compliance-check.sh',
),
s3_put(
command_type=EvgCommandType.SYSTEM,
Expand Down Expand Up @@ -57,6 +57,9 @@ def tasks():
return [
EvgTask(
name=CheckABICompliance.name,
commands=[CheckABICompliance.call()],
commands=[
InstallUV.call(),
CheckABICompliance.call(),
],
)
]
4 changes: 2 additions & 2 deletions .evergreen/config_generator/components/c_std_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from shrub.v3.evg_command import EvgCommandType
from shrub.v3.evg_task import EvgTask, EvgTaskRef

from config_generator.components.funcs.find_cmake_latest import FindCMakeLatest
from config_generator.components.funcs.install_uv import InstallUV

from config_generator.etc.distros import find_large_distro
from config_generator.etc.distros import make_distro_str
Expand Down Expand Up @@ -96,7 +96,7 @@ def tasks():
run_on=distro.name,
tags=tags + [f'std-c{std}'],
commands=[
FindCMakeLatest.call(),
InstallUV.call(),
StdCompile.call(vars=compile_vars | with_std)
],
)
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/config_generator/components/clang_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ClangFormat(Function):
env={
"DRYRUN": "1",
},
script="uv run --frozen --only-group=format tools/format.py --mode=check",
script='PATH="${UV_INSTALL_DIR}:$PATH" uv run --frozen --only-group=format tools/format.py --mode=check',
),
]

Expand Down
15 changes: 0 additions & 15 deletions .evergreen/config_generator/components/funcs/fetch_det.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,6 @@ class FetchDET(Function):
working_dir="drivers-evergreen-tools",
script='find .evergreen -type f -name "*.sh" -exec chmod +rx "{}" \;',
),

# python is used frequently enough by many tasks that it is worth
# running find_python3 once here and reusing the result.
bash_exec(
command_type=EvgCommandType.SETUP,
script='''\
set -o errexit
. drivers-evergreen-tools/.evergreen/find-python3.sh
echo "PYTHON3_BINARY: $(find_python3)" >|python3_binary.yml
''',
),
expansions_update(
command_type=EvgCommandType.SETUP,
file='python3_binary.yml',
),
]


Expand Down

This file was deleted.

57 changes: 57 additions & 0 deletions .evergreen/config_generator/components/funcs/install_uv.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
from config_generator.components.funcs.set_cache_dir import SetCacheDir

from config_generator.etc.function import Function
from config_generator.etc.utils import bash_exec

from shrub.v3.evg_command import EvgCommandType, expansions_update


class InstallUV(Function):
name = 'install-uv'
commands = SetCacheDir.commands + [
bash_exec(
command_type=EvgCommandType.SETUP,
script='''\
set -o errexit
set -o pipefail

version="0.8.13"

if [[ ! -n "${MONGO_C_DRIVER_CACHE_DIR}" ]]; then
echo "MONGO_C_DRIVER_CACHE_DIR is not defined!" 1>&2
exit 1
fi

uv_install_dir="${MONGO_C_DRIVER_CACHE_DIR}/uv-$version"
mkdir -p "$uv_install_dir"

if ! command -v "$uv_install_dir/uv" 2>/dev/null; then
script="$(mktemp)"
cp -f mongoc/.evergreen/scripts/uv-installer.sh "$script"
chmod +x "$script"
(
. mongoc/.evergreen/scripts/patch-uv-installer.sh
patch_uv_installer "$script" "$version"
)
env \\
UV_INSTALL_DIR="$uv_install_dir" \\
UV_UNMANAGED_INSTALL=1 \\
INSTALLER_PRINT_VERBOSE=1 \\
"$script"
fi

PATH="$uv_install_dir:$PATH" command -V uv
PATH="$uv_install_dir:$PATH" uv --version

printf "UV_INSTALL_DIR: %s\\n" "$uv_install_dir" >|expansions.uv.yml
''',
),
expansions_update(
command_type=EvgCommandType.SETUP,
file='expansions.uv.yml',
),
]


def functions():
return InstallUV.defn()
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ class RunSimpleHTTPServer(Function):
command_type=command_type,
background=True,
working_dir='mongoc',
include_expansions_in_env=['UV_INSTALL_DIR'],
script='''\
set -o errexit
echo "Starting simple HTTP server..."
command -V "${PYTHON3_BINARY}" >/dev/null
"${PYTHON3_BINARY}" .evergreen/scripts/simple_http_server.py
PATH="${UV_INSTALL_DIR}:$PATH" uvx python .evergreen/scripts/simple_http_server.py
echo "Starting simple HTTP server... done."
''',
),
Expand Down
6 changes: 4 additions & 2 deletions .evergreen/config_generator/components/loadbalanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from config_generator.components.funcs.bootstrap_mongo_orchestration import BootstrapMongoOrchestration
from config_generator.components.funcs.fetch_build import FetchBuild
from config_generator.components.funcs.fetch_det import FetchDET
from config_generator.components.funcs.find_cmake_latest import FindCMakeLatest
from config_generator.components.funcs.install_uv import InstallUV
from config_generator.components.funcs.run_simple_http_server import RunSimpleHTTPServer
from config_generator.components.funcs.run_tests import RunTests
from config_generator.components.funcs.upload_build import UploadBuild
Expand Down Expand Up @@ -56,6 +56,7 @@ def make_test_task(auth: bool, ssl: bool, server_version: str):
'TOPOLOGY': 'sharded_cluster',
'LOAD_BALANCER': 'on',
}),
InstallUV.call(),
RunSimpleHTTPServer.call(),
FunctionCall(func='start-load-balancer', vars={
'MONGODB_URI': 'mongodb://localhost:27017,localhost:27018'
Expand All @@ -77,14 +78,15 @@ def tasks():
run_on=find_large_distro(_DISTRO_NAME).name,
tags=['loadbalanced', _DISTRO_NAME, _COMPILER],
commands=[
FindCMakeLatest.call(),
InstallUV.call(),
bash_exec(
command_type=EvgCommandType.TEST,
env={
'CC': _COMPILER,
'CFLAGS': '-fno-omit-frame-pointer',
'SSL': 'OPENSSL'
},
include_expansions_in_env=['distro_id', 'UV_INSTALL_DIR'],
working_dir='mongoc',
script='.evergreen/scripts/compile.sh',
),
Expand Down
6 changes: 3 additions & 3 deletions .evergreen/config_generator/components/make_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from shrub.v3.evg_command import s3_put
from shrub.v3.evg_task import EvgTask

from config_generator.components.funcs.find_cmake_latest import FindCMakeLatest
from config_generator.components.funcs.install_uv import InstallUV

from config_generator.etc.function import Function
from config_generator.etc.function import merge_defns
Expand All @@ -18,7 +18,7 @@ class MakeDocs(Function):
include_expansions_in_env=["distro_id"],
script="""\
# See SphinxBuild.cmake for EVG_DOCS_BUILD reasoning
uv run --frozen --only-group docs env EVG_DOCS_BUILD=1 .evergreen/scripts/build-docs.sh
PATH="${UV_INSTALL_DIR}:$PATH" uv run --frozen --only-group docs env EVG_DOCS_BUILD=1 .evergreen/scripts/build-docs.sh
""",
),
]
Expand Down Expand Up @@ -120,7 +120,7 @@ def tasks():
EvgTask(
name="make-docs",
commands=[
FindCMakeLatest.call(),
InstallUV.call(),
MakeDocs.call(),
UploadDocs.call(),
UploadManPages.call(),
Expand Down
7 changes: 2 additions & 5 deletions .evergreen/config_generator/components/mock_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
from shrub.v3.evg_command import EvgCommandType
from shrub.v3.evg_task import EvgTask, EvgTaskRef

from config_generator.components.funcs.fetch_det import FetchDET
from config_generator.components.funcs.find_cmake_latest import FindCMakeLatest
from config_generator.components.funcs.install_uv import InstallUV
from config_generator.components.funcs.run_simple_http_server import RunSimpleHTTPServer
from config_generator.etc.utils import bash_exec

Expand All @@ -13,10 +12,8 @@ def tasks():
name="mock-server-test",
run_on="ubuntu2204-small",
commands=[
# Call fetch-det to define PYTHON3_BINARY expansion required for run-simple-http-server.
FetchDET.call(),
InstallUV.call(),
RunSimpleHTTPServer.call(),
FindCMakeLatest.call(),
bash_exec(
command_type=EvgCommandType.TEST,
add_expansions_to_env=True,
Expand Down
18 changes: 13 additions & 5 deletions .evergreen/config_generator/components/openssl_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from config_generator.etc.utils import bash_exec

from config_generator.components.funcs.fetch_source import FetchSource
from config_generator.components.funcs.find_cmake_latest import FindCMakeLatest
from config_generator.components.funcs.install_uv import InstallUV

from shrub.v3.evg_build_variant import BuildVariant
from shrub.v3.evg_command import EvgCommandType, FunctionCall
Expand Down Expand Up @@ -39,13 +39,21 @@ class OpenSSLSetup(Function):
bash_exec(
command_type=EvgCommandType.SETUP,
working_dir='mongoc',
include_expansions_in_env=['OPENSSL_VERSION', 'OPENSSL_ENABLE_FIPS', 'OPENSSL_USE_STATIC_LIBS'],
include_expansions_in_env=[
'OPENSSL_ENABLE_FIPS',
'OPENSSL_USE_STATIC_LIBS',
'OPENSSL_VERSION',
],
script='.evergreen/scripts/openssl-compat-setup.sh',
),
bash_exec(
command_type=EvgCommandType.SETUP,
working_dir='mongoc',
include_expansions_in_env=['OPENSSL_VERSION', 'OPENSSL_USE_STATIC_LIBS'],
include_expansions_in_env=[
'OPENSSL_USE_STATIC_LIBS',
'OPENSSL_VERSION',
'UV_INSTALL_DIR',
],
script='.evergreen/scripts/openssl-compat-check.sh',
),
]
Expand All @@ -71,7 +79,7 @@ def tasks():
tags=[TAG, f'openssl-{version}', f'openssl-{link_type}', distro_name, compiler],
commands=[
FetchSource.call(),
FindCMakeLatest.call(),
InstallUV.call(),
OpenSSLSetup.call(vars=vars),
FunctionCall(func="run auth tests"),
],
Expand All @@ -92,7 +100,7 @@ def tasks():
tags=[TAG, f'openssl-fips-{version}', f'openssl-{link_type}', distro_name, compiler],
commands=[
FetchSource.call(),
FindCMakeLatest.call(),
InstallUV.call(),
OpenSSLSetup.call(vars=vars),
FunctionCall(func="run auth tests"),
],
Expand Down
4 changes: 2 additions & 2 deletions .evergreen/config_generator/components/scan_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from shrub.v3.evg_command import FunctionCall
from shrub.v3.evg_task import EvgTask, EvgTaskRef

from config_generator.components.funcs.find_cmake_latest import FindCMakeLatest
from config_generator.components.funcs.install_uv import InstallUV

from config_generator.etc.distros import find_large_distro
from config_generator.etc.distros import make_distro_str
Expand Down Expand Up @@ -68,7 +68,7 @@ def tasks():
run_on=distro.name,
tags=tags,
commands=[
FindCMakeLatest.call(),
InstallUV.call(),
ScanBuild.call(vars=compile_vars if compile_vars else None),
FunctionCall(func='upload scan artifacts'),
],
Expand Down
4 changes: 2 additions & 2 deletions .evergreen/config_generator/etc/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from config_generator.etc.distros import make_distro_str
from config_generator.etc.distros import compiler_to_vars

from config_generator.components.funcs.find_cmake_latest import FindCMakeLatest
from config_generator.components.funcs.install_uv import InstallUV
from config_generator.components.funcs.upload_build import UploadBuild


Expand Down Expand Up @@ -37,7 +37,7 @@ def generate_compile_tasks(SSL, TAG, SASL_TO_FUNC, MATRIX, MORE_TAGS=None, MORE_
task_name = f'{tag}-{task_name}'

commands = []
commands.append(FindCMakeLatest.call())
commands.append(InstallUV.call())
commands.append(SASL_TO_FUNC[sasl].call(vars=compile_vars if compile_vars else None))
commands.append(UploadBuild.call())

Expand Down
2 changes: 2 additions & 0 deletions .evergreen/config_generator/etc/cse/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from config_generator.components.funcs.bootstrap_mongo_orchestration import BootstrapMongoOrchestration
from config_generator.components.funcs.fetch_build import FetchBuild
from config_generator.components.funcs.fetch_det import FetchDET
from config_generator.components.funcs.install_uv import InstallUV
from config_generator.components.funcs.run_mock_kms_servers import RunMockKMSServers
from config_generator.components.funcs.run_tests import RunTests

Expand Down Expand Up @@ -62,6 +63,7 @@ def generate_test_tasks(SSL, TAG, MATRIX):
test_commands.append(expansions_update(updates=updates))
test_commands.append(FetchDET.call())
test_commands.append(BootstrapMongoOrchestration.call())
test_commands.append(InstallUV.call())
test_commands.append(RunMockKMSServers.call())
test_commands.append(RunTests.call())

Expand Down
2 changes: 2 additions & 0 deletions .evergreen/config_generator/etc/sanitizers/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from config_generator.components.funcs.bootstrap_mongo_orchestration import BootstrapMongoOrchestration
from config_generator.components.funcs.fetch_build import FetchBuild
from config_generator.components.funcs.fetch_det import FetchDET
from config_generator.components.funcs.install_uv import InstallUV
from config_generator.components.funcs.run_simple_http_server import RunSimpleHTTPServer
from config_generator.components.funcs.run_mock_kms_servers import RunMockKMSServers
from config_generator.components.funcs.run_tests import RunTests
Expand Down Expand Up @@ -87,6 +88,7 @@ def generate_test_tasks(SSL, TAG, MATRIX, MORE_COMPILE_TAGS=None, MORE_TEST_TAGS
test_commands.append(expansions_update(updates=updates))
test_commands.append(FetchDET.call())
test_commands.append(BootstrapMongoOrchestration.call())
test_commands.append(InstallUV.call())
test_commands.append(RunSimpleHTTPServer.call())

if 'cse' in MORE_COMPILE_TAGS:
Expand Down
Loading