Skip to content

CXX-3126 convert EVG config to config_generator components #1242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 82 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
6633f60
cherry-pick: cxx-evg-rhel79
eramongodb Oct 28, 2024
b74e4be
Add Astral uv project files
eramongodb Oct 28, 2024
6187935
Port required packages for etc/deploy-to-ghpages.pl
eramongodb Oct 28, 2024
cf9a937
Port required packages for etc/make_release.py
eramongodb Oct 28, 2024
638e68b
Remove obsoleted requirements.txt
eramongodb Oct 28, 2024
bf084b5
Relocate old evergreen files to old directory
eramongodb Oct 28, 2024
d482d58
Port minimal config generator from C Driver
eramongodb Oct 28, 2024
140d711
Add config_generator as uv workspace
eramongodb Oct 28, 2024
a89867c
distros: add debian12
eramongodb Oct 28, 2024
034b238
distros: add rhel8-latest
eramongodb Oct 28, 2024
51ae53e
distros: add debian12-latest
eramongodb Oct 28, 2024
ca2cae2
distros: add rhel92-arm64
eramongodb Oct 28, 2024
cb40feb
distros: add rhel79
eramongodb Oct 28, 2024
505a35f
distros: add support for VS2019 and VS2022
eramongodb Oct 28, 2024
5cd677a
distros: add to_platform for CMAKE_GENERATOR_PLATFORM
eramongodb Oct 28, 2024
13b84b1
distros: add compiler_to_vars
eramongodb Oct 28, 2024
d5ed7f4
Update CMake minimum required version and policies
eramongodb Oct 28, 2024
df00f10
Include functions.yml in legacy config
eramongodb Oct 28, 2024
4f404c6
functions: abi-compliance-check
eramongodb Oct 28, 2024
7cf0d1e
functions: abidiff
eramongodb Oct 28, 2024
32ba2ba
functions: abi-prohibited-symbols
eramongodb Oct 28, 2024
6cbb00e
functions: setup
eramongodb Oct 28, 2024
3e6d857
functions: build_mongohouse
eramongodb Oct 28, 2024
602f8fa
functions: run_mongohouse
eramongodb Oct 28, 2024
ee7b3af
functions: test_mongohouse
eramongodb Oct 28, 2024
7f48869
functions: start_mongod
eramongodb Oct 28, 2024
2475293
functions: stop_mongod
eramongodb Oct 28, 2024
7dea189
functions: install_c_driver
eramongodb Oct 28, 2024
d5e7ceb
functions: fetch_c_driver_source
eramongodb Oct 28, 2024
c02577b
functions: lint
eramongodb Oct 28, 2024
3852f14
functions: clang-tidy
eramongodb Oct 28, 2024
b4eb259
functions: fetch-det (clone_drivers-evergreen-tools)
eramongodb Oct 28, 2024
23f86d8
functions: run_kms_servers
eramongodb Oct 28, 2024
7bebc90
functions: compile
eramongodb Oct 28, 2024
ee58389
functions: compile_benchmarks
eramongodb Oct 28, 2024
4e23be3
functions: test
eramongodb Oct 28, 2024
c180d49
functions: test auth
eramongodb Oct 28, 2024
58dc7d6
functions: test atlas connectivity
eramongodb Oct 28, 2024
61d608f
functions: backtrace
eramongodb Oct 28, 2024
f826c85
functions: upload working dir
eramongodb Oct 28, 2024
13de776
functions: upload mongo orchestration artifacts
eramongodb Oct 28, 2024
e3fa8ca
functions: upload code coverage
eramongodb Oct 28, 2024
ae96a4b
functions: docker-image-build
eramongodb Oct 28, 2024
5f2a1f2
functions: run benchmarks
eramongodb Oct 28, 2024
23e09c3
functions: run scan build
eramongodb Oct 28, 2024
2db8ca4
functions: upload scan artifacts
eramongodb Oct 28, 2024
ca73606
functions: check augmented sbom
eramongodb Oct 28, 2024
f4fe7ca
functions: upload augmented sbom
eramongodb Oct 28, 2024
2b87bc7
Reference .evergreen-old in legacy config
eramongodb Oct 28, 2024
17b76d4
Remove obsolete reference to install.sh (6a4998952b)
eramongodb Oct 28, 2024
e034c13
Remove stub.py
eramongodb Oct 28, 2024
dc3a478
compile: fix extra alignment with auto-downloaded C Driver
eramongodb Oct 28, 2024
3f4a788
Add support for teardown_task_can_fail_task
eramongodb Oct 28, 2024
cdc0c55
Include all generated configs in legacy config
eramongodb Oct 28, 2024
7222fe1
Substitute all YAML anchors
eramongodb Oct 28, 2024
3a58075
component: abi_stability
eramongodb Oct 28, 2024
1643aed
component: atlas_search_indexes
eramongodb Oct 28, 2024
86763ca
component: lint
eramongodb Oct 28, 2024
5ee20b0
component: clang_tidy (ubuntu2004-debug-clang)
eramongodb Oct 28, 2024
387669c
component: uninstall_check (+ uninstall_check_windows)
eramongodb Oct 28, 2024
c5daa38
component: mongohouse
eramongodb Oct 28, 2024
3f43ebd
component: silk
eramongodb Oct 28, 2024
f6ebaa9
component: docker_build
eramongodb Oct 28, 2024
0a7534f
component: packaging
eramongodb Oct 28, 2024
a7b432e
component: scan_build
eramongodb Oct 28, 2024
0370dff
component: compile_only
eramongodb Oct 28, 2024
b08fb8a
component: macro_guards
eramongodb Oct 28, 2024
252fae5
component: versioned_api
eramongodb Oct 28, 2024
795e11b
component: compile_only (<- compile_with_shared_libs)
eramongodb Oct 28, 2024
9095232
component: sanitizers
eramongodb Oct 28, 2024
09a0603
component: valgrind
eramongodb Oct 28, 2024
193d6af
component: add_subdirectory (<- build_example_with_add_subdirectory)
eramongodb Oct 28, 2024
b5f0bc1
component: benchmarks
eramongodb Oct 28, 2024
3d3a14a
component: auth
eramongodb Oct 28, 2024
24e3f44
component: integration
eramongodb Oct 28, 2024
c61abc2
evg: copy post commands from legacy config into new config
eramongodb Oct 28, 2024
31b2a43
python: use inline metadata for script dependencies
eramongodb Oct 28, 2024
0e03df1
Fix COMPILE_MACRO_GUARD_TESTS: OFF -> ON
eramongodb Oct 28, 2024
1f373ca
Avoid conflict with ENABLE_TESTS: ON
eramongodb Oct 28, 2024
fe86cf8
Fix setting of -DENABLE_EXTRA_ALIGNMENT=ON flag
eramongodb Oct 28, 2024
4ece2e9
Add validation of enabled/disabled state of extra alignment
eramongodb Oct 28, 2024
6651e30
Support configuring ENABLE_EXTRA_ALIGNMENT=ON for auto-downloaded C D…
eramongodb Oct 28, 2024
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
32 changes: 0 additions & 32 deletions .evergreen/build_example_projects.sh

