Debian Codegraph @

.evergreen/config_generator/components/sasl/openssl.py

raw
1 from shrub.v3.evg_build_variant import BuildVariant
2
3 from config_generator.etc.compile import generate_compile_tasks
4 from config_generator.etc.function import merge_defns
5 from config_generator.etc.sasl.compile import CompileCommon
6 from config_generator.etc.sasl.test import generate_test_tasks
7 from config_generator.etc.utils import TaskRef
8
9 SSL = 'openssl'
10 TAG = f'sasl-matrix-{SSL}'
11
12
13 # pylint: disable=line-too-long
14 # fmt: off
15 COMPILE_MATRIX = [
16 # For test matrix.
17 ('amazon2023-arm64-latest-large-m8g', 'gcc', None, ['cyrus']),
18 ('rhel8-latest', 'gcc', None, ['cyrus']),
19 ('rhel8-arm64-latest', 'gcc', None, ['cyrus']),
20 ('rhel8-power', 'gcc', None, ['cyrus']),
21 ('rhel8-zseries', 'gcc', None, ['cyrus']),
22 ('windows-2022-latest', 'vs2022x64', None, ['sspi' ]),
23
24 # For compile only.
25 ('debian11-latest', 'gcc', None, ['cyrus']),
26 ('debian12-latest', 'gcc', None, ['cyrus']),
27 ('rhel80', 'gcc', None, ['cyrus']),
28 ('ubuntu2204', 'gcc', None, ['cyrus']),
29 ('ubuntu2204', 'clang-12', None, ['cyrus']),
30 ('ubuntu2404', 'gcc', None, ['cyrus']),
31 ('ubuntu2404', 'clang-14', None, ['cyrus']),
32 ('windows-vsCurrent', 'vs2017x64', None, ['sspi' ]),
33 ('windows-vsCurrent', 'vs2019x64', None, ['sspi' ]),
34 ('windows-vsCurrent', 'vs2022x64', None, ['sspi' ]),
35 ]
36
37 TEST_MATRIX = [
38 ('rhel8-latest', 'gcc', None, 'cyrus', ['auth'], ['server'], ['4.2', '4.4', '5.0', '6.0', '7.0', '8.0', 'rapid', 'latest']),
39 ('rhel8-arm64-latest', 'gcc', None, 'cyrus', ['auth'], ['server'], [ '4.4', '5.0', '6.0', '7.0', '8.0', 'rapid', 'latest']),
40 ('rhel8-power', 'gcc', None, 'cyrus', ['auth'], ['server'], ['4.2', '4.4', '5.0', '6.0', '7.0', '8.0', 'rapid', 'latest']),
41 ('rhel8-zseries', 'gcc', None, 'cyrus', ['auth'], ['server'], [ '5.0', '6.0', '7.0', '8.0', 'rapid', 'latest']),
42
43 ('windows-2022-latest', 'vs2022x64', None, 'sspi', ['auth'], ['server'], ['rapid', 'latest']),
44
45 # Test with Graviton processor:
46 ('amazon2023-arm64-latest-large-m8g', 'gcc', None, 'cyrus', ['auth'], ['server', 'replica', 'sharded'], ['latest']),
47 ]
48 # fmt: on
49 # pylint: enable=line-too-long
50
51
52 class OpenSSLCompileCommon(CompileCommon):
53 ssl = 'OPENSSL'
54
55
56 class SaslCyrusOpenSSLCompile(OpenSSLCompileCommon):
57 name = 'sasl-cyrus-openssl-compile'
58 commands = OpenSSLCompileCommon.compile_commands(sasl='CYRUS')
59
60
61 class SaslSspiOpenSSLCompile(OpenSSLCompileCommon):
62 name = 'sasl-sspi-openssl-compile'
63 commands = OpenSSLCompileCommon.compile_commands(sasl='SSPI')
64
65
66 def functions():
67 return merge_defns(
68 SaslCyrusOpenSSLCompile.defn(),
69 SaslSspiOpenSSLCompile.defn(),
70 )
71
72
73 SASL_TO_FUNC = {
74 'cyrus': SaslCyrusOpenSSLCompile,
75 'sspi': SaslSspiOpenSSLCompile,
76 }
77
78 TASKS = [
79 *generate_compile_tasks(SSL, TAG, SASL_TO_FUNC, COMPILE_MATRIX),
80 *generate_test_tasks(SSL, TAG, TEST_MATRIX),
81 ]
82
83
84 def tasks():
85 res = TASKS.copy()
86
87 # PowerPC and zSeries are limited resources.
88 for task in res:
89 if any(pattern in task.run_on for pattern in ['power', 'zseries']):
90 task.patchable = False
91
92 return res
93
94
95 def variants():
96 expansions = {}
97
98 tasks = []
99
100 # PowerPC and zSeries are limited resources.
101 for task in TASKS:
102 if any(pattern in task.run_on for pattern in ['power', 'zseries']):
103 tasks.append(
104 TaskRef(
105 name=task.name,
106 batchtime=1440, # 1 day
107 )
108 )
109 else:
110 tasks.append(task.get_task_ref())
111
112 tasks.sort(key=lambda t: t.name)
113
114 return [
115 BuildVariant(
116 name=TAG,
117 display_name=TAG,
118 tasks=tasks,
119 expansions=expansions,
120 ),
121 ]