From ede25b67368ebeb1cc6efa8b94e4b3f086313e06 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Fri, 16 Oct 2020 15:53:28 +0200 Subject: [PATCH] Use the stage names as inputs --- garlic/postprocess/fetch.nix | 12 ++++++++---- garlic/postprocess/result.nix | 8 ++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/garlic/postprocess/fetch.nix b/garlic/postprocess/fetch.nix index 32460f8..752021d 100644 --- a/garlic/postprocess/fetch.nix +++ b/garlic/postprocess/fetch.nix @@ -10,14 +10,14 @@ { sshHost , prefix -, experiment +, experimentStage +, trebuchetStage , garlicTemp }: with garlicTools; let - experimentStage = getExperimentStage experiment; experimentName = baseNameOf (toString experimentStage); in stdenv.mkDerivation { @@ -33,11 +33,15 @@ in mkdir -p ${garlicTemp} export PATH=${rsync}/bin:${openssh}/bin:${nix}/bin rsync -av \ + --copy-links \ --include='*/*/*.log' --include='*/*/*.json' --exclude='*/*/*' \ '${sshHost}:${prefix}/${experimentName}' ${garlicTemp} - res=\$(nix-build -E '(with import ./default.nix; garlic.getExpResult \ - {experiment = "${experiment}"; garlicTemp = "${garlicTemp}"; })') + res=\$(nix-build -E '(with import ./default.nix; garlic.getExpResult { \ + experimentStage = "${experimentStage}"; \ + trebuchetStage = "${trebuchetStage}"; \ + garlicTemp = "${garlicTemp}"; \ + })') echo "The results for experiment ${experimentName} are at:" echo " \$res" diff --git a/garlic/postprocess/result.nix b/garlic/postprocess/result.nix index 272884e..e6beeb4 100644 --- a/garlic/postprocess/result.nix +++ b/garlic/postprocess/result.nix @@ -5,20 +5,20 @@ }: { - experiment + trebuchetStage +, experimentStage , garlicTemp }: with garlicTools; let - experimentStage = getExperimentStage experiment; experimentName = baseNameOf (toString experimentStage); fetcher = fetchExperiment { sshHost = "mn1"; prefix = "/gpfs/projects/\\\$(id -gn)/\\\$(id -un)/garlic-out"; garlicTemp = "/tmp/garlic-temp"; - inherit experiment; + inherit experimentStage trebuchetStage; }; in stdenv.mkDerivation { @@ -33,7 +33,7 @@ in if [ ! -e $expPath ]; then echo "The experiment ${experimentName} is missing in ${garlicTemp}." echo "Please fetch it and try again." - echo "You can execute ${experiment} to run the experiment." + echo "You can execute ${trebuchetStage} to run the experiment." echo "And then ${fetcher} to get the results." exit 1 fi