This file was deleted.

38 changes: 38 additions & 0 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Default timeout for all tasks is 1 hour.
# May be overridden by individual tasks.
exec_timeout_secs: 3600

# Default command type is 'system' to indicate failures unrelated to tests or
# their setup. Most commands should define their type as 'setup' or 'test'.
# - setup: before test (lavendar).
# - test: during test (red).
# - system: after test (purple).
command_type: system

# Ensure Evergreen tests earlier commits when a task fails.
stepback: true

# Ensure failure in pre commands is also considered task failure.
pre_error_fails_task: true

# Too many post commands are not designed to handle errors.
# TODO: set to true once failing post commands have been moved into
# teardown_group commands of appropriate task groups.
post_error_fails_task: false

# Commands run after all tasks (excluding those in task groups).
# Use sparingly and ensure they are error-proof.
# TODO: move into teardown_group commands of appropriate task groups.
post:
- func: "stop_mongod"
- func: "backtrace"
# Workaround for CXX-2040
# - func: "upload working dir"
- func: "upload mongo orchestration artifacts"
- func: "upload code coverage"

include:
- filename: .evergreen/generated_configs/functions.yml
- filename: .evergreen/generated_configs/task_groups.yml
- filename: .evergreen/generated_configs/tasks.yml
- filename: .evergreen/generated_configs/variants.yml
200 changes: 200 additions & 0 deletions .evergreen/config_generator/components/abi_stability.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
from config_generator.components.funcs.install_c_driver import InstallCDriver

