Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
argo
argopkgs
Commits
e8bc2391
Commit
e8bc2391
authored
May 01, 2019
by
Valentin Reis
Browse files
minor refactor dhrun code
parent
775efc99
Pipeline
#6633
passed with stages
in 10 minutes and 57 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
dhrun/all-tests.dh
View file @
e8bc2391
...
...
@@ -145,7 +145,7 @@ in { apps =
apps
, hello =
lib.makeBase
( lib.emptyMakeBaseArg
s
"echo" basicManifest cn
( lib.emptyMakeBaseArg "echo" basicManifest cn
⫽ { args =
[ message ]
, verbose =
...
...
@@ -160,7 +160,7 @@ in { apps =
)
, listen =
lib.makeExtended
( lib.emptyMakeBaseArg
s
"sleep" basicManifest cn
( lib.emptyMakeBaseArg "sleep" basicManifest cn
⫽ { args =
[ "1" ]
, verbose =
...
...
@@ -207,14 +207,4 @@ in { apps =
"perfwrap.json"
}
)
, stream =
apps.stream True < NoCap = {=} | Cap : Text >
, openmc =
apps.openmc True < NoCap = {=} | Cap : Text >
, lammps =
apps.lammps True < NoCap = {=} | Cap : Text >
, qmcpack =
apps.qmcpack True < NoCap = {=} | Cap : Text >
, amg =
apps.amg True < NoCap = {=} | Cap : Text >
}
dhrun/lib.dh
View file @
e8bc2391
...
...
@@ -56,7 +56,7 @@ let basicCommand =
let Powercap = < Cap : Text | NoCap : {} >
let MakeBaseArg
s
=
let MakeBaseArg =
{ manifest :
Text
, cmd :
...
...
@@ -81,7 +81,7 @@ let MakeBaseArgs =
Powercap
}
let emptyMakeBaseArg
s
=
let emptyMakeBaseArg =
λ(cmd : Text)
→ λ(manifest : Text)
→ λ(containerName : Text)
...
...
@@ -108,7 +108,7 @@ let emptyMakeBaseArgs =
, powercap =
< NoCap = {=} | Cap : Text >
}
: MakeBaseArg
s
: MakeBaseArg
let addVerbose = λ(v : Bool) → if v then [ "--verbose" ] else [] : List Text
...
...
@@ -123,7 +123,7 @@ let addPowercap =
p
let makeBase =
λ(args : MakeBaseArg
s
)
λ(args : MakeBaseArg)
→ { cmds =
[ basicCommand
{ name =
...
...
@@ -188,7 +188,7 @@ let makeBase =
: types.Config
let makeExtended =
λ(args : MakeBaseArg
s
)
λ(args : MakeBaseArg)
→ λ(cmds : List types.Cmd)
→ let b = makeBase args in b ⫽ { cmds = b.cmds # cmds }
...
...
@@ -392,8 +392,8 @@ let extendApp =
in { values =
values
, emptyMakeBaseArg
s
=
emptyMakeBaseArg
s
, emptyMakeBaseArg =
emptyMakeBaseArg
, makeBase =
makeBase
, makeExtended =
...
...
@@ -418,4 +418,4 @@ in { values =
powerexpeCmds
, extendApp =
extendApp
}
\ No newline at end of file
}
pkgs/default.nix
View file @
e8bc2391
...
...
@@ -349,14 +349,7 @@ let
unpackPhase
=
"true"
;
};
doDhrun
=
drv
:
app
:
let
dhrscript
=
pkgs
.
writeText
"test.dhall"
''
let all =
${
dhrunSpecs
}
/all-tests.dh
in all.apps.
${
app
}
True < NoCap = {=} | Cap : Text >
''
;
in
drv
.
overrideAttrs
(
old
:{
doDhrun
=
dhrscript
:
test
.
overrideAttrs
(
old
:{
buildPhase
=
''
cat
${
dhrscript
}
|\
dhall resolve |\
...
...
@@ -377,23 +370,48 @@ let
''
;
});
testHello
=
doDhrun
test
"hello"
;
testListen
=
doDhrun
test
"listen"
;
testPerfwrapper
=
doDhrun
test
"performance"
;
testPower
=
doDhrun
test
"power"
;
testSTREAM
=
doDhrun
(
test
.
overrideAttrs
(
old
:{
buildInputs
=
old
.
buildInputs
++
[
stream
];}))
"stream"
;
testAMG
=
doDhrun
(
test
.
overrideAttrs
(
old
:{
buildInputs
=
old
.
buildInputs
++
[
amg
];}))
"amg"
;
testOpenMC
=
doDhrun
(
test
.
overrideAttrs
appDhrunScript
=
app
:
pkgs
.
writeText
"test.dhall"
''
let all =
${
dhrunSpecs
}
/all-tests.dh
in all.apps.
${
app
}
True < NoCap = {=} | Cap : Text >
''
;
doDhrunApp
=
app
:
let
dhrunscript
=
pkgs
.
writeText
"test.dhall"
''
let all =
${
dhrunSpecs
}
/all-tests.dh
in all.apps.
${
app
}
True < NoCap = {=} | Cap : Text >
''
;
in
doDhrun
dhrunscript
;
doDhrunKey
=
key
:
let
dhrunscript
=
pkgs
.
writeText
"test.dhall"
''
let all =
${
dhrunSpecs
}
/all-tests.dh
in all.
${
key
}
''
;
in
doDhrun
dhrunscript
;
testHello
=
doDhrunKey
"hello"
;
testListen
=
doDhrunKey
"listen"
;
testPerfwrapper
=
doDhrunKey
"performance"
;
testPower
=
doDhrunKey
"power"
;
testSTREAM
=
(
doDhrunApp
"stream"
)
.
overrideAttrs
(
old
:{
buildInputs
=
old
.
buildInputs
++
[
stream
];});
testAMG
=
(
doDhrunApp
"amg"
)
.
overrideAttrs
(
old
:{
buildInputs
=
old
.
buildInputs
++
[
amg
];});
testOpenMC
=
(
doDhrunApp
"openmc"
)
.
overrideAttrs
(
old
:{
buildInputs
=
old
.
buildInputs
++
[
openmc
];
OPENMC_CROSS_SECTIONS
=
"
${
openmc-data
}
/cross_sections.xml"
;
}))
"openmc"
;
testLAMMPS
=
doDhrun
(
test
.
overrideAttrs
(
old
:{
buildInputs
=
old
.
buildInputs
++
[
lammps
];}))
"lammps"
;
testQMCPack
=
doDhrun
(
test
.
overrideAttrs
(
old
:{
buildInputs
=
old
.
buildInputs
++
[
qmcpack
];}))
"qmcpack"
;
testAll
=
doDhrun
(
test
.
overrideAttrs
});
testLAMMPS
=
(
doDhrunApp
"lammps"
)
.
overrideAttrs
(
old
:{
buildInputs
=
old
.
buildInputs
++
[
lammps
];});
testQMCPack
=
(
doDhrunApp
"qmcpack"
)
.
overrideAttrs
(
old
:{
buildInputs
=
old
.
buildInputs
++
[
qmcpack
];});
testAll
=
test
.
overrideAttrs
(
old
:{
buildInputs
=
old
.
buildInputs
++
[
lammps
...
...
@@ -403,7 +421,7 @@ let
amg
openmc-data
];
OPENMC_CROSS_SECTIONS
=
"
${
openmc-data
}
/cross_sections.xml"
;})
)
"tests"
;
OPENMC_CROSS_SECTIONS
=
"
${
openmc-data
}
/cross_sections.xml"
;});
powerexpe
=
testAll
.
overrideAttrs
(
old
:{
name
=
"power-experiments"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment