stdexp: add result and timetable targets

These targets allow one experiment to directly refer to another
experiment results, thus a dependency chain can be formed to ensure
execution order.

It also simplifies the dataset definition, as they can be automatically
fetched from the experiment directly.
This commit is contained in:
Rodrigo Arias 2021-02-03 12:37:54 +01:00
parent b453c12253
commit e89139284a
2 changed files with 15 additions and 8 deletions

View File

@ -69,7 +69,7 @@
# Load some helper functions to generate app variants # Load some helper functions to generate app variants
stdexp = callPackage ./stdexp.nix { stdexp = callPackage ./stdexp.nix {
inherit (bsc.garlic) targetMachine stages; inherit (bsc.garlic) targetMachine stages pp;
}; };
# Execution stages # Execution stages

View File

@ -8,6 +8,7 @@
, writeTextFile , writeTextFile
, runCommandLocal , runCommandLocal
, python , python
, pp
}: }:
with stdenv.lib; with stdenv.lib;
@ -19,7 +20,9 @@ in
rec { rec {
/* Takes a list of units and builds an experiment, after executing the /* Takes a list of units and builds an experiment, after executing the
trebuchet, runexp and isolate stages. Returns the trebuchet stage. */ trebuchet, runexp and isolate stages. Returns the trebuchet stage. */
buildTrebuchet = units: stages.trebuchet { buildTrebuchet = units:
let
trebuchet = stages.trebuchet {
inherit (machineConf) nixPrefix sshHost; inherit (machineConf) nixPrefix sshHost;
nextStage = stages.runexp { nextStage = stages.runexp {
inherit (machineConf) nixPrefix; inherit (machineConf) nixPrefix;
@ -31,6 +34,10 @@ rec {
}; };
}; };
}; };
in trebuchet // rec {
result = pp.resultFromLauncher (pp.launcher trebuchet);
timetable = pp.timetable result;
};
/* Given an attrset of lists `varConf` and a function `genConf` that accepts a /* Given an attrset of lists `varConf` and a function `genConf` that accepts a
attrset, computes the cartesian product of all combinations of `varConf` calls attrset, computes the cartesian product of all combinations of `varConf` calls