from config_generator.etc.distros import find_large_distro
from config_generator.etc.function import Function, merge_defns
from config_generator.etc.utils import TaskGroup, bash_exec

from shrub.v3.evg_command import EvgCommandType, git_get_project, s3_put
from shrub.v3.evg_task import EvgTask, EvgTaskRef
from shrub.v3.evg_build_variant import BuildVariant, DisplayTask


TAG = 'abi-stability'


# pylint: disable=line-too-long
# fmt: off
MATRIX = [
('polyfill', 11),
('stdlib', 17),
]
# fmt: on
# pylint: enable=line-too-long


class AbiComplianceCheck(Function):
name = 'abi-compliance-check'
commands = [
bash_exec(
command_type=EvgCommandType.SETUP,
script='mongo-cxx-driver/.evergreen/scripts/abi-compliance-check-setup.sh'
),
bash_exec(
command_type=EvgCommandType.TEST,
script='mongo-cxx-driver/.evergreen/scripts/abi-compliance-check-test.sh'
),
s3_put(
command_type=EvgCommandType.SYSTEM,
aws_key='${aws_key}',
aws_secret='${aws_secret}',
bucket='mciuploads',
content_type='text/html',
display_name='ABI Compliance Check (Stable): ',
local_files_include_filter='cxx-abi/compat_reports/**/compat_report.html',
permissions='public-read',
remote_file='mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abi-compliance-check/abi/',
),
s3_put(
command_type=EvgCommandType.SYSTEM,
aws_key='${aws_key}',
aws_secret='${aws_secret}',
bucket='mciuploads',
content_type='text/plain',
display_name='ABI Compliance Check (Stable): ',
local_files_include_filter='cxx-abi/logs/**/log.txt',
permissions='public-read',
remote_file='mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abi-compliance-check/abi/',
),
s3_put(
command_type=EvgCommandType.SYSTEM,
aws_key='${aws_key}',
aws_secret='${aws_secret}',
bucket='mciuploads',
content_type='text/html',
display_name='ABI Compliance Check (Unstable): ',
local_files_include_filter='cxx-noabi/compat_reports/**/compat_report.html',
permissions='public-read',
remote_file='mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abi-compliance-check/noabi/',
),
s3_put(
command_type=EvgCommandType.SYSTEM,
aws_key='${aws_key}',
aws_secret='${aws_secret}',
bucket='mciuploads',
content_type='text/plain',
display_name='ABI Compliance Check (Unstable): ',
local_files_include_filter='cxx-noabi/logs/**/log.txt',
permissions='public-read',
remote_file='mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abi-compliance-check/noabi/',
),
]

@classmethod
def call(cls, **kwargs):
return cls.default_call(**kwargs)


class Abidiff(Function):
name = 'abidiff'
commands = [
bash_exec(
command_type=EvgCommandType.SETUP,
script='mongo-cxx-driver/.evergreen/scripts/abidiff-setup.sh'
),
bash_exec(
command_type=EvgCommandType.TEST,
script='mongo-cxx-driver/.evergreen/scripts/abidiff-test.sh'
),
s3_put(
command_type=EvgCommandType.SYSTEM,
aws_key='${aws_key}',
aws_secret='${aws_secret}',
bucket='mciuploads',
content_type='text/plain',
display_name='abidiff (Stable): ',
local_files_include_filter='cxx-abi/*.txt',
permissions='public-read',
remote_file='mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abidiff/abi/',
),
s3_put(
command_type=EvgCommandType.SYSTEM,
aws_key='${aws_key}',
aws_secret='${aws_secret}',
bucket='mciuploads',
content_type='text/plain',
display_name='abidiff (Unstable): ',
local_files_include_filter='cxx-noabi/*.txt',
permissions='public-read',
remote_file='mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abidiff/noabi/',
),
]

@classmethod
def call(cls, **kwargs):
return cls.default_call(**kwargs)


class AbiProhibitedSymbols(Function):
name = 'abi-prohibited-symbols'
commands = bash_exec(
command_type=EvgCommandType.TEST,
script='mongo-cxx-driver/.evergreen/scripts/abi-prohibited-symbols-test.sh'
)

