Commit a90ba04a authored by Valentin Reis's avatar Valentin Reis

Updating the default pipeline to work with the 'config' WIP branch

of the nrm daemon, as this really the intended workflow.
parent ad4f3fee
Pipeline #4594 passed with stage
in 15 seconds
.argo_nodeos_config_exit_message .argo_nodeos_config_exit_message
*.log
...@@ -46,9 +46,7 @@ data StackArgs = StackArgs ...@@ -46,9 +46,7 @@ data StackArgs = StackArgs
, cmd_err :: FilePath , cmd_err :: FilePath
, daemon_out :: FilePath , daemon_out :: FilePath
, daemon_err :: FilePath , daemon_err :: FilePath
, log_progress :: FilePath , nrm_log :: FilePath
, log_hardwareprogress :: FilePath
, log_power :: FilePath
, time_file :: FilePath } , time_file :: FilePath }
instance Default StackArgs where instance Default StackArgs where
...@@ -60,13 +58,10 @@ instance Default StackArgs where ...@@ -60,13 +58,10 @@ instance Default StackArgs where
, cmd_err = "cmd_err.log" , cmd_err = "cmd_err.log"
, daemon_out = "daemon_out.log" , daemon_out = "daemon_out.log"
, daemon_err = "daemon_err.log" , daemon_err = "daemon_err.log"
, log_progress = "progress.log" , nrm_log = "nrm.log"
, log_hardwareprogress = "hardwareprogress.log"
, log_power = "power.log"
, time_file = "time.log" , time_file = "time.log"
} }
colorShell :: Color -> Shell ()-> Shell () colorShell :: Color -> Shell ()-> Shell ()
colorShell color s = setC color *> s *> setC White colorShell color s = setC color *> s *> setC White
where setC c = liftIO $ setSGR [SetColor Foreground Dull c] where setC c = liftIO $ setSGR [SetColor Foreground Dull c]
...@@ -104,8 +99,7 @@ cleanLog = sudoRemoveFile printWarning "log file" ...@@ -104,8 +99,7 @@ cleanLog = sudoRemoveFile printWarning "log file"
argoTest :: StackArgs -> IO () argoTest :: StackArgs -> IO ()
argoTest StackArgs{..} = sh $ do argoTest StackArgs{..} = sh $ do
--Cleaning --Cleaning
mapM_ cleanLog [daemon_out, daemon_err, cmd_out, cmd_err, time_file, mapM_ cleanLog [daemon_out, daemon_err, cmd_out, cmd_err, time_file, nrm_log]
log_progress, log_hardwareprogress, log_power]
mapM_ cleanSocket ["/tmp/nrm-downstream-in", "/tmp/nrm-upstream-in"] mapM_ cleanSocket ["/tmp/nrm-downstream-in", "/tmp/nrm-upstream-in"]
--Retrieving binaries,setting suid bits and perms --Retrieving binaries,setting suid bits and perms
...@@ -131,8 +125,8 @@ argoTest StackArgs{..} = sh $ do ...@@ -131,8 +125,8 @@ argoTest StackArgs{..} = sh $ do
die ("Clean config failed with exit code " <> repr n) die ("Clean config failed with exit code " <> repr n)
printInfo "Running the daemon.\n" printInfo "Running the daemon.\n"
export "ARGO_NODEOS_CONFIG" (format fp confPath') export "ARGO_NODEOS_CONFIG" (format fp confPath')
let daemon = inshell (format (fp%" "%s%" --log_hardwareprogress="%fp%" --log_progress="%fp%" --log_power="%fp%" >"%fp%" 2>"%fp) let daemon = inshell (format (fp%" "%s%" --nrm_log="%fp%" >"%fp%" 2>"%fp)
daemonPath dargs log_hardwareprogress log_progress log_power daemon_out daemon_err) empty daemonPath dargs nrm_log daemon_out daemon_err) empty
daemonAsync <- fork $ sh $ daemon daemonAsync <- fork $ sh $ daemon
printInfo "Daemon is running.\n" printInfo "Daemon is running.\n"
let handler = do let handler = do
......
...@@ -28,3 +28,9 @@ integration.test: ...@@ -28,3 +28,9 @@ integration.test:
tags: tags:
- integration - integration
``` ```
Standalone usage: example with the nrm source in `../`.
```
nix-shell -A test --arg nrm-src ../nrm
./integration.hs
```
...@@ -23,7 +23,6 @@ in rec ...@@ -23,7 +23,6 @@ in rec
src=./.; src=./.;
name="nrm-experimental-dev-environment"; name="nrm-experimental-dev-environment";
buildInputs = [ buildInputs = [
argopkgs.sudo
containers containers
amg amg
nrm nrm
......
#! /usr/bin/env bash #! /usr/bin/env bash
nix-shell --pure -A test --command ./integration.hs nix-shell -A test --command ./integration.hs
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