From c54958145c7d6a0452bb9e3b3080614d736b5e9d Mon Sep 17 00:00:00 2001 From: Satyabrat35 Date: Fri, 15 Jun 2018 00:31:18 +0530 Subject: [PATCH 1/3] Added ruby worker --- .gitignore | 1 + README.md | 26 ++++++++++++++++++++++++++ build_workers.sh | 20 ++++++++++++++++++++ containers/c/Dockerfile | 7 +++++++ containers/c/compile.sh | 3 +++ containers/c/run.sh | 4 ++++ containers/cpp/Dockerfile | 7 +++++++ containers/cpp/compile.sh | 3 +++ containers/cpp/run.sh | 4 ++++ containers/java8/Dockerfile | 10 ++++++++++ containers/java8/compile.sh | 3 +++ containers/java8/run.sh | 3 +++ containers/nodejs6/Dockerfile | 7 +++++++ containers/nodejs6/compile.sh | 1 + containers/nodejs6/run.sh | 3 +++ containers/nodejs8/Dockerfile | 7 +++++++ containers/nodejs8/compile.sh | 1 + containers/nodejs8/run.sh | 3 +++ containers/py2/Dockerfile | 7 +++++++ containers/py2/compile.sh | 1 + containers/py2/run.sh | 3 +++ containers/py3/Dockerfile | 7 +++++++ containers/py3/compile.sh | 1 + containers/py3/run.sh | 3 +++ containers/ruby/Dockerfile | 7 +++++++ containers/ruby/compile.sh | 1 + containers/ruby/run.sh | 3 +++ tests/c/run.stdin | 1 + tests/c/runbox/compile.stderr | 0 tests/c/runbox/compile.stdout | 0 tests/c/runbox/exe | Bin 0 -> 10672 bytes tests/c/runbox/run.stderr | 0 tests/c/runbox/run.stdin | 1 + tests/c/runbox/run.stdout | 1 + tests/c/runbox/source.c | 8 ++++++++ tests/c/source.c | 8 ++++++++ tests/c/test_worker.sh | 27 +++++++++++++++++++++++++++ tests/cpp/run.stdin | 1 + tests/cpp/runbox/compile.stderr | 0 tests/cpp/runbox/compile.stdout | 0 tests/cpp/runbox/exe | Bin 0 -> 11304 bytes tests/cpp/runbox/run.stderr | 0 tests/cpp/runbox/run.stdin | 1 + tests/cpp/runbox/run.stdout | 1 + tests/cpp/runbox/source.cpp | 8 ++++++++ tests/cpp/source.cpp | 8 ++++++++ tests/cpp/test_worker.sh | 26 ++++++++++++++++++++++++++ tests/java8/Main.java | 9 +++++++++ tests/java8/run.stdin | 1 + tests/java8/runbox/Main.class | Bin 0 -> 710 bytes tests/java8/runbox/Main.java | 9 +++++++++ tests/java8/runbox/compile.stderr | 0 tests/java8/runbox/compile.stdout | 0 tests/java8/runbox/run.stderr | 0 tests/java8/runbox/run.stdin | 1 + tests/java8/runbox/run.stdout | 1 + tests/java8/test_worker.sh | 26 ++++++++++++++++++++++++++ tests/nodejs6/run.stdin | 1 + tests/nodejs6/runbox/run.stderr | 0 tests/nodejs6/runbox/run.stdin | 1 + tests/nodejs6/runbox/run.stdout | 1 + tests/nodejs6/runbox/script.js | 11 +++++++++++ tests/nodejs6/script.js | 11 +++++++++++ tests/nodejs6/test_worker.sh | 30 ++++++++++++++++++++++++++++++ tests/nodejs8/run.stdin | 1 + tests/nodejs8/runbox/run.stderr | 0 tests/nodejs8/runbox/run.stdin | 1 + tests/nodejs8/runbox/run.stdout | 1 + tests/nodejs8/runbox/script.js | 11 +++++++++++ tests/nodejs8/script.js | 11 +++++++++++ tests/nodejs8/test_worker.sh | 30 ++++++++++++++++++++++++++++++ tests/py2/run.stdin | 1 + tests/py2/runbox/run.stderr | 0 tests/py2/runbox/run.stdin | 1 + tests/py2/runbox/run.stdout | 1 + tests/py2/runbox/script.py | 2 ++ tests/py2/script.py | 2 ++ tests/py2/test_worker.sh | 30 ++++++++++++++++++++++++++++++ tests/py3/run.stdin | 1 + tests/py3/runbox/run.stderr | 0 tests/py3/runbox/run.stdin | 1 + tests/py3/runbox/run.stdout | 1 + tests/py3/runbox/script.py | 2 ++ tests/py3/script.py | 2 ++ tests/py3/test_worker.sh | 30 ++++++++++++++++++++++++++++++ tests/ruby/run.stdin | 1 + tests/ruby/runbox/run.stderr | 0 tests/ruby/runbox/run.stdin | 1 + tests/ruby/runbox/run.stdout | 1 + tests/ruby/runbox/script.rb | 1 + tests/ruby/script.rb | 1 + tests/ruby/test_worker.sh | 30 ++++++++++++++++++++++++++++++ 92 files changed, 503 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100755 build_workers.sh create mode 100644 containers/c/Dockerfile create mode 100755 containers/c/compile.sh create mode 100644 containers/c/run.sh create mode 100644 containers/cpp/Dockerfile create mode 100755 containers/cpp/compile.sh create mode 100644 containers/cpp/run.sh create mode 100644 containers/java8/Dockerfile create mode 100755 containers/java8/compile.sh create mode 100644 containers/java8/run.sh create mode 100644 containers/nodejs6/Dockerfile create mode 100644 containers/nodejs6/compile.sh create mode 100644 containers/nodejs6/run.sh create mode 100644 containers/nodejs8/Dockerfile create mode 100644 containers/nodejs8/compile.sh create mode 100644 containers/nodejs8/run.sh create mode 100644 containers/py2/Dockerfile create mode 100644 containers/py2/compile.sh create mode 100644 containers/py2/run.sh create mode 100644 containers/py3/Dockerfile create mode 100644 containers/py3/compile.sh create mode 100644 containers/py3/run.sh create mode 100644 containers/ruby/Dockerfile create mode 100644 containers/ruby/compile.sh create mode 100644 containers/ruby/run.sh create mode 100644 tests/c/run.stdin create mode 100644 tests/c/runbox/compile.stderr create mode 100644 tests/c/runbox/compile.stdout create mode 100755 tests/c/runbox/exe create mode 100644 tests/c/runbox/run.stderr create mode 100644 tests/c/runbox/run.stdin create mode 100644 tests/c/runbox/run.stdout create mode 100644 tests/c/runbox/source.c create mode 100644 tests/c/source.c create mode 100755 tests/c/test_worker.sh create mode 100644 tests/cpp/run.stdin create mode 100644 tests/cpp/runbox/compile.stderr create mode 100644 tests/cpp/runbox/compile.stdout create mode 100755 tests/cpp/runbox/exe create mode 100644 tests/cpp/runbox/run.stderr create mode 100644 tests/cpp/runbox/run.stdin create mode 100644 tests/cpp/runbox/run.stdout create mode 100644 tests/cpp/runbox/source.cpp create mode 100644 tests/cpp/source.cpp create mode 100755 tests/cpp/test_worker.sh create mode 100644 tests/java8/Main.java create mode 100644 tests/java8/run.stdin create mode 100644 tests/java8/runbox/Main.class create mode 100644 tests/java8/runbox/Main.java create mode 100644 tests/java8/runbox/compile.stderr create mode 100644 tests/java8/runbox/compile.stdout create mode 100644 tests/java8/runbox/run.stderr create mode 100644 tests/java8/runbox/run.stdin create mode 100644 tests/java8/runbox/run.stdout create mode 100755 tests/java8/test_worker.sh create mode 100644 tests/nodejs6/run.stdin create mode 100644 tests/nodejs6/runbox/run.stderr create mode 100644 tests/nodejs6/runbox/run.stdin create mode 100644 tests/nodejs6/runbox/run.stdout create mode 100644 tests/nodejs6/runbox/script.js create mode 100644 tests/nodejs6/script.js create mode 100755 tests/nodejs6/test_worker.sh create mode 100644 tests/nodejs8/run.stdin create mode 100644 tests/nodejs8/runbox/run.stderr create mode 100644 tests/nodejs8/runbox/run.stdin create mode 100644 tests/nodejs8/runbox/run.stdout create mode 100644 tests/nodejs8/runbox/script.js create mode 100644 tests/nodejs8/script.js create mode 100755 tests/nodejs8/test_worker.sh create mode 100644 tests/py2/run.stdin create mode 100644 tests/py2/runbox/run.stderr create mode 100644 tests/py2/runbox/run.stdin create mode 100644 tests/py2/runbox/run.stdout create mode 100644 tests/py2/runbox/script.py create mode 100644 tests/py2/script.py create mode 100755 tests/py2/test_worker.sh create mode 100644 tests/py3/run.stdin create mode 100644 tests/py3/runbox/run.stderr create mode 100644 tests/py3/runbox/run.stdin create mode 100644 tests/py3/runbox/run.stdout create mode 100644 tests/py3/runbox/script.py create mode 100644 tests/py3/script.py create mode 100644 tests/py3/test_worker.sh create mode 100644 tests/ruby/run.stdin create mode 100644 tests/ruby/runbox/run.stderr create mode 100644 tests/ruby/runbox/run.stdin create mode 100644 tests/ruby/runbox/run.stdout create mode 100644 tests/ruby/runbox/script.rb create mode 100644 tests/ruby/script.rb create mode 100644 tests/ruby/test_worker.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..723ef36 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..90cf890 --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +# judge-workers + +This is one of the component of Coding Blocke Online Code Judge v2 + +## Workers + +Workers are docker containers that run the code. They have simple requirements + + - They have one compile.sh file that compiles (if required) the source + - They have a run.sh file that runs the source or the binary + +## Composition + +All workers are built on top of [alpine linux](https://alpinelinux.org/) 3.6 + +## Supported Languages + +Currently we have following images - + + - [c](containers/c) + - [cpp](containers/cpp) + - [java8](containers/java8) + - [nodejs6](containers/nodejs6) + - [nodejs](containers/nodejs8) + - [py2](containers/py2) + - [ruby](containers/ruby) diff --git a/build_workers.sh b/build_workers.sh new file mode 100755 index 0000000..e476616 --- /dev/null +++ b/build_workers.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +cd $(dirname "$0") +DIR=$(cd -) + +for i in $(ls "$DIR/containers") +do + cd $DIR/containers/$i + #docker image rm codingblocks/judge-worker-$i + docker build -t codingblocks/judge-worker-$i . + cd $DIR +done + +read -p "Push the images? [Enter to Continue | Ctrl-C to exit]" + +for i in $(ls "$DIR/containers") +do + cd $DIR/containers/$i + docker push codingblocks/judge-worker-$i + cd $DIR +done diff --git a/containers/c/Dockerfile b/containers/c/Dockerfile new file mode 100644 index 0000000..9053c7f --- /dev/null +++ b/containers/c/Dockerfile @@ -0,0 +1,7 @@ +FROM alpine:3.6 + +RUN apk add --no-cache gcc musl-dev bash +COPY ./compile.sh /bin/compile.sh +COPY ./run.sh /bin/run.sh +RUN chmod 777 /bin/compile.sh; \ + chmod 777 /bin/run.sh \ No newline at end of file diff --git a/containers/c/compile.sh b/containers/c/compile.sh new file mode 100755 index 0000000..b68e0b9 --- /dev/null +++ b/containers/c/compile.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +gcc -o exe source.c 2> compile.stderr 1> compile.stdout diff --git a/containers/c/run.sh b/containers/c/run.sh new file mode 100644 index 0000000..ab73511 --- /dev/null +++ b/containers/c/run.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +chmod 777 exe +./exe < run.stdin 1> run.stdout 2> run.stderr diff --git a/containers/cpp/Dockerfile b/containers/cpp/Dockerfile new file mode 100644 index 0000000..5ac3768 --- /dev/null +++ b/containers/cpp/Dockerfile @@ -0,0 +1,7 @@ +FROM alpine:3.6 + +RUN apk add --no-cache g++ musl-dev bash +COPY ./compile.sh /bin/compile.sh +COPY ./run.sh /bin/run.sh +RUN chmod 777 /bin/compile.sh; \ + chmod 777 /bin/run.sh \ No newline at end of file diff --git a/containers/cpp/compile.sh b/containers/cpp/compile.sh new file mode 100755 index 0000000..443eff4 --- /dev/null +++ b/containers/cpp/compile.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +g++ -o exe source.cpp 2> compile.stderr 1> compile.stdout diff --git a/containers/cpp/run.sh b/containers/cpp/run.sh new file mode 100644 index 0000000..ab73511 --- /dev/null +++ b/containers/cpp/run.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +chmod 777 exe +./exe < run.stdin 1> run.stdout 2> run.stderr diff --git a/containers/java8/Dockerfile b/containers/java8/Dockerfile new file mode 100644 index 0000000..88277e0 --- /dev/null +++ b/containers/java8/Dockerfile @@ -0,0 +1,10 @@ +FROM alpine:3.6 + +RUN apk add --no-cache openjdk8 bash +ENV PATH="/usr/lib/jvm/java-1.8-openjdk/bin:${PATH}" + +COPY ./compile.sh /bin/compile.sh +COPY ./run.sh /bin/run.sh + +RUN chmod 777 /bin/compile.sh; \ + chmod 777 /bin/run.sh diff --git a/containers/java8/compile.sh b/containers/java8/compile.sh new file mode 100755 index 0000000..bcbc086 --- /dev/null +++ b/containers/java8/compile.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +javac Main.java 2> compile.stderr 1> compile.stdout diff --git a/containers/java8/run.sh b/containers/java8/run.sh new file mode 100644 index 0000000..6bba19d --- /dev/null +++ b/containers/java8/run.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +java Main < run.stdin 1> run.stdout 2> run.stderr \ No newline at end of file diff --git a/containers/nodejs6/Dockerfile b/containers/nodejs6/Dockerfile new file mode 100644 index 0000000..12c50c3 --- /dev/null +++ b/containers/nodejs6/Dockerfile @@ -0,0 +1,7 @@ +FROM alpine:3.6 + +RUN apk add --no-cache nodejs=6.10.3-r1 bash +COPY ./compile.sh /bin/compile.sh +COPY ./run.sh /bin/run.sh +RUN chmod 777 /bin/compile.sh; \ + chmod 777 /bin/run.sh \ No newline at end of file diff --git a/containers/nodejs6/compile.sh b/containers/nodejs6/compile.sh new file mode 100644 index 0000000..212c4ba --- /dev/null +++ b/containers/nodejs6/compile.sh @@ -0,0 +1 @@ +#!/usr/bin/env bash \ No newline at end of file diff --git a/containers/nodejs6/run.sh b/containers/nodejs6/run.sh new file mode 100644 index 0000000..c261bd1 --- /dev/null +++ b/containers/nodejs6/run.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +node script.js < run.stdin 1> run.stdout 2> run.stderr \ No newline at end of file diff --git a/containers/nodejs8/Dockerfile b/containers/nodejs8/Dockerfile new file mode 100644 index 0000000..fd9b89b --- /dev/null +++ b/containers/nodejs8/Dockerfile @@ -0,0 +1,7 @@ +FROM alpine:3.7 + +RUN apk add --no-cache nodejs=8.9.3-r0 bash +COPY ./compile.sh /bin/compile.sh +COPY ./run.sh /bin/run.sh +RUN chmod 777 /bin/compile.sh; \ + chmod 777 /bin/run.sh \ No newline at end of file diff --git a/containers/nodejs8/compile.sh b/containers/nodejs8/compile.sh new file mode 100644 index 0000000..212c4ba --- /dev/null +++ b/containers/nodejs8/compile.sh @@ -0,0 +1 @@ +#!/usr/bin/env bash \ No newline at end of file diff --git a/containers/nodejs8/run.sh b/containers/nodejs8/run.sh new file mode 100644 index 0000000..c261bd1 --- /dev/null +++ b/containers/nodejs8/run.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +node script.js < run.stdin 1> run.stdout 2> run.stderr \ No newline at end of file diff --git a/containers/py2/Dockerfile b/containers/py2/Dockerfile new file mode 100644 index 0000000..000208b --- /dev/null +++ b/containers/py2/Dockerfile @@ -0,0 +1,7 @@ +FROM alpine:3.6 + +RUN apk add --no-cache python2 bash +COPY ./compile.sh /bin/compile.sh +COPY ./run.sh /bin/run.sh +RUN chmod 777 /bin/compile.sh; \ + chmod 777 /bin/run.sh \ No newline at end of file diff --git a/containers/py2/compile.sh b/containers/py2/compile.sh new file mode 100644 index 0000000..212c4ba --- /dev/null +++ b/containers/py2/compile.sh @@ -0,0 +1 @@ +#!/usr/bin/env bash \ No newline at end of file diff --git a/containers/py2/run.sh b/containers/py2/run.sh new file mode 100644 index 0000000..0a53a9f --- /dev/null +++ b/containers/py2/run.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +python script.py < run.stdin 1> run.stdout 2> run.stderr \ No newline at end of file diff --git a/containers/py3/Dockerfile b/containers/py3/Dockerfile new file mode 100644 index 0000000..fe69983 --- /dev/null +++ b/containers/py3/Dockerfile @@ -0,0 +1,7 @@ +FROM alpine:3.6 + +RUN apk add --no-cache python3 bash +COPY ./compile.sh /bin/compile.sh +COPY ./run.sh /bin/run.sh +RUN chmod 777 /bin/compile.sh; \ + chmod 777 /bin/run.sh \ No newline at end of file diff --git a/containers/py3/compile.sh b/containers/py3/compile.sh new file mode 100644 index 0000000..212c4ba --- /dev/null +++ b/containers/py3/compile.sh @@ -0,0 +1 @@ +#!/usr/bin/env bash \ No newline at end of file diff --git a/containers/py3/run.sh b/containers/py3/run.sh new file mode 100644 index 0000000..d2a6b8b --- /dev/null +++ b/containers/py3/run.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +python3 script.py < run.stdin 1> run.stdout 2> run.stderr \ No newline at end of file diff --git a/containers/ruby/Dockerfile b/containers/ruby/Dockerfile new file mode 100644 index 0000000..5f66556 --- /dev/null +++ b/containers/ruby/Dockerfile @@ -0,0 +1,7 @@ +FROM alpine:3.6 + +RUN apk add --no-cache ruby bash +COPY ./compile.sh /bin/compile.sh +COPY ./run.sh /bin/run.sh +RUN chmod 777 /bin/compile.sh; \ + chmod 777 /bin/run.sh \ No newline at end of file diff --git a/containers/ruby/compile.sh b/containers/ruby/compile.sh new file mode 100644 index 0000000..212c4ba --- /dev/null +++ b/containers/ruby/compile.sh @@ -0,0 +1 @@ +#!/usr/bin/env bash \ No newline at end of file diff --git a/containers/ruby/run.sh b/containers/ruby/run.sh new file mode 100644 index 0000000..c8a4c63 --- /dev/null +++ b/containers/ruby/run.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +ruby script.py < run.stdin 1> run.stdout 2> run.stderr \ No newline at end of file diff --git a/tests/c/run.stdin b/tests/c/run.stdin new file mode 100644 index 0000000..beef906 --- /dev/null +++ b/tests/c/run.stdin @@ -0,0 +1 @@ +World \ No newline at end of file diff --git a/tests/c/runbox/compile.stderr b/tests/c/runbox/compile.stderr new file mode 100644 index 0000000..e69de29 diff --git a/tests/c/runbox/compile.stdout b/tests/c/runbox/compile.stdout new file mode 100644 index 0000000..e69de29 diff --git a/tests/c/runbox/exe b/tests/c/runbox/exe new file mode 100755 index 0000000000000000000000000000000000000000..65c3a0888a7c7492592a693d5c391e948f9289a9 GIT binary patch literal 10672 zcmeHNeQX@X6`#HHIp;XGFLqjDLSP9=YpVKe6A}!;i5=Fv;_I$Ut56*Yy zK7x}_L5ZL>k*gG_XrU5SKO~9(A*Ax5wrY?O0wGlqRST7>Hc~+~4U~koG$Ui zb=MG9hhGDJoBMwE&M*FQ-|f%Mo~r-Dt$Qvy@!R*5w@|31F!)9dBen;>Rb}uCfR&R! z0NgAie_sXs@e23`;N|QOR={7bVCRn&@KN9)(IkQ)6S;+yLpCIqi75?l0p18tpH!2a z$0@Glbvx^%{9>_D%`=u47}sdHWK?ZClZ`}gv7-~W*kh4+LfG+SJS(Qs@nm*P*kj;C zCK^d1Z%3yi1Vj??0}fa+NZRSFJsF87h3&*5*$4_oGZ_~Ll#Bt0IcaA+p2<3Cdn_H9 zbWq1wO4tL#J8Ui(-qD*#C7t2OXacsWWI?I8Y}-D2NLlMmL^2sCgBsY3*FGG9bhN>g zRJo(zN1^=8IP;Gxd79e=-y#2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G|ve=BrJgu?~iKQQIie=l|1TO7DGd(pY(%$b_38XW(5I=!_49tGTj}%vA+g_BpWF3it$yAY9ce%T(v(XIPu6GpW0ZK? zUx?RK1uVw~bpB^3AdK5@avZMo2U$^3Q{$fmPxZHJcu?u%2J~Jfj8;0@1Rh} zNIpaxJETu~|9l7;(r+hWPqLK$t(tLWnN}ggd5^kyUTv*^?*)<9Wg9B!A5mNIA8Pvg z_>nz+cX>tI)mHtadXHa%Li$$m{N?Wl?fZD{diBkVUG56axZeJy74(NpSAV6Zpt0gV DnvQ%l literal 0 HcmV?d00001 diff --git a/tests/c/runbox/run.stderr b/tests/c/runbox/run.stderr new file mode 100644 index 0000000..e69de29 diff --git a/tests/c/runbox/run.stdin b/tests/c/runbox/run.stdin new file mode 100644 index 0000000..beef906 --- /dev/null +++ b/tests/c/runbox/run.stdin @@ -0,0 +1 @@ +World \ No newline at end of file diff --git a/tests/c/runbox/run.stdout b/tests/c/runbox/run.stdout new file mode 100644 index 0000000..5e1c309 --- /dev/null +++ b/tests/c/runbox/run.stdout @@ -0,0 +1 @@ +Hello World \ No newline at end of file diff --git a/tests/c/runbox/source.c b/tests/c/runbox/source.c new file mode 100644 index 0000000..1121887 --- /dev/null +++ b/tests/c/runbox/source.c @@ -0,0 +1,8 @@ +#include + +int main () { + char in[10]; + scanf("%s", in); + printf("Hello %s", in); + return 0; +} \ No newline at end of file diff --git a/tests/c/source.c b/tests/c/source.c new file mode 100644 index 0000000..1121887 --- /dev/null +++ b/tests/c/source.c @@ -0,0 +1,8 @@ +#include + +int main () { + char in[10]; + scanf("%s", in); + printf("Hello %s", in); + return 0; +} \ No newline at end of file diff --git a/tests/c/test_worker.sh b/tests/c/test_worker.sh new file mode 100755 index 0000000..de74bee --- /dev/null +++ b/tests/c/test_worker.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +pushd $(dirname "$0") +DIR=$(pwd) +RUNBOX="${DIR}/runbox" + +echo $RUNBOX +# Create runbox +mkdir -p $RUNBOX + +# Copy source to runbox +cp $DIR/source.c $RUNBOX/source.c +cp $DIR/run.stdin $RUNBOX/run.stdin + +# Test Compile +docker run \ + --cpus="0.5" \ + --memory="20m" \ + --ulimit nofile=64:64 \ + --rm \ + --read-only \ + -v "$RUNBOX":/usr/src/runbox \ + -w /usr/src/runbox codingblocks/judge-worker-c \ + bash -c "/bin/compile.sh && /bin/run.sh" + + +# Delete runbox +#rm -rf $RUNBOX \ No newline at end of file diff --git a/tests/cpp/run.stdin b/tests/cpp/run.stdin new file mode 100644 index 0000000..beef906 --- /dev/null +++ b/tests/cpp/run.stdin @@ -0,0 +1 @@ +World \ No newline at end of file diff --git a/tests/cpp/runbox/compile.stderr b/tests/cpp/runbox/compile.stderr new file mode 100644 index 0000000..e69de29 diff --git a/tests/cpp/runbox/compile.stdout b/tests/cpp/runbox/compile.stdout new file mode 100644 index 0000000..e69de29 diff --git a/tests/cpp/runbox/exe b/tests/cpp/runbox/exe new file mode 100755 index 0000000000000000000000000000000000000000..c56dde970d2adbf09d6821bf008c0afa07f19d65 GIT binary patch literal 11304 zcmeHNeQ;dWb-!<)R$AGTyprr-#}GC$ZtbR8Nk}%vAS_vu{bb}1^pTQ)=XtgJBrWXj z6T5GXOhW5mk{}$lPQrlGWCqeEDU-<%PdjOWX&XCAQ&QTg`x!dZ>3B%eDr0EOblNHd z@%DG_yJ!9O?b`xL{>;_9J?H+;$Gz`DQQ<+ep!WIzd?-J%$f z0kKO&@Y^BYFY1vGOU#uIxCBx+omZ}zDz`$1xQWr`KNm{%1Z~c(Nh%$^&;_|H9H6E$h!V4PE|+ACp>O zqI!1(NNxlc3&5WP))s)@Rs+9U1JC0{g35iehW=wU^p61#s?WdI@G}NHhR2_d0SNMw z1s=oWPtTy-s8}x|(O8A(k0ic9Jl|G{FF~tSY!CyjF1`_Zl>R{J`~7?pvNnwP^9@o> zD0Q(L4Ec$va-&Kx4B95vh)2~pXMKTjRd74z*~j!qsl zQ&!%ZO&1(1KY4H{W9O{N#B>HSv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^eY50*2*M7Utz?T*O2gEY6Qvd(} literal 0 HcmV?d00001 diff --git a/tests/cpp/runbox/run.stderr b/tests/cpp/runbox/run.stderr new file mode 100644 index 0000000..e69de29 diff --git a/tests/cpp/runbox/run.stdin b/tests/cpp/runbox/run.stdin new file mode 100644 index 0000000..beef906 --- /dev/null +++ b/tests/cpp/runbox/run.stdin @@ -0,0 +1 @@ +World \ No newline at end of file diff --git a/tests/cpp/runbox/run.stdout b/tests/cpp/runbox/run.stdout new file mode 100644 index 0000000..5e1c309 --- /dev/null +++ b/tests/cpp/runbox/run.stdout @@ -0,0 +1 @@ +Hello World \ No newline at end of file diff --git a/tests/cpp/runbox/source.cpp b/tests/cpp/runbox/source.cpp new file mode 100644 index 0000000..42775b5 --- /dev/null +++ b/tests/cpp/runbox/source.cpp @@ -0,0 +1,8 @@ +#include +using namespace std; +int main () { + char in[10]; + cin>>in; + cout<<"Hello "< +using namespace std; +int main () { + char in[10]; + cin>>in; + cout<<"Hello "<9OclMuuXMXSRKR}I-IxuB2RyWSWb;^2eig=H_F7T!num(w+hm{>^PMo(`}we^(@#M!l1OnFgt219 z``kGRz6O32#K(R&OT+kh*CaaKBv1SLU1-47JppeUoXb2l#lkcv&%(&>_JcUqsm&9Y zr+5a?bZOCc*u8b6~2p}rJhQboU5!@oOUM_|3j^?N9Ll)v~(TyAsgI~7h;Bm{8?&Z z7i704UWqTYCa52>P}Ieir@;bM7Fm+Df$md~4_aqfN2e4f6g%xPrM*+iXV^y*D)s6Z fXH({wxiRjHuTD`iOUwy#O`czqim)zA%wpv)!H}Ku literal 0 HcmV?d00001 diff --git a/tests/java8/runbox/Main.java b/tests/java8/runbox/Main.java new file mode 100644 index 0000000..c6ec1e5 --- /dev/null +++ b/tests/java8/runbox/Main.java @@ -0,0 +1,9 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + String input = in.next(); + System.out.println("Hello " + input); + } +} \ No newline at end of file diff --git a/tests/java8/runbox/compile.stderr b/tests/java8/runbox/compile.stderr new file mode 100644 index 0000000..e69de29 diff --git a/tests/java8/runbox/compile.stdout b/tests/java8/runbox/compile.stdout new file mode 100644 index 0000000..e69de29 diff --git a/tests/java8/runbox/run.stderr b/tests/java8/runbox/run.stderr new file mode 100644 index 0000000..e69de29 diff --git a/tests/java8/runbox/run.stdin b/tests/java8/runbox/run.stdin new file mode 100644 index 0000000..beef906 --- /dev/null +++ b/tests/java8/runbox/run.stdin @@ -0,0 +1 @@ +World \ No newline at end of file diff --git a/tests/java8/runbox/run.stdout b/tests/java8/runbox/run.stdout new file mode 100644 index 0000000..557db03 --- /dev/null +++ b/tests/java8/runbox/run.stdout @@ -0,0 +1 @@ +Hello World diff --git a/tests/java8/test_worker.sh b/tests/java8/test_worker.sh new file mode 100755 index 0000000..7daf8c7 --- /dev/null +++ b/tests/java8/test_worker.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +pushd $(dirname "$0") +DIR=$(pwd) +RUNBOX="${DIR}/runbox" + +echo $RUNBOX +# Create runbox +mkdir -p $RUNBOX + +# Copy source to runbox +cp $DIR/Main.java $RUNBOX/Main.java +cp $DIR/run.stdin $RUNBOX/run.stdin + +# Test Compile +docker run \ + --cpus="1" \ + --memory="100m" \ + --ulimit nofile=64:64 \ + --rm \ + --read-only \ + -v "$RUNBOX":/usr/src/runbox \ + -w /usr/src/runbox codingblocks/judge-worker-java8 \ + bash -c "/bin/compile.sh && /bin/run.sh" + +# Delete runbox +#rm -rf $RUNBOX \ No newline at end of file diff --git a/tests/nodejs6/run.stdin b/tests/nodejs6/run.stdin new file mode 100644 index 0000000..beef906 --- /dev/null +++ b/tests/nodejs6/run.stdin @@ -0,0 +1 @@ +World \ No newline at end of file diff --git a/tests/nodejs6/runbox/run.stderr b/tests/nodejs6/runbox/run.stderr new file mode 100644 index 0000000..e69de29 diff --git a/tests/nodejs6/runbox/run.stdin b/tests/nodejs6/runbox/run.stdin new file mode 100644 index 0000000..beef906 --- /dev/null +++ b/tests/nodejs6/runbox/run.stdin @@ -0,0 +1 @@ +World \ No newline at end of file diff --git a/tests/nodejs6/runbox/run.stdout b/tests/nodejs6/runbox/run.stdout new file mode 100644 index 0000000..557db03 --- /dev/null +++ b/tests/nodejs6/runbox/run.stdout @@ -0,0 +1 @@ +Hello World diff --git a/tests/nodejs6/runbox/script.js b/tests/nodejs6/runbox/script.js new file mode 100644 index 0000000..609e7d5 --- /dev/null +++ b/tests/nodejs6/runbox/script.js @@ -0,0 +1,11 @@ +var readline = require('readline'); + +var rl = readline.createInterface({ + input: process.stdin, + output: process.stdout, + terminal: false +}); + +rl.on('line', function (line) { + console.log("Hello " + line); +}); \ No newline at end of file diff --git a/tests/nodejs6/script.js b/tests/nodejs6/script.js new file mode 100644 index 0000000..609e7d5 --- /dev/null +++ b/tests/nodejs6/script.js @@ -0,0 +1,11 @@ +var readline = require('readline'); + +var rl = readline.createInterface({ + input: process.stdin, + output: process.stdout, + terminal: false +}); + +rl.on('line', function (line) { + console.log("Hello " + line); +}); \ No newline at end of file diff --git a/tests/nodejs6/test_worker.sh b/tests/nodejs6/test_worker.sh new file mode 100755 index 0000000..9ff2806 --- /dev/null +++ b/tests/nodejs6/test_worker.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +pushd $(dirname "$0") +DIR=$(pwd) +RUNBOX="${DIR}/runbox" + +echo $RUNBOX +# Remove RUNBOX +rm -rf $RUNBOX + +# Create runbox +mkdir -p $RUNBOX + +# Copy source to runbox +cp $DIR/script.js $RUNBOX/script.js +cp $DIR/run.stdin $RUNBOX/run.stdin + +# Test Compile +docker run \ + --cpus="0.5" \ + --memory="20m" \ + --ulimit nofile=64:64 \ + --rm \ + --read-only \ + -v "$RUNBOX":/usr/src/runbox \ + -w /usr/src/runbox codingblocks/judge-worker-nodejs6 \ + bash -c "/bin/compile.sh && /bin/run.sh" + + +# Delete runbox +#rm -rf $RUNBOX \ No newline at end of file diff --git a/tests/nodejs8/run.stdin b/tests/nodejs8/run.stdin new file mode 100644 index 0000000..beef906 --- /dev/null +++ b/tests/nodejs8/run.stdin @@ -0,0 +1 @@ +World \ No newline at end of file diff --git a/tests/nodejs8/runbox/run.stderr b/tests/nodejs8/runbox/run.stderr new file mode 100644 index 0000000..e69de29 diff --git a/tests/nodejs8/runbox/run.stdin b/tests/nodejs8/runbox/run.stdin new file mode 100644 index 0000000..beef906 --- /dev/null +++ b/tests/nodejs8/runbox/run.stdin @@ -0,0 +1 @@ +World \ No newline at end of file diff --git a/tests/nodejs8/runbox/run.stdout b/tests/nodejs8/runbox/run.stdout new file mode 100644 index 0000000..557db03 --- /dev/null +++ b/tests/nodejs8/runbox/run.stdout @@ -0,0 +1 @@ +Hello World diff --git a/tests/nodejs8/runbox/script.js b/tests/nodejs8/runbox/script.js new file mode 100644 index 0000000..1d03bfa --- /dev/null +++ b/tests/nodejs8/runbox/script.js @@ -0,0 +1,11 @@ +const readline = require('readline'); + +const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout, + terminal: false +}); + +rl.on('line', function (line) { + console.log("Hello " + line); +}); \ No newline at end of file diff --git a/tests/nodejs8/script.js b/tests/nodejs8/script.js new file mode 100644 index 0000000..1d03bfa --- /dev/null +++ b/tests/nodejs8/script.js @@ -0,0 +1,11 @@ +const readline = require('readline'); + +const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout, + terminal: false +}); + +rl.on('line', function (line) { + console.log("Hello " + line); +}); \ No newline at end of file diff --git a/tests/nodejs8/test_worker.sh b/tests/nodejs8/test_worker.sh new file mode 100755 index 0000000..12e3bcd --- /dev/null +++ b/tests/nodejs8/test_worker.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +pushd $(dirname "$0") +DIR=$(pwd) +RUNBOX="${DIR}/runbox" + +echo $RUNBOX +# Remove RUNBOX +rm -rf $RUNBOX + +# Create runbox +mkdir -p $RUNBOX + +# Copy source to runbox +cp $DIR/script.js $RUNBOX/script.js +cp $DIR/run.stdin $RUNBOX/run.stdin + +# Test Compile +docker run \ + --cpus="0.5" \ + --memory="20m" \ + --ulimit nofile=64:64 \ + --rm \ + --read-only \ + -v "$RUNBOX":/usr/src/runbox \ + -w /usr/src/runbox codingblocks/judge-worker-nodejs8 \ + bash -c "/bin/compile.sh && /bin/run.sh" + + +# Delete runbox +#rm -rf $RUNBOX \ No newline at end of file diff --git a/tests/py2/run.stdin b/tests/py2/run.stdin new file mode 100644 index 0000000..beef906 --- /dev/null +++ b/tests/py2/run.stdin @@ -0,0 +1 @@ +World \ No newline at end of file diff --git a/tests/py2/runbox/run.stderr b/tests/py2/runbox/run.stderr new file mode 100644 index 0000000..e69de29 diff --git a/tests/py2/runbox/run.stdin b/tests/py2/runbox/run.stdin new file mode 100644 index 0000000..beef906 --- /dev/null +++ b/tests/py2/runbox/run.stdin @@ -0,0 +1 @@ +World \ No newline at end of file diff --git a/tests/py2/runbox/run.stdout b/tests/py2/runbox/run.stdout new file mode 100644 index 0000000..557db03 --- /dev/null +++ b/tests/py2/runbox/run.stdout @@ -0,0 +1 @@ +Hello World diff --git a/tests/py2/runbox/script.py b/tests/py2/runbox/script.py new file mode 100644 index 0000000..8d6f84c --- /dev/null +++ b/tests/py2/runbox/script.py @@ -0,0 +1,2 @@ +inp = raw_input() +print("Hello " + inp) \ No newline at end of file diff --git a/tests/py2/script.py b/tests/py2/script.py new file mode 100644 index 0000000..8d6f84c --- /dev/null +++ b/tests/py2/script.py @@ -0,0 +1,2 @@ +inp = raw_input() +print("Hello " + inp) \ No newline at end of file diff --git a/tests/py2/test_worker.sh b/tests/py2/test_worker.sh new file mode 100755 index 0000000..e661e8a --- /dev/null +++ b/tests/py2/test_worker.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +pushd $(dirname "$0") +DIR=$(pwd) +RUNBOX="${DIR}/runbox" + +echo $RUNBOX +# Remove RUNBOX +rm -rf $RUNBOX + +# Create runbox +mkdir -p $RUNBOX + +# Copy source to runbox +cp $DIR/script.py $RUNBOX/script.py +cp $DIR/run.stdin $RUNBOX/run.stdin + +# Test Compile +docker run \ + --cpus="0.5" \ + --memory="20m" \ + --ulimit nofile=64:64 \ + --rm \ + --read-only \ + -v "$RUNBOX":/usr/src/runbox \ + -w /usr/src/runbox codingblocks/judge-worker-py2 \ + bash -c "/bin/compile.sh && /bin/run.sh" + + +# Delete runbox +#rm -rf $RUNBOX \ No newline at end of file diff --git a/tests/py3/run.stdin b/tests/py3/run.stdin new file mode 100644 index 0000000..beef906 --- /dev/null +++ b/tests/py3/run.stdin @@ -0,0 +1 @@ +World \ No newline at end of file diff --git a/tests/py3/runbox/run.stderr b/tests/py3/runbox/run.stderr new file mode 100644 index 0000000..e69de29 diff --git a/tests/py3/runbox/run.stdin b/tests/py3/runbox/run.stdin new file mode 100644 index 0000000..beef906 --- /dev/null +++ b/tests/py3/runbox/run.stdin @@ -0,0 +1 @@ +World \ No newline at end of file diff --git a/tests/py3/runbox/run.stdout b/tests/py3/runbox/run.stdout new file mode 100644 index 0000000..5e1c309 --- /dev/null +++ b/tests/py3/runbox/run.stdout @@ -0,0 +1 @@ +Hello World \ No newline at end of file diff --git a/tests/py3/runbox/script.py b/tests/py3/runbox/script.py new file mode 100644 index 0000000..4ed63c2 --- /dev/null +++ b/tests/py3/runbox/script.py @@ -0,0 +1,2 @@ +inp = input() +print("Hello " + inp) \ No newline at end of file diff --git a/tests/py3/script.py b/tests/py3/script.py new file mode 100644 index 0000000..4ed63c2 --- /dev/null +++ b/tests/py3/script.py @@ -0,0 +1,2 @@ +inp = input() +print("Hello " + inp) \ No newline at end of file diff --git a/tests/py3/test_worker.sh b/tests/py3/test_worker.sh new file mode 100644 index 0000000..729a8e2 --- /dev/null +++ b/tests/py3/test_worker.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +pushd $(dirname "$0") +DIR=$(pwd) +RUNBOX="${DIR}/runbox" + +echo $RUNBOX +# Remove RUNBOX +rm -rf $RUNBOX + +# Create runbox +mkdir -p $RUNBOX + +# Copy source to runbox +cp $DIR/script.py $RUNBOX/script.py +cp $DIR/run.stdin $RUNBOX/run.stdin + +# Test Compile +docker run \ + --cpus="0.5" \ + --memory="20m" \ + --ulimit nofile=64:64 \ + --rm \ + --read-only \ + -v "$RUNBOX":/usr/src/runbox \ + -w /usr/src/runbox codingblocks/judge-worker-py3 \ + bash -c "/bin/compile.sh && /bin/run.sh" + + +# Delete runbox +#rm -rf $RUNBOX \ No newline at end of file diff --git a/tests/ruby/run.stdin b/tests/ruby/run.stdin new file mode 100644 index 0000000..beef906 --- /dev/null +++ b/tests/ruby/run.stdin @@ -0,0 +1 @@ +World \ No newline at end of file diff --git a/tests/ruby/runbox/run.stderr b/tests/ruby/runbox/run.stderr new file mode 100644 index 0000000..e69de29 diff --git a/tests/ruby/runbox/run.stdin b/tests/ruby/runbox/run.stdin new file mode 100644 index 0000000..beef906 --- /dev/null +++ b/tests/ruby/runbox/run.stdin @@ -0,0 +1 @@ +World \ No newline at end of file diff --git a/tests/ruby/runbox/run.stdout b/tests/ruby/runbox/run.stdout new file mode 100644 index 0000000..5e1c309 --- /dev/null +++ b/tests/ruby/runbox/run.stdout @@ -0,0 +1 @@ +Hello World \ No newline at end of file diff --git a/tests/ruby/runbox/script.rb b/tests/ruby/runbox/script.rb new file mode 100644 index 0000000..ac3e255 --- /dev/null +++ b/tests/ruby/runbox/script.rb @@ -0,0 +1 @@ +puts "Hello " + gets.to_s \ No newline at end of file diff --git a/tests/ruby/script.rb b/tests/ruby/script.rb new file mode 100644 index 0000000..ac3e255 --- /dev/null +++ b/tests/ruby/script.rb @@ -0,0 +1 @@ +puts "Hello " + gets.to_s \ No newline at end of file diff --git a/tests/ruby/test_worker.sh b/tests/ruby/test_worker.sh new file mode 100644 index 0000000..03ce079 --- /dev/null +++ b/tests/ruby/test_worker.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +pushd $(dirname "$0") +DIR=$(pwd) +RUNBOX="${DIR}/runbox" + +echo $RUNBOX +# Remove RUNBOX +rm -rf $RUNBOX + +# Create runbox +mkdir -p $RUNBOX + +# Copy source to runbox +cp $DIR/script.rb $RUNBOX/script.rb +cp $DIR/run.stdin $RUNBOX/run.stdin + +# Test Compile +docker run \ + --cpus="0.5" \ + --memory="20m" \ + --ulimit nofile=64:64 \ + --rm \ + --read-only \ + -v "$RUNBOX":/usr/src/runbox \ + -w /usr/src/runbox codingblocks/judge-worker-ruby \ + bash -c "/bin/compile.sh && /bin/run.sh" + + +# Delete runbox +#rm -rf $RUNBOX From 7e48aa2b4391f83684a5ed45eff49d27cde430e1 Mon Sep 17 00:00:00 2001 From: Satyabrat Bhol Date: Fri, 15 Jun 2018 00:40:13 +0530 Subject: [PATCH 2/3] Added ruby worker --- containers/ruby/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/containers/ruby/run.sh b/containers/ruby/run.sh index c8a4c63..4916f60 100644 --- a/containers/ruby/run.sh +++ b/containers/ruby/run.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -ruby script.py < run.stdin 1> run.stdout 2> run.stderr \ No newline at end of file +ruby script.rb < run.stdin 1> run.stdout 2> run.stderr From 908a9e4097dd49eaf94218960bb8ea85d401a9d0 Mon Sep 17 00:00:00 2001 From: Satyabrat Bhol Date: Fri, 15 Jun 2018 00:40:50 +0530 Subject: [PATCH 3/3] Added ruby worker --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 5f1d138..90cf890 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,3 @@ Currently we have following images - - [nodejs](containers/nodejs8) - [py2](containers/py2) - [ruby](containers/ruby) - - -