INGInious icon indicating copy to clipboard operation
INGInious copied to clipboard

[agent_docker] scheduling allowed if student container require a missing runtime.

Open anthonygego opened this issue 2 years ago • 0 comments

Describe the bug

If a task is configured for standard Docker runc runtime, but calls run_student with run-as-root option, student container creation fails with an Exception and never returns correctly. The end-user has to cancel the job manually.

 oct 07 09:13:35 inginious-agents-2 inginious-agent-docker[2826]: Traceback (most recent call last):
 oct 07 09:13:35 inginious-agents-2 inginious-agent-docker[2826]:   File "/opt/inginious-venv/lib64/python3.8/site-packages/inginious/agent/docker_agent/__init__.py", line 467, in create_student_container
 oct 07 09:13:35 inginious-agents-2 inginious-agent-docker[2826]:     runtime_name = {k for k in self._runtimes if self._runtimes[k].run_as_root}.pop()
 oct 07 09:13:35 inginious-agents-2 inginious-agent-docker[2826]: KeyError: 'pop from an empty set'

INGInious installation details

  • Version: v0.7+

To Reproduce Steps to reproduce the behavior: Use run_student --run-as-root inside the grading script:

#!/bin/bash

getinput "thecode" > student/student_code.py
output=$(run_student --run-as-root python3 student/student_code.py)

if [ "$output" = "Hello World!" ]; then
    feedback-result success
else
    feedback-result failed
    feedback-msg -em "Your program displayed : $output"
fi

Expected behavior

  1. In a first time: A clean "internal error" message is returned to the end user informing the environment is not available, whatever the setup is.
  2. In a second time: In case we are in mixed agent environments (runc only and both runc,kata), add a mechanism for specifying multiple runtimes for the task if required, so that the scheduling can be done on the most appropriate agent.

anthonygego avatar Oct 07 '22 07:10 anthonygego