Skip to content

Commit a08c1c6

Browse files
committed
updated
1 parent 30f9965 commit a08c1c6

4 files changed

Lines changed: 11 additions & 15 deletions

File tree

‎v4-cokapi/Dockerfile‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ MAINTAINER Philip Guo <philip@pgbovine.net>
1818
#
1919
# lots of packages required especially to build ruby and to use the compiled version of 'gem'
2020
RUN apt-get update && apt-get install -y \
21-
nodejs \
2221
openjdk-7-jdk \
2322
python \
2423
build-essential \
@@ -28,10 +27,6 @@ RUN apt-get update && apt-get install -y \
2827
libssl-dev
2928

3029

31-
# ugh ubuntu calls node 'nodejs'
32-
RUN ln -s /usr/bin/nodejs /usr/bin/node
33-
34-
3530
# Ruby backend: pretty complex setup since we need to compile and
3631
# install a custom Ruby interpreter
3732
#
@@ -78,7 +73,7 @@ RUN chmod a+x /tmp/run-java-backend.sh
7873
COPY backends/ruby/pg_logger.rb /tmp/ruby/
7974
RUN cd /tmp/ruby && ln -s ruby-2.2.2-custom-OPT/bin/ruby
8075

81-
# To properly run Ruby tests, become root:
76+
# To properly run Ruby tests, become root since it needs to write files (maybe ?):
8277
# $ docker run -t -i --rm --net=none --cap-drop all pgbovine/cokapi:v1 bash
8378
#COPY backends/ruby/golden_test.py /tmp/ruby/
8479
#RUN mkdir /tmp/ruby/tests

‎v4-cokapi/Makefile‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ prod:
77
jshint cokapi.js && forever -l cokapi-https.log start cokapi.js https &
88

99
deps:
10-
npm install express jshint serve-static sqlite3
10+
npm install express
11+
#npm install express jshint serve-static sqlite3
1112

1213
docker:
1314
docker build -t="pgbovine/cokapi:v1" .
@@ -17,13 +18,13 @@ dockerbash:
1718

1819
test:
1920
@echo 'Python'
20-
@time --portability docker run --rm pgbovine/cokapi:v1 python /tmp/python/generate_json_trace.py --code="x=1; y=2; z=x+y"
21+
@time --portability docker run --rm --user=netuser --net=none --cap-drop all pgbovine/cokapi:v1 python /tmp/python/generate_json_trace.py --code="x=1; y=2; z=x+y"
2122
@echo
2223
@echo 'JS'
23-
@time --portability docker run --rm pgbovine/cokapi:v1 node --expose-debug-as=Debug /tmp/javascript/jslogger.js --jsondump=true --code="var x=1; var y=2; var z=x+y;"
24+
@time --portability docker run --rm --user=netuser --net=none --cap-drop all pgbovine/cokapi:v1 /tmp/javascript/node-v6.0.0-linux-x64/bin/node --expose-debug-as=Debug /tmp/javascript/jslogger.js --jsondump=true --code="var x=1; var y=2; var z=x+y;"
2425
@echo
2526
@echo 'Java'
26-
@time --portability docker run -i --rm pgbovine/cokapi:v1 java -cp /tmp/java_jail/cp:/tmp/java_jail/cp/javax.json-1.0.jar:/usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar traceprinter.InMemory < backends/java/java_jail/cp/traceprinter/test-input.txt
27+
@time --portability docker run -i --rm --user=netuser --net=none --cap-drop all pgbovine/cokapi:v1 java -cp /tmp/java_jail/cp:/tmp/java_jail/cp/javax.json-1.0.jar:/usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar traceprinter.InMemory < backends/java/java_jail/cp/traceprinter/test-input.txt
2728
@echo
2829
@echo 'Ruby'
29-
@time --portability docker run -i --rm pgbovine/cokapi:v1 /tmp/ruby/ruby /tmp/ruby/pg_logger.rb -c "x = 1; y = 2"
30+
@time --portability docker run -i --rm --user=netuser --net=none --cap-drop all pgbovine/cokapi:v1 /tmp/ruby/ruby /tmp/ruby/pg_logger.rb -c "x = 1; y = 2"

‎v4-cokapi/backends/javascript/Makefile‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ test:
1919
diffall:
2020
jshint jslogger.js && python golden_test.py --diffall
2121

22+
# run this before creating any Docker containers
2223
deps:
23-
npm install eval underscore minimist source-map
24-
sudo npm install typescript # ugh need sudo
25-
#sudo npm link typescript # (maybe needed so that require('typescript') will work
24+
npm install eval underscore minimist source-map typescript
25+
tar -xvf node-v6.0.0-linux-x64.tar.xz

‎v4-cokapi/cokapi.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ var JAVA_TIMEOUT_SECS = 15; // the Java backend is SUPER SLOW :/
6363

6464
// bind() res and useJSONP before using
6565
function postExecHandler(res, useJSONP, err, stdout, stderr) {
66+
var errTrace;
6667
if (err) {
6768
console.log('postExecHandler', util.inspect(err, {depth: null}));
68-
var errTrace;
6969
if (err.killed) {
7070
// timeout!
7171
errTrace = {code: '', trace: [{'event': 'uncaught_exception',

0 commit comments

Comments
 (0)