WIP: postprocessing pipeline

Now each run is executed in a independent folder
This commit is contained in:
2020-10-21 18:18:43 +02:00
parent 1321b6a888
commit 4beb069627
20 changed files with 232 additions and 279 deletions

43
garlic/pp/result.nix Normal file
View File

@@ -0,0 +1,43 @@
{
stdenv
, garlicTools
, fetchExperiment
}:
{
trebuchetStage
, experimentStage
, garlicTemp
}:
with garlicTools;
let
experimentName = baseNameOf (toString experimentStage);
fetcher = fetchExperiment {
sshHost = "mn1";
prefix = "/gpfs/projects/\\\$(id -gn)/\\\$(id -un)/garlic-out";
garlicTemp = "/tmp/garlic-temp";
inherit experimentStage trebuchetStage;
};
in
stdenv.mkDerivation {
name = "result";
preferLocalBuild = true;
__noChroot = true;
phases = [ "installPhase" ];
installPhase = ''
expPath=${garlicTemp}/${experimentName}
if [ ! -e $expPath ]; then
echo "The experiment ${experimentName} is missing in ${garlicTemp}."
echo "Please fetch it and try again."
echo "You can execute ${trebuchetStage} to run the experiment."
echo "And then ${fetcher} to get the results."
exit 1
fi
mkdir -p $out
cp -a ${garlicTemp}/${experimentName} $out
'';
}