in esrally/rally.py [0:0]
def main():
check_python_version()
log.install_default_log_config()
log.configure_logging()
logger = logging.getLogger(__name__)
start = time.time()
# Early init of console output so we start to show everything consistently.
console.init(quiet=False)
arg_parser = create_arg_parser()
args = arg_parser.parse_args()
if args.subcommand is None:
arg_parser.print_help()
sys.exit(0)
console.init(quiet=args.quiet)
console.println(BANNER)
cfg = config.Config(config_name=args.configuration_name)
if not cfg.config_present():
cfg.install_default_config()
cfg.load_config(auto_upgrade=True)
cfg.add(config.Scope.application, "system", "time.start", datetime.datetime.utcnow())
# Local config per node
cfg.add(config.Scope.application, "node", "rally.root", paths.rally_root())
cfg.add(config.Scope.application, "node", "rally.cwd", os.getcwd())
logger.info("OS [%s]", str(platform.uname()))
logger.info("Python [%s]", str(sys.implementation))
logger.info("Rally version [%s]", version.version())
logger.debug("Command line arguments: %s", args)
# Configure networking
net.init()
def _trap_exc(function, path, exc_info):
if isinstance(exc_info, FileNotFoundError):
# couldn't delete because it was already clean
return
logging.exception("Failed to clean up [%s] with [%s]", path, function, exc_info=True)
raise exceptions.SystemSetupError(f"Unable to clean [{paths.libs()}]. See Rally log for more information.")
def _trap(function, path, exc_info):
if exc_info[0] == FileNotFoundError:
# couldn't delete because it was already clean
return
logging.exception("Failed to clean up [%s] with [%s]", path, function, exc_info=True)
raise exceptions.SystemSetupError(f"Unable to clean [{paths.libs()}]. See Rally log for more information.")
# fully destructive is fine, we only allow one Rally to run at a time and we will rely on the pip cache for download caching
logger.info("Cleaning track dependency directory [%s]...", paths.libs())
if sys.version_info.major == 3 and sys.version_info.minor <= 11:
shutil.rmtree(paths.libs(), onerror=_trap) # pylint: disable=deprecated-argument, disable=useless-suppression
else:
shutil.rmtree(paths.libs(), onexc=_trap_exc) # pylint: disable=unexpected-keyword-arg, disable=useless-suppression
result = dispatch_sub_command(arg_parser, args, cfg)
end = time.time()
if result == ExitStatus.SUCCESSFUL:
console.println("")
console.info("SUCCESS (took %d seconds)" % (end - start), overline="-", underline="-")
elif result == ExitStatus.INTERRUPTED:
console.println("")
console.info("ABORTED (took %d seconds)" % (end - start), overline="-", underline="-")
sys.exit(130)
elif result == ExitStatus.ERROR:
console.println("")
console.info("FAILURE (took %d seconds)" % (end - start), overline="-", underline="-")
sys.exit(64)