From 20dd40d50c75d7877218ef5816646f44e9ef4333 Mon Sep 17 00:00:00 2001 From: Quentin De Coninck Date: Fri, 5 Mar 2021 10:36:24 +0100 Subject: [PATCH] record git commit when running --- runner.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runner.py b/runner.py index 062ad5d..f20a9a9 100644 --- a/runner.py +++ b/runner.py @@ -10,8 +10,11 @@ from experiments import EXPERIMENTS from topos import TOPO_CONFIGS, TOPOS import logging +import subprocess import traceback +def get_git_revision_short_hash(): + return subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).decode("unicode_escape").strip() class Runner(object): """ @@ -22,6 +25,7 @@ class Runner(object): All the operations are done when calling the constructor. """ def __init__(self, builder_type, topo_parameter_file, experiment_parameter_file): + logging.info("Minitopo version {}".format(get_git_revision_short_hash())) self.topo_parameter = TopoParameter(topo_parameter_file) self.set_builder(builder_type) self.apply_topo()