Use the stage names as inputs
This commit is contained in:
parent
2680dcb66f
commit
ede25b6736
@ -10,14 +10,14 @@
|
|||||||
{
|
{
|
||||||
sshHost
|
sshHost
|
||||||
, prefix
|
, prefix
|
||||||
, experiment
|
, experimentStage
|
||||||
|
, trebuchetStage
|
||||||
, garlicTemp
|
, garlicTemp
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with garlicTools;
|
with garlicTools;
|
||||||
|
|
||||||
let
|
let
|
||||||
experimentStage = getExperimentStage experiment;
|
|
||||||
experimentName = baseNameOf (toString experimentStage);
|
experimentName = baseNameOf (toString experimentStage);
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
@ -33,11 +33,15 @@ in
|
|||||||
mkdir -p ${garlicTemp}
|
mkdir -p ${garlicTemp}
|
||||||
export PATH=${rsync}/bin:${openssh}/bin:${nix}/bin
|
export PATH=${rsync}/bin:${openssh}/bin:${nix}/bin
|
||||||
rsync -av \
|
rsync -av \
|
||||||
|
--copy-links \
|
||||||
--include='*/*/*.log' --include='*/*/*.json' --exclude='*/*/*' \
|
--include='*/*/*.log' --include='*/*/*.json' --exclude='*/*/*' \
|
||||||
'${sshHost}:${prefix}/${experimentName}' ${garlicTemp}
|
'${sshHost}:${prefix}/${experimentName}' ${garlicTemp}
|
||||||
|
|
||||||
res=\$(nix-build -E '(with import ./default.nix; garlic.getExpResult \
|
res=\$(nix-build -E '(with import ./default.nix; garlic.getExpResult { \
|
||||||
{experiment = "${experiment}"; garlicTemp = "${garlicTemp}"; })')
|
experimentStage = "${experimentStage}"; \
|
||||||
|
trebuchetStage = "${trebuchetStage}"; \
|
||||||
|
garlicTemp = "${garlicTemp}"; \
|
||||||
|
})')
|
||||||
|
|
||||||
echo "The results for experiment ${experimentName} are at:"
|
echo "The results for experiment ${experimentName} are at:"
|
||||||
echo " \$res"
|
echo " \$res"
|
||||||
|
@ -5,20 +5,20 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
experiment
|
trebuchetStage
|
||||||
|
, experimentStage
|
||||||
, garlicTemp
|
, garlicTemp
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with garlicTools;
|
with garlicTools;
|
||||||
|
|
||||||
let
|
let
|
||||||
experimentStage = getExperimentStage experiment;
|
|
||||||
experimentName = baseNameOf (toString experimentStage);
|
experimentName = baseNameOf (toString experimentStage);
|
||||||
fetcher = fetchExperiment {
|
fetcher = fetchExperiment {
|
||||||
sshHost = "mn1";
|
sshHost = "mn1";
|
||||||
prefix = "/gpfs/projects/\\\$(id -gn)/\\\$(id -un)/garlic-out";
|
prefix = "/gpfs/projects/\\\$(id -gn)/\\\$(id -un)/garlic-out";
|
||||||
garlicTemp = "/tmp/garlic-temp";
|
garlicTemp = "/tmp/garlic-temp";
|
||||||
inherit experiment;
|
inherit experimentStage trebuchetStage;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
@ -33,7 +33,7 @@ in
|
|||||||
if [ ! -e $expPath ]; then
|
if [ ! -e $expPath ]; then
|
||||||
echo "The experiment ${experimentName} is missing in ${garlicTemp}."
|
echo "The experiment ${experimentName} is missing in ${garlicTemp}."
|
||||||
echo "Please fetch it and try again."
|
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."
|
echo "And then ${fetcher} to get the results."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user