mirror of
https://github.com/engineer-man/piston.git
synced 2025-06-08 03:06:26 +02:00
added a version of piston which uses lxc instead of docker, added tests for lxc
This commit is contained in:
parent
748f438718
commit
b26d1b5b45
30 changed files with 233 additions and 0 deletions
3
lxc/executors/c
Executable file
3
lxc/executors/c
Executable file
|
@ -0,0 +1,3 @@
|
|||
cd /tmp/$1
|
||||
timeout -s KILL 10 gcc -o binary -x c code.code
|
||||
timeout -s KILL 3 bash -c "cat args.args | xargs -d '\n' ./binary"
|
3
lxc/executors/cpp
Executable file
3
lxc/executors/cpp
Executable file
|
@ -0,0 +1,3 @@
|
|||
cd /tmp/$1
|
||||
timeout -s KILL 10 g++ -o binary -x c++ code.code
|
||||
timeout -s KILL 3 bash -c "cat args.args | xargs -d '\n' ./binary"
|
3
lxc/executors/csharp
Executable file
3
lxc/executors/csharp
Executable file
|
@ -0,0 +1,3 @@
|
|||
cd /tmp/$1
|
||||
timeout -s KILL 10 mcs $(echo code.code | sed 's/\///') -out:binary
|
||||
timeout -s KILL 3 bash -c "cat args.args | xargs -d '\n' mono binary"
|
6
lxc/executors/go
Executable file
6
lxc/executors/go
Executable file
|
@ -0,0 +1,6 @@
|
|||
cd /tmp/$1
|
||||
cp code.code interim.go
|
||||
file="interim.go"
|
||||
GOROOT=/usr/lib/go timeout -s KILL 10 go build $file
|
||||
file=${file%%.*}
|
||||
timeout -s KILL 3 bash -c "cat args.args | xargs -d '\n' ./$file"
|
6
lxc/executors/java
Executable file
6
lxc/executors/java
Executable file
|
@ -0,0 +1,6 @@
|
|||
cd /tmp/$1
|
||||
cp code.code interim.java
|
||||
name=$(cat interim.java | grep -Eo 'public\s+class\s+([A-Za-z0-9]+)' | sed -n 's/ */ /gp' | cut -d' ' -f3)
|
||||
mv interim.java $name.java
|
||||
timeout -s KILL 10 javac $name.java
|
||||
timeout -s KILL 3 bash -c "cat args.args | xargs -d '\n' java $name"
|
4
lxc/executors/nasm
Executable file
4
lxc/executors/nasm
Executable file
|
@ -0,0 +1,4 @@
|
|||
cd /tmp/$1
|
||||
timeout -s KILL 10 nasm -f elf64 -o binary.o code.code
|
||||
timeout -s KILL 10 ld binary.o -o binary
|
||||
timeout -s KILL 3 bash -c "cat args.args | xargs -d '\n' ./binary"
|
2
lxc/executors/node
Executable file
2
lxc/executors/node
Executable file
|
@ -0,0 +1,2 @@
|
|||
cd /tmp/$1
|
||||
timeout -s KILL 3 bash -c "cat args.args | xargs -d '\n' nodejs code.code"
|
2
lxc/executors/php
Executable file
2
lxc/executors/php
Executable file
|
@ -0,0 +1,2 @@
|
|||
cd /tmp/$1
|
||||
timeout -s KILL 3 bash -c "cat args.args | xargs -d '\n' php code.code"
|
2
lxc/executors/python2
Executable file
2
lxc/executors/python2
Executable file
|
@ -0,0 +1,2 @@
|
|||
cd /tmp/$1
|
||||
timeout -s KILL 3 bash -c "cat args.args | xargs -d '\n' python2 code.code"
|
2
lxc/executors/python3
Executable file
2
lxc/executors/python3
Executable file
|
@ -0,0 +1,2 @@
|
|||
cd /tmp/$1
|
||||
timeout -s KILL 3 bash -c "cat args.args | xargs -d '\n' python3.6 code.code"
|
2
lxc/executors/r
Executable file
2
lxc/executors/r
Executable file
|
@ -0,0 +1,2 @@
|
|||
cd /tmp/$1
|
||||
timeout -s KILL 3 bash -c "cat args.args | xargs -d '\n' Rscript code.code"
|
2
lxc/executors/ruby
Executable file
2
lxc/executors/ruby
Executable file
|
@ -0,0 +1,2 @@
|
|||
cd /tmp/$1
|
||||
timeout -s KILL 3 bash -c "cat args.args | xargs -d '\n' ruby code.code"
|
Loading…
Add table
Add a link
Reference in a new issue