From 826e28b1989fef4229e444d7e7a1b762409f53d8 Mon Sep 17 00:00:00 2001 From: Tomsawyerhu <46986832+Tomsawyerhu@users.noreply.github.com> Date: Tue, 2 Jun 2026 19:02:58 +0800 Subject: [PATCH 1/3] Update container.py --- src/programbench/container.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/programbench/container.py b/src/programbench/container.py index 4c24e57..2e49d5b 100644 --- a/src/programbench/container.py +++ b/src/programbench/container.py @@ -35,6 +35,14 @@ def __init__( self.cpus = cpus self._name = f"programbench-{uuid.uuid4().hex[:12]}" run_args = list(run_args or []) + memory = os.environ.get("PROGRAMBENCH_DOCKER_MEMORY", "20g").strip() + memory_swap = os.environ.get("PROGRAMBENCH_DOCKER_MEMORY_SWAP", memory).strip() + has_memory_arg = any(arg in {"--memory", "-m"} or arg.startswith("--memory=") for arg in run_args) + has_memory_swap_arg = any(arg == "--memory-swap" or arg.startswith("--memory-swap=") for arg in run_args) + if memory and not has_memory_arg: + run_args.extend(["--memory", memory]) + if memory_swap and not has_memory_swap_arg: + run_args.extend(["--memory-swap", memory_swap]) env_dict = {"PYTEST_XDIST_AUTO_NUM_WORKERS": str(cpus), **(env or {})} env_args: list[str] = [] for key, value in env_dict.items(): From c0922c9834311a7c0e1efb9344277837b00dd5dc Mon Sep 17 00:00:00 2001 From: Tomsawyerhu <46986832+Tomsawyerhu@users.noreply.github.com> Date: Wed, 3 Jun 2026 10:54:48 +0800 Subject: [PATCH 2/3] Update container.py --- src/programbench/container.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/programbench/container.py b/src/programbench/container.py index 2e49d5b..61f109c 100644 --- a/src/programbench/container.py +++ b/src/programbench/container.py @@ -9,6 +9,7 @@ import uuid from pathlib import Path from typing import Any +import os from programbench.constants import DOCKER_CP_TIMEOUT, DOCKER_RUN_TIMEOUT @@ -35,7 +36,7 @@ def __init__( self.cpus = cpus self._name = f"programbench-{uuid.uuid4().hex[:12]}" run_args = list(run_args or []) - memory = os.environ.get("PROGRAMBENCH_DOCKER_MEMORY", "20g").strip() + memory = os.environ.get("PROGRAMBENCH_DOCKER_MEMORY", "60g").strip() memory_swap = os.environ.get("PROGRAMBENCH_DOCKER_MEMORY_SWAP", memory).strip() has_memory_arg = any(arg in {"--memory", "-m"} or arg.startswith("--memory=") for arg in run_args) has_memory_swap_arg = any(arg == "--memory-swap" or arg.startswith("--memory-swap=") for arg in run_args) From 4d6bde52074d99f7bb63038836b2ae18b8cc476e Mon Sep 17 00:00:00 2001 From: Tomsawyerhu <46986832+Tomsawyerhu@users.noreply.github.com> Date: Wed, 3 Jun 2026 13:39:08 +0800 Subject: [PATCH 3/3] Update container.py --- src/programbench/container.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/programbench/container.py b/src/programbench/container.py index 61f109c..3477825 100644 --- a/src/programbench/container.py +++ b/src/programbench/container.py @@ -36,6 +36,8 @@ def __init__( self.cpus = cpus self._name = f"programbench-{uuid.uuid4().hex[:12]}" run_args = list(run_args or []) + storage_size = os.environ.get("PROGRAMBENCH_DOCKER_STORAGE_SIZE", "50G").strip() + has_storage_opt_arg = any(arg == "--storage-opt" or arg.startswith("--storage-opt=") for arg in run_args) memory = os.environ.get("PROGRAMBENCH_DOCKER_MEMORY", "60g").strip() memory_swap = os.environ.get("PROGRAMBENCH_DOCKER_MEMORY_SWAP", memory).strip() has_memory_arg = any(arg in {"--memory", "-m"} or arg.startswith("--memory=") for arg in run_args) @@ -44,6 +46,8 @@ def __init__( run_args.extend(["--memory", memory]) if memory_swap and not has_memory_swap_arg: run_args.extend(["--memory-swap", memory_swap]) + if storage_size and not has_storage_opt_arg: + run_args.extend(["--storage-opt", f"size={storage_size}"]) env_dict = {"PYTEST_XDIST_AUTO_NUM_WORKERS": str(cpus), **(env or {})} env_args: list[str] = [] for key, value in env_dict.items():