@classmethod
def call(cls, **kwargs):
return cls.default_call(**kwargs)


def functions():
return merge_defns(
AbiComplianceCheck.defn(),
Abidiff.defn(),
AbiProhibitedSymbols.defn(),
)


def tasks():
distro_name = 'ubuntu2204'
distro = find_large_distro(distro_name)

return [
EvgTask(
name=func.name,
tags=[TAG, func.name, distro_name],
run_on=distro.name,
commands=[func.call()],
)
for func in [AbiComplianceCheck, Abidiff, AbiProhibitedSymbols]
]


def task_groups():
return [
TaskGroup(
name=f'tg-{TAG}',
max_hosts=-1,
setup_group_can_fail_task=True,
setup_task=[
git_get_project(directory='mongo-cxx-driver'),
InstallCDriver.call(),
bash_exec(
include_expansions_in_env=['cxx_standard'],
script='mongo-cxx-driver/.evergreen/scripts/abi-stability-setup.sh'
),
],
tasks=[f'.{TAG}'],
teardown_task_can_fail_task=True,
teardown_task=[bash_exec(script='rm -rf *'),],
)
]


def variants():
return [
BuildVariant(
name=f'abi-stability-{name}',
display_name=f'ABI Stability Checks ({name})',
expansions={
'cxx_standard': f'{cxx_standard}', # Use a polyfill library.
},
tasks=[EvgTaskRef(name='tg-abi-stability')],
display_tasks=[
DisplayTask(
name=f'ABI Stability Checks ({name})',
execution_tasks=[f'.{TAG}'],
)
],
)
for name, cxx_standard in MATRIX
]
91 changes: 91 additions & 0 deletions .evergreen/config_generator/components/add_subdirectory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
from config_generator.components.funcs.setup import Setup
from config_generator.components.funcs.start_mongod import StartMongod

from config_generator.etc.function import Function
from config_generator.etc.distros import find_large_distro, make_distro_str
from config_generator.etc.utils import bash_exec

from shrub.v3.evg_build_variant import BuildVariant, DisplayTask
from shrub.v3.evg_command import EvgCommandType
from shrub.v3.evg_task import EvgTask, EvgTaskRef

from itertools import product


TAG = 'add-subdirectory'


# pylint: disable=line-too-long
# fmt: off
MATRIX = [
('debian10', ['5.0', ], ['single']),
('debian11', ['5.0', ], ['single']),
('debian12', [ 'latest'], ['single']),
('rhel90', [ 'latest'], ['single']),
('rhel90-arm64', [ 'latest'], ['single']),
('ubuntu1804', ['5.0', ], ['single']),
('ubuntu2004', ['5.0', 'latest'], ['single']),
]
# fmt: on
# pylint: enable=line-too-long


class BuildExamplesWithAddSubdirectory(Function):
name = 'build-examples-with-add-subdirectory'
commands = bash_exec(
command_type=EvgCommandType.TEST,
working_dir='mongo-cxx-driver',
script='.evergreen/scripts/build-examples-with-add-subdirectory.sh',
)

@classmethod
def call(cls, **kwargs):
return cls.default_call(**kwargs)


def functions():
return BuildExamplesWithAddSubdirectory.defn()


def tasks():
res = []

build_type = 'Release'

for distro_name, mongodb_versions, topologies in MATRIX:
distro = find_large_distro(distro_name)

for mongodb_version, topology in product(mongodb_versions, topologies):
name = f'{TAG}-{make_distro_str(distro_name, None, None)}-{build_type.lower()}-{mongodb_version}-{topology}'
tags = [TAG, distro_name, build_type.lower(), mongodb_version, topology]

res.append(
EvgTask(
name=name,
tags=tags,
run_on=distro.name,
commands=[
Setup.call(),
StartMongod.call(mongodb_version=mongodb_version, topology=topology),
BuildExamplesWithAddSubdirectory.call(),
],
)
)

return res


def variants():
return [
BuildVariant(
name=f'{TAG}-examples',
display_name=f'{TAG}-examples',
tasks=[EvgTaskRef(name=f'.{TAG}')],
display_tasks=[
DisplayTask(
name=f'{TAG}-examples',
execution_tasks=[f'.{TAG}'],
)
],
),
]
Loading