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
argopkgs = import ../pkgs {};
hydraSrc = builtins.fetchTarball https://github.com/nixos/hydra/archive/master.tar.gz;
argomodules = import ../modules/module-list.nix;
mkChameleonRunner = ip: name:
{ ... }:
mkChameleonRunner = ip: name: { ... }:
{
deployment.targetEnv = "none";
deployment.targetHost = ip;
......@@ -71,6 +70,31 @@ let
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)];
};
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
{
network.description = "argo-ci";
......@@ -80,7 +104,7 @@ in
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-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 =
{ ... }:
......@@ -88,6 +112,11 @@ in
deployment.targetEnv = "none";
deployment.targetHost = "140.221.10.9";
environment.argo.singularity ={
enable = true;
package = argopkgs.singularity;
};
imports = [ ./gitlab-runner.nix];
time.timeZone = "America/Chicago";
......
λ(dataDir : Text)
→ let lib = ./lib.dh dataDir
let message = "HelloWorld"
let cn = "testContainer"
let basicManifest = lib.manifestDir ++ "basic.json"
let singularityManifest = lib.manifestDir ++ "singularity.json"
let argIfTest =
λ(isTest : Bool)
→ { isTest =
isTest
, timeout =
if isTest
then [ 600 ] : Optional Natural
else [] : Optional Natural
}
let Powercap = < Cap : Text | NoCap : {} >
in { run-singularity =
lib.makeBase
( lib.emptyMakeBaseArg "echo" singularityManifest cn
......@@ -72,6 +72,23 @@
[ "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 =
lib.makeBase
( lib.emptyMakeBaseArg "echo" basicManifest cn
......
λ(dataDir : 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 manifestDir = dataDir ++ "manifests/"
let assetDir = dataDir ++ "assets/"
let openmcDir = assetDir ++ "openmc/"
let lammpsDir = assetDir
let qmcPackDir = assetDir
let basicCommand =
λ ( args
: { name :
......@@ -51,10 +51,14 @@
[ "PATH" ]
, timeout =
[] : Optional Natural
, otherwd =
[] : Optional Text
, exitcode =
[] : Optional Integer
}
let Powercap = < Cap : Text | NoCap : {} >
let MakeBaseArg =
{ manifest :
Text
......@@ -76,6 +80,8 @@
List types.EnvVar
, timeout :
Optional Natural
, runExitcode :
Optional Integer
, passvars :
List Text
, powercap :
......@@ -83,7 +89,7 @@
, runwd :
Optional Text
}
let emptyMakeBaseArg =
λ(cmd : Text)
→ λ(manifest : Text)
......@@ -108,6 +114,8 @@
values.emptyVars
, timeout =
[] : Optional Natural
, runExitcode =
[] : Optional Integer
, passvars =
[] : List Text
, powercap =
......@@ -116,13 +124,13 @@
[] : 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
......@@ -132,7 +140,7 @@
λ(x : {}) → [] : List Text
}
p
let makeBase =
λ(args : MakeBaseArg)
→ { cmds =
......@@ -158,8 +166,6 @@
"/tmp/argo_nodeos_config"
}
]
, otherwd =
[] : Optional Text
}
, let b =
basicCommand
......@@ -172,7 +178,7 @@
, outavoids =
args.cmdavoids
}
in b
⫽ { args =
[ "run"
......@@ -188,6 +194,8 @@
args.vars
, timeout =
args.timeout
, exitcode =
args.runExitcode
, otherwd =
args.runwd
}
......@@ -204,14 +212,14 @@
[] : 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
......@@ -234,7 +242,7 @@
, powercap :
Powercap
}
let emptyFilterTestArgs =
λ(filter : Text)
→ λ(cmd : Text)
......@@ -260,18 +268,18 @@
< NoCap = {=} | Cap : Text >
}
: FilterTestArgs
let appTest =
λ(args : FilterTestArgs)
→ let cn = "testContainer"
in makeExtended
{ manifest =
manifestDir
++ ( if args.isTest
then args.manifestname
else "parallel.json"
)
, containerName =
......@@ -296,6 +304,8 @@
args.timeout
, runwd =
[] : Optional Text
, runExitcode =
[] : Optional Integer
, powercap =
args.powercap
}
......@@ -308,7 +318,7 @@
, errfile =
"nrmlisten.err"
}
in b
⫽ { args =
[ "listen", "-u", cn, "--filter", args.filter ]
......@@ -318,15 +328,15 @@
values.emptyCheck
⫽ { wants =
if args.isTest
then [ args.filter ]
else [] : List Text
}
}
}
]
let ProgressAppTestArg =
{ cmd :
Text
......@@ -345,7 +355,7 @@
, powercap :
Powercap
}
let emptyProgressAppTestArg =
λ(cmd : Text)
→ λ(args : List Text)
......@@ -367,7 +377,7 @@
< NoCap = {=} | Cap : Text >
}
: ProgressAppTestArg
let progressAppTest =
λ(args : ProgressAppTestArg)
→ appTest
......@@ -390,7 +400,7 @@
args.powercap
}
)
let mkListen =
λ(cn : Text)
→ λ(filter : Text)
......@@ -403,20 +413,20 @@
, 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 =
......
......@@ -54,3 +54,4 @@ testSingularity:
extends: .test
script:
- "argonix build testSingularity --argopkgs $ARGOPKGS $EXTRA --verbose"
- notknl
{
"url": "https://github.com/freuk/dhrun.git",
"rev": "050991b7f2f1a885507d7cffadf61b06e0f61277",
"date": "2019-05-20T13:47:58-05:00",
"sha256": "1ac1zz4isx9imjm5hr3flh7fgn8mdqibflb77kzyybz5fr9ifnh9",
"rev": "d0ad28692d7071a1408d196d29b0c8e4303f8ca8",
"date": "2019-05-21T10:33:48-05:00",
"sha256": "19dmxgh5lkwslg3hwr84nrbskhpn6qfmn6iidxnv6i8jkmv18zpk",
"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