From 03208a1ab23ea9fe4db63cf8af42ddadbded0884 Mon Sep 17 00:00:00 2001 From: Richie Cahill Date: Fri, 10 Apr 2026 13:16:18 -0400 Subject: [PATCH] moved renamed container.py to vllm_container.py --- python/prompt_bench/finetune_container.py | 2 +- python/prompt_bench/main.py | 2 +- .../prompt_bench/{container.py => vllm_container.py} | 10 ++++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) rename python/prompt_bench/{container.py => vllm_container.py} (88%) diff --git a/python/prompt_bench/finetune_container.py b/python/prompt_bench/finetune_container.py index 5b8cb8e..42f5444 100644 --- a/python/prompt_bench/finetune_container.py +++ b/python/prompt_bench/finetune_container.py @@ -9,7 +9,7 @@ from typing import Annotated import typer -from python.prompt_bench.container import check_gpu_free +from python.prompt_bench.vllm_container import check_gpu_free logger = logging.getLogger(__name__) diff --git a/python/prompt_bench/main.py b/python/prompt_bench/main.py index 0d39e69..cb2e7d5 100644 --- a/python/prompt_bench/main.py +++ b/python/prompt_bench/main.py @@ -12,7 +12,7 @@ from typing import Annotated import typer -from python.prompt_bench.container import check_gpu_free, start_vllm, stop_vllm +from python.prompt_bench.vllm_container import check_gpu_free, start_vllm, stop_vllm from python.prompt_bench.downloader import is_model_present from python.prompt_bench.models import BenchmarkConfig from python.prompt_bench.vllm_client import VLLMClient diff --git a/python/prompt_bench/container.py b/python/prompt_bench/vllm_container.py similarity index 88% rename from python/prompt_bench/container.py rename to python/prompt_bench/vllm_container.py index dc73fcc..f29ce7d 100644 --- a/python/prompt_bench/container.py +++ b/python/prompt_bench/vllm_container.py @@ -8,7 +8,7 @@ import subprocess logger = logging.getLogger(__name__) CONTAINER_NAME = "vllm-bench" -VLLM_IMAGE = "vllm/vllm-openai:v0.8.5" +VLLM_IMAGE = "vllm/vllm-openai:v0.19.0" def start_vllm( @@ -49,6 +49,7 @@ def start_vllm( "4096", ] logger.info("Starting vLLM container with model: %s", model) + stop_vllm() result = subprocess.run(command, capture_output=True, text=True, check=False) if result.returncode != 0: msg = f"Failed to start vLLM container: {result.stderr.strip()}" @@ -60,7 +61,12 @@ def stop_vllm() -> None: """Stop and remove the vLLM benchmark container.""" logger.info("Stopping vLLM container") subprocess.run(["docker", "stop", CONTAINER_NAME], capture_output=True, check=False) - subprocess.run(["docker", "rm", CONTAINER_NAME], capture_output=True, check=False) + subprocess.run(["docker", "rm", "-f", CONTAINER_NAME], capture_output=True, check=False) + subprocess.run( + ["docker", "network", "disconnect", "-f", "bridge", CONTAINER_NAME], + capture_output=True, + check=False, + ) logger.info("vLLM container stopped and removed")