Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
argotk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
argo
argotk
Commits
5625bbba
Commit
5625bbba
authored
Feb 13, 2019
by
Valentin Reis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding openmc.
parent
03157f9f
Pipeline
#5208
passed with stage
in 29 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
8 deletions
+55
-8
src/Argo/Args.hs
src/Argo/Args.hs
+10
-0
src/Argo/Stack.hs
src/Argo/Stack.hs
+19
-8
src/argotk.hs
src/argotk.hs
+26
-0
No files found.
src/Argo/Args.hs
View file @
5625bbba
...
...
@@ -21,6 +21,7 @@ data StackArgs = StackArgs
,
workingDirectory
::
WorkingDirectory
,
shareDir
::
ShareDir
,
manifestName
::
ManifestName
,
preludeCommand
::
PreludeCommand
,
daemon
::
ProcessBehavior
,
cmdrun
::
ProcessBehavior
,
cmdlisten
::
ProcessBehavior
...
...
@@ -39,6 +40,7 @@ newtype AppName = AppName Text deriving (IsString, Show, Read)
newtype
ContainerName
=
ContainerName
Text
deriving
(
IsString
,
Show
,
Read
)
newtype
ShareDir
=
ShareDir
FilePath
deriving
(
IsString
,
Show
)
newtype
ManifestName
=
ManifestName
FilePath
deriving
(
IsString
,
Show
)
newtype
PreludeCommand
=
PreludeCommand
Text
deriving
(
IsString
,
Show
,
Read
)
data
ProcessBehavior
=
Test
TestText
StdOutLog
StdErrLog
|
JustRun
StdOutLog
StdErrLog
...
...
@@ -67,6 +69,7 @@ instance Default StackArgs where
,
workingDirectory
=
WorkingDirectory
"_output"
,
shareDir
=
ShareDir
"/tmp"
,
manifestName
=
ManifestName
"basic.json"
,
preludeCommand
=
PreludeCommand
""
,
daemon
=
DontRun
,
cmdrun
=
DontRun
,
cmdlisten
=
DontRun
...
...
@@ -117,6 +120,13 @@ parseExtendStackArgs sa = do
<>
showDefault
<>
value
(
manifestName
sa
)
)
preludeCommand
<-
strOption
(
long
"prelude_command"
<>
metavar
"COMMAND"
<>
help
"Command to run before executing the stack (after stack setup)"
<>
showDefault
<>
value
(
preludeCommand
sa
)
)
daemon
<-
behaviorOption
(
long
"daemon"
<>
metavar
"BEHAVIOR"
...
...
src/Argo/Stack.hs
View file @
5625bbba
...
...
@@ -7,6 +7,7 @@
module
Argo.Stack
where
import
Argo.Args
import
Data.Coerce
(
coerce
)
import
Turtle
import
Turtle.Shell
import
Prelude
hiding
(
FilePath
)
...
...
@@ -54,13 +55,16 @@ prepareDaemon out stdErr test = do
printInfo
$
format
(
"Copied the configurator to "
%
fp
)
confPath'
printInfo
$
format
"Trying to sudo chown and chmod argo_nodeos_config"
sudoPath
<-
liftIO
$
pack
<$>
getEnv
"SUDO"
verboseShell
(
format
(
s
%
" chown root:root "
%
fp
)
sudoPath
confPath'
)
empty
>>=
\
case
ExitSuccess
->
printInfo
"Chowned argo_nodeos_config to root:root."
ExitFailure
n
->
die
(
"Failed to set argo_nodeos_config permissions "
<>
repr
n
)
verboseShell
(
format
(
s
%
" chmod u+sw "
%
fp
)
sudoPath
confPath'
)
empty
>>=
\
case
ExitSuccess
->
printInfo
"Set the suid bit."
ExitFailure
n
->
die
(
"Setting suid bit failed with exit code "
<>
repr
n
)
verboseShell
(
format
(
s
%
" chown root:root "
%
fp
)
sudoPath
confPath'
)
empty
>>=
\
case
ExitSuccess
->
printInfo
"Chowned argo_nodeos_config to root:root."
ExitFailure
n
->
die
(
"Failed to set argo_nodeos_config permissions "
<>
repr
n
)
verboseShell
(
format
(
s
%
" chmod u+sw "
%
fp
)
sudoPath
confPath'
)
empty
>>=
\
case
ExitSuccess
->
printInfo
"Set the suid bit."
ExitFailure
n
->
die
(
"Setting suid bit failed with exit code "
<>
repr
n
)
cleanContainers
confPath'
1
2
export
"ARGO_NODEOS_CONFIG"
(
format
fp
confPath'
)
return
$
Instrumentation
(
P
.
proc
"daemon"
[]
)
out
stdErr
test
...
...
@@ -122,7 +126,12 @@ cmdRunI (AppName app) args (ContainerName cn) (ShareDir md) (ManifestName mn) pb
=
Just
(
Run
,
)
<*>
processBehaviorToI
(
P
.
proc
"cmd"
$
[
"run"
,
"-u"
,
T
.
unpack
cn
,
encodeString
$
md
<>
"manifests"
</>
mn
,
T
.
unpack
app
]
$
[
"run"
,
"-u"
,
T
.
unpack
cn
,
encodeString
$
md
<>
"manifests"
</>
mn
,
T
.
unpack
app
]
++
fmap
(
T
.
unpack
.
argToText
)
args
)
pb
...
...
@@ -210,6 +219,8 @@ runStack sa@StackArgs {..} = do
]
ilist
=
catMaybes
milist
_
<-
inshell
((
coerce
preludeCommand
)
::
Text
)
empty
if
verbosity
==
Verbose
then
do
printInfo
"Starting the following processes:"
...
...
src/argotk.hs
View file @
5625bbba
...
...
@@ -51,6 +51,7 @@ data TestType =
|
TestSTREAM
|
RunAMG
|
RunQMCPack
|
RunOpenMC
|
RunSTREAM
|
RunLAMMPS
deriving
(
Enum
,
Bounded
,
Show
)
...
...
@@ -194,6 +195,31 @@ configureTest = \case
|]
,
isTest
=
IsTest
}
RunOpenMC
->
TestSpec
{
stackArgsUpdate
=
\
sa
->
sa
{
app
=
AppName
"mpiexec"
,
preludeCommand
=
PreludeCommand
"cp $OPENMC_PWD/* ."
,
args
=
let
tc
=
coerce
(
hwThreadCount
sa
)
::
Int
in
[
AppArg
"mpiexec"
,
AppArg
"-n"
,
AppArg
$
repr
tc
,
AppArg
"openmc"
]
,
manifestName
=
"parallel.json"
,
daemon
=
daemonBehavior
,
cmdrun
=
runBehavior
,
cmdlistenperformance
=
JustRun
(
StdOutLog
"performance.csv"
)
(
StdErrLog
"performance.log"
)
,
cmdlistenpower
=
JustRun
(
StdOutLog
"power.csv"
)
(
StdErrLog
"power.log"
)
,
cmdlistenprogress
=
JustRun
(
StdOutLog
"progress.csv"
)
(
StdErrLog
"progress.log"
)
}
,
description
=
"Run QMCPACK in the argo stack."
,
isTest
=
NotTest
}
RunQMCPack
->
TestSpec
{
stackArgsUpdate
=
\
sa
->
sa
...
...
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