2020-10-21 18:18:43 +02:00
|
|
|
{
|
|
|
|
stdenv
|
|
|
|
, jq
|
|
|
|
}:
|
|
|
|
|
|
|
|
inputResult:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "timetable.json";
|
|
|
|
preferLocalBuild = true;
|
|
|
|
phases = [ "installPhase" ];
|
|
|
|
buildInputs = [ jq ];
|
|
|
|
installPhase = ''
|
|
|
|
touch $out
|
|
|
|
cd ${inputResult}
|
|
|
|
for exp in *-experiment; do
|
|
|
|
cd ${inputResult}/$exp
|
|
|
|
for unit in *-unit; do
|
|
|
|
cd ${inputResult}/$exp/$unit
|
|
|
|
conf=garlic_config.json
|
|
|
|
for run in $(ls -d [0-9]* | sort -n); do
|
|
|
|
time=$(awk '/^time /{print $2}' $run/stdout.log)
|
2020-10-23 10:19:37 +02:00
|
|
|
jq -cn "{ exp:\"$exp\", unit:\"$unit\", config:inputs, time:$time, run:$run }" $conf >> $out
|
2020-10-21 18:18:43 +02:00
|
|
|
done
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
#gzip $out
|
|
|
|
'';
|
|
|
|
}
|