Commit 9ae760fd authored by Valentin Reis's avatar Valentin Reis
Browse files

Updating this branch to extend the CI jobs.

parent 77acfd11
Pipeline #4976 failed with stage
in 3 minutes and 8 seconds
...@@ -32,9 +32,9 @@ import Text.Show.Pretty ...@@ -32,9 +32,9 @@ import Text.Show.Pretty
cleanLeftovers :: WorkingDirectory -> Shell () cleanLeftovers :: WorkingDirectory -> Shell ()
cleanLeftovers (WorkingDirectory wd) = do cleanLeftovers (WorkingDirectory wd) = do
printInfo "Cleaning working(output) directory.\n" printInfo "Cleaning working(output) directory."
cleanLog wd cleanLog wd
printInfo "Cleaning sockets.\n" printInfo "Cleaning sockets."
CM.mapM_ cleanSocket ["/tmp/nrm-downstream-in", "/tmp/nrm-upstream-in"] CM.mapM_ cleanSocket ["/tmp/nrm-downstream-in", "/tmp/nrm-upstream-in"]
checkFsAttributes :: FilePath -> Shell () checkFsAttributes :: FilePath -> Shell ()
...@@ -55,24 +55,24 @@ prepareDaemon out stdErr test = do ...@@ -55,24 +55,24 @@ prepareDaemon out stdErr test = do
confPath <- myWhich "argo_nodeos_config" confPath <- myWhich "argo_nodeos_config"
let confPath' = "./argo_nodeos_config" let confPath' = "./argo_nodeos_config"
cp confPath confPath' cp confPath confPath'
printInfo $ format ("Copied the configurator to " % fp % "\n") confPath' printInfo $ format ("Copied the configurator to " % fp ) confPath'
printInfo $ format "Trying to sudo chown and chmod argo_nodeos_config\n" printInfo $ format "Trying to sudo chown and chmod argo_nodeos_config"
verboseShell (format ("sudo chown root:root " % fp) confPath') empty >>= \case verboseShell (format ("sudo chown root:root " % fp) confPath') empty >>= \case
ExitSuccess -> printInfo "Chowned argo_nodeos_config to root:root.\n" ExitSuccess -> printInfo "Chowned argo_nodeos_config to root:root."
ExitFailure n -> ExitFailure n ->
die ("Failed to set argo_nodeos_config permissions " <> repr n) die ("Failed to set argo_nodeos_config permissions " <> repr n)
verboseShell (format ("sudo chmod u+sw " % fp) confPath') empty >>= \case verboseShell (format ("sudo chmod u+sw " % fp) confPath') empty >>= \case
ExitSuccess -> printInfo "Set the suid bit.\n" ExitSuccess -> printInfo "Set the suid bit."
ExitFailure n -> die ("Setting suid bit failed with exit code " <> repr n) ExitFailure n -> die ("Setting suid bit failed with exit code " <> repr n)
cleanContainers confPath' 1 2 cleanContainers confPath' 1 2
export "ARGO_NODEOS_CONFIG" (format fp confPath') export "ARGO_NODEOS_CONFIG" (format fp confPath')
return $ Instrumentation (P.proc "daemon" []) out stdErr test return $ Instrumentation (P.proc "daemon" []) out stdErr test
where where
nodeOsFailure n = do nodeOsFailure n = do
printError ("argo_nodeos_config failed with exit code :" <> repr n <> "\n") printError ("argo_nodeos_config failed with exit code :" <> repr n )
testfile ".argo_nodeos_config_exit_message" >>= \case testfile ".argo_nodeos_config_exit_message" >>= \case
True -> do True -> do
printInfo "Contents of .argo_nodeos_config_exit_message: \n" printInfo "Contents of .argo_nodeos_config_exit_message: "
view $ input ".argo_nodeos_config_exit_message" view $ input ".argo_nodeos_config_exit_message"
False -> die ("argo_nodeos_config failed with exit code " <> repr n) False -> die ("argo_nodeos_config failed with exit code " <> repr n)
cleanContainers :: FilePath -> NominalDiffTime -> Integer -> Shell () cleanContainers :: FilePath -> NominalDiffTime -> Integer -> Shell ()
...@@ -89,14 +89,14 @@ prepareDaemon out stdErr test = do ...@@ -89,14 +89,14 @@ prepareDaemon out stdErr test = do
printWarning printWarning
( "the argo_nodeos_config call failed with exit code " ( "the argo_nodeos_config call failed with exit code "
<> repr n <> repr n
<> ". Retrying..\n" <> ". Retrying.."
) )
liftIO $ sleep (retryTime * 2) liftIO $ sleep (retryTime * 2)
cleanContainers argo_nodeos_config cleanContainers argo_nodeos_config
(retryTime * 2) (retryTime * 2)
(remainingRetries - 1) (remainingRetries - 1)
(ExitSuccess, _, _) -> do (ExitSuccess, _, _) -> do
printInfo "Cleaned the argo config.\n" printInfo "Cleaned the argo config."
len <- liftIO $ Turtle.Shell.fold len <- liftIO $ Turtle.Shell.fold
(grep (has "CONTAINER") showConfig) (grep (has "CONTAINER") showConfig)
Fold.length Fold.length
...@@ -112,7 +112,7 @@ prepareDaemon out stdErr test = do ...@@ -112,7 +112,7 @@ prepareDaemon out stdErr test = do
else else
printInfo printInfo
"argo_nodeos_config successfully cleaned the container \ "argo_nodeos_config successfully cleaned the container \
\config.\n" \config."
cmdRunI cmdRunI
:: AppName :: AppName
...@@ -204,14 +204,14 @@ runStack sa@StackArgs {..} = do ...@@ -204,14 +204,14 @@ runStack sa@StackArgs {..} = do
if verbosity == Verbose if verbosity == Verbose
then do then do
printInfo "Starting the following processes:\n" printInfo "Starting the following processes:"
liftIO $ pPrint ilist liftIO $ pPrint ilist
else liftIO $ pPrint (fmap fst ilist) else liftIO $ pPrint (fmap fst ilist)
asyncs <- liftIO $ mapM tupleToAsync ilist asyncs <- liftIO $ mapM tupleToAsync ilist
_ <- liftIO $ kbInstallHandler $ CM.mapM_ cancel asyncs _ <- liftIO $ kbInstallHandler $ CM.mapM_ cancel asyncs
when (verbosity == Verbose) $ printInfo "Processes started.\n" when (verbosity == Verbose) $ printInfo "Processes started."
out <- liftIO $ waitAnyCancel asyncs out <- liftIO $ waitAnyCancel asyncs
...@@ -220,7 +220,6 @@ runStack sa@StackArgs {..} = do ...@@ -220,7 +220,6 @@ runStack sa@StackArgs {..} = do
<> repr (fst $ snd out) <> repr (fst $ snd out)
<> " with exit information: " <> " with exit information: "
<> repr (snd $ snd out) <> repr (snd $ snd out)
<> "\n"
) )
cd "../" cd "../"
......
...@@ -42,11 +42,11 @@ printSuccess :: Text -> Shell () ...@@ -42,11 +42,11 @@ printSuccess :: Text -> Shell ()
printTest :: Text -> Shell () printTest :: Text -> Shell ()
dieRed :: Text -> Shell () dieRed :: Text -> Shell ()
printInfo = printf ("Info: " % s) printInfo = printf ("Info: " % s% "\n")
printCommand = printf ("Running: " % s % "\n") printCommand = printf ("Running: " % s % "\n")
printWarning = colorShell Yellow . printf ("Warning: " % s) printWarning = colorShell Yellow . printf ("Warning: " % s% "\n")
printError = colorShell Red . printf ("Error: " % s) printError = colorShell Red . printf ("Error: " % s% "\n")
printSuccess = colorShell Green . printf ("Success: " % s) printSuccess = colorShell Green . printf ("Success: " % s% "\n")
printTest = colorShell Green . printf ("RUNNING TEST: " % s % "\n") printTest = colorShell Green . printf ("RUNNING TEST: " % s % "\n")
dieRed str = dieRed str =
colorShell Red (printf ("Failure: " % s) str) >> exit (ExitFailure 1) colorShell Red (printf ("Failure: " % s) str) >> exit (ExitFailure 1)
...@@ -54,12 +54,12 @@ dieRed str = ...@@ -54,12 +54,12 @@ dieRed str =
myWhich :: FilePath -> Shell FilePath myWhich :: FilePath -> Shell FilePath
myWhich str = which str >>= \case myWhich str = which str >>= \case
(Just p) -> (Just p) ->
printInfo (format ("Found " % fp % " at " % fp % "\n") str p) >> return p printInfo (format ("Found " % fp % " at " % fp) str p) >> return p
Nothing -> die $ format ("Argo `" % fp % "` not in $PATH.") str Nothing -> die $ format ("Argo `" % fp % "` not in $PATH.") str
myWhichMaybe :: FilePath -> Shell (Maybe FilePath) myWhichMaybe :: FilePath -> Shell (Maybe FilePath)
myWhichMaybe str = which str >>= \case myWhichMaybe str = which str >>= \case
(Just p) -> printInfo (format ("Found " % fp % " at " % fp % "\n") str p) (Just p) -> printInfo (format ("Found " % fp % " at " % fp) str p)
>> return (Just p) >> return (Just p)
Nothing -> return Nothing Nothing -> return Nothing
...@@ -67,7 +67,7 @@ sudoRemoveFile :: (Text -> Shell ()) -> Text -> FilePath -> Shell () ...@@ -67,7 +67,7 @@ sudoRemoveFile :: (Text -> Shell ()) -> Text -> FilePath -> Shell ()
sudoRemoveFile printer desc filePath = do sudoRemoveFile printer desc filePath = do
foundSocket <- testfile filePath foundSocket <- testfile filePath
when foundSocket $ go False when foundSocket $ go False
printInfo $ format ("OK: " % s % " " % fp % "\n") desc filePath printInfo $ format ("OK: " % s % " " % fp) desc filePath
where where
go useSudo = do go useSudo = do
printer $ format ("found stale " % s % " at " % fp % ".. ") desc filePath printer $ format ("found stale " % s % " at " % fp % ".. ") desc filePath
......
...@@ -17,7 +17,7 @@ opts sa = hsubparser ...@@ -17,7 +17,7 @@ opts sa = hsubparser
( command "clean" ( command "clean"
(info (pure $ clean sa) (progDesc "Clean sockets, logfiles.")) (info (pure $ clean sa) (progDesc "Clean sockets, logfiles."))
<> mconcat (fmap commandTest [(minBound :: TestType) ..]) <> mconcat (fmap commandTest [(minBound :: TestType) ..])
<> commandTests [TestHello, TestListen, TestPerfwrapper] <> commandTests [TestHello, TestListen, TestPerfwrapper, TestAMG, TestSTREAM]
"tests" "tests"
"Run hardware-independent CI tests" "Run hardware-independent CI tests"
<> help <> help
...@@ -64,7 +64,7 @@ doSpec :: TestSpec -> StackArgs -> Shell () ...@@ -64,7 +64,7 @@ doSpec :: TestSpec -> StackArgs -> Shell ()
doSpec spec stackArgs = do doSpec spec stackArgs = do
printTest $ T.pack $ description spec printTest $ T.pack $ description spec
fullStack (isTest spec) stackArgs fullStack (isTest spec) stackArgs
printSuccess "Test Successful." printSuccess "Test Successful.\n"
configureTest :: TestType -> TestSpec configureTest :: TestType -> TestSpec
configureTest = \case configureTest = \case
...@@ -235,14 +235,13 @@ newtype IsTest = IsTest Bool ...@@ -235,14 +235,13 @@ newtype IsTest = IsTest Bool
fullStack :: IsTest -> StackArgs -> Shell () fullStack :: IsTest -> StackArgs -> Shell ()
fullStack (IsTest b) a@StackArgs {..} = runStack a >>= \case fullStack (IsTest b) a@StackArgs {..} = runStack a >>= \case
FoundMessage -> printSuccess "Found message!\n" FoundMessage -> printSuccess "Found message!"
Died stacki errorcode -> if b Died stacki errorcode -> if b
then then
printError printError
( repr stacki ( repr stacki
<> " died before a message could be found:" <> " died before a message could be found:"
<> repr errorcode <> repr errorcode
<> "\n"
) )
>> exit (ExitFailure 1) >> exit (ExitFailure 1)
else exit ExitSuccess else exit ExitSuccess
......
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
inherit (pinnedVersion) url rev sha256; inherit (pinnedVersion) url rev sha256;
}, },
pkgs ? import argopkgs-src {}, pkgs ? import argopkgs-src {},
nrm-src ? pkgs.nodelevel.nrm.src, nrm-src ? pkgs.nodelevel.nrm.src,
containers-src ? pkgs.nodelevel.containers.src, containers-src ? pkgs.nodelevel.containers.src,
libnrm-src ? pkgs.nodelevel.libnrm.src, libnrm-src ? pkgs.nodelevel.libnrm.src,
amg-src ? pkgs.applications.nrm.amg.src, amg-src ? pkgs.applications.nrm.amg.src,
lammps-src ? pkgs.applications.nrm.lammps.src, lammps-src ? pkgs.applications.nrm.lammps.src,
qmcpack-src ? pkgs.applications.nrm.qmcpack.src, qmcpack-src ? pkgs.applications.nrm.qmcpack.src,
stream-src ? pkgs.applications.nrm.stream.src, stream-src ? pkgs.applications.nrm.stream.src,
}: }:
let let
filterHdevTools = builtins.filterSource (path: type: baseNameOf path != ".hdevtools.sock"); filterHdevTools = builtins.filterSource (path: type: baseNameOf path != ".hdevtools.sock");
...@@ -46,33 +46,8 @@ let ...@@ -46,33 +46,8 @@ let
echo "Installed bash completion." echo "Installed bash completion."
''; '';
#cabal2snack = hpkgs.callPackage ({ mkDerivation, base, Cabal, cabal2nix, containers
#, distribution-nixpkgs, filepath, language-nix
#, optparse-applicative, pretty, stdenv, text
#}:
#mkDerivation {
#pname = "cabal2snack";
#version = "0.1.0.0";
#src = pkgs.fetchFromGitHub {
#owner = "freuk";
#repo = "cabal2snack";
#rev = "83705f82baa4b62864a6580a9048d547968dd185";
#sha256 = "0xqkznn66vg10iag47pan0d6zsn352xs69pi3jzvn8vgfclfy6h4";
#};
#isLibrary = true;
#isExecutable = true;
#libraryHaskellDepends = [
#base Cabal cabal2nix containers distribution-nixpkgs filepath
#language-nix optparse-applicative pretty text
#];
#executableHaskellDepends = [ base ];
#description = "A tool to generate nix expressions for snack from cabal projects";
#license = stdenv.lib.licenses.bsd3;
#}) {};
in rec in rec
{ {
#inherit cabal2snack;
nrm = pkgs.nodelevel.nrm.overrideAttrs (old: {src = nrm-src;} ); nrm = pkgs.nodelevel.nrm.overrideAttrs (old: {src = nrm-src;} );
libnrm = pkgs.nodelevel.libnrm.overrideAttrs (old: {src = libnrm-src;} ); libnrm = pkgs.nodelevel.libnrm.overrideAttrs (old: {src = libnrm-src;} );
containers = pkgs.nodelevel.containers.overrideAttrs (old: {src = containers-src;} ); containers = pkgs.nodelevel.containers.overrideAttrs (old: {src = containers-src;} );
...@@ -174,7 +149,4 @@ in rec ...@@ -174,7 +149,4 @@ in rec
in pkgs.writeText "test-list" ('' in pkgs.writeText "test-list" (''
Available test provenance configurations: Available test provenance configurations:
''+(builtins.concatStringsSep "\n" (pkgs.lib.mapAttrsToList showTest tests))); ''+(builtins.concatStringsSep "\n" (pkgs.lib.mapAttrsToList showTest tests)));
#testsRepresentations = pkgs.lib.mapAttrsToList (name: value: name ) tests;
#output = builtins.concatStringsSep "\n" testsRepresentations;
} }
...@@ -73,6 +73,20 @@ nrm.build: ...@@ -73,6 +73,20 @@ nrm.build:
- XDG_CACHE_HOME=$CACHE nix-shell .nix -A test --run "argotk.hs TestPerfwrapper" - XDG_CACHE_HOME=$CACHE nix-shell .nix -A test --run "argotk.hs TestPerfwrapper"
- rm -rf $CACHE - rm -rf $CACHE
.TestAMG.test:
extends: .nix-integration
script:
- CACHE=$(mktemp -d --suffix=nixcache /tmp/deletable-nix-cache-XXXX)
- XDG_CACHE_HOME=$CACHE nix-shell .nix -A test --run "argotk.hs TestAMG"
- rm -rf $CACHE
.TestSTREAM.test:
extends: .nix-integration
script:
- CACHE=$(mktemp -d --suffix=nixcache /tmp/deletable-nix-cache-XXXX)
- XDG_CACHE_HOME=$CACHE nix-shell .nix -A test --run "argotk.hs TestSTREAM"
- rm -rf $CACHE
KNL-Power.test: KNL-Power.test:
extends: .TestPower.test extends: .TestPower.test
tags: tags:
...@@ -98,3 +112,17 @@ KNL-Hello.test: ...@@ -98,3 +112,17 @@ KNL-Hello.test:
extends: .TestHello.test extends: .TestHello.test
tags: tags:
- knl - knl
STREAM.test:
extends: .TestSTREAM.test
KNL-STREAM.test:
extends: .TestSTREAM.test
tags:
- knl
AMG.test:
extends: .TestAMG.test
KNL-AMG.test:
extends: .TestAMG.test
tags:
- knl
{ {
"url": "https://xgitlab.cels.anl.gov/argo/argopkgs.git", "url": "https://xgitlab.cels.anl.gov/argo/argopkgs.git",
"rev": "59feb155cb40de40e3f1345e2a01dd86c0d4c6bb", "rev": "79d93fefe6d7e3cb1992332fd07389cc1436b0aa",
"date": "2019-01-07T16:58:16-06:00", "date": "2019-01-23T08:46:56-06:00",
"sha256": "13dxwsmsb84hxqiga4mray6j2mwcg9lhgdxfaipbf2v7gd3n574h", "sha256": "10hc9mgvr3fkn6q40rdc79a1f865hmh2h3xymj9rmxq1dffmc8ag",
"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