Commit 38ab5236 authored by Valentin Reis's avatar Valentin Reis

singularity features

parent a4d3fa91
Pipeline #7425 passed with stages
in 3 minutes and 45 seconds
......@@ -21,6 +21,7 @@ module Args
, remoteParser
, targets
, isTarget
, needsSingularity
)
where
......@@ -176,6 +177,9 @@ stringArgs = mapMaybe toSrc nixStatic
isTarget :: Text -> Bool
isTarget x = Target x `elem` nixStatic
needsSingularity :: Text -> Bool
needsSingularity = (=="testSingularity")
nixStatic :: [NixStaticInOut]
nixStatic = src <> both <> simpletarget <> target <> stringA
where
......
......@@ -208,6 +208,8 @@ setupSystem target sa = do
>> return [("ARGO_NODEOS_CONFIG", "/tmp/argo_nodeos_config")]
else return []
when (needsSingularity target) $ setupSingularity envVars
return (envVars ++ nodeosVar, varTMPDIR)
where
getVars :: [Text] -> IO [(Text, Text)]
......@@ -218,6 +220,25 @@ setupSystem target sa = do
Nothing -> return Nothing
Just val -> return $ Just (var, toS val)
setupSingularity :: [(Text, Text)] -> IO ()
setupSingularity env = do
_ <- rpVerbose "mkdir" ["-p","/tmp/argonix"] env
(_,singularity) <- rpVerbose "which" ["singularity"] env
sVerbose "sudo rm -rf /tmp/argonix/singularity" >>= \case
ExitSuccess -> return ()
ExitFailure n ->
die ("Failed to remove /tmp/argonix/singularity" <> show n)
sVerbose
( "cp "
<> toS singularity
<> " /tmp/argonix/singularity"
)
>>= \case
ExitSuccess -> return ()
ExitFailure n ->
die ("Failed to setup singularity symlink" <> show n)
setupNodeOs :: [(Text, Text)] -> IO ()
setupNodeOs env = do
cleanSockets $ verbosity sa
......
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