Skip to content

Commit 2cab407

Browse files
2 parents dc965f3 + dd15325 commit 2cab407

File tree

11 files changed

+74
-0
lines changed

11 files changed

+74
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# judge-workers
2+
3+
This is one of the component of Coding Blocke Online Code Judge v2
4+
5+
## Workers
6+
7+
Workers are docker containers that run the code. They have simple requirements
8+
9+
- They have one compile.sh file that compiles (if required) the source
10+
- They have a run.sh file that runs the source or the binary
11+
12+
## Composition
13+
14+
All workers are built on top of [alpine linux](https://alpinelinux.org/) 3.6
15+
16+
## Supported Languages
17+
18+
Currently we have following images -
19+
20+
- [c](containers/c)
21+
- [cpp](containers/cpp)
22+
- [java8](containers/java8)
23+
- [nodejs6](containers/nodejs6)
24+
- [nodejs](containers/nodejs8)
25+
- [py2](containers/py2)
26+

containers/py3/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM alpine:3.6
2+
3+
RUN apk add --no-cache python3 bash
4+
COPY ./compile.sh /bin/compile.sh
5+
COPY ./run.sh /bin/run.sh
6+
RUN chmod 777 /bin/compile.sh; \
7+
chmod 777 /bin/run.sh

containers/py3/compile.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#!/usr/bin/env bash

containers/py3/run.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
python3 script.py < run.stdin 1> run.stdout 2> run.stderr

tests/py3/run.stdin

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
World

tests/py3/runbox/run.stderr

Whitespace-only changes.

tests/py3/runbox/run.stdin

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
World

tests/py3/runbox/run.stdout

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Hello World

tests/py3/runbox/script.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
inp = input()
2+
print("Hello " + inp)

tests/py3/script.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
inp = input()
2+
print("Hello " + inp)

0 commit comments

Comments
 (0)