Commit 698ca2f3 authored by Valentin Reis's avatar Valentin Reis

Merge branch 'dhall-refact' into 'master'

Dhall refactor

See merge request !6
parents 1c44133c afb64947
Pipeline #7701 failed with stages
in 1 minute and 45 seconds
#!/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."
This diff is collapsed.
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
}
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 }
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
}
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
}
{ basic =
./basicCommand.dh
, nrmd =
./nrmd.dh
, run =
./run.dh
, listen =
./listen.dh
, list =
./list.dh
}
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
}
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
}
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"
let Check = { avoids : List Text, wants : List Text }
in Check
{ avoids = [] : List Text, wants = [] : List Text }
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
}
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
}
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
}
let EnvVar = { varname : Text, value : Text } in EnvVar
let EnvVar = ./EnvVar.dh
in [] : List EnvVar
let Check = ./../Check/Check.dh
let FileCheck = { filename : Text, filecheck : Check }
in FileCheck
let Normal = < Normal = {=} | Verbose : {} > in Normal
let Verbose = < Verbose = {=} | Normal : {} > in Verbose
let Verbosity = < Normal : {} | Verbose : {} > in Verbosity
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
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
}
}
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
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
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