diff --git a/deployments/restart-runners.sh b/deployments/restart-runners.sh index c1adefbb8aa780553e71e5de748d035e131006a5..32d7997d6c77a455302532e9fc00e211987f859e 100755 --- a/deployments/restart-runners.sh +++ b/deployments/restart-runners.sh @@ -1,19 +1,14 @@ #!/usr/bin/env bash -echo "restarted runner." ssh root@140.221.10.9 systemctl restart gitlab-runner2.service - echo "restarted runner." ssh root@129.114.111.114 systemctl restart gitlab-runner2.service - echo "restarted runner." ssh root@129.114.110.3 systemctl restart gitlab-runner2.service - echo "restarted runner." ssh root@129.114.111.116 systemctl restart gitlab-runner2.service - echo "restarted runner." ssh root@129.114.33.201 systemctl restart gitlab-runner2.service - echo "restarted runner." -ssh gitlab-runner@argo-phi1 sudo systemctl restart gitlab-runner.service +ssh gitlab-runner@argo-phi1.mcs sudo systemctl restart gitlab-runner.service +echo "restarted runner." diff --git a/dhrun/all-tests.dh b/dhrun/all-tests.dh index ea52437131a1485d4309f10cba612e87ae746bc3..c37c49d265259a11bbca2a6bf7e962f3b67512af 100644 --- a/dhrun/all-tests.dh +++ b/dhrun/all-tests.dh @@ -1,233 +1,221 @@ λ(dataDir : Text) --> λ(manifestDir : Text) -→ let lib = ./lib.dh dataDir manifestDir +→ λ(manifestDir : Text) +→ λ(isTest : Bool) +→ let assetDir = dataDir ++ "test_assets/" + + let types = ./dhrunlib/types.dh + + let argotypes = ./argolib/types.dh + + let argo = ./argolib/package.dh let message = "HelloWorld" let cn = "testContainer" - let basicManifest = manifestDir ++ "basic.yml" + let idCmd = let id = λ(a : Type) → λ(x : a) → x in id types.Cmd - let singularityManifest = manifestDir ++ "singularity.yml" - - let argIfTest = - λ(isTest : Bool) - → { isTest = - isTest - , timeout = - if isTest - - then [ 600 ] : Optional Natural - - else [] : Optional Natural + let dhrunTemplate = + { cmds = + [] : List types.Cmd + , verbose = + True + , cleaning = + True + , workdir = + "./_output" + , pre = + [] : List Text + , post = + [] : List Text } + : types.Config - let Powercap = < Cap : Text | NoCap : {} > + let makeExtended = + λ(daemonArg : argotypes.MkDaemon) + → λ(daemonOverrides : types.Cmd → types.Cmd) + → λ(runArg : argotypes.MkRun) + → λ(runOverrides : types.Cmd → types.Cmd) + → λ(extraCmds : List types.Cmd) + → dhrunTemplate + ⫽ { cmds = + [ daemonOverrides (argo.nrmd.mk daemonArg) + , runOverrides (argo.run.mk runArg) + ] + # extraCmds + } - in { run-singularity = - lib.makeBase - ( lib.emptyMakeBaseArg "echo" singularityManifest cn - ⫽ { args = - [ message ] - , verbose = - True - , singularity = - True - , cmdwants = - [] : List Text - , cmdavoids = - [ "Traceback" ] - , timeout = - [ 600 ] : Optional Natural + let manifests = + { basic = + manifestDir ++ "basic.yml" + , perf = + manifestDir ++ "perfwrap.yml" + , singularity = + manifestDir ++ "singularity.yml" + } + + let ifTest = + λ(t : Type) + → λ(default : t) + → λ(value : t) + → if isTest then value else default + + let ifTestList = ifTest (List Text) ([] : List Text) + + let withDaemon = + λ(daemonArg : argotypes.MkDaemon) + → λ(runArg : argotypes.MkRun) + → λ(runOverrides : types.Cmd → types.Cmd) + → λ(extraCmds : List types.Cmd) + → makeExtended + ( daemonArg + ⫽ { daemonavoids = + ifTestList [ "Traceback", "ValueError" ] + , powercap = + < NoCap = {=} | Cap : Text > : argotypes.Powercap } ) - , run = - lib.makeBase - ( lib.emptyMakeBaseArg "echo" basicManifest cn - ⫽ { args = - [ message ] - , verbose = - True - , cmdwants = - [] : List Text - , cmdavoids = - [ "Traceback" ] - , timeout = - [ 600 ] : Optional Natural + idCmd + ( runArg + ⫽ { cmdavoids = + runArg.cmdavoids # ifTestList [ "Traceback", "ValueError" ] } ) - , pwd = - lib.makeBase - ( lib.emptyMakeBaseArg "pwd" basicManifest cn - ⫽ { args = - [] : List Text - , verbose = - True - , cmdwants = - [ "toto" ] : List Text - , cmdavoids = - [ "Traceback" ] - , timeout = - [ 600 ] : Optional Natural - , runwd = - [ "toto" ] : Optional Text - } + ( λ(c : types.Cmd) + → runOverrides + ( c + ⫽ { timeout = + ifTest + (Optional Natural) + ([] : Optional Natural) + ([ 600 ] : Optional Natural) + } + ) ) + extraCmds + + let withDaemonNoExtras = + λ(runArg : argotypes.MkRun) + → λ(runOverrides : types.Cmd → types.Cmd) + → withDaemon argo.nrmd.defarg runArg runOverrides ([] : List types.Cmd) + + let withDaemonExtraListen = + λ(filter : Text) + → λ(doFilter : Bool) + → λ(runArg : argotypes.MkRun) + → λ(runOverrides : types.Cmd → types.Cmd) + → withDaemon + argo.nrmd.defarg + runArg + runOverrides + [ argo.listen.mk + (argo.listen.defarg cn ⫽ { filter = filter, doFilter = doFilter }) + ] + + let withDaemonExtraProgresstest = withDaemonExtraListen "progress" True + + let mkrun = + λ(manifest : Text) → λ(name : Text) → argo.run.defarg name manifest cn + + let basicRun = mkrun manifests.basic + + let perfRun = mkrun manifests.perf + + let singularityRun = mkrun manifests.singularity + + in { list = + dhrunTemplate ⫽ { cmds = [ argo.nrmd.default, argo.list.default ] } + , run = + withDaemonNoExtras (basicRun "true") idCmd + , pwd = + let somedir = "toto" + + in withDaemonNoExtras + (basicRun "pwd" ⫽ { cmdwants = [ somedir ] : List Text }) + (λ(x : types.Cmd) → x ⫽ { otherwd = [ somedir ] : Optional Text }) , exitcode = - lib.makeBase - ( lib.emptyMakeBaseArg "false" basicManifest cn - ⫽ { args = - [] : List Text - , verbose = - True - , cmdwants = - [] : List Text - , cmdavoids = - [ "Traceback" ] - , timeout = - [ 600 ] : Optional Natural - , runExitcode = - [ +1 ] : Optional Integer - } - ) + withDaemonNoExtras + (basicRun "false") + (λ(x : types.Cmd) → x ⫽ { exitcode = [ +1 ] : Optional Integer }) , hello = - lib.makeBase - ( lib.emptyMakeBaseArg "echo" basicManifest cn - ⫽ { args = - [ message ] - , verbose = - True - , cmdwants = - [ message ] - , cmdavoids = - [ "Traceback" ] - , timeout = - [ 600 ] : Optional Natural - } + withDaemonNoExtras + ( basicRun "echo" + ⫽ { args = [ message ], cmdwants = [ message ] : List Text } ) + idCmd , listen = - lib.makeExtended - ( lib.emptyMakeBaseArg "sleep" basicManifest cn - ⫽ { args = - [ "1" ] - , verbose = - True - , cmdwants = - [] : List Text - , cmdavoids = - [ "Traceback" ] - , timeout = - [ 600 ] : Optional Natural - } - ) - [ lib.values.emptyCmd - { name = - "nrm" - , outfile = - "nrmlisten.out" - , errfile = - "nrmlisten.err" - } - ⫽ { args = [ "listen", "-u", cn ] } - ] + withDaemonExtraListen + "," + False + (basicRun "sleep" ⫽ { args = [ "1" ] }) + idCmd , power = - lib.appTest - ( lib.emptyFilterTestArgs "power" "sleep" - ⫽ { timeout = - [ 600 ] : Optional Natural - , args = - [ "15" ] - , isTest = - True - } - ) + withDaemonExtraListen + "power" + True + (basicRun "sleep" ⫽ { args = [ "15" ] }) + idCmd , performance = - lib.appTest - ( lib.emptyFilterTestArgs "performance" "sleep" - ⫽ { timeout = - [ 600 ] : Optional Natural - , args = - [ "15" ] - , isTest = - True - , manifestname = - "perfwrap.yml" - } - ) + withDaemonExtraListen + "performance" + True + (perfRun "sleep" ⫽ { args = [ "15" ] }) + idCmd + , run-singularity = + withDaemon + (argo.nrmd.defarg ⫽ { singularity = True }) + (singularityRun "true") + idCmd + ([] : List types.Cmd) , qmcpack = - λ(isTest : Bool) - → λ(powercap : Powercap) - → lib.extendApp - ( lib.progressAppTest - ( lib.emptyProgressAppTestArg - "mpiexec" - [ "-n" - , if isTest then "2" else "24" + withDaemonExtraProgresstest + ( basicRun "mpiexec" + ⫽ { args = + [ if isTest then "2" else "24" , "qmcpack" - , lib.qmcPackDir ++ "/simple-H2O.xml" + , assetDir ++ "/simple-H2O.xml" ] - ⫽ argIfTest isTest - ⫽ { cmdavoids = - [ "Error", "error", "ERROR" ] - , powercap = - powercap - } - ) - ) - isTest + , cmdavoids = + [ "Error", "error", "ERROR" ] + } + ) + idCmd , lammps = - λ(isTest : Bool) - → λ(powercap : Powercap) - → lib.extendApp - ( lib.progressAppTest - ( lib.emptyProgressAppTestArg - "mpiexec" + withDaemonExtraProgresstest + ( basicRun "mpiexec" + ⫽ { args = [ "-n" , if isTest then "2" else "24" , "-bind-to" , "core" , "lmp_mpi" , "-i" - , lib.lammpsDir ++ "/modified.lj" + , assetDir ++ "/modified.lj" ] - ⫽ argIfTest isTest - ⫽ { cmdavoids = - [ "Error", "error", "ERROR" ] - , powercap = - powercap - } - ) - ) - isTest + , cmdavoids = + [ "Error", "error", "ERROR" ] + } + ) + idCmd , openmc = - λ(isTest : Bool) - → λ(powercap : Powercap) - → lib.extendApp - ( lib.progressAppTest - ( lib.emptyProgressAppTestArg - "mpiexec" + withDaemonExtraProgresstest + ( basicRun "mpiexec" + ⫽ { args = [ "-n", if isTest then "2" else "24", "openmc" ] - ⫽ argIfTest isTest - ⫽ { passvars = - [ "OPENMC_CROSS_SECTIONS" ] - , cmdavoids = - [ "Error" ] - , powercap = - powercap - } - ) - ⫽ { pre = - [ "cp --no-preserve=mode -r " ++ lib.openmcDir ++ "/* ." ] + , cmdavoids = + [ "Error", "error", "ERROR" ] + , passvars = + [ "OPENMC_CROSS_SECTIONS" ] } ) - isTest + idCmd + ⫽ { pre = + [ "cp --no-preserve=mode -r " ++ assetDir ++ "openmc/* ." ] + } , amg = - λ(isTest : Bool) - → λ(powercap : Powercap) - → lib.extendApp - ( lib.progressAppTest - ( lib.emptyProgressAppTestArg - "mpiexec" + withDaemonExtraProgresstest + ( basicRun "mpiexec" + ⫽ { args = [ "-n" , if isTest then "2" else "24" , "amg" @@ -242,38 +230,32 @@ , if isTest then "1" else "12" , "1" ] - ⫽ argIfTest isTest - ⫽ { vars = - [ { varname = "OMP_NUM_THREADS", value = "1" } ] - , cmdavoids = - [ "Error", "error", "ERROR" ] - , powercap = - powercap - } - ) - ) - isTest + , cmdavoids = + [ "Error", "error", "ERROR" ] + } + ) + ( λ(x : types.Cmd) + → x ⫽ { vars = [ { varname = "OMP_NUM_THREADS", value = "1" } ] } + ) , stream = - λ(isTest : Bool) - → λ(powercap : Powercap) - → lib.extendApp - ( lib.progressAppTest - ( lib.emptyProgressAppTestArg "stream_c" ([] : List Text) - ⫽ argIfTest isTest - ⫽ { vars = - [ { varname = - "OMP_NUM_THREADS" - , value = - if isTest then "2" else "24" - } - , { varname = "OMP_PLACES", value = "cores" } - ] - , cmdavoids = - [ "Error", "error", "ERROR" ] - , powercap = - powercap - } - ) - ) - isTest + withDaemonExtraProgresstest + ( basicRun "stream_c" + ⫽ { args = + [] : List Text + , cmdavoids = + [ "Error", "error", "ERROR" ] + } + ) + ( λ(x : types.Cmd) + → x + ⫽ { vars = + [ { varname = + "OMP_NUM_THREADS" + , value = + if isTest then "2" else "24" + } + , { varname = "OMP_PLACES", value = "cores" } + ] + } + ) } diff --git a/dhrun/argolib/basicCommand.dh b/dhrun/argolib/basicCommand.dh new file mode 100644 index 0000000000000000000000000000000000000000..4ec6f52f5bff2c7279df2526eaf765a2ab57858f --- /dev/null +++ b/dhrun/argolib/basicCommand.dh @@ -0,0 +1,44 @@ +let values = ../dhrunlib/package.dh + +let types = ../dhrunlib/types.dh + +in λ ( args + : { name : + Text + , outprefix : + Text + , outwants : + List Text + , outavoids : + List Text + } + ) + → { name = + args.name + , args = + [] : List Text + , out = + { filename = + "${args.outprefix}.out" + , filecheck = + { wants = args.outwants, avoids = args.outavoids } + } + , err = + { filename = + "${args.outprefix}.err" + , filecheck = + values.emptyCheck ⫽ { avoids = args.outavoids } + } + , postchecks = + [] : List types.FileCheck + , vars = + values.emptyVars + , passvars = + [ "PATH" ] + , timeout = + [] : Optional Natural + , otherwd = + [] : Optional Text + , exitcode = + [] : Optional Integer + } diff --git a/dhrun/argolib/list.dh b/dhrun/argolib/list.dh new file mode 100644 index 0000000000000000000000000000000000000000..f88c7e36f50f01d9d3285a0c200959356d7c4efc --- /dev/null +++ b/dhrun/argolib/list.dh @@ -0,0 +1,19 @@ +let types = ../dhrunlib/types.dh + +let basicCommand = ./basicCommand.dh + +let list = + basicCommand + { name = + "nrm" + , outprefix = + "nrmlist" + , outavoids = + [] : List Text + , outwants = + [] : List Text + } + ⫽ { args = [ "list" ] } + : types.Cmd + +in { default = list : types.Cmd } diff --git a/dhrun/argolib/listen.dh b/dhrun/argolib/listen.dh new file mode 100644 index 0000000000000000000000000000000000000000..a68079516c7402141f816d35f5647c3724813127 --- /dev/null +++ b/dhrun/argolib/listen.dh @@ -0,0 +1,47 @@ +let values = ../dhrunlib/package.dh + +let types = ../dhrunlib/types.dh + +let argotypes = ./types.dh + +let basicCommand = ./basicCommand.dh + +let defaultMkListen = + λ(containerName : Text) + → { attr = + "performance" + , doFilter = + False + , filter = + "," + , containerName = + containerName + } + : argotypes.MkListen + +let listen = + λ(a : argotypes.MkListen) + → basicCommand + { name = + "nrm" + , outprefix = + "nrmlisten" + , outavoids = + [] : List Text + , outwants = + if a.doFilter then [ a.filter ] else [] : List Text + } + ⫽ { args = [ "listen", "-u", a.containerName, "--filter", a.filter ] } + : types.Cmd + +let default = + λ(containerName : Text) + → listen (defaultMkListen containerName) : types.Cmd + +in { defarg = + defaultMkListen : Text → argotypes.MkListen + , mk = + listen : argotypes.MkListen → types.Cmd + , default = + default : Text → types.Cmd + } diff --git a/dhrun/argolib/nrmd.dh b/dhrun/argolib/nrmd.dh new file mode 100644 index 0000000000000000000000000000000000000000..dfcd46c93a271f9cd866c19f27aa837b0a0c72e4 --- /dev/null +++ b/dhrun/argolib/nrmd.dh @@ -0,0 +1,76 @@ +let values = ../dhrunlib/package.dh + +let types = ../dhrunlib/types.dh + +let argotypes = ./types.dh + +let basicCommand = ./basicCommand.dh + +let addVerbose = λ(v : Bool) → if v then [ "--verbose" ] else [] : List Text + +let addSingularity = + λ(v : Bool) + → if v then [ "--container-runtime", "singularity" ] else [] : List Text + +let addPowercap = + λ(p : argotypes.Powercap) + → merge + { Cap = + λ(x : Text) → [ "--powercap", x ] + , NoCap = + λ(x : {}) → [] : List Text + } + p + +let defaultMkDaemon = + { verbose = + True + , powercap = + < NoCap = {=} | Cap : Text > + , singularity = + False + , daemonavoids = + [] : List Text + } + : argotypes.MkDaemon + +let daemon = + λ(a : argotypes.MkDaemon) + → basicCommand + { name = + "nrmd" + , outprefix = + "nrmd" + , outavoids = + [ "Traceback", "ValueError" ] : List Text + , outwants = + [] : List Text + } + ⫽ { args = + [ "--nrm_log", "./nrm_log" ] + # addVerbose a.verbose + # addSingularity a.singularity + # addPowercap a.powercap + , out = + { filename = + "nrmd.out" + , filecheck = + { wants = [] : List Text, avoids = a.daemonavoids } + } + , vars = + [ { varname = + "ARGO_NODEOS_CONFIG" + , value = + "/tmp/argo_nodeos_config" + } + ] + } + : types.Cmd + +in { defarg = + defaultMkDaemon : argotypes.MkDaemon + , mk = + daemon : argotypes.MkDaemon → types.Cmd + , default = + daemon defaultMkDaemon : types.Cmd + } diff --git a/dhrun/argolib/package.dh b/dhrun/argolib/package.dh new file mode 100644 index 0000000000000000000000000000000000000000..c65406df163414388c4a498822c9d405801c650c --- /dev/null +++ b/dhrun/argolib/package.dh @@ -0,0 +1,11 @@ +{ basic = + ./basicCommand.dh +, nrmd = + ./nrmd.dh +, run = + ./run.dh +, listen = + ./listen.dh +, list = + ./list.dh +} diff --git a/dhrun/argolib/run.dh b/dhrun/argolib/run.dh new file mode 100644 index 0000000000000000000000000000000000000000..154d49868fc7a666c43f4a019d5f39c882276029 --- /dev/null +++ b/dhrun/argolib/run.dh @@ -0,0 +1,72 @@ +let values = ../dhrunlib/package.dh + +let types = ../dhrunlib/types.dh + +let argotypes = ./types.dh + +let basicCommand = ./basicCommand.dh + +let defaultMkRun = + λ(cmd : Text) + → λ(manifest : Text) + → λ(containerName : Text) + → { manifest = + manifest + , cmd = + cmd + , containerName = + containerName + , args = + [] : List Text + , cmdwants = + [] : List Text + , cmdavoids = + [] : List Text + , passvars = + [] : List Text + } + : argotypes.MkRun + +let run = + λ(a : argotypes.MkRun) + → let b = + basicCommand + { name = + "nrm" + , outprefix = + "nrmrun" + , outwants = + a.cmdwants + , outavoids = + a.cmdavoids + } + + in b + ⫽ { args = + [ "run", "-u", a.containerName, a.manifest, a.cmd ] # a.args + , passvars = + b.passvars # a.passvars + , vars = + values.emptyVars + , timeout = + [] : Optional Natural + , exitcode = + [] : Optional Integer + , otherwd = + [] : Optional Text + } + : types.Cmd + +let default = + λ(cmd : Text) + → λ(manifest : Text) + → λ(containerName : Text) + → run (defaultMkRun cmd manifest containerName) : types.Cmd + +in { defarg = + defaultMkRun : Text → Text → Text → argotypes.MkRun + , mk = + run : argotypes.MkRun → types.Cmd + , default = + default : Text → Text → Text → types.Cmd + } diff --git a/dhrun/argolib/types.dh b/dhrun/argolib/types.dh new file mode 100644 index 0000000000000000000000000000000000000000..ca297552359309c744b9a7bd7e276bad0c834dce --- /dev/null +++ b/dhrun/argolib/types.dh @@ -0,0 +1,44 @@ +let types = ../dhrunlib/types.dh + +let Powercap = < Cap : Text | NoCap : {} > + +let MkDaemon = + { verbose : + Bool + , powercap : + Powercap + , singularity : + Bool + , daemonavoids : + List Text + } + +let MkRun = + { manifest : + Text + , cmd : + Text + , containerName : + Text + , args : + List Text + , cmdwants : + List Text + , cmdavoids : + List Text + , passvars : + List Text + } + +let MkListen = + { attr : Text, containerName : Text, doFilter : Bool, filter : Text } + +in { MkRun = + MkRun + , MkDaemon = + MkDaemon + , Powercap = + Powercap + , MkListen = + MkListen + } diff --git a/dhrun/check_golden.sh b/dhrun/check_golden.sh new file mode 100644 index 0000000000000000000000000000000000000000..6dfe211899938de17c7060a9d75277f5cce0b8d3 --- /dev/null +++ b/dhrun/check_golden.sh @@ -0,0 +1,18 @@ +check_golden () { + echo "--- START checking golden test ${1}" + diff <(dhrun print <<< "let a = ./all-tests.dh \".\" \".\" True in a.${1}") <(cat golden/${1}.yaml) + echo "--- DONE checking golden test ${1}" +} + +check_golden "run" +check_golden "pwd" +check_golden "exitcode" +check_golden "hello" +check_golden "listen" +check_golden "power" +check_golden "performance" +check_golden "qmcpack" +check_golden "openmc" +check_golden "lammps" +check_golden "amg" +check_golden "stream" diff --git a/dhrun/dhrunlib/Check/Check.dh b/dhrun/dhrunlib/Check/Check.dh new file mode 100644 index 0000000000000000000000000000000000000000..e679908b08257bb35f50414bca8134c438797114 --- /dev/null +++ b/dhrun/dhrunlib/Check/Check.dh @@ -0,0 +1,3 @@ + let Check = { avoids : List Text, wants : List Text } + +in Check diff --git a/dhrun/dhrunlib/Check/empty.dh b/dhrun/dhrunlib/Check/empty.dh new file mode 100644 index 0000000000000000000000000000000000000000..4860a847e1b853958b3f76d274fa533d9b18bbc8 --- /dev/null +++ b/dhrun/dhrunlib/Check/empty.dh @@ -0,0 +1 @@ +{ avoids = [] : List Text, wants = [] : List Text } diff --git a/dhrun/dhrunlib/Cmd/Cmd.dh b/dhrun/dhrunlib/Cmd/Cmd.dh new file mode 100644 index 0000000000000000000000000000000000000000..1deae33e2c901e42ae1f70002805e72be089dce3 --- /dev/null +++ b/dhrun/dhrunlib/Cmd/Cmd.dh @@ -0,0 +1,29 @@ +let Verbosity = ./../Verbosity/Verbosity.dh + +let EnvVar = ./../EnvVar/EnvVar.dh + +let FileCheck = ./../FileCheck/FileCheck.dh + +let Check = ./../Check/Check.dh + +in { name : + Text + , exitcode : + Optional Integer + , args : + List Text + , out : + FileCheck + , err : + FileCheck + , postchecks : + List FileCheck + , vars : + List EnvVar + , passvars : + List Text + , timeout : + Optional Natural + , otherwd : + Optional Text + } diff --git a/dhrun/dhrunlib/Cmd/empty.dh b/dhrun/dhrunlib/Cmd/empty.dh new file mode 100644 index 0000000000000000000000000000000000000000..50de4264a61a149376c2716ec5d87d3c6ebe21f3 --- /dev/null +++ b/dhrun/dhrunlib/Cmd/empty.dh @@ -0,0 +1,28 @@ +let emptyCheck = ./../Check/empty.dh + +let FileCheck = ./../FileCheck/FileCheck.dh + +let emptyVars = ./../EnvVar/empty.dh + +in λ(args : { name : Text, outfile : Text, errfile : Text }) + → { name = + args.name + , exitcode = + [] : Optional Integer + , args = + [] : List Text + , out = + { filename = args.outfile, filecheck = emptyCheck } + , err = + { filename = args.errfile, filecheck = emptyCheck } + , postchecks = + [] : List FileCheck + , vars = + emptyVars + , passvars = + [] : List Text + , timeout = + [] : Optional Natural + , otherwd = + [] : Optional Text + } diff --git a/dhrun/dhrunlib/Config/Config.dh b/dhrun/dhrunlib/Config/Config.dh new file mode 100644 index 0000000000000000000000000000000000000000..866f160d997945b1f24f238af8f25616b3e7fd5d --- /dev/null +++ b/dhrun/dhrunlib/Config/Config.dh @@ -0,0 +1,19 @@ +let Verbosity = ./../Verbosity/Verbosity.dh + +let FileCheck = ./../FileCheck/FileCheck.dh + +let Cmd = ./../Cmd/Cmd.dh + +in { cmds : + List Cmd + , cleaning : + Bool + , verbose : + Bool + , workdir : + Text + , pre : + List Text + , post : + List Text + } diff --git a/dhrun/dhrunlib/EnvVar/EnvVar.dh b/dhrun/dhrunlib/EnvVar/EnvVar.dh new file mode 100644 index 0000000000000000000000000000000000000000..ac10d074df8884bfb3264f8ae899b3aeaaf24ae3 --- /dev/null +++ b/dhrun/dhrunlib/EnvVar/EnvVar.dh @@ -0,0 +1 @@ +let EnvVar = { varname : Text, value : Text } in EnvVar diff --git a/dhrun/dhrunlib/EnvVar/empty.dh b/dhrun/dhrunlib/EnvVar/empty.dh new file mode 100644 index 0000000000000000000000000000000000000000..56dec91c5c024dfd2dc8dbe7ab17a3a644225b03 --- /dev/null +++ b/dhrun/dhrunlib/EnvVar/empty.dh @@ -0,0 +1,2 @@ +let EnvVar = ./EnvVar.dh +in [] : List EnvVar diff --git a/dhrun/dhrunlib/FileCheck/FileCheck.dh b/dhrun/dhrunlib/FileCheck/FileCheck.dh new file mode 100644 index 0000000000000000000000000000000000000000..f30d809da1bcb9c66f2b31472438ecfe8ad92171 --- /dev/null +++ b/dhrun/dhrunlib/FileCheck/FileCheck.dh @@ -0,0 +1,5 @@ +let Check = ./../Check/Check.dh + +let FileCheck = { filename : Text, filecheck : Check } + +in FileCheck diff --git a/dhrun/dhrunlib/Verbosity/Normal.dh b/dhrun/dhrunlib/Verbosity/Normal.dh new file mode 100644 index 0000000000000000000000000000000000000000..d446f8430db2115ee5d3dc9458227fc3b1c60cef --- /dev/null +++ b/dhrun/dhrunlib/Verbosity/Normal.dh @@ -0,0 +1 @@ +let Normal = < Normal = {=} | Verbose : {} > in Normal diff --git a/dhrun/dhrunlib/Verbosity/Verbose.dh b/dhrun/dhrunlib/Verbosity/Verbose.dh new file mode 100644 index 0000000000000000000000000000000000000000..f838a8f1b6280f2414c9ccc917b8cfbc3adc5dd0 --- /dev/null +++ b/dhrun/dhrunlib/Verbosity/Verbose.dh @@ -0,0 +1 @@ +let Verbose = < Verbose = {=} | Normal : {} > in Verbose diff --git a/dhrun/dhrunlib/Verbosity/Verbosity.dh b/dhrun/dhrunlib/Verbosity/Verbosity.dh new file mode 100644 index 0000000000000000000000000000000000000000..d20ce2b4a1d3bc2ff79cadc1a1e06355411ac4e3 --- /dev/null +++ b/dhrun/dhrunlib/Verbosity/Verbosity.dh @@ -0,0 +1 @@ +let Verbosity = < Normal : {} | Verbose : {} > in Verbosity diff --git a/dhrun/dhrunlib/package.dh b/dhrun/dhrunlib/package.dh new file mode 100644 index 0000000000000000000000000000000000000000..4c4566ed5390cb59fcda36f715fc40ce3099db85 --- /dev/null +++ b/dhrun/dhrunlib/package.dh @@ -0,0 +1,14 @@ +let types = ./types.dh + +in { Normal = + ./Verbosity/Normal.dh + , Verbose = + ./Verbosity/Verbose.dh + , emptyCheck = + ./Check/empty.dh + , emptyVars = + ./EnvVar/empty.dh + , emptyCmd = + ./Cmd/empty.dh + } + : types.Package diff --git a/dhrun/dhrunlib/types.dh b/dhrun/dhrunlib/types.dh new file mode 100644 index 0000000000000000000000000000000000000000..faaef931409d4f435a1cb57269fb550855afd761 --- /dev/null +++ b/dhrun/dhrunlib/types.dh @@ -0,0 +1,29 @@ +let base = + { Verbosity = + ./Verbosity/Verbosity.dh + , Cmd = + ./Cmd/Cmd.dh + , EnvVar = + ./EnvVar/EnvVar.dh + , Check = + ./Check/Check.dh + , Config = + ./Config/Config.dh + , FileCheck = + ./FileCheck/FileCheck.dh + } + +in base + ⫽ { Package = + { Normal : + base.Verbosity + , Verbose : + base.Verbosity + , emptyCheck : + base.Check + , emptyVars : + List base.EnvVar + , emptyCmd : + { name : Text, outfile : Text, errfile : Text } → base.Cmd + } + } diff --git a/dhrun/golden/amg.yaml b/dhrun/golden/amg.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c6bdc1af6876dd52c4e1c32c48d75dc56d4a08c0 --- /dev/null +++ b/dhrun/golden/amg.yaml @@ -0,0 +1,109 @@ +pre: "toto" +verbose: true +post: null +cmds: +- otherwd: null + args: + - --nrm_log + - ./nrm_log + - --verbose + postchecks: null + passvars: + - PATH + name: nrmd + err: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmd.err + exitcode: null + timeout: null + vars: + - value: /tmp/argo_nodeos_config + varname: ARGO_NODEOS_CONFIG + out: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmd.out +- otherwd: null + args: + - run + - -u + - testContainer + - .basic.yml + - mpiexec + - -n + - '2' + - amg + - -problem + - '2' + - -n + - '90' + - '90' + - '90' + - -P + - '2' + - '1' + - '1' + postchecks: null + passvars: + - PATH + name: nrm + err: + filecheck: + wants: null + avoids: + - Error + - error + - ERROR + - Traceback + - ValueError + filename: nrmrun.err + exitcode: null + timeout: 600 + vars: + - value: '1' + varname: OMP_NUM_THREADS + out: + filecheck: + wants: null + avoids: + - Error + - error + - ERROR + - Traceback + - ValueError + filename: nrmrun.out +- otherwd: null + args: + - listen + - -u + - testContainer + - --filter + - progress + postchecks: null + passvars: + - PATH + name: nrm + err: + filecheck: + wants: null + avoids: null + filename: nrmlisten.err + exitcode: null + timeout: null + vars: null + out: + filecheck: + wants: + - progress + avoids: null + filename: nrmlisten.out +cleaning: true +workdir: ./_output + diff --git a/dhrun/golden/exitcode.yaml b/dhrun/golden/exitcode.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a48c13030c82c126509310e21803a3cd775d7266 --- /dev/null +++ b/dhrun/golden/exitcode.yaml @@ -0,0 +1,63 @@ +pre: null +verbose: true +post: null +cmds: +- otherwd: null + args: + - --nrm_log + - ./nrm_log + - --verbose + postchecks: null + passvars: + - PATH + name: nrmd + err: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmd.err + exitcode: null + timeout: null + vars: + - value: /tmp/argo_nodeos_config + varname: ARGO_NODEOS_CONFIG + out: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmd.out +- otherwd: null + args: + - run + - -u + - testContainer + - .basic.yml + - 'false' + postchecks: null + passvars: + - PATH + name: nrm + err: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmrun.err + exitcode: 1 + timeout: 600 + vars: null + out: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmrun.out +cleaning: true +workdir: ./_output + diff --git a/dhrun/golden/hello.yaml b/dhrun/golden/hello.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d71d08ad09f23d16725574aa752d61da014bff6c --- /dev/null +++ b/dhrun/golden/hello.yaml @@ -0,0 +1,65 @@ +pre: null +verbose: true +post: null +cmds: +- otherwd: null + args: + - --nrm_log + - ./nrm_log + - --verbose + postchecks: null + passvars: + - PATH + name: nrmd + err: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmd.err + exitcode: null + timeout: null + vars: + - value: /tmp/argo_nodeos_config + varname: ARGO_NODEOS_CONFIG + out: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmd.out +- otherwd: null + args: + - run + - -u + - testContainer + - .basic.yml + - echo + - HelloWorld + postchecks: null + passvars: + - PATH + name: nrm + err: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmrun.err + exitcode: null + timeout: 600 + vars: null + out: + filecheck: + wants: + - HelloWorld + avoids: + - Traceback + - ValueError + filename: nrmrun.out +cleaning: true +workdir: ./_output + diff --git a/dhrun/golden/lammps.yaml b/dhrun/golden/lammps.yaml new file mode 100644 index 0000000000000000000000000000000000000000..14219ded92e669ad2f24c155ef6c20aa572406a8 --- /dev/null +++ b/dhrun/golden/lammps.yaml @@ -0,0 +1,101 @@ +pre: null +verbose: true +post: null +cmds: +- otherwd: null + args: + - --nrm_log + - ./nrm_log + - --verbose + postchecks: null + passvars: + - PATH + name: nrmd + err: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmd.err + exitcode: null + timeout: null + vars: + - value: /tmp/argo_nodeos_config + varname: ARGO_NODEOS_CONFIG + out: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmd.out +- otherwd: null + args: + - run + - -u + - testContainer + - .basic.yml + - mpiexec + - -n + - '2' + - -bind-to + - core + - lmp_mpi + - -i + - .test_assets//modified.lj + postchecks: null + passvars: + - PATH + name: nrm + err: + filecheck: + wants: null + avoids: + - Error + - error + - ERROR + - Traceback + - ValueError + filename: nrmrun.err + exitcode: null + timeout: 600 + vars: null + out: + filecheck: + wants: null + avoids: + - Error + - error + - ERROR + - Traceback + - ValueError + filename: nrmrun.out +- otherwd: null + args: + - listen + - -u + - testContainer + - --filter + - progress + postchecks: null + passvars: + - PATH + name: nrm + err: + filecheck: + wants: null + avoids: null + filename: nrmlisten.err + exitcode: null + timeout: null + vars: null + out: + filecheck: + wants: + - progress + avoids: null + filename: nrmlisten.out +cleaning: true +workdir: ./_output + diff --git a/dhrun/golden/listen.yaml b/dhrun/golden/listen.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0fdd1b2afbf4347ecb7080972ad25d513ef1b627 --- /dev/null +++ b/dhrun/golden/listen.yaml @@ -0,0 +1,88 @@ +pre: null +verbose: true +post: null +cmds: +- otherwd: null + args: + - --nrm_log + - ./nrm_log + - --verbose + postchecks: null + passvars: + - PATH + name: nrmd + err: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmd.err + exitcode: null + timeout: null + vars: + - value: /tmp/argo_nodeos_config + varname: ARGO_NODEOS_CONFIG + out: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmd.out +- otherwd: null + args: + - run + - -u + - testContainer + - .basic.yml + - sleep + - '1' + postchecks: null + passvars: + - PATH + name: nrm + err: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmrun.err + exitcode: null + timeout: 600 + vars: null + out: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmrun.out +- otherwd: null + args: + - listen + - -u + - testContainer + - --filter + - ',' + postchecks: null + passvars: + - PATH + name: nrm + err: + filecheck: + wants: null + avoids: null + filename: nrmlisten.err + exitcode: null + timeout: null + vars: null + out: + filecheck: + wants: null + avoids: null + filename: nrmlisten.out +cleaning: true +workdir: ./_output + diff --git a/dhrun/golden/openmc.yaml b/dhrun/golden/openmc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..31ab9e47a4724acb30be84990cc722e0e932aad3 --- /dev/null +++ b/dhrun/golden/openmc.yaml @@ -0,0 +1,99 @@ +pre: +- cp --no-preserve=mode -r .test_assets/openmc/* . +verbose: true +post: null +cmds: +- otherwd: null + args: + - --nrm_log + - ./nrm_log + - --verbose + postchecks: null + passvars: + - PATH + name: nrmd + err: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmd.err + exitcode: null + timeout: null + vars: + - value: /tmp/argo_nodeos_config + varname: ARGO_NODEOS_CONFIG + out: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmd.out +- otherwd: null + args: + - run + - -u + - testContainer + - .basic.yml + - mpiexec + - -n + - '2' + - openmc + postchecks: null + passvars: + - PATH + - OPENMC_CROSS_SECTIONS + name: nrm + err: + filecheck: + wants: null + avoids: + - Error + - error + - ERROR + - Traceback + - ValueError + filename: nrmrun.err + exitcode: null + timeout: 600 + vars: null + out: + filecheck: + wants: null + avoids: + - Error + - error + - ERROR + - Traceback + - ValueError + filename: nrmrun.out +- otherwd: null + args: + - listen + - -u + - testContainer + - --filter + - progress + postchecks: null + passvars: + - PATH + name: nrm + err: + filecheck: + wants: null + avoids: null + filename: nrmlisten.err + exitcode: null + timeout: null + vars: null + out: + filecheck: + wants: + - progress + avoids: null + filename: nrmlisten.out +cleaning: true +workdir: ./_output + diff --git a/dhrun/golden/performance.yaml b/dhrun/golden/performance.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d55d31132522f57af7e126943fa46599e421acdc --- /dev/null +++ b/dhrun/golden/performance.yaml @@ -0,0 +1,89 @@ +pre: null +verbose: true +post: null +cmds: +- otherwd: null + args: + - --nrm_log + - ./nrm_log + - --verbose + postchecks: null + passvars: + - PATH + name: nrmd + err: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmd.err + exitcode: null + timeout: null + vars: + - value: /tmp/argo_nodeos_config + varname: ARGO_NODEOS_CONFIG + out: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmd.out +- otherwd: null + args: + - run + - -u + - testContainer + - .perfwrap.yml + - sleep + - '15' + postchecks: null + passvars: + - PATH + name: nrm + err: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmrun.err + exitcode: null + timeout: 600 + vars: null + out: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmrun.out +- otherwd: null + args: + - listen + - -u + - testContainer + - --filter + - performance + postchecks: null + passvars: + - PATH + name: nrm + err: + filecheck: + wants: null + avoids: null + filename: nrmlisten.err + exitcode: null + timeout: null + vars: null + out: + filecheck: + wants: + - performance + avoids: null + filename: nrmlisten.out +cleaning: true +workdir: ./_output + diff --git a/dhrun/golden/power.yaml b/dhrun/golden/power.yaml new file mode 100644 index 0000000000000000000000000000000000000000..28d9f1294321f539f93e9dfc8cf3ba3b55c2389f --- /dev/null +++ b/dhrun/golden/power.yaml @@ -0,0 +1,89 @@ +pre: null +verbose: true +post: null +cmds: +- otherwd: null + args: + - --nrm_log + - ./nrm_log + - --verbose + postchecks: null + passvars: + - PATH + name: nrmd + err: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmd.err + exitcode: null + timeout: null + vars: + - value: /tmp/argo_nodeos_config + varname: ARGO_NODEOS_CONFIG + out: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmd.out +- otherwd: null + args: + - run + - -u + - testContainer + - .basic.yml + - sleep + - '15' + postchecks: null + passvars: + - PATH + name: nrm + err: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmrun.err + exitcode: null + timeout: 600 + vars: null + out: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmrun.out +- otherwd: null + args: + - listen + - -u + - testContainer + - --filter + - power + postchecks: null + passvars: + - PATH + name: nrm + err: + filecheck: + wants: null + avoids: null + filename: nrmlisten.err + exitcode: null + timeout: null + vars: null + out: + filecheck: + wants: + - power + avoids: null + filename: nrmlisten.out +cleaning: true +workdir: ./_output + diff --git a/dhrun/golden/pwd.yaml b/dhrun/golden/pwd.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ecf3d03078fafbaed0620e7ab224644517c8d7be --- /dev/null +++ b/dhrun/golden/pwd.yaml @@ -0,0 +1,64 @@ +pre: null +verbose: true +post: null +cmds: +- otherwd: null + args: + - --nrm_log + - ./nrm_log + - --verbose + postchecks: null + passvars: + - PATH + name: nrmd + err: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmd.err + exitcode: null + timeout: null + vars: + - value: /tmp/argo_nodeos_config + varname: ARGO_NODEOS_CONFIG + out: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmd.out +- otherwd: toto + args: + - run + - -u + - testContainer + - .basic.yml + - pwd + postchecks: null + passvars: + - PATH + name: nrm + err: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmrun.err + exitcode: null + timeout: 600 + vars: null + out: + filecheck: + wants: + - toto + avoids: + - Traceback + - ValueError + filename: nrmrun.out +cleaning: true +workdir: ./_output + diff --git a/dhrun/golden/qmcpack.yaml b/dhrun/golden/qmcpack.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3267945a0cf998d9c3fe5dfd6de7818fd7caa930 --- /dev/null +++ b/dhrun/golden/qmcpack.yaml @@ -0,0 +1,97 @@ +pre: null +verbose: true +post: null +cmds: +- otherwd: null + args: + - --nrm_log + - ./nrm_log + - --verbose + postchecks: null + passvars: + - PATH + name: nrmd + err: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmd.err + exitcode: null + timeout: null + vars: + - value: /tmp/argo_nodeos_config + varname: ARGO_NODEOS_CONFIG + out: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmd.out +- otherwd: null + args: + - run + - -u + - testContainer + - .basic.yml + - mpiexec + - '2' + - qmcpack + - .test_assets//simple-H2O.xml + postchecks: null + passvars: + - PATH + name: nrm + err: + filecheck: + wants: null + avoids: + - Error + - error + - ERROR + - Traceback + - ValueError + filename: nrmrun.err + exitcode: null + timeout: 600 + vars: null + out: + filecheck: + wants: null + avoids: + - Error + - error + - ERROR + - Traceback + - ValueError + filename: nrmrun.out +- otherwd: null + args: + - listen + - -u + - testContainer + - --filter + - progress + postchecks: null + passvars: + - PATH + name: nrm + err: + filecheck: + wants: null + avoids: null + filename: nrmlisten.err + exitcode: null + timeout: null + vars: null + out: + filecheck: + wants: + - progress + avoids: null + filename: nrmlisten.out +cleaning: true +workdir: ./_output + diff --git a/dhrun/golden/run.yaml b/dhrun/golden/run.yaml new file mode 100644 index 0000000000000000000000000000000000000000..87d0844f1a91af5ea5d6ebd08353b122f17ac4d9 --- /dev/null +++ b/dhrun/golden/run.yaml @@ -0,0 +1,63 @@ +pre: null +verbose: true +post: null +cmds: +- otherwd: null + args: + - --nrm_log + - ./nrm_log + - --verbose + postchecks: null + passvars: + - PATH + name: nrmd + err: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmd.err + exitcode: null + timeout: null + vars: + - value: /tmp/argo_nodeos_config + varname: ARGO_NODEOS_CONFIG + out: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmd.out +- otherwd: null + args: + - run + - -u + - testContainer + - .basic.yml + - 'true' + postchecks: null + passvars: + - PATH + name: nrm + err: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmrun.err + exitcode: null + timeout: 600 + vars: null + out: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmrun.out +cleaning: true +workdir: ./_output + diff --git a/dhrun/golden/stream.yaml b/dhrun/golden/stream.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9956f11d7ec9a877a336edfe6beacea2428615cb --- /dev/null +++ b/dhrun/golden/stream.yaml @@ -0,0 +1,98 @@ +pre: null +verbose: true +post: null +cmds: +- otherwd: null + args: + - --nrm_log + - ./nrm_log + - --verbose + postchecks: null + passvars: + - PATH + name: nrmd + err: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmd.err + exitcode: null + timeout: null + vars: + - value: /tmp/argo_nodeos_config + varname: ARGO_NODEOS_CONFIG + out: + filecheck: + wants: null + avoids: + - Traceback + - ValueError + filename: nrmd.out +- otherwd: null + args: + - run + - -u + - testContainer + - .basic.yml + - stream_c + postchecks: null + passvars: + - PATH + name: nrm + err: + filecheck: + wants: null + avoids: + - Error + - error + - ERROR + - Traceback + - ValueError + filename: nrmrun.err + exitcode: null + timeout: 600 + vars: + - value: '2' + varname: OMP_NUM_THREADS + - value: cores + varname: OMP_PLACES + out: + filecheck: + wants: null + avoids: + - Error + - error + - ERROR + - Traceback + - ValueError + filename: nrmrun.out +- otherwd: null + args: + - listen + - -u + - testContainer + - --filter + - progress + postchecks: null + passvars: + - PATH + name: nrm + err: + filecheck: + wants: null + avoids: null + filename: nrmlisten.err + exitcode: null + timeout: null + vars: null + out: + filecheck: + wants: + - progress + avoids: null + filename: nrmlisten.out +cleaning: true +workdir: ./_output + diff --git a/dhrun/lib.dh b/dhrun/lib.dh deleted file mode 100644 index d2d5dcb38f265e6536edcef7c06584a281200f8d..0000000000000000000000000000000000000000 --- a/dhrun/lib.dh +++ /dev/null @@ -1,457 +0,0 @@ - λ(dataDir : Text) -→ λ(manifestDir : Text) -→ let values = - https://xgitlab.cels.anl.gov/argo/dhrun/raw/master/resources/package.dh - - let types = - https://xgitlab.cels.anl.gov/argo/dhrun/raw/master/resources/types.dh - - let assetDir = dataDir ++ "assets/" - - let openmcDir = assetDir ++ "openmc/" - - let lammpsDir = assetDir - - let qmcPackDir = assetDir - - let basicCommand = - λ ( args - : { name : - Text - , outprefix : - Text - , outwants : - List Text - , outavoids : - List Text - } - ) - → { name = - args.name - , args = - [] : List Text - , out = - { filename = - "${args.outprefix}.out" - , filecheck = - { wants = args.outwants, avoids = args.outavoids } - } - , err = - { filename = - "${args.outprefix}.err" - , filecheck = - values.emptyCheck ⫽ { avoids = args.outavoids } - } - , postchecks = - [] : List types.FileCheck - , vars = - values.emptyVars - , passvars = - [ "PATH" ] - , timeout = - [] : Optional Natural - , otherwd = - [] : Optional Text - , exitcode = - [] : Optional Integer - } - - let Powercap = < Cap : Text | NoCap : {} > - - let MakeBaseArg = - { manifest : - Text - , cmd : - Text - , containerName : - Text - , args : - List Text - , verbose : - Bool - , singularity : - Bool - , cmdwants : - List Text - , cmdavoids : - List Text - , vars : - List types.EnvVar - , timeout : - Optional Natural - , runExitcode : - Optional Integer - , passvars : - List Text - , powercap : - Powercap - , runwd : - Optional Text - } - - let emptyMakeBaseArg = - λ(cmd : Text) - → λ(manifest : Text) - → λ(containerName : Text) - → { manifest = - manifest - , cmd = - cmd - , containerName = - containerName - , args = - [] : List Text - , verbose = - True - , singularity = - False - , cmdwants = - [] : List Text - , cmdavoids = - [] : List Text - , vars = - values.emptyVars - , timeout = - [] : Optional Natural - , runExitcode = - [] : Optional Integer - , passvars = - [] : List Text - , powercap = - < NoCap = {=} | Cap : Text > - , runwd = - [] : Optional Text - } - : MakeBaseArg - - let addVerbose = λ(v : Bool) → if v then [ "--verbose" ] else [] : List Text - - let addSingularity = - λ(v : Bool) - → if v then [ "--container-runtime", "singularity" ] else [] : List Text - - let addPowercap = - λ(p : Powercap) - → merge - { Cap = - λ(x : Text) → [ "--powercap", x ] - , NoCap = - λ(x : {}) → [] : List Text - } - p - - let makeBase = - λ(args : MakeBaseArg) - → { cmds = - [ basicCommand - { name = - "nrmd" - , outprefix = - "nrmd" - , outwants = - [] : List Text - , outavoids = - [ "Traceback", "ValueError" ] : List Text - } - ⫽ { args = - [ "--nrm_log", "./nrm_log" ] - # addVerbose args.verbose - # addSingularity args.singularity - # addPowercap args.powercap - , vars = - [ { varname = - "ARGO_NODEOS_CONFIG" - , value = - "/tmp/argo_nodeos_config" - } - ] - } - , let b = - basicCommand - { name = - "nrm" - , outprefix = - "nrmrun" - , outwants = - args.cmdwants - , outavoids = - args.cmdavoids - } - - in b - ⫽ { args = - [ "run" - , "-u" - , args.containerName - , args.manifest - , args.cmd - ] - # args.args - , passvars = - b.passvars # args.passvars - , vars = - args.vars - , timeout = - args.timeout - , exitcode = - args.runExitcode - , otherwd = - args.runwd - } - ] - , verbose = - True - , cleaning = - True - , workdir = - "./_output" - , pre = - [] : List Text - , post = - [] : List Text - } - : types.Config - - let makeExtended = - λ(args : MakeBaseArg) - → λ(cmds : List types.Cmd) - → let b = makeBase args in b ⫽ { cmds = b.cmds # cmds } - - let OptionalSleep = < Cmd : Text | Sleep : {} > - - let FilterTestArgs = - { manifestname : - Text - , filter : - Text - , cmd : - Text - , args : - List Text - , vars : - List types.EnvVar - , passvars : - List Text - , cmdavoids : - List Text - , isTest : - Bool - , timeout : - Optional Natural - , powercap : - Powercap - } - - let emptyFilterTestArgs = - λ(filter : Text) - → λ(cmd : Text) - → { cmd = - cmd - , manifestname = - "perfwrap.yml" - , filter = - filter - , args = - [] : List Text - , vars = - values.emptyVars - , passvars = - [] : List Text - , cmdavoids = - [] : List Text - , isTest = - False - , timeout = - [] : Optional Natural - , powercap = - < NoCap = {=} | Cap : Text > - } - : FilterTestArgs - - let appTest = - λ(args : FilterTestArgs) - → let cn = "testContainer" - - in makeExtended - { manifest = - manifestDir - ++ ( if args.isTest - - then args.manifestname - - else "parallel.yml" - ) - , containerName = - cn - , cmd = - args.cmd - , args = - args.args - , verbose = - True - , singularity = - False - , cmdwants = - [] : List Text - , cmdavoids = - args.cmdavoids - , vars = - args.vars - , passvars = - args.passvars - , timeout = - args.timeout - , runwd = - [] : Optional Text - , runExitcode = - [] : Optional Integer - , powercap = - args.powercap - } - [ let b = - values.emptyCmd - { name = - "nrm" - , outfile = - "nrmlisten.out" - , errfile = - "nrmlisten.err" - } - - in b - ⫽ { args = - [ "listen", "-u", cn, "--filter", args.filter ] - , out = - b.out - ⫽ { filecheck = - values.emptyCheck - ⫽ { wants = - if args.isTest - - then [ args.filter ] - - else [] : List Text - } - } - } - ] - - let ProgressAppTestArg = - { cmd : - Text - , args : - List Text - , vars : - List types.EnvVar - , passvars : - List Text - , cmdavoids : - List Text - , isTest : - Bool - , timeout : - Optional Natural - , powercap : - Powercap - } - - let emptyProgressAppTestArg = - λ(cmd : Text) - → λ(args : List Text) - → { cmd = - cmd - , args = - args - , vars = - [] : List types.EnvVar - , passvars = - [] : List Text - , cmdavoids = - [] : List Text - , isTest = - False - , timeout = - [] : Optional Natural - , powercap = - < NoCap = {=} | Cap : Text > - } - : ProgressAppTestArg - - let progressAppTest = - λ(args : ProgressAppTestArg) - → appTest - ( emptyFilterTestArgs "progress" args.cmd - ⫽ { args = - args.args - , manifestname = - "basic.yml" - , vars = - args.vars - , passvars = - args.passvars - , cmdavoids = - args.cmdavoids - , isTest = - args.isTest - , timeout = - args.timeout - , powercap = - args.powercap - } - ) - - let mkListen = - λ(cn : Text) - → λ(filter : Text) - → let b = - values.emptyCmd - { name = - "nrm" - , outfile = - filter ++ ".out" - , errfile = - filter ++ ".err" - } - - in b ⫽ { args = [ "listen", "-u", cn, "--filter", filter ] } - - let powerexpeCmds = - [ mkListen "testContainer" "power" - , mkListen "testContainer" "performance" - , mkListen "testContainer" "control" - ] : List types.Cmd - - let extendApp = - λ(c : types.Config) - → λ(isTest : Bool) - → if isTest then c else c ⫽ { cmds = c.cmds # powerexpeCmds } - - in { values = - values - , emptyMakeBaseArg = - emptyMakeBaseArg - , makeBase = - makeBase - , makeExtended = - makeExtended - , appTest = - appTest - , progressAppTest = - progressAppTest - , emptyFilterTestArgs = - emptyFilterTestArgs - , qmcPackDir = - qmcPackDir - , openmcDir = - openmcDir - , lammpsDir = - lammpsDir - , manifestDir = - manifestDir - , emptyProgressAppTestArg = - emptyProgressAppTestArg - , powerexpeCmds = - powerexpeCmds - , extendApp = - extendApp - } diff --git a/dhrun/replace_golden.sh b/dhrun/replace_golden.sh new file mode 100644 index 0000000000000000000000000000000000000000..e47afd4d3405a228842f0d515dc8001472b2a7ef --- /dev/null +++ b/dhrun/replace_golden.sh @@ -0,0 +1,16 @@ +print_golden () { + dhrun print <<< "let a = ./all-tests.dh \".\" \".\" True in a.${1}" > golden/${1}.yaml +} + +print_golden "run" +print_golden "pwd" +print_golden "exitcode" +print_golden "hello" +print_golden "listen" +print_golden "power" +print_golden "performance" +print_golden "qmcpack" +print_golden "openmc" +print_golden "lammps" +print_golden "amg" +print_golden "stream" diff --git a/dhrun/assets/H.BFD.xml b/dhrun/test_assets/H.BFD.xml similarity index 100% rename from dhrun/assets/H.BFD.xml rename to dhrun/test_assets/H.BFD.xml diff --git a/dhrun/assets/H2O.HF.wfs.xml b/dhrun/test_assets/H2O.HF.wfs.xml similarity index 100% rename from dhrun/assets/H2O.HF.wfs.xml rename to dhrun/test_assets/H2O.HF.wfs.xml diff --git a/dhrun/assets/O.BFD.xml b/dhrun/test_assets/O.BFD.xml similarity index 100% rename from dhrun/assets/O.BFD.xml rename to dhrun/test_assets/O.BFD.xml diff --git a/dhrun/assets/in.lj b/dhrun/test_assets/in.lj similarity index 100% rename from dhrun/assets/in.lj rename to dhrun/test_assets/in.lj diff --git a/dhrun/assets/modified.lj b/dhrun/test_assets/modified.lj similarity index 100% rename from dhrun/assets/modified.lj rename to dhrun/test_assets/modified.lj diff --git a/dhrun/assets/openmc/assembly.tar.gz b/dhrun/test_assets/openmc/assembly.tar.gz similarity index 100% rename from dhrun/assets/openmc/assembly.tar.gz rename to dhrun/test_assets/openmc/assembly.tar.gz diff --git a/dhrun/assets/openmc/geometry.xml b/dhrun/test_assets/openmc/geometry.xml similarity index 100% rename from dhrun/assets/openmc/geometry.xml rename to dhrun/test_assets/openmc/geometry.xml diff --git a/dhrun/assets/openmc/materials.xml b/dhrun/test_assets/openmc/materials.xml similarity index 100% rename from dhrun/assets/openmc/materials.xml rename to dhrun/test_assets/openmc/materials.xml diff --git a/dhrun/assets/openmc/plots.xml b/dhrun/test_assets/openmc/plots.xml similarity index 100% rename from dhrun/assets/openmc/plots.xml rename to dhrun/test_assets/openmc/plots.xml diff --git a/dhrun/assets/openmc/settings.xml b/dhrun/test_assets/openmc/settings.xml similarity index 100% rename from dhrun/assets/openmc/settings.xml rename to dhrun/test_assets/openmc/settings.xml diff --git a/dhrun/assets/openmc/tallies.xml b/dhrun/test_assets/openmc/tallies.xml similarity index 100% rename from dhrun/assets/openmc/tallies.xml rename to dhrun/test_assets/openmc/tallies.xml diff --git a/dhrun/assets/simple-H2O.xml b/dhrun/test_assets/simple-H2O.xml similarity index 100% rename from dhrun/assets/simple-H2O.xml rename to dhrun/test_assets/simple-H2O.xml diff --git a/gitlab-ci/integration.yml b/gitlab-ci/integration.yml index 95b63cece4d390c816b5e41876fe0db19e8a0197..bb2f8e9eeaaa64f24b44ab974412b97a91252e2e 100644 --- a/gitlab-ci/integration.yml +++ b/gitlab-ci/integration.yml @@ -30,6 +30,11 @@ testHello: script: - "argonix test hello --argopkgs $ARGOPKGS $EXTRA --verbose" +testList: + extends: .test + script: + - "argonix test list --argopkgs $ARGOPKGS $EXTRA --verbose" + testListen: extends: .test script: diff --git a/pkgs/default.nix b/pkgs/default.nix index f9aeaddeb37e678bac7843231d5cf05e142f8d89..ba61b2b13d52c4028ec254071d91cd592329de76 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -63,7 +63,7 @@ let }; numabench = callPackage ./numabench {src=numabench-src; hwloc = hwloc2;}; excit = callPackage ./excit {src=excit-src;}; - nrm = (callPackage ./nrm {src=nrm-src;}).overrideAttrs (o:{ + nrm = (callPackage ./nrm { src=nrm-src;}).overrideAttrs (o:{ installPhase=o.installPhase+'' mkdir -p $out/share cp -r nrm/schemas $out/lib/python2.7/site-packages/nrm/ @@ -178,7 +178,7 @@ let candlePkgs = import pkgs.path { overlays = [ candleOverlay ] ; }; - candle = callCandlePackage ./candle {src = candle-src; nrm= nrm;}; + candle = callCandlePackage ./candle {src = candle-src; nrm = nrm;}; # data (static, non source overridable via arguments) openmc-data = fetched openmc/data.json; @@ -436,17 +436,12 @@ let installPhase = '' mkdir -p $out cp -r $src/* $out - substituteInPlace $out/assets/simple-H2O.xml --replace \ - H2O.HF.wfs.xml $out/assets/H2O.HF.wfs.xml - substituteInPlace $out/assets/simple-H2O.xml --replace \ - O.BFD.xml $out/assets/O.BFD.xml - substituteInPlace $out/assets/simple-H2O.xml --replace \ - H.BFD.xml $out/assets/H.BFD.xml - substituteInPlace $out/lib.dh --replace \ - "dataDir = \"./\"" "dataDir = \"$out/\"" - substituteInPlace $out/lib.dh --replace \ - "https://xgitlab.cels.anl.gov/argo/dhrun/raw/master/" "./" - ln -s ${dhrun}/share/resources $out/resources + substituteInPlace $out/test_assets/simple-H2O.xml --replace \ + H2O.HF.wfs.xml $out/test_assets/H2O.HF.wfs.xml + substituteInPlace $out/test_assets/simple-H2O.xml --replace \ + O.BFD.xml $out/test_assets/O.BFD.xml + substituteInPlace $out/test_assets/simple-H2O.xml --replace \ + H.BFD.xml $out/test_assets/H.BFD.xml ''; unpackPhase = "true"; }; @@ -454,7 +449,7 @@ let doDhrun = dhallcall: test.overrideAttrs (old:{ buildPhase = '' dhrun run <<< 'let all = ${dhrunTestConfigLayer}/all-tests.dh - "${dhrunTestConfigLayer}/" "${nrm}/share/examples/" in all.${dhallcall}' + "${dhrunTestConfigLayer}/" "${nrm}/share/examples/" True in all.${dhallcall}' ''; installPhase = '' mkdir -p $out @@ -471,13 +466,12 @@ let __noChroot = true; # the test needs OS singularity installation so we disable sanboxing here. }); - doDhrunApp = app : doDhrun "${app} True < NoCap = {=} | Cap : Text >"; - testSTREAM = addBI (doDhrunApp "stream") stream; - testAMG = addBI (doDhrunApp "amg") amg; - testOpenMC = (addBI (doDhrunApp "openmc") openmc).overrideAttrs + testSTREAM = addBI (doDhrun "stream") stream; + testAMG = addBI (doDhrun "amg") amg; + testOpenMC = (addBI (doDhrun "openmc") openmc).overrideAttrs (old:{ OPENMC_CROSS_SECTIONS = "${openmc-data}/cross_sections.xml"; }); - testLAMMPS = addBI (doDhrunApp "lammps") lammps; - testQMCPack = addBI (doDhrunApp "qmcpack") qmcpack ; + testLAMMPS = addBI (doDhrun "lammps") lammps; + testQMCPack = addBI (doDhrun "qmcpack") qmcpack ; testAll = (doDhrun "hello").overrideAttrs (old:{ diff --git a/pkgs/nrm/default.nix b/pkgs/nrm/default.nix index 423185c57d31db0ec428818839d114d60c54ed1d..b64bbf899f59416a8ffdc479c4f7bf6695d7c189 100644 --- a/pkgs/nrm/default.nix +++ b/pkgs/nrm/default.nix @@ -15,10 +15,4 @@ pythonPackages.buildPythonPackage { pythonPackages.warlock containers ]; - - #checkInputs = [ pythonPackages.pytest ]; - - #checkPhase = '' - #py.test $out - #''; }