Commit c6aee253 authored by Valentin Reis's avatar Valentin Reis

update for singularity tests

parent 71a4ddf5
Pipeline #7417 canceled with stages
in 9 minutes and 14 seconds
No preview for this file type
...@@ -6,8 +6,7 @@ let ...@@ -6,8 +6,7 @@ let
argopkgs = import ../pkgs {}; argopkgs = import ../pkgs {};
hydraSrc = builtins.fetchTarball https://github.com/nixos/hydra/archive/master.tar.gz; hydraSrc = builtins.fetchTarball https://github.com/nixos/hydra/archive/master.tar.gz;
argomodules = import ../modules/module-list.nix; argomodules = import ../modules/module-list.nix;
mkChameleonRunner = ip: name: mkChameleonRunner = ip: name: { ... }:
{ ... }:
{ {
deployment.targetEnv = "none"; deployment.targetEnv = "none";
deployment.targetHost = ip; deployment.targetHost = ip;
...@@ -71,6 +70,31 @@ let ...@@ -71,6 +70,31 @@ let
users.extraUsers.root.openssh.authorizedKeys.keys = [ (pkgs.lib.readFile ./keys/id_buildfarm.pub)]; users.extraUsers.root.openssh.authorizedKeys.keys = [ (pkgs.lib.readFile ./keys/id_buildfarm.pub)];
users.extraUsers.fre.openssh.authorizedKeys.keys = [ (pkgs.lib.readFile ./keys/id_buildfarm.pub)]; users.extraUsers.fre.openssh.authorizedKeys.keys = [ (pkgs.lib.readFile ./keys/id_buildfarm.pub)];
}; };
mkBigChameleonRunner = ip: name: a@{...}:
((mkChameleonRunner ip name a)//
{
virtualisation.docker = {
enable = true;
};
#networking.firewall.enable = false;
#systemd.services."rkt-afl" = {
#description = "Airflow";
#wantedBy = [ "multi-user.target" ];
#serviceConfig = {
#Slice = "machine.slice";
#ExecStart = ''\
#${pkgs.rkt}/bin/rkt run --insecure-options=image \
#--port=8080-tcp:8080 \
#--volume=volume-root-airflow,kind=host,source=/var/airflow,readOnly=false \
#docker://puckel/docker-airflow \
#webserver
#'';
#KillMode = "mixed";
#Restart = "always";
#};
#};
});
in in
{ {
network.description = "argo-ci"; network.description = "argo-ci";
...@@ -80,7 +104,7 @@ in ...@@ -80,7 +104,7 @@ in
gitlab-runner-3 = mkChameleonRunner "129.114.110.3" "chameleon-129.114.110.3"; gitlab-runner-3 = mkChameleonRunner "129.114.110.3" "chameleon-129.114.110.3";
gitlab-runner-2 = mkChameleonRunner "129.114.111.116" "chameleon-129.114.111.116"; gitlab-runner-2 = mkChameleonRunner "129.114.111.116" "chameleon-129.114.111.116";
gitlab-runner-1 = mkChameleonRunner "129.114.33.201" "chameleon-129.114.33.201"; gitlab-runner-1 = mkChameleonRunner "129.114.33.201" "chameleon-129.114.33.201";
gitlab-runner-0 = mkChameleonRunner "129.114.111.64" "chameleon-129.114.111.64"; gitlab-runner-0 = mkBigChameleonRunner "129.114.111.64" "chameleon-129.114.111.64";
gitlab-runner-physical = gitlab-runner-physical =
{ ... }: { ... }:
...@@ -88,6 +112,11 @@ in ...@@ -88,6 +112,11 @@ in
deployment.targetEnv = "none"; deployment.targetEnv = "none";
deployment.targetHost = "140.221.10.9"; deployment.targetHost = "140.221.10.9";
environment.argo.singularity ={
enable = true;
package = argopkgs.singularity;
};
imports = [ ./gitlab-runner.nix]; imports = [ ./gitlab-runner.nix];
time.timeZone = "America/Chicago"; time.timeZone = "America/Chicago";
......
λ(dataDir : Text) λ(dataDir : Text)
→ let lib = ./lib.dh dataDir → let lib = ./lib.dh dataDir
let message = "HelloWorld" let message = "HelloWorld"
let cn = "testContainer" let cn = "testContainer"
let basicManifest = lib.manifestDir ++ "basic.json" let basicManifest = lib.manifestDir ++ "basic.json"
let singularityManifest = lib.manifestDir ++ "singularity.json" let singularityManifest = lib.manifestDir ++ "singularity.json"
let argIfTest = let argIfTest =
λ(isTest : Bool) λ(isTest : Bool)
→ { isTest = → { isTest =
isTest isTest
, timeout = , timeout =
if isTest if isTest
then [ 600 ] : Optional Natural then [ 600 ] : Optional Natural
else [] : Optional Natural else [] : Optional Natural
} }
let Powercap = < Cap : Text | NoCap : {} > let Powercap = < Cap : Text | NoCap : {} >
in { run-singularity = in { run-singularity =
lib.makeBase lib.makeBase
( lib.emptyMakeBaseArg "echo" singularityManifest cn ( lib.emptyMakeBaseArg "echo" singularityManifest cn
...@@ -72,6 +72,23 @@ ...@@ -72,6 +72,23 @@
[ "toto" ] : Optional Text [ "toto" ] : 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
}
)
, hello = , hello =
lib.makeBase lib.makeBase
( lib.emptyMakeBaseArg "echo" basicManifest cn ( lib.emptyMakeBaseArg "echo" basicManifest cn
......
λ(dataDir : Text) λ(dataDir : Text)
→ let values = → let values =
https://xgitlab.cels.anl.gov/argo/dhrun/raw/master/resources/package.dh https://xgitlab.cels.anl.gov/argo/dhrun/raw/master/resources/package.dh
let types = let types =
https://xgitlab.cels.anl.gov/argo/dhrun/raw/master/resources/types.dh https://xgitlab.cels.anl.gov/argo/dhrun/raw/master/resources/types.dh
let manifestDir = dataDir ++ "manifests/" let manifestDir = dataDir ++ "manifests/"
let assetDir = dataDir ++ "assets/" let assetDir = dataDir ++ "assets/"
let openmcDir = assetDir ++ "openmc/" let openmcDir = assetDir ++ "openmc/"
let lammpsDir = assetDir let lammpsDir = assetDir
let qmcPackDir = assetDir let qmcPackDir = assetDir
let basicCommand = let basicCommand =
λ ( args λ ( args
: { name : : { name :
...@@ -51,10 +51,14 @@ ...@@ -51,10 +51,14 @@
[ "PATH" ] [ "PATH" ]
, timeout = , timeout =
[] : Optional Natural [] : Optional Natural
, otherwd =
[] : Optional Text
, exitcode =
[] : Optional Integer
} }
let Powercap = < Cap : Text | NoCap : {} > let Powercap = < Cap : Text | NoCap : {} >
let MakeBaseArg = let MakeBaseArg =
{ manifest : { manifest :
Text Text
...@@ -76,6 +80,8 @@ ...@@ -76,6 +80,8 @@
List types.EnvVar List types.EnvVar
, timeout : , timeout :
Optional Natural Optional Natural
, runExitcode :
Optional Integer
, passvars : , passvars :
List Text List Text
, powercap : , powercap :
...@@ -83,7 +89,7 @@ ...@@ -83,7 +89,7 @@
, runwd : , runwd :
Optional Text Optional Text
} }
let emptyMakeBaseArg = let emptyMakeBaseArg =
λ(cmd : Text) λ(cmd : Text)
→ λ(manifest : Text) → λ(manifest : Text)
...@@ -108,6 +114,8 @@ ...@@ -108,6 +114,8 @@
values.emptyVars values.emptyVars
, timeout = , timeout =
[] : Optional Natural [] : Optional Natural
, runExitcode =
[] : Optional Integer
, passvars = , passvars =
[] : List Text [] : List Text
, powercap = , powercap =
...@@ -116,13 +124,13 @@ ...@@ -116,13 +124,13 @@
[] : Optional Text [] : Optional Text
} }
: MakeBaseArg : MakeBaseArg
let addVerbose = λ(v : Bool) → if v then [ "--verbose" ] else [] : List Text let addVerbose = λ(v : Bool) → if v then [ "--verbose" ] else [] : List Text
let addSingularity = let addSingularity =
λ(v : Bool) λ(v : Bool)
→ if v then [ "--container-runtime", "singularity" ] else [] : List Text → if v then [ "--container-runtime", "singularity" ] else [] : List Text
let addPowercap = let addPowercap =
λ(p : Powercap) λ(p : Powercap)
→ merge → merge
...@@ -132,7 +140,7 @@ ...@@ -132,7 +140,7 @@
λ(x : {}) → [] : List Text λ(x : {}) → [] : List Text
} }
p p
let makeBase = let makeBase =
λ(args : MakeBaseArg) λ(args : MakeBaseArg)
→ { cmds = → { cmds =
...@@ -158,8 +166,6 @@ ...@@ -158,8 +166,6 @@
"/tmp/argo_nodeos_config" "/tmp/argo_nodeos_config"
} }
] ]
, otherwd =
[] : Optional Text
} }
, let b = , let b =
basicCommand basicCommand
...@@ -172,7 +178,7 @@ ...@@ -172,7 +178,7 @@
, outavoids = , outavoids =
args.cmdavoids args.cmdavoids
} }
in b in b
⫽ { args = ⫽ { args =
[ "run" [ "run"
...@@ -188,6 +194,8 @@ ...@@ -188,6 +194,8 @@
args.vars args.vars
, timeout = , timeout =
args.timeout args.timeout
, exitcode =
args.runExitcode
, otherwd = , otherwd =
args.runwd args.runwd
} }
...@@ -204,14 +212,14 @@ ...@@ -204,14 +212,14 @@
[] : List Text [] : List Text
} }
: types.Config : types.Config
let makeExtended = let makeExtended =
λ(args : MakeBaseArg) λ(args : MakeBaseArg)
→ λ(cmds : List types.Cmd) → λ(cmds : List types.Cmd)
→ let b = makeBase args in b ⫽ { cmds = b.cmds # cmds } → let b = makeBase args in b ⫽ { cmds = b.cmds # cmds }
let OptionalSleep = < Cmd : Text | Sleep : {} > let OptionalSleep = < Cmd : Text | Sleep : {} >
let FilterTestArgs = let FilterTestArgs =
{ manifestname : { manifestname :
Text Text
...@@ -234,7 +242,7 @@ ...@@ -234,7 +242,7 @@
, powercap : , powercap :
Powercap Powercap
} }
let emptyFilterTestArgs = let emptyFilterTestArgs =
λ(filter : Text) λ(filter : Text)
→ λ(cmd : Text) → λ(cmd : Text)
...@@ -260,18 +268,18 @@ ...@@ -260,18 +268,18 @@
< NoCap = {=} | Cap : Text > < NoCap = {=} | Cap : Text >
} }
: FilterTestArgs : FilterTestArgs
let appTest = let appTest =
λ(args : FilterTestArgs) λ(args : FilterTestArgs)
→ let cn = "testContainer" → let cn = "testContainer"
in makeExtended in makeExtended
{ manifest = { manifest =
manifestDir manifestDir
++ ( if args.isTest ++ ( if args.isTest
then args.manifestname then args.manifestname
else "parallel.json" else "parallel.json"
) )
, containerName = , containerName =
...@@ -296,6 +304,8 @@ ...@@ -296,6 +304,8 @@
args.timeout args.timeout
, runwd = , runwd =
[] : Optional Text [] : Optional Text
, runExitcode =
[] : Optional Integer
, powercap = , powercap =
args.powercap args.powercap
} }
...@@ -308,7 +318,7 @@ ...@@ -308,7 +318,7 @@
, errfile = , errfile =
"nrmlisten.err" "nrmlisten.err"
} }
in b in b
⫽ { args = ⫽ { args =
[ "listen", "-u", cn, "--filter", args.filter ] [ "listen", "-u", cn, "--filter", args.filter ]
...@@ -318,15 +328,15 @@ ...@@ -318,15 +328,15 @@
values.emptyCheck values.emptyCheck
⫽ { wants = ⫽ { wants =
if args.isTest if args.isTest
then [ args.filter ] then [ args.filter ]
else [] : List Text else [] : List Text
} }
} }
} }
] ]
let ProgressAppTestArg = let ProgressAppTestArg =
{ cmd : { cmd :
Text Text
...@@ -345,7 +355,7 @@ ...@@ -345,7 +355,7 @@
, powercap : , powercap :
Powercap Powercap
} }
let emptyProgressAppTestArg = let emptyProgressAppTestArg =
λ(cmd : Text) λ(cmd : Text)
→ λ(args : List Text) → λ(args : List Text)
...@@ -367,7 +377,7 @@ ...@@ -367,7 +377,7 @@
< NoCap = {=} | Cap : Text > < NoCap = {=} | Cap : Text >
} }
: ProgressAppTestArg : ProgressAppTestArg
let progressAppTest = let progressAppTest =
λ(args : ProgressAppTestArg) λ(args : ProgressAppTestArg)
→ appTest → appTest
...@@ -390,7 +400,7 @@ ...@@ -390,7 +400,7 @@
args.powercap args.powercap
} }
) )
let mkListen = let mkListen =
λ(cn : Text) λ(cn : Text)
→ λ(filter : Text) → λ(filter : Text)
...@@ -403,20 +413,20 @@ ...@@ -403,20 +413,20 @@
, errfile = , errfile =
filter ++ ".err" filter ++ ".err"
} }
in b ⫽ { args = [ "listen", "-u", cn, "--filter", filter ] } in b ⫽ { args = [ "listen", "-u", cn, "--filter", filter ] }
let powerexpeCmds = let powerexpeCmds =
[ mkListen "testContainer" "power" [ mkListen "testContainer" "power"
, mkListen "testContainer" "performance" , mkListen "testContainer" "performance"
, mkListen "testContainer" "control" , mkListen "testContainer" "control"
] : List types.Cmd ] : List types.Cmd
let extendApp = let extendApp =
λ(c : types.Config) λ(c : types.Config)
→ λ(isTest : Bool) → λ(isTest : Bool)
→ if isTest then c else c ⫽ { cmds = c.cmds # powerexpeCmds } → if isTest then c else c ⫽ { cmds = c.cmds # powerexpeCmds }
in { values = in { values =
values values
, emptyMakeBaseArg = , emptyMakeBaseArg =
......
...@@ -54,3 +54,4 @@ testSingularity: ...@@ -54,3 +54,4 @@ testSingularity:
extends: .test extends: .test
script: script:
- "argonix build testSingularity --argopkgs $ARGOPKGS $EXTRA --verbose" - "argonix build testSingularity --argopkgs $ARGOPKGS $EXTRA --verbose"
- notknl
{ {
"url": "https://github.com/freuk/dhrun.git", "url": "https://github.com/freuk/dhrun.git",
"rev": "050991b7f2f1a885507d7cffadf61b06e0f61277", "rev": "d0ad28692d7071a1408d196d29b0c8e4303f8ca8",
"date": "2019-05-20T13:47:58-05:00", "date": "2019-05-21T10:33:48-05:00",
"sha256": "1ac1zz4isx9imjm5hr3flh7fgn8mdqibflb77kzyybz5fr9ifnh9", "sha256": "19dmxgh5lkwslg3hwr84nrbskhpn6qfmn6iidxnv6i8jkmv18zpk",
"fetchSubmodules": false "fetchSubmodules": false
} }
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