Commit d4a2f6e6 authored by Valentin Reis's avatar Valentin Reis
Browse files

adding a few dhrun runs.

parent 7cf867b4
Pipeline #6377 passed with stages
in 6 minutes and 35 seconds
let lib = ./package.dh
in let message = "HelloWorld"
in let cn = "testContainer"
in { hello =
lib.makeBase
{ manifest =
lib.argopkgsManifestDirPath ++ "basic.json"
, cmd =
"echo"
, containerName =
cn
, args =
[ message ]
, verbose =
True
, cmdwants =
[ message ]
}
, listen =
lib.makeExtended
{ manifest =
lib.argopkgsManifestDirPath ++ "basic.json"
, containerName =
cn
, cmd =
"sleep"
, args =
[ "1" ]
, verbose =
True
, cmdwants =
[] : List Text
}
[ lib.values.emptyCmd
{ name =
"cmd"
, outfile =
"cmdlisten.out"
, errfile =
"cmdlisten.err"
}
⫽ { args = [ "listen", "-u", cn ] }
]
, power =
lib.appTest (lib.emptyFilterTestArgs "power")
, performance =
lib.appTest (lib.emptyFilterTestArgs "performance")
, qmcPack =
lib.appTest
( lib.emptyFilterTestArgs "progress"
⫽ { cmd =
< Cmd = "qmcpack" | Sleep : {} >
, args =
[ "-n", "24", "qmcpack", lib.qmcPackDir ++ "/simple-H2O.xml" ]
}
)
}
{
"acKind": "ImageManifest",
"acVersion": "0.6.0",
"name": "test",
"app": {
"isolators": [
{
"name": "argo/scheduler",
"value": {
"policy": "SCHED_OTHER",
"priority": "0"
}
},
{
"name": "argo/container",
"value": {
"cpus": "2",
"mems": "1"
}
},
{
"name": "argo/perfwrapper",
"value": {
"enabled": "0"
}
},
{
"name": "argo/power",
"value": {
"enabled": "0",
"profile": "0",
"policy": "NONE",
"damper": "0.1",
"slowdown": "1.1"
}
},
{
"name": "argo/monitoring",
"value": {
"enabled": "1",
"ratelimit": "1000000000"
}
}
]
}
}
{
"acKind": "ImageManifest",
"acVersion": "0.6.0",
"name": "test",
"app": {
"isolators": [
{
"name": "argo/scheduler",
"value": {
"policy": "SCHED_OTHER",
"priority": "0"
}
},
{
"name": "argo/container",
"value": {
"cpus": "24",
"mems": "2"
}
},
{
"name": "argo/perfwrapper",
"value": {
"enabled": "1"
}
},
{
"name": "argo/power",
"value": {
"enabled": "0",
"profile": "0",
"policy": "NONE",
"damper": "0.1",
"slowdown": "1.1"
}
},
{
"name": "argo/monitoring",
"value": {
"enabled": "1",
"ratelimit": "1000000000"
}
}
]
}
}
{
"acKind": "ImageManifest",
"acVersion": "0.6.0",
"name": "test",
"app": {
"isolators": [
{
"name": "argo/scheduler",
"value": {
"policy": "SCHED_OTHER",
"priority": "0"
}
},
{
"name": "argo/container",
"value": {
"cpus": "1",
"mems": "1"
}
},
{
"name": "argo/perfwrapper",
"value": {
"enabled": "1"
}
},
{
"name": "argo/power",
"value": {
"enabled": "0",
"profile": "0",
"policy": "NONE",
"damper": "0.1",
"slowdown": "1.1"
}
},
{
"name": "argo/monitoring",
"value": {
"enabled": "1",
"ratelimit": "1000000000"
}
}
]
}
}
let values = ./../../dhrun/resources/package.dh
in let types = ./../../dhrun/resources/types.dh
in let argopkgsManifestDirPath =
"/home/fre/workspace/argopkgs/dhrun/manifests/"
in let qmcPackDir = "toto"
in let basicCommand =
λ(args : { name : Text, outprefix : Text, outwants : List Text })
→ { name =
args.name
, args =
[] : List Text
, out =
{ filename =
"${args.outprefix}.out"
, filecheck =
values.emptyCheck ⫽ { wants = args.outwants }
}
, err =
{ filename =
"${args.outprefix}.err"
, filecheck =
values.emptyCheck
}
, postchecks =
[] : List types.FileCheck
, vars =
values.emptyVars
, passvars =
[ "PATH" ]
}
in let MakeBaseArgs =
{ manifest :
Text
, cmd :
Text
, containerName :
Text
, args :
List Text
, verbose :
Bool
, cmdwants :
List Text
}
in let addVerbose = λ(v : Bool) → if v then [ "--verbose" ] else [] : List Text
in let makeBase =
λ(args : MakeBaseArgs)
→ { cmds =
[ basicCommand
{ name =
"daemon"
, outprefix =
"daemon"
, outwants =
[] : List Text
}
⫽ { args =
addVerbose args.verbose
, vars =
[ { varname =
"ARGO_NODEOS_CONFIG"
, value =
"/tmp/argo_nodeos_config"
}
]
}
, basicCommand
{ name =
"cmd"
, outprefix =
"cmdrun"
, outwants =
args.cmdwants
}
⫽ { args =
[ "run"
, "-u"
, args.containerName
, args.manifest
, args.cmd
]
# args.args
, passvars =
[ "PATH" ]
}
]
, verbosity =
values.Normal
, workdir =
"./_dhrun_out"
, pre =
[] : List Text
, post =
[] : List Text
}
: types.Config
in let makeExtended =
λ(args : MakeBaseArgs)
→ λ(cmds : List types.Cmd)
→ let b = makeBase args in b ⫽ { cmds = b.cmds # cmds }
in let OptionalSleep = < Cmd : Text | Sleep : {} >
in let FilterTestArgs =
{ filter : Text, cmd : OptionalSleep, args : List Text }
in let emptyFilterTestArgs =
λ(filter : Text)
→ { filter =
filter
, cmd =
< Sleep = {=} | Cmd : Text >
, args =
[] : List Text
}
in let sleepArgs =
λ(l : List Text)
→ if Natural/isZero (List/length Text l) then [ "15" ] else l
in let sleep =
λ(x : OptionalSleep)
→ let handlers =
{ Sleep = λ(_ : {}) → "cmd", Cmd = λ(b : Text) → b }
in merge handlers x
in let appTest =
λ(args : FilterTestArgs)
→ let cn = "testContainer"
in makeExtended
{ manifest =
argopkgsManifestDirPath ++ "perfwrap.json"
, containerName =
cn
, cmd =
sleep args.cmd
, args =
sleepArgs args.args
, verbose =
True
, cmdwants =
[] : List Text
}
[ let b =
values.emptyCmd
{ name =
"cmd"
, outfile =
"cmdlisten.out"
, errfile =
"cmdlisten.err"
}
in b
⫽ { args =
[ "listen", "-u", cn, "--filter", args.filter ]
, out =
b.out
⫽ { filecheck =
values.emptyCheck
⫽ { wants = [ args.filter ] }
}
}
]
in { values =
values
, makeBase =
makeBase
, makeExtended =
makeExtended
, appTest =
appTest
, emptyFilterTestArgs =
emptyFilterTestArgs
, qmcPackDir =
qmcPackDir
, argopkgsManifestDirPath =
argopkgsManifestDirPath
}
let all = ./all.dh in all.hello
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment