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

Concurrent Grading using asyncio #33

Closed
wants to merge 9 commits into from
Prev Previous commit
Next Next commit
Documentation updates, formatting changes
brhoades committed Mar 5, 2017
commit c6cc8a83a93c1f3711ec98ba74251c59652b52fd
5 changes: 3 additions & 2 deletions grader/grader/commands/grade/async.py
Original file line number Diff line number Diff line change
@@ -8,7 +8,8 @@

def grade(submission, print_lock, rebuild, suppress_output):
"""
Grade a single submission asyncronously.
Grade a single submission asynchronously. Locks to print
output if output is not suppressed.
"""
logger.info("Grading submission for %s", submission.user_id)
output = submission.grade(
@@ -26,7 +27,7 @@ def async_grade(args, users):
"""
Asynchronously grade submissions.
:param argparse.Arguments args: the arguments from the grade
:param argparse.Namespace args: the arguments from the grade
comand.
:param dict users: user_id: [Submission, ...], all
submissions will be graded.
6 changes: 2 additions & 4 deletions grader/grader/models/submission.py
Original file line number Diff line number Diff line change
@@ -678,7 +678,7 @@ def grade(self, rebuild_container=False, show_output=True):
:param bool show_output: Whether to output STDOUT/STDERR from the
container to STDOUT. Defaults to True.
:return: output stfrom the container.
:return: output str from the container.
"""
c_id = self.get_container_id(rebuild=rebuild_container)
@@ -711,8 +711,6 @@ def grade(self, rebuild_container=False, show_output=True):
output_text = output_text.getvalue()
self._record_output(output_text)

self.docker_cli.stop(
container=c_id
)
self.docker_cli.stop(container=c_id)

return output_text