diff --git a/api/main.go b/api/main.go index afac4b2..9cd0b3e 100644 --- a/api/main.go +++ b/api/main.go @@ -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": diff --git a/lxc/execute b/lxc/execute index e09817f..e8a9f50 100755 --- a/lxc/execute +++ b/lxc/execute @@ -63,6 +63,9 @@ case "$lang" in "java") bin=java ;; +"julia" | "jl") + bin=julia + ;; "nasm" | "asm") bin=nasm ;; diff --git a/lxc/executors/julia b/lxc/executors/julia new file mode 100755 index 0000000..7dddb24 --- /dev/null +++ b/lxc/executors/julia @@ -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" diff --git a/lxc/versions b/lxc/versions index a3b1e10..f53836e 100755 --- a/lxc/versions +++ b/lxc/versions @@ -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 '---' diff --git a/readme.md b/readme.md index a44a202..f9c9fd6 100644 --- a/readme.md +++ b/readme.md @@ -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 diff --git a/tests/test.jl b/tests/test.jl new file mode 100644 index 0000000..3bfd06e --- /dev/null +++ b/tests/test.jl @@ -0,0 +1 @@ +println("good") diff --git a/tests/test_all_lxc b/tests/test_all_lxc index dab55df..e3cf275 100755 --- a/tests/test_all_lxc +++ b/tests/test_all_lxc @@ -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'