Skip to content

Commit ffe4968

Browse files
python2 works
Signed-off-by: Arnav Gupta <arnav@codingblocks.com>
1 parent 82d6c8f commit ffe4968

File tree

10 files changed

+15
-6
lines changed

10 files changed

+15
-6
lines changed

containers/nodejs6/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/py2/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM alpine:3.6
22

33
RUN apk add --no-cache python2 bash
4+
COPY ./compile.sh /bin/compile.sh
45
COPY ./run.sh /bin/run.sh
5-
RUN chmod 777 /bin/run.sh
6+
RUN chmod 777 /bin/compile.sh; \
7+
chmod 777 /bin/run.sh

containers/py2/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/py2/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env bash
22

3-
python script.py 1> run.stdout 2> run.stderr
3+
python script.py < run.stdin 1> run.stdout 2> run.stderr

tests/py2/run.stdin

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

tests/py2/runbox/run.stdin

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

tests/py2/runbox/run.stdout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Hello World!
1+
Hello World

tests/py2/runbox/script.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
print "Hello World!"
1+
inp = raw_input()
2+
print("Hello " + inp)

tests/py2/script.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
print "Hello World!"
1+
inp = raw_input()
2+
print("Hello " + inp)

tests/py2/test_worker.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ mkdir -p $RUNBOX
99

1010
# Copy source to runbox
1111
cp $DIR/script.py $RUNBOX/script.py
12+
cp $DIR/run.stdin $RUNBOX/run.stdin
1213

1314
# Test Compile
1415
docker run \
@@ -19,7 +20,7 @@ docker run \
1920
--read-only \
2021
-v "$RUNBOX":/usr/src/runbox \
2122
-w /usr/src/runbox codingblocks/judge-worker-py2 \
22-
bash -c "/bin/run.sh"
23+
bash -c "/bin/compile.sh && /bin/run.sh"
2324

2425

2526
# Delete runbox

0 commit comments

Comments
 (0)