From fab8873d85c5ff09693fb6990bf3eafdba54119e Mon Sep 17 00:00:00 2001 From: Tommy-Xavier Robillard Date: Sat, 2 May 2020 00:00:46 -0400 Subject: [PATCH 1/4] Added julia support. --- api/main.go | 1 + lxc/execute | 3 +++ lxc/executors/julia | 2 ++ 3 files changed, 6 insertions(+) create mode 100755 lxc/executors/julia diff --git a/api/main.go b/api/main.go index afac4b2..4b95915 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", 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" From 28ca95ef97dd14205f5aefb1898b55ade06fcfd6 Mon Sep 17 00:00:00 2001 From: Tommy-Xavier Robillard Date: Sat, 2 May 2020 00:04:48 -0400 Subject: [PATCH 2/4] Added julia test. --- tests/test.jl | 1 + tests/test_all_lxc | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 tests/test.jl 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' From c6295ad329964785c2f35683826dec0836543f44 Mon Sep 17 00:00:00 2001 From: Tommy-Xavier Robillard Date: Sat, 2 May 2020 00:19:36 -0400 Subject: [PATCH 3/4] Added julia install instructions --- readme.md | 9 +++++++++ 1 file changed, 9 insertions(+) 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 From 31471c3ee08596e8a4d69a8b990b424dd0ad4178 Mon Sep 17 00:00:00 2001 From: Tommy-Xavier Robillard Date: Sat, 2 May 2020 00:30:12 -0400 Subject: [PATCH 4/4] Added julia version, and alias. --- api/main.go | 2 ++ lxc/versions | 3 +++ 2 files changed, 5 insertions(+) diff --git a/api/main.go b/api/main.go index 4b95915..9cd0b3e 100644 --- a/api/main.go +++ b/api/main.go @@ -142,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/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 '---'