File tree 8 files changed +65
-3
lines changed
8 files changed +65
-3
lines changed Original file line number Diff line number Diff line change @@ -29,5 +29,6 @@ Currently we have following images -
29
29
- [ perl] ( containers/perl )
30
30
- [ py2] ( containers/py2 )
31
31
- [ py3] ( containers/py3 )
32
+ - [ R] ( containers/r )
32
33
- [ ruby] ( containers/ruby )
33
34
- [ rust] ( containers/rust )
Original file line number Diff line number Diff line change
1
+ FROM alpine:3.6
2
+
3
+ RUN apk add --no-cache R="3.3.3-r0" bash
4
+
5
+ COPY ./compile.sh /bin/compile.sh
6
+ COPY ./run.sh /bin/run.sh
7
+
8
+ RUN chmod 777 /bin/compile.sh; \
9
+ chmod 777 /bin/run.sh
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ Rscript script.r < run.stdin 1> run.stdout 2> run.stderr
Original file line number Diff line number Diff line change 4
4
bash tests/c/test_worker.sh
5
5
}
6
6
7
- # @test "test cpp" {
8
- # bash tests/cpp/test_worker.sh
9
- # }
7
+ @test " test cpp" {
8
+ bash tests/cpp/test_worker.sh
9
+ }
10
10
11
11
@test " test csharp" {
12
12
bash tests/csharp/test_worker.sh
40
40
bash tests/py3/test_worker.sh
41
41
}
42
42
43
+ @test " test R" {
44
+ bash tests/R/test_worker.sh
45
+ }
46
+
43
47
@test " test ruby" {
44
48
bash tests/ruby/test_worker.sh
45
49
}
Original file line number Diff line number Diff line change
1
+ World
Original file line number Diff line number Diff line change
1
+ input <- readLines(file(" stdin" ))
2
+ cat(' Hello' ,input )
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ pushd $( dirname " $0 " )
3
+ DIR=$( pwd)
4
+ RUNBOX=" ${DIR} /runbox"
5
+
6
+ echo $RUNBOX
7
+ # Remove RUNBOX
8
+ rm -rf $RUNBOX
9
+
10
+ # Create runbox
11
+ mkdir -p $RUNBOX
12
+
13
+ # Copy source to runbox
14
+ cp -fv $DIR /script.r $RUNBOX /script.r
15
+ cp -fv $DIR /run.stdin $RUNBOX /run.stdin
16
+
17
+ # Test Compile
18
+ docker run \
19
+ --cpus=" 1" \
20
+ --memory=" 100m" \
21
+ --ulimit nofile=64:64 \
22
+ --rm \
23
+ --read-only \
24
+ -v " $RUNBOX " :/usr/src/runbox \
25
+ -v " $RUNBOX " :/tmp \
26
+ -w /usr/src/runbox r \
27
+ bash -c " /bin/compile.sh && /bin/run.sh"
28
+
29
+ ls -lh ${RUNBOX}
30
+
31
+ expected=" Hello World"
32
+ actual=" $( cat ${RUNBOX} /run.stdout) "
33
+ if [ " $expected " == " $actual " ] ; then
34
+ :
35
+ else
36
+ echo " MISMATCH: Expected = $expected ; Actual = $actual "
37
+ exit 1
38
+ fi
39
+
40
+ # Delete runbox
41
+ rm -rf $RUNBOX
You can’t perform that action at this time.
0 commit comments