Merge pull request #9 from TommyXR/julia_support

Julia support
This commit is contained in:
Brian Seymour 2020-05-01 23:38:08 -05:00 committed by GitHub
commit b750de1f5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 23 additions and 0 deletions

View File

@ -72,6 +72,7 @@ func Execute(res http.ResponseWriter, req *http.Request) {
"csharp", "cs", "c#",
"go",
"java",
"julia", "jl",
"nasm", "asm",
"node", "javascript", "js",
"php",
@ -141,6 +142,8 @@ func launch(request Inbound, res http.ResponseWriter) {
execlang = "nasm"
case "js", "javascript":
execlang = "node"
case "jl":
execlang = "julia"
case "python":
execlang = "python3"
case "ts":

View File

@ -63,6 +63,9 @@ case "$lang" in
"java")
bin=java
;;
"julia" | "jl")
bin=julia
;;
"nasm" | "asm")
bin=nasm
;;

2
lxc/executors/julia Executable file
View File

@ -0,0 +1,2 @@
cd /tmp/$2
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 julia code.code"

View File

@ -21,6 +21,9 @@ echo '---'
echo 'java'
lxc-attach --clear-env -n piston -- /bin/bash -l -c "java -version"
echo '---'
echo 'julia'
lxc-attach --clear-env -n piston -- /bin/bash -l -c "julia --version"
echo '---'
echo 'nasm'
lxc-attach --clear-env -n piston -- /bin/bash -l -c "nasm -version"
echo '---'

View File

@ -137,6 +137,15 @@ tar -xzf openjdk-14_linux-x64_bin.tar.gz
echo 'export PATH=$PATH:/opt/java/jdk-14/bin' >> /opt/.profile
source /opt/.profile
# install julia
#final binary: /opt/julia/julia-1.4.1/bin/julia --version
cd /opt && mkdir julia && cd julia
wget https://julialang-s3.julialang.org/bin/linux/x64/1.4/julia-1.4.1-linux-x86_64.tar.gz
tar -xzf julia-1.4.1-linux-x86_64.tar.gz
echo 'export PATH=$PATH:/opt/julia/julia-1.4.1/bin' >> /opt/.profile
source /opt/.profile
# create runnable users and apply limits
for i in {1..150}; do
useradd -M runner$i

1
tests/test.jl Normal file
View File

@ -0,0 +1 @@
println("good")

View File

@ -16,6 +16,8 @@ echo 'testing asm'
../lxc/execute asm test.nasm
echo 'testing js'
../lxc/execute js test.js
echo 'testing jl'
../lxc/execute jl test.jl
echo 'testing php'
../lxc/execute php test.php
echo 'testing python2'