Skip to content

Commit

Permalink
remove container after gathering logs
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispyles committed Nov 7, 2024
1 parent bdd08c1 commit 2446f31
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion otter/grade/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ def grade_submission(
image,
command=["/autograder/run_autograder"],
networks=["none"] if not network else [],
remove=True,
)

for local_path, container_path in volumes:
Expand Down Expand Up @@ -212,6 +211,9 @@ def kill_container():
logs = docker.container.logs(container)
LOGGER.debug(f"Container {container_id} logs:\n{indent(logs, ' ')}")

docker.container.remove(container)
LOGGER.debug(f"Removed container {container_id}")

# Close our file handles since docker cp will delete the original file when performing the
# copy.
os.close(temp_subm_file)
Expand Down

0 comments on commit 2446f31

Please sign in to comment.