From 084211cb46de2448e78f1d93a4829d032edb9f85 Mon Sep 17 00:00:00 2001 From: Ethan Edwards Date: Sat, 17 Oct 2020 01:22:15 -0400 Subject: [PATCH] added deno Fixes issue: https://github.com/engineer-man/piston/issues/18 --- lxc/execute | 3 +++ lxc/executors/deno | 7 +++++++ lxc/test_all_lxc | 4 ++++ lxc/tests/testdeno.js | 1 + lxc/tests/testdeno.ts | 1 + lxc/versions | 3 +++ readme.md | 10 +++++++++- 7 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 lxc/executors/deno create mode 100644 lxc/tests/testdeno.js create mode 100644 lxc/tests/testdeno.ts diff --git a/lxc/execute b/lxc/execute index 2582a9f..de824e1 100755 --- a/lxc/execute +++ b/lxc/execute @@ -87,6 +87,9 @@ case "$lang" in "node" | "js" | "javascript") bin=node ;; +"deno" | "denojs" | "denots") + bin=deno + ;; "perl") bin=perl ;; diff --git a/lxc/executors/deno b/lxc/executors/deno new file mode 100644 index 0000000..76d65ae --- /dev/null +++ b/lxc/executors/deno @@ -0,0 +1,7 @@ +cd /tmp/$2 + +if [[ -z $(grep '[^[:space:]]' args.args) ]]; then + runuser runner$1 -c "cd /tmp/$2 ; timeout -s KILL 3 deno code.code" +else + runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 deno code.code" +fi \ No newline at end of file diff --git a/lxc/test_all_lxc b/lxc/test_all_lxc index f3d6dc3..1641e41 100755 --- a/lxc/test_all_lxc +++ b/lxc/test_all_lxc @@ -47,3 +47,7 @@ echo 'testing python3' ../execute python3 test3.py echo 'testing haskell' ../execute haskell test.hs +echo 'testing deno js' +../execute deno testdeno.js +echo 'testing deno ts' +../execute deno testdeno.ts diff --git a/lxc/tests/testdeno.js b/lxc/tests/testdeno.js new file mode 100644 index 0000000..847245f --- /dev/null +++ b/lxc/tests/testdeno.js @@ -0,0 +1 @@ +console.log('good') diff --git a/lxc/tests/testdeno.ts b/lxc/tests/testdeno.ts new file mode 100644 index 0000000..868450a --- /dev/null +++ b/lxc/tests/testdeno.ts @@ -0,0 +1 @@ +console.log('good') \ No newline at end of file diff --git a/lxc/versions b/lxc/versions index 7078168..d3c6318 100755 --- a/lxc/versions +++ b/lxc/versions @@ -69,3 +69,6 @@ echo '---' echo 'haskell' lxc-attach --clear-env -n piston -- /bin/bash -l -c "ghc --version" echo '---' +echo 'deno' +lxc-attach --clear-env -n piston -- /bin/bash -l -c "deno --version" +echo '---' diff --git a/readme.md b/readme.md index ac7a226..91d3ce4 100644 --- a/readme.md +++ b/readme.md @@ -54,7 +54,7 @@ apt-get update apt-get install -y \ nano wget build-essential pkg-config libxml2-dev \ libsqlite3-dev mono-complete curl cmake libpython2.7-dev \ - ruby libtinfo-dev + ruby libtinfo-dev unzip # install python2 # final binary: /opt/python2/Python-2.7.17/python @@ -223,6 +223,14 @@ source /opt/.profile # get version: /usr/bin/ghc --version apt install ghc +# install deno +# final binary: /opt/.deno/bin/deno +# get version: /opt/.deno/bin/deno --version +curl -fsSL https://deno.land/x/install/install.sh | sh +echo 'export DENO_INSTALL="/opt/.deno"' +echo 'export PATH="$DENO_INSTALL/bin:$PATH"' +source /opt/.profile + # create runnable users and apply limits for i in {1..150}; do useradd -M runner$i