Files
mongo/buildscripts/evergreen_task_timeout.py

76 lines
2.4 KiB
Python
Raw Normal View History

2019-04-10 11:42:47 -04:00
#!/usr/bin/env python3
"""Determine the timeout value a task should use in evergreen."""
import argparse
import sys
import yaml
COMMIT_QUEUE_ALIAS = "__commit_queue"
COMMIT_QUEUE_TIMEOUT_SECS = 40 * 60
DEFAULT_REQUIRED_BUILD_TIMEOUT_SECS = 30 * 60
DEFAULT_NON_REQUIRED_BUILD_TIMEOUT_SECS = 2 * 60 * 60
SPECIFIC_TASK_OVERRIDES = {
"linux-64-debug": {"auth": 60 * 60, },
}
REQUIRED_BUILD_VARIANTS = {
"linux-64-debug", "enterprise-windows-64-2k8", "enterprise-rhel-62-64-bit",
"enterprise-ubuntu1604-clang-3.8-libcxx", "enterprise-rhel-62-64-bit-required-inmem",
SERVER-44549 Remove the mobile storage engine mode change 100644 => 100755 buildscripts/evergreen_task_timeout.py delete mode 100644 buildscripts/resmokeconfig/suites/disk_mobile.yml delete mode 100644 src/mongo/db/storage/mobile/SConscript delete mode 100644 src/mongo/db/storage/mobile/mobile_index.cpp delete mode 100644 src/mongo/db/storage/mobile/mobile_index.h delete mode 100644 src/mongo/db/storage/mobile/mobile_index_test.cpp delete mode 100644 src/mongo/db/storage/mobile/mobile_init.cpp delete mode 100644 src/mongo/db/storage/mobile/mobile_kv_engine.cpp delete mode 100644 src/mongo/db/storage/mobile/mobile_kv_engine.h delete mode 100644 src/mongo/db/storage/mobile/mobile_kv_engine_test.cpp delete mode 100644 src/mongo/db/storage/mobile/mobile_options.cpp delete mode 100644 src/mongo/db/storage/mobile/mobile_options.h delete mode 100644 src/mongo/db/storage/mobile/mobile_options.idl delete mode 100644 src/mongo/db/storage/mobile/mobile_options_mongod.cpp delete mode 100644 src/mongo/db/storage/mobile/mobile_record_store.cpp delete mode 100644 src/mongo/db/storage/mobile/mobile_record_store.h delete mode 100644 src/mongo/db/storage/mobile/mobile_record_store_test.cpp delete mode 100644 src/mongo/db/storage/mobile/mobile_recovery_unit.cpp delete mode 100644 src/mongo/db/storage/mobile/mobile_recovery_unit.h delete mode 100644 src/mongo/db/storage/mobile/mobile_session.cpp delete mode 100644 src/mongo/db/storage/mobile/mobile_session.h delete mode 100644 src/mongo/db/storage/mobile/mobile_session_pool.cpp delete mode 100644 src/mongo/db/storage/mobile/mobile_session_pool.h delete mode 100644 src/mongo/db/storage/mobile/mobile_sqlite_statement.cpp delete mode 100644 src/mongo/db/storage/mobile/mobile_sqlite_statement.h delete mode 100644 src/mongo/db/storage/mobile/mobile_util.cpp delete mode 100644 src/mongo/db/storage/mobile/mobile_util.h delete mode 100755 src/third_party/scripts/sqlite_get_sources.sh delete mode 100644 src/third_party/shim_sqlite.cpp delete mode 100644 src/third_party/sqlite-amalgamation-3260000/SConscript delete mode 100644 src/third_party/sqlite-amalgamation-3260000/patches/gethostuuid.patch delete mode 100644 src/third_party/sqlite-amalgamation-3260000/sqlite/shell.c delete mode 100644 src/third_party/sqlite-amalgamation-3260000/sqlite/sqlite3.c delete mode 100644 src/third_party/sqlite-amalgamation-3260000/sqlite/sqlite3.h delete mode 100644 src/third_party/sqlite-amalgamation-3260000/sqlite/sqlite3ext.h
2020-02-02 11:05:31 -05:00
"ubuntu1604-debug-aubsan-lite"
}
def determine_timeout(task_name: str, variant: str, timeout: int = 0, evg_alias: str = '') -> int:
"""Determine what timeout should be used."""
if timeout and timeout != 0:
return timeout
if evg_alias == COMMIT_QUEUE_ALIAS:
return COMMIT_QUEUE_TIMEOUT_SECS
if variant in SPECIFIC_TASK_OVERRIDES and task_name in SPECIFIC_TASK_OVERRIDES[variant]:
return SPECIFIC_TASK_OVERRIDES[variant][task_name]
if variant in REQUIRED_BUILD_VARIANTS:
return DEFAULT_REQUIRED_BUILD_TIMEOUT_SECS
return DEFAULT_NON_REQUIRED_BUILD_TIMEOUT_SECS
def output_timeout(timeout, options):
"""Output timeout configuration to the specified location."""
output = {
"timeout_secs": timeout,
}
if options.outfile:
with open(options.outfile, "w") as outfile:
yaml.dump(output, stream=outfile, default_flow_style=False)
yaml.dump(output, stream=sys.stdout, default_flow_style=False)
def main():
"""Determine the timeout value a task should use in evergreen."""
parser = argparse.ArgumentParser(description=main.__doc__)
parser.add_argument("--task-name", dest="task", required=True, help="Task being executed.")
parser.add_argument("--build-variant", dest="variant", required=True,
help="Build variant task is being executed on.")
parser.add_argument("--evg-alias", dest="evg_alias", required=True,
help="Evergreen alias used to trigger build.")
parser.add_argument("--timeout", dest="timeout", type=int, help="Timeout to use.")
parser.add_argument("--out-file", dest="outfile", help="File to write configuration to.")
options = parser.parse_args()
timeout = determine_timeout(options.task, options.variant, options.timeout)
output_timeout(timeout, options)
if __name__ == "__main__":
main()