diff options
author | Daniel Moody <daniel.moody@mongodb.com> | 2022-08-12 20:12:46 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-08-12 20:42:58 +0000 |
commit | 3af863123ffe506578c483fff51a0871f485b987 (patch) | |
tree | aa57daea5bd253746fcee2434b05526d32fa747e /buildscripts/scons_metrics/report.py | |
parent | a0438659bfd3940d12e4a3639294573a555bbead (diff) | |
download | mongo-3af863123ffe506578c483fff51a0871f485b987.tar.gz |
SERVER-68637 disable cache metrics for static hosts
Diffstat (limited to 'buildscripts/scons_metrics/report.py')
-rw-r--r-- | buildscripts/scons_metrics/report.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/buildscripts/scons_metrics/report.py b/buildscripts/scons_metrics/report.py index 61b60ccc186..cae5e5ef1d0 100644 --- a/buildscripts/scons_metrics/report.py +++ b/buildscripts/scons_metrics/report.py @@ -27,14 +27,25 @@ def main(scons_stdout_log_file: str, scons_cache_debug_log_file: str, scons_cache_debug_log_file = os.path.abspath(scons_cache_debug_log_file) cedar_report_file = os.path.abspath(cedar_report_file) + # This is a special file which must be available to use scons cache in evergreen. Here + # we are assuming that if this file is not present then this a static host which + # can not use scons cache in evergreen so therefore we will disable colleting cache metrics. + # Otherwise we assume the cache is available and if the cache log file is not found, + # something is not right and we exit with failure. + if not os.path.exists('/etc/mongodb-build-system-id'): + print( + "System is a static host and not connected to AWS cache dir. Skipping scons cache metrics." + ) + scons_cache_debug_log_file = None + else: + if not os.path.exists(scons_cache_debug_log_file): + print(f"Could not find SCons cache debug log file '{scons_cache_debug_log_file}'.") + sys.exit(1) + if not os.path.exists(scons_stdout_log_file): print(f"Could not find SCons stdout log file '{scons_stdout_log_file}'.") sys.exit(1) - if not os.path.exists(scons_cache_debug_log_file): - print(f"Could not find SCons cache debug log file '{scons_cache_debug_log_file}'.") - sys.exit(1) - scons_metrics = SconsMetrics(scons_stdout_log_file, scons_cache_debug_log_file) if not scons_metrics.raw_report: print( |