Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update #405

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ RUN cat /etc/cron.d/* | crontab -

COPY . .

RUN npm cache clean -f
RUN npm install -g n
RUN sudo n 18.15.0
RUN npm install --global typescript

RUN chmod -R 777 /api

ENTRYPOINT ["/api/docker-entrypoint.sh"]
CMD ["/api/scripts/server"]

Expand Down
6 changes: 3 additions & 3 deletions app/controllers/submissions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ def create
if submission.save
if @wait
begin
IsolateRunner.perform_now(submission)
IsolateJob.perform_now(submission)
submission.reload
render json: submission, status: :created, base64_encoded: @base64_encoded, fields: @requested_fields
rescue Encoding::UndefinedConversionError => e
render_conversion_error(:created, submission.token)
end
else
IsolateRunner.perform_later(submission)
IsolateJob.perform_later(submission)
render json: submission, status: :created, fields: [:token]
end
else
Expand Down Expand Up @@ -143,7 +143,7 @@ def batch_create

submissions.each do |submission|
if submission.save
IsolateRunner.perform_later(submission)
IsolateJob.perform_later(submission)
response << { token: submission.token }
has_valid_submission = true
else
Expand Down
1 change: 1 addition & 0 deletions app/jobs/isolate_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def compile
initialize_file(compile_output_file)

command = "isolate #{cgroups} \
--share-net \
-s \
-b #{box_id} \
-M #{metadata_file} \
Expand Down
8 changes: 4 additions & 4 deletions db/languages/active.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@
},
{
id: 63,
name: "JavaScript (Node.js 12.14.0)",
name: "JavaScript (Node.js 18.15.0)",
is_archived: false,
source_file: "script.js",
run_cmd: "/usr/local/node-12.14.0/bin/node script.js"
run_cmd: "node script.js"
},
{
id: 64,
Expand Down Expand Up @@ -239,11 +239,11 @@
},
{
id: 74,
name: "TypeScript (3.7.4)",
name: "TypeScript (5.0.2)",
is_archived: false,
source_file: "script.ts",
compile_cmd: "/usr/bin/tsc %s script.ts",
run_cmd: "/usr/local/node-12.14.0/bin/node script.js"
run_cmd: "node script.js"
},
{
id: 75,
Expand Down
8 changes: 6 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ x-logging:

services:
server:
image: judge0/judge0:latest
build:
context: .
dockerfile: Dockerfile
volumes:
- ./judge0.conf:/judge0.conf:ro
ports:
Expand All @@ -19,7 +21,9 @@ services:
restart: always

worker:
image: judge0/judge0:latest
build:
context: .
dockerfile: Dockerfile
command: ["./scripts/workers"]
volumes:
- ./judge0.conf:/judge0.conf:ro
Expand Down