Actually switch to cabal

This commit is contained in:
1Computer1 2019-09-04 23:53:57 -04:00
parent 46b60a9944
commit 4776a89f9a
3 changed files with 71 additions and 154 deletions

View file

@ -15,6 +15,7 @@ Arbitrary code execution server using Docker.
## Endpoints ## Endpoints
### **GET** `/languages` ### **GET** `/languages`
List of enabled languages. List of enabled languages.
Example response: Example response:
@ -23,6 +24,7 @@ Example response:
``` ```
### **POST** `/eval` ### **POST** `/eval`
Evaluate code. Evaluate code.
JSON payload with `language` and `code` keys. JSON payload with `language` and `code` keys.
The `language` is as in the name of a subfolder in the `languages` directory. The `language` is as in the name of a subfolder in the `languages` directory.
@ -41,7 +43,9 @@ Example response:
Errors with 404 if `language` is not found, `504` if evaluation timed out, or `500` if evaluation failed for other reasons. Errors with 404 if `language` is not found, `504` if evaluation timed out, or `500` if evaluation failed for other reasons.
### **GET** `/containers` ### **GET** `/containers`
List of containers being handled by Myriad. List of containers being handled by Myriad.
### **POST** `/cleanup` ### **POST** `/cleanup`
Kill all containers, giving back the names of the containers killed. Kill all containers, giving back the names of the containers killed.

View file

@ -1,10 +1,4 @@
cabal-version: 1.12 cabal-version: 2.2
-- This file has been generated from package.yaml by hpack version 0.31.2.
--
-- see: https://github.com/sol/hpack
--
-- hash: 04a15c51f0ad270f323a3edd67bc229f0a0796226ff53a118338ec643b22b3c1
name: myriad name: myriad
version: 0.1.0.0 version: 0.1.0.0
@ -26,75 +20,76 @@ source-repository head
type: git type: git
location: https://github.com/1computer1/myriad location: https://github.com/1computer1/myriad
common extensions
default-extensions:
BlockArguments
ConstraintKinds
DataKinds
DerivingStrategies
DeriveFunctor
DeriveGeneric
FlexibleContexts
FlexibleInstances
FunctionalDependencies
GADTs
GeneralizedNewtypeDeriving
LambdaCase
MultiParamTypeClasses
MultiWayIf
NamedFieldPuns
OverloadedStrings
PatternSynonyms
PolyKinds
RankNTypes
ScopedTypeVariables
StandaloneDeriving
TupleSections
TypeApplications
TypeOperators
TypeFamilies
ViewPatterns
common deps
build-depends:
aeson ^>= 1.4.4.0
, async ^>= 2.2.2
, base ^>= 4.12.0.0
, bytestring ^>= 0.10.8.2
, containers ^>= 0.6.0.1
, dhall ^>= 1.24.0
, filepath ^>= 1.4.2.1
, lifted-async ^>= 0.10.0.4
, lifted-base ^>= 0.2.3.12
, monad-control ^>= 1.0.2.3
, monad-logger ^>= 0.3.30
, mtl ^>= 2.2.2
, servant ^>= 0.16.2
, servant-server ^>= 0.16.2
, snowflake ^>= 0.1.1.1
, string-conversions ^>= 0.4.0.1
, text ^>= 1.2.3.1
, time ^>= 1.8.0.2
, transformers ^>= 0.5.6.2
, transformers-base ^>= 0.4.5.2
, typed-process ^>= 0.2.6.0
, wai ^>= 3.2.2.1
, warp ^>= 3.2.28
default-language: Haskell2010
library library
import: extensions, deps
exposed-modules: exposed-modules:
Myriad Myriad
Myriad.Core Myriad.Core
Myriad.Docker Myriad.Docker
Myriad.Server Myriad.Server
other-modules: hs-source-dirs: src
Paths_myriad
hs-source-dirs:
src
default-extensions: BlockArguments ConstraintKinds DataKinds DerivingStrategies DeriveFunctor DeriveGeneric FlexibleContexts FlexibleInstances FunctionalDependencies GADTs GeneralizedNewtypeDeriving LambdaCase MultiParamTypeClasses MultiWayIf NamedFieldPuns OverloadedStrings PatternSynonyms PolyKinds RankNTypes ScopedTypeVariables StandaloneDeriving TupleSections TypeApplications TypeOperators TypeFamilies ViewPatterns
build-depends:
aeson
, async
, base
, bytestring
, containers
, dhall
, filepath
, lifted-async
, lifted-base
, monad-control
, monad-logger
, mtl
, servant
, servant-server
, snowflake
, string-conversions
, text
, time
, transformers
, transformers-base
, typed-process
, wai
, warp
default-language: Haskell2010
executable myriad executable myriad
import: extensions, deps
main-is: Main.hs main-is: Main.hs
other-modules: hs-source-dirs: app
Paths_myriad
hs-source-dirs:
app
default-extensions: BlockArguments ConstraintKinds DataKinds DerivingStrategies DeriveFunctor DeriveGeneric FlexibleContexts FlexibleInstances FunctionalDependencies GADTs GeneralizedNewtypeDeriving LambdaCase MultiParamTypeClasses MultiWayIf NamedFieldPuns OverloadedStrings PatternSynonyms PolyKinds RankNTypes ScopedTypeVariables StandaloneDeriving TupleSections TypeApplications TypeOperators TypeFamilies ViewPatterns
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall
build-depends: build-depends:
aeson myriad
, async
, base
, bytestring
, containers
, dhall
, filepath
, lifted-async
, lifted-base
, monad-control
, monad-logger
, mtl
, myriad
, optparse-applicative , optparse-applicative
, servant
, servant-server
, snowflake
, string-conversions
, text
, time
, transformers
, transformers-base
, typed-process
, wai
, warp
default-language: Haskell2010

View file

@ -1,82 +0,0 @@
name: myriad
version: 0.1.0.0
github: "1computer1/myriad"
license: MIT
author: "1Computer1"
maintainer: "onecomputer00@gmail.com"
copyright: "2019 1Computer1"
extra-source-files:
- README.md
synopsis: Arbitrary code execution in Docker
category: Server
description: Please see the README
dependencies:
- aeson
- async
- base
- bytestring
- containers
- dhall
- filepath
- lifted-base
- lifted-async
- monad-control
- monad-logger
- mtl
- servant
- servant-server
- snowflake
- string-conversions
- text
- time
- transformers
- transformers-base
- typed-process
- wai
- warp
default-extensions:
- BlockArguments
- ConstraintKinds
- DataKinds
- DerivingStrategies
- DeriveFunctor
- DeriveGeneric
- FlexibleContexts
- FlexibleInstances
- FunctionalDependencies
- GADTs
- GeneralizedNewtypeDeriving
- LambdaCase
- MultiParamTypeClasses
- MultiWayIf
- NamedFieldPuns
- OverloadedStrings
- PatternSynonyms
- PolyKinds
- RankNTypes
- ScopedTypeVariables
- StandaloneDeriving
- TupleSections
- TypeApplications
- TypeOperators
- TypeFamilies
- ViewPatterns
library:
source-dirs: src
executable:
main: Main.hs
source-dirs: app
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
- -Wall
dependencies:
- myriad
- optparse-applicative