Skip to content

Commit 4366cb5

Browse files
Fix and update EVG configuration for r2.0 (#2079)
* CDRIVER-5959 temporarily restrict updateDescription tests to 8.1 or older (#1970) * CDRIVER-5959 sync change streams unified spec tests with 0aee4aad (#1971) * CDRIVER-5304 set cluster time in test sessions (#2008) * CDRIVER-6010 use `ec2.assume_role` for mongohouse task (#2025) * Ignore -Wpre-c11-compat warnings when building public-header-warnings (#2027) * CDRIVER-6042 Migrate Python scripts from Poetry to Astral UV (#2039) * Migrate EVG task coverage to latest Debian, Ubuntu, and RHEL distros (#2044) * CDRIVER-6010 use `ec2.assume_role` for Azure KMS task (#2051) * CDRIVER-5971 Use Amazon ECR to obtain OCI images in EVG (#2058) * CDRIVER-5874 Drop Debian 10 EVG task coverage (#2062) * update Earthly version from 0.8.3 to 0.8.16 (#2072) --------- Co-authored-by: Kevin Albertson <[email protected]>
1 parent 0ae37e8 commit 4366cb5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+3114
-3049
lines changed

.evergreen/config_generator/README.md

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,22 @@
33
The scripts in this directory are used to generate the Evergreen configuration
44
files stored in `.evergreen/generated_configs/`.
55

6-
The easiest way to execute these scripts is using the Poetry to install the
7-
dependencies and then run the scripts.
6+
The easiest way to execute these scripts is to use [uv](https://docs.astral.sh/uv/) to run the scripts.
87

98
**Note**: These scripts require Python 3.10 or newer.
109

1110

1211
## Setting Up
1312

14-
Before running, use Poetry to install a virtualenv containing the dependencies.
15-
This can be done by using the `poetry.sh` (or `poetry.ps1`) script contained in
16-
the `tools/` directory at the root of the `mongo-c-driver` repository:
17-
18-
```sh
19-
./tools/poetry.sh install --with=dev
20-
```
21-
22-
Or with PowerShell:
23-
24-
```pwsh
25-
./tools/poetry.ps1 install --with=dev
26-
```
13+
`uv` is required to run Python scripts. See ["Installing uv"](https://docs.astral.sh/uv/getting-started/installation/) for instructions on how to obtain `uv`.
2714

2815

2916
## Running the Generator
3017

31-
The package defines a program `mc-evg-generate`, which can be run within the
32-
virtualenv. This can be done via Poetry as well, following the setup:
18+
The package provides the `mc-evg-generate` [entry point](https://packaging.python.org/en/latest/specifications/entry-points):
3319

3420
```sh
35-
./tools/poetry.sh run mc-evg-generate
21+
uv run --frozen mc-evg-generate
3622
```
3723

3824
This command will ready the generation files and generate a new set of Evergreen

.evergreen/config_generator/components/c_std_compile.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@
2828
('rhel94', 'clang', None, [99, 11, 17, 23]), # Clang 17.0 (max: C2x)
2929
('rhel95', 'clang', None, [99, 11, 17, 23]), # Clang 18.0 (max: C23)
3030

31-
('rhel76', 'gcc', None, [99, 11, ]), # GCC 4.8 (max: C11)
32-
('rhel80', 'gcc', None, [99, 11, 17, ]), # GCC 8.2 (max: C17)
33-
('debian10', 'gcc-8', None, [99, 11, 17, ]), # GCC 8.3 (max: C17)
34-
('rhel84', 'gcc', None, [99, 11, 17, ]), # GCC 8.4 (max: C17)
35-
('ubuntu2004', 'gcc-9', None, [99, 11, 17, 23]), # GCC 9.4 (max: C2x)
36-
('debian11', 'gcc-10', None, [99, 11, 17, 23]), # GCC 10.2 (max: C2x)
37-
('rhel90', 'gcc', None, [99, 11, 17, 23]), # GCC 11.2 (max: C2x)
38-
('rhel92', 'gcc', None, [99, 11, 17, 23]), # GCC 11.3 (max: C2x)
39-
('rhel94', 'gcc', None, [99, 11, 17, 23]), # GCC 11.4 (max: C2x)
40-
('rhel95', 'gcc', None, [99, 11, 17, 23]), # GCC 11.5 (max: C2x)
31+
('rhel7-latest', 'gcc', None, [99, 11, ]), # GCC 4.8 (max: C11)
32+
('rhel80', 'gcc', None, [99, 11, 17, ]), # GCC 8.2 (max: C17)
33+
('rhel84', 'gcc', None, [99, 11, 17, ]), # GCC 8.4 (max: C17)
34+
('ubuntu2004', 'gcc-9', None, [99, 11, 17, 23]), # GCC 9.4 (max: C2x)
35+
('debian11', 'gcc-10', None, [99, 11, 17, 23]), # GCC 10.2 (max: C2x)
36+
('rhel90', 'gcc', None, [99, 11, 17, 23]), # GCC 11.2 (max: C2x)
37+
('rhel92', 'gcc', None, [99, 11, 17, 23]), # GCC 11.3 (max: C2x)
38+
('rhel94', 'gcc', None, [99, 11, 17, 23]), # GCC 11.4 (max: C2x)
39+
('rhel95', 'gcc', None, [99, 11, 17, 23]), # GCC 11.5 (max: C2x)
40+
('ubuntu2404', 'gcc-13', None, [99, 11, 17, 23]), # GCC 13.3 (max: C2x)
4141

4242
('windows-vsCurrent', 'vs2017x64', None, [99, 11, 17, 'latest']), # Max: C17, clatest (C2x)
4343
('windows-vsCurrent', 'vs2019x64', None, [99, 11, 17, 'latest']), # Max: C17, clatest (C2x)

.evergreen/config_generator/components/clang_format.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,24 @@
33
from shrub.v3.evg_task import EvgTask
44
from shrub.v3.evg_task import EvgTaskRef
55

6-
from config_generator.etc.distros import find_large_distro
6+
from config_generator.etc.distros import find_small_distro
77
from config_generator.etc.function import Function
88
from config_generator.etc.utils import bash_exec
99

1010

1111
TAG = "clang-format"
1212

13-
DISTROS = [
14-
find_large_distro("ubuntu2204").name,
15-
find_large_distro("ubuntu2004").name,
16-
]
17-
1813

1914
class ClangFormat(Function):
2015
name = TAG
2116
commands = [
22-
bash_exec(
23-
command_type=EvgCommandType.SETUP,
24-
working_dir="mongoc",
25-
script="./tools/poetry.sh install --with=dev"
26-
),
2717
bash_exec(
2818
command_type=EvgCommandType.TEST,
2919
working_dir="mongoc",
3020
env={
3121
"DRYRUN": "1",
3222
},
33-
script="./tools/poetry.sh run .evergreen/scripts/clang-format-all.sh",
23+
script="uv run --frozen --only-group format .evergreen/scripts/clang-format-all.sh",
3424
),
3525
]
3626

@@ -56,7 +46,7 @@ def variants():
5646
BuildVariant(
5747
name=TAG,
5848
display_name=TAG,
59-
run_on=DISTROS,
49+
run_on=[find_small_distro("ubuntu2204").name],
6050
tasks=[EvgTaskRef(name=f'.{TAG}')],
6151
),
6252
]

.evergreen/config_generator/components/cse/openssl.py

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,40 @@
1515
# pylint: disable=line-too-long
1616
# fmt: off
1717
COMPILE_MATRIX = [
18-
('debian92', 'clang', None, ['cyrus']),
19-
('debian92', 'gcc', None, ['cyrus']),
20-
('debian10', 'clang', None, ['cyrus']),
21-
('debian10', 'gcc', None, ['cyrus']),
22-
('debian11', 'clang', None, ['cyrus']),
23-
('debian11', 'gcc', None, ['cyrus']),
24-
('rhel80', 'gcc', None, ['cyrus']),
18+
# For test matrix.
19+
('rhel8-latest', 'gcc', None, ['cyrus']),
2520
('rhel8-zseries', 'gcc', None, ['cyrus']),
26-
('ubuntu2004', 'clang', None, ['cyrus']),
27-
('ubuntu2004', 'gcc', None, ['cyrus']),
2821
('ubuntu2004-arm64', 'gcc', None, ['cyrus']),
2922
('windows-vsCurrent', 'vs2017x64', None, ['cyrus']),
23+
24+
# For compile only.
25+
('debian11', 'clang', None, ['cyrus']),
26+
('debian11', 'gcc', None, ['cyrus']),
27+
('debian12', 'clang', None, ['cyrus']),
28+
('debian12', 'gcc', None, ['cyrus']),
29+
('rhel80', 'gcc', None, ['cyrus']),
30+
('ubuntu2004', 'gcc', None, ['cyrus']),
31+
('ubuntu2004', 'clang', None, ['cyrus']),
32+
('ubuntu2204', 'gcc', None, ['cyrus']),
33+
('ubuntu2204', 'clang-12', None, ['cyrus']),
34+
('ubuntu2404', 'gcc', None, ['cyrus']),
35+
('ubuntu2404', 'clang-14', None, ['cyrus']),
3036
]
3137

3238
# TODO (CDRIVER-3789): test cse with the 'sharded' topology.
39+
# CSFLE requires 4.2+. QE requires 7.0+ and are skipped on "server" tasks.
3340
TEST_MATRIX = [
34-
# 4.2 and 4.4 not available on rhel8-zseries.
35-
('rhel8-zseries', 'gcc', None, 'cyrus', ['auth'], ['server'], ['5.0']),
41+
# rhel8-latest provides 4.2+.
42+
('rhel8-latest', 'gcc', None, 'cyrus', ['auth'], ['server', 'replica'], ['4.2', '4.4', '5.0', '6.0', '7.0', '8.0', 'latest']),
3643

37-
('windows-vsCurrent', 'vs2017x64', None, 'cyrus', ['auth'], ['server'], ['4.2', '4.4', '5.0', '6.0' ]),
44+
# windows-vsCurrent provides 4.2+.
45+
('windows-vsCurrent', 'vs2017x64', None, 'cyrus', ['auth'], ['server', 'replica'], ['4.2', '4.4', '5.0', '6.0', '7.0', '8.0', 'latest']),
3846

39-
# Test 7.0+ with a replica set since Queryable Encryption does not support the 'server' topology. Queryable Encryption tests require 7.0+.
40-
('ubuntu2004', 'gcc', None, 'cyrus', ['auth'], ['server', 'replica'], ['4.4', '5.0', '6.0', '7.0', '8.0', 'latest']),
41-
('rhel8-zseries', 'gcc', None, 'cyrus', ['auth'], ['server', 'replica'], [ '7.0', '8.0', 'latest']),
42-
('ubuntu2004-arm64', 'gcc', None, 'cyrus', ['auth'], ['server', 'replica'], ['4.4', '5.0', '6.0', '7.0', '8.0', 'latest']),
43-
('windows-vsCurrent', 'vs2017x64', None, 'cyrus', ['auth'], ['server', 'replica'], [ '7.0', '8.0', 'latest']),
47+
# ubuntu2004-arm64 provides 4.4+.
48+
('ubuntu2004-arm64', 'gcc', None, 'cyrus', ['auth'], ['server', 'replica'], ['4.4', '5.0', '6.0', '7.0', '8.0', 'latest']),
4449

45-
# Test 4.2 with Debian 10 since 4.2 does not ship on Ubuntu 20.04+.
46-
('debian10', 'gcc', None, 'cyrus', ['auth'], ['server', 'replica'], ['4.2']),
50+
# rhel8-zseries provides 5.0+.
51+
('rhel8-zseries', 'gcc', None, 'cyrus', ['auth'], ['server', 'replica'], ['5.0', '6.0', '7.0', '8.0', 'latest']),
4752
]
4853
# fmt: on
4954
# pylint: enable=line-too-long
@@ -106,6 +111,8 @@ def variants():
106111
else:
107112
tasks.append(task.get_task_ref())
108113

114+
tasks.sort(key=lambda t: t.name)
115+
109116
return [
110117
BuildVariant(
111118
name=TAG,

.evergreen/config_generator/components/earthly.py

Lines changed: 53 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,18 @@
55
from typing import Iterable, Literal, Mapping, NamedTuple, TypeVar
66

77
from shrub.v3.evg_build_variant import BuildVariant
8-
from shrub.v3.evg_command import BuiltInCommand, EvgCommandType, subprocess_exec
8+
from shrub.v3.evg_command import (
9+
BuiltInCommand,
10+
EvgCommandType,
11+
KeyValueParam,
12+
ec2_assume_role,
13+
expansions_update,
14+
subprocess_exec,
15+
)
916
from shrub.v3.evg_task import EvgTask, EvgTaskRef
1017

18+
from config_generator.etc.function import Function
19+
1120
from ..etc.utils import all_possible
1221

1322
T = TypeVar("T")
@@ -38,7 +47,7 @@
3847
"Valid options for the SASL configuration parameter"
3948
TLSOption = Literal["OpenSSL", "off"]
4049
"Options for the TLS backend configuration parameter (AKA 'ENABLE_SSL')"
41-
CxxVersion = Literal["none"] # TODO: Once CXX-3103 is released, add latest C++ release tag.
50+
CxxVersion = Literal["none"] # TODO: Once CXX-3103 is released, add latest C++ release tag.
4251
"C++ driver refs that are under CI test"
4352

4453
# A separator character, since we cannot use whitespace
@@ -136,6 +145,34 @@ def suffix(self) -> str:
136145
return _SEPARATOR.join(f"{k}={v}" for k, v in self._asdict().items())
137146

138147

148+
# Authenticate with DevProd-provided Amazon ECR instance to use as pull-through cache for DockerHub.
149+
class DockerLoginAmazonECR(Function):
150+
name = 'docker-login-amazon-ecr'
151+
commands = [
152+
# Avoid inadvertently using a pre-existing and potentially conflicting Docker config.
153+
expansions_update(updates=[KeyValueParam(key='DOCKER_CONFIG', value='${workdir}/.docker')]),
154+
ec2_assume_role(role_arn="arn:aws:iam::901841024863:role/ecr-role-evergreen-ro"),
155+
subprocess_exec(
156+
binary="bash",
157+
command_type=EvgCommandType.SETUP,
158+
include_expansions_in_env=[
159+
"AWS_ACCESS_KEY_ID",
160+
"AWS_SECRET_ACCESS_KEY",
161+
"AWS_SESSION_TOKEN",
162+
"DOCKER_CONFIG",
163+
],
164+
args=[
165+
"-c",
166+
'aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 901841024863.dkr.ecr.us-east-1.amazonaws.com',
167+
],
168+
),
169+
]
170+
171+
@classmethod
172+
def call(cls, **kwargs):
173+
return cls.default_call(**kwargs)
174+
175+
139176
def task_filter(env: EarthlyVariant, conf: Configuration) -> bool:
140177
"""
141178
Control which tasks are actually defined by matching on the platform and
@@ -170,11 +207,16 @@ def earthly_exec(
170207
return subprocess_exec(
171208
"./tools/earthly.sh",
172209
args=[
210+
# Use Amazon ECR as pull-through cache for DockerHub to avoid rate limits.
211+
"--buildkit-image=901841024863.dkr.ecr.us-east-1.amazonaws.com/dockerhub/earthly/buildkitd:v0.8.3",
173212
*(f"--secret={k}" for k in (secrets or ())),
174213
f"+{target}",
214+
# Use Amazon ECR as pull-through cache for DockerHub to avoid rate limits.
215+
"--default_search_registry=901841024863.dkr.ecr.us-east-1.amazonaws.com/dockerhub",
175216
*(f"--{arg}={val}" for arg, val in (args or {}).items()),
176217
],
177218
command_type=EvgCommandType(kind),
219+
include_expansions_in_env=["DOCKER_CONFIG"],
178220
env=env if env else None,
179221
working_dir="mongoc",
180222
)
@@ -209,15 +251,7 @@ def earthly_task(
209251
return EvgTask(
210252
name=name,
211253
commands=[
212-
# Ensure subsequent Docker commands are authenticated.
213-
subprocess_exec(
214-
binary="bash",
215-
command_type=EvgCommandType.SETUP,
216-
args=[
217-
"-c",
218-
r'docker login -u "${artifactory_username}" --password-stdin artifactory.corp.mongodb.com <<<"${artifactory_password}"',
219-
],
220-
),
254+
DockerLoginAmazonECR.call(),
221255
# First, just build the "env-warmup" which will prepare the build environment.
222256
# This won't generate any output, but allows EVG to track it as a separate build step
223257
# for timing and logging purposes. The subequent build step will cache-hit the
@@ -241,13 +275,18 @@ def earthly_task(
241275

242276

243277
CONTAINER_RUN_DISTROS = [
244-
"ubuntu2204-large",
245-
"debian10-large",
246-
"debian11-large",
247278
"amazon2",
279+
"debian11-large",
280+
"debian12-large",
281+
"ubuntu2204-large",
282+
"ubuntu2404-large",
248283
]
249284

250285

286+
def functions():
287+
return DockerLoginAmazonECR.defn()
288+
289+
251290
def tasks() -> Iterable[EvgTask]:
252291
for conf in all_possible(Configuration):
253292
# test-example is a target in all configurations

.evergreen/config_generator/components/loadbalanced.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
from config_generator.etc.distros import make_distro_str, find_small_distro, find_large_distro
1313
from config_generator.etc.utils import bash_exec
1414

15-
# Use `rhel8.9` distro. `rhel8.9` distro includes necessary dependency: `haproxy`.
16-
_DISTRO_NAME = "rhel8.9"
15+
# Use `rhel8-latest` distro. `rhel8-latest` distro includes necessary dependency: `haproxy`.
16+
_DISTRO_NAME = "rhel8-latest"
1717
_COMPILER = "gcc"
1818

1919

.evergreen/config_generator/components/make_docs.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@ class MakeDocs(Function):
1717
working_dir="mongoc",
1818
include_expansions_in_env=["distro_id"],
1919
script="""\
20-
set -o errexit
21-
./tools/poetry.sh install --with=docs
2220
# See SphinxBuild.cmake for EVG_DOCS_BUILD reasoning
23-
./tools/poetry.sh run env EVG_DOCS_BUILD=1 .evergreen/scripts/build-docs.sh
24-
""",
21+
uv run --frozen --only-group docs env EVG_DOCS_BUILD=1 .evergreen/scripts/build-docs.sh
22+
""",
2523
),
2624
]
2725

.evergreen/config_generator/components/openssl_static_compile.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
# pylint: disable=line-too-long
1818
# fmt: off
1919
MATRIX = [
20-
('debian92', 'gcc', None),
21-
('debian10', 'gcc', None),
2220
('debian11', 'gcc', None),
21+
('debian12', 'gcc', None),
2322
('ubuntu2004', 'gcc', None),
23+
('ubuntu2204', 'gcc', None),
24+
('ubuntu2404', 'gcc', None),
2425
]
2526
# fmt: on
2627
# pylint: enable=line-too-long

.evergreen/config_generator/components/sanitizers/asan_cse.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,13 @@
1010
# pylint: disable=line-too-long
1111
# fmt: off
1212
COMPILE_MATRIX = [
13-
('ubuntu2004', 'clang', None, ['cyrus']),
14-
('debian10', 'clang', None, ['cyrus']),
13+
('rhel8-latest', 'clang', None, ['cyrus']),
1514
]
1615

16+
# CSFLE requires 4.2+. QE requires 7.0+ and are skipped on "server" tasks.
1717
TEST_MATRIX = [
18-
# Test 7.0+ with a replica set since Queryable Encryption does not support the 'server' topology. Queryable Encryption tests require 7.0+.
19-
('ubuntu2004', 'clang', None, 'cyrus', ['auth'], ['server', 'replica'], ['4.4', '5.0', '6.0', '7.0', '8.0', 'latest']),
20-
21-
# Test 4.2 with Debian 10 since 4.2 does not ship on Ubuntu 20.04+.
22-
('debian10', 'clang', None, 'cyrus', ['auth'], ['server'], ['4.2']),
18+
# rhel8-latest provides 4.2 through latest.
19+
('rhel8-latest', 'clang', None, 'cyrus', ['auth'], ['server', 'replica'], ['4.2', '4.4', '5.0', '6.0', '7.0', '8.0', 'latest']),
2320
]
2421
# fmt: on
2522
# pylint: enable=line-too-long

.evergreen/config_generator/components/sanitizers/asan_sasl.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,12 @@
1010
# pylint: disable=line-too-long
1111
# fmt: off
1212
COMPILE_MATRIX = [
13-
('ubuntu2004', 'clang', None, ['cyrus']),
14-
('debian10', 'clang', None, ['cyrus']),
13+
('rhel8-latest', 'clang', None, ['cyrus']),
1514
]
1615

1716
TEST_MATRIX = [
18-
('ubuntu2004', 'clang', None, 'cyrus', ['auth'], ['server', 'replica', 'sharded'], ['4.4', '5.0', '6.0', '7.0', '8.0', 'latest']),
19-
20-
# Test 4.2 with Debian 10 since 4.2 does not ship on Ubuntu 20.04+.
21-
('debian10', 'clang', None, 'cyrus', ['auth'], ['server', 'replica', 'sharded'], ['4.2']),
17+
# rhel8-latest provides 4.2 through latest.
18+
('rhel8-latest', 'clang', None, 'cyrus', ['auth'], ['server', 'replica', 'sharded'], ['4.2', '4.4', '5.0', '6.0', '7.0', '8.0', 'latest']),
2219
]
2320
# fmt: on
2421
# pylint: enable=line-too-long

0 commit comments

Comments
 (0)