pp: Add automatic launcher

This commit is contained in:
Rodrigo Arias 2021-02-03 12:36:59 +01:00
parent 32d8636ae1
commit b453c12253
2 changed files with 36 additions and 0 deletions

View File

@ -118,6 +118,10 @@
# Takes a list of experiments and returns a file that contains
# all timetable results from the experiments.
merge = exps: mergeDatasets (map timetableFromTrebuchet exps);
# Automatic launcher
launcher = callPackage ./pp/launcher.nix { };
resultFromLauncher = l: import (builtins.readFile l);
};
# Apps for Garlic

32
garlic/pp/launcher.nix Normal file
View File

@ -0,0 +1,32 @@
{
stdenv
}:
trebuchet:
stdenv.mkDerivation {
name = "launcher";
preferLocalBuild = true;
phases = [ "installPhase" ];
installPhase = ''
if [ ! -e /garlic/run ]; then
echo "Missing /garlic/run, cannot continue"
echo "Are you running the garlicd daemon?"
echo
echo "You can manually run the experiment and fetch the results with:"
echo
echo -e "\e[30;48;5;2mgarlic -RFv ${trebuchetStage}\e[0m"
echo
echo "See garlic(1) for more details."
exit 1
fi
echo ${trebuchet} >> /garlic/run
echo "Waiting for experiment results..."
results=$(cat /garlic/completed)
#ln -s $results $out
echo -n "$results" > $out
'';
}