Skip to content

Commit

Permalink
Removed max_num_processes param from AutograderSandbox.run_command.
Browse files Browse the repository at this point in the history
Removed --max_num_processes flag from cmd_runner.py.
  • Loading branch information
james-perretta committed Apr 29, 2020
1 parent 6f76189 commit a091689
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 9 deletions.
7 changes: 0 additions & 7 deletions autograder_sandbox/autograder_sandbox.py
Expand Up @@ -272,7 +272,6 @@ def environment_variables(self) -> Mapping[str, str]:

def run_command(self,
args: List[str],
max_num_processes: Optional[int] = None,
max_stack_size: Optional[int] = None,
max_virtual_memory: Optional[int] = None,
as_root: bool = False,
Expand All @@ -287,9 +286,6 @@ def run_command(self,
:param args: A list of strings that specify which command should
be run inside the sandbox.
:param max_num_processes: The maximum number of processes the
command is allowed to spawn.
:param max_stack_size: The maximum stack size, in bytes, allowed
for the command.
Expand Down Expand Up @@ -318,9 +314,6 @@ def run_command(self,
if stdin is None:
cmd.append('--stdin_devnull')

if max_num_processes is not None:
cmd += ['--max_num_processes', str(max_num_processes)]

if max_stack_size is not None:
cmd += ['--max_stack_size', str(max_stack_size)]

Expand Down
1 change: 0 additions & 1 deletion autograder_sandbox/docker-image-setup/cmd_runner.py
Expand Up @@ -124,7 +124,6 @@ def set_subprocess_rlimits():
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--timeout", type=int)
parser.add_argument("--max_num_processes", type=int)
parser.add_argument("--max_stack_size", type=int)
parser.add_argument("--max_virtual_memory", type=int)
parser.add_argument("--truncate_stdout", type=int)
Expand Down
1 change: 0 additions & 1 deletion autograder_sandbox/tests.py
Expand Up @@ -170,7 +170,6 @@ def test_command_tries_to_read_from_stdin_when_stdin_arg_is_none(self) -> None:
with AutograderSandbox() as sandbox:
result = sandbox.run_command(
['python3', '-c', "import sys; sys.stdin.read(); print('done')"],
max_num_processes=10,
max_stack_size=10000000,
max_virtual_memory=500000000,
timeout=2,
Expand Down

0 comments on commit a091689

Please sign in to comment.