move EvalResult to Myriad.Docker

This commit is contained in:
1computer1 2020-06-16 22:38:54 -04:00
parent e2942e38b9
commit e27755cdda
2 changed files with 8 additions and 7 deletions

View file

@ -4,7 +4,6 @@ module Myriad.Core
( Language ( Language
, ContainerName , ContainerName
, ImageName , ImageName
, EvalResult(..)
, Env(..) , Env(..)
, MyriadT , MyriadT
, runMyriadT , runMyriadT
@ -49,11 +48,6 @@ data Env = Env
, snowflakeGen :: SnowflakeGen , snowflakeGen :: SnowflakeGen
} }
data EvalResult
= EvalOk BL.ByteString
| EvalTimedOut
| EvalErrored
newtype MyriadT m a = MyriadT { unMyriadT :: ReaderT Env (LoggingT m) a } newtype MyriadT m a = MyriadT { unMyriadT :: ReaderT Env (LoggingT m) a }
deriving newtype deriving newtype
( Functor ( Functor

View file

@ -11,6 +11,7 @@ module Myriad.Docker
import Control.Monad.Reader import Control.Monad.Reader
import qualified Data.ByteString.Lazy as BL
import qualified Data.Map.Strict as M import qualified Data.Map.Strict as M
import Data.Snowflake import Data.Snowflake
import Data.String.Conversions import Data.String.Conversions
@ -28,6 +29,12 @@ import Myriad.Core
type Myriad = MyriadT IO type Myriad = MyriadT IO
data EvalResult
= EvalOk BL.ByteString
| EvalTimedOut
| EvalErrored
deriving (Show)
buildImage :: Language -> Myriad () buildImage :: Language -> Myriad ()
buildImage lang@Language { name, concurrent } = do buildImage lang@Language { name, concurrent } = do
Env { config = Config { prepareContainers }, languagesDir } <- ask Env { config = Config { prepareContainers }, languagesDir } <- ask