|
| 1 | +from config_generator.components.funcs.install_c_driver import InstallCDriver |
| 2 | + |
| 3 | +from config_generator.etc.distros import find_large_distro |
| 4 | +from config_generator.etc.function import Function, merge_defns |
| 5 | +from config_generator.etc.utils import TaskGroup, bash_exec |
| 6 | + |
| 7 | +from shrub.v3.evg_command import EvgCommandType, git_get_project, s3_put |
| 8 | +from shrub.v3.evg_task import EvgTask, EvgTaskRef |
| 9 | +from shrub.v3.evg_build_variant import BuildVariant, DisplayTask |
| 10 | + |
| 11 | + |
| 12 | +TAG = 'abi-stability' |
| 13 | + |
| 14 | + |
| 15 | +# pylint: disable=line-too-long |
| 16 | +# fmt: off |
| 17 | +MATRIX = [ |
| 18 | + ('polyfill', 11), |
| 19 | + ('stdlib', 17), |
| 20 | +] |
| 21 | +# fmt: on |
| 22 | +# pylint: enable=line-too-long |
| 23 | + |
| 24 | + |
| 25 | +class AbiComplianceCheck(Function): |
| 26 | + name = 'abi-compliance-check' |
| 27 | + commands = [ |
| 28 | + bash_exec( |
| 29 | + command_type=EvgCommandType.SETUP, |
| 30 | + script='mongo-cxx-driver/.evergreen/scripts/abi-compliance-check-setup.sh' |
| 31 | + ), |
| 32 | + bash_exec( |
| 33 | + command_type=EvgCommandType.TEST, |
| 34 | + script='mongo-cxx-driver/.evergreen/scripts/abi-compliance-check-test.sh' |
| 35 | + ), |
| 36 | + s3_put( |
| 37 | + command_type=EvgCommandType.SYSTEM, |
| 38 | + aws_key='${aws_key}', |
| 39 | + aws_secret='${aws_secret}', |
| 40 | + bucket='mciuploads', |
| 41 | + content_type='text/html', |
| 42 | + display_name='ABI Compliance Check (Stable): ', |
| 43 | + local_files_include_filter='cxx-abi/compat_reports/**/compat_report.html', |
| 44 | + permissions='public-read', |
| 45 | + remote_file='mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abi-compliance-check/abi/', |
| 46 | + ), |
| 47 | + s3_put( |
| 48 | + command_type=EvgCommandType.SYSTEM, |
| 49 | + aws_key='${aws_key}', |
| 50 | + aws_secret='${aws_secret}', |
| 51 | + bucket='mciuploads', |
| 52 | + content_type='text/plain', |
| 53 | + display_name='ABI Compliance Check (Stable): ', |
| 54 | + local_files_include_filter='cxx-abi/logs/**/log.txt', |
| 55 | + permissions='public-read', |
| 56 | + remote_file='mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abi-compliance-check/abi/', |
| 57 | + ), |
| 58 | + s3_put( |
| 59 | + command_type=EvgCommandType.SYSTEM, |
| 60 | + aws_key='${aws_key}', |
| 61 | + aws_secret='${aws_secret}', |
| 62 | + bucket='mciuploads', |
| 63 | + content_type='text/html', |
| 64 | + display_name='ABI Compliance Check (Unstable): ', |
| 65 | + local_files_include_filter='cxx-noabi/compat_reports/**/compat_report.html', |
| 66 | + permissions='public-read', |
| 67 | + remote_file='mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abi-compliance-check/noabi/', |
| 68 | + ), |
| 69 | + s3_put( |
| 70 | + command_type=EvgCommandType.SYSTEM, |
| 71 | + aws_key='${aws_key}', |
| 72 | + aws_secret='${aws_secret}', |
| 73 | + bucket='mciuploads', |
| 74 | + content_type='text/plain', |
| 75 | + display_name='ABI Compliance Check (Unstable): ', |
| 76 | + local_files_include_filter='cxx-noabi/logs/**/log.txt', |
| 77 | + permissions='public-read', |
| 78 | + remote_file='mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abi-compliance-check/noabi/', |
| 79 | + ), |
| 80 | + ] |
| 81 | + |
| 82 | + |
| 83 | +class Abidiff(Function): |
| 84 | + name = 'abidiff' |
| 85 | + commands = [ |
| 86 | + bash_exec( |
| 87 | + command_type=EvgCommandType.SETUP, |
| 88 | + script='mongo-cxx-driver/.evergreen/scripts/abidiff-setup.sh' |
| 89 | + ), |
| 90 | + bash_exec( |
| 91 | + command_type=EvgCommandType.TEST, |
| 92 | + script='mongo-cxx-driver/.evergreen/scripts/abidiff-test.sh' |
| 93 | + ), |
| 94 | + s3_put( |
| 95 | + command_type=EvgCommandType.SYSTEM, |
| 96 | + aws_key='${aws_key}', |
| 97 | + aws_secret='${aws_secret}', |
| 98 | + bucket='mciuploads', |
| 99 | + content_type='text/plain', |
| 100 | + display_name='abidiff (Stable): ', |
| 101 | + local_files_include_filter='cxx-abi/*.txt', |
| 102 | + permissions='public-read', |
| 103 | + remote_file='mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abidiff/abi/', |
| 104 | + ), |
| 105 | + s3_put( |
| 106 | + command_type=EvgCommandType.SYSTEM, |
| 107 | + aws_key='${aws_key}', |
| 108 | + aws_secret='${aws_secret}', |
| 109 | + bucket='mciuploads', |
| 110 | + content_type='text/plain', |
| 111 | + display_name='abidiff (Unstable): ', |
| 112 | + local_files_include_filter='cxx-noabi/*.txt', |
| 113 | + permissions='public-read', |
| 114 | + remote_file='mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abidiff/noabi/', |
| 115 | + ), |
| 116 | + ] |
| 117 | + |
| 118 | + |
| 119 | +class AbiProhibitedSymbols(Function): |
| 120 | + name = 'abi-prohibited-symbols' |
| 121 | + commands = bash_exec( |
| 122 | + command_type=EvgCommandType.TEST, |
| 123 | + script='mongo-cxx-driver/.evergreen/scripts/abi-prohibited-symbols-test.sh' |
| 124 | + ) |
| 125 | + |
| 126 | + |
| 127 | +def functions(): |
| 128 | + return merge_defns( |
| 129 | + AbiComplianceCheck.defn(), |
| 130 | + Abidiff.defn(), |
| 131 | + AbiProhibitedSymbols.defn(), |
| 132 | + ) |
| 133 | + |
| 134 | + |
| 135 | +def tasks(): |
| 136 | + distro_name = 'ubuntu2204' |
| 137 | + distro = find_large_distro(distro_name) |
| 138 | + |
| 139 | + return [ |
| 140 | + EvgTask( |
| 141 | + name=func.name, |
| 142 | + tags=[TAG, func.name, distro_name], |
| 143 | + run_on=distro.name, |
| 144 | + commands=[func.call()], |
| 145 | + ) |
| 146 | + for func in [AbiComplianceCheck, Abidiff, AbiProhibitedSymbols] |
| 147 | + ] |
| 148 | + |
| 149 | + |
| 150 | +def task_groups(): |
| 151 | + return [ |
| 152 | + TaskGroup( |
| 153 | + name=f'tg-{TAG}', |
| 154 | + max_hosts=-1, |
| 155 | + setup_group_can_fail_task=True, |
| 156 | + setup_task=[ |
| 157 | + git_get_project(directory='mongo-cxx-driver'), |
| 158 | + InstallCDriver.call(), |
| 159 | + bash_exec( |
| 160 | + include_expansions_in_env=['cxx_standard'], |
| 161 | + script='mongo-cxx-driver/.evergreen/scripts/abi-stability-setup.sh' |
| 162 | + ), |
| 163 | + ], |
| 164 | + tasks=[f'.{TAG}'], |
| 165 | + teardown_task_can_fail_task=True, |
| 166 | + teardown_task=[bash_exec(script='rm -rf *'),], |
| 167 | + ) |
| 168 | + ] |
| 169 | + |
| 170 | + |
| 171 | +def variants(): |
| 172 | + return [ |
| 173 | + BuildVariant( |
| 174 | + name=f'abi-stability-{name}', |
| 175 | + display_name=f'ABI Stability Checks ({name})', |
| 176 | + expansions={ |
| 177 | + 'cxx_standard': f'{cxx_standard}', # Use a polyfill library. |
| 178 | + }, |
| 179 | + tasks=[EvgTaskRef(name='tg-abi-stability')], |
| 180 | + display_tasks=[ |
| 181 | + DisplayTask( |
| 182 | + name=f'ABI Stability Checks ({name})', |
| 183 | + execution_tasks=[f'.{TAG}'], |
| 184 | + ) |
| 185 | + ], |
| 186 | + ) |
| 187 | + for name, cxx_standard in MATRIX |
| 188 | + ] |
0 commit comments