Skip to content

Commit 58473eb

Browse files
Add sm vllm back to test runner (#5383)
* add sm vllm * add sm vllm * add new fucntion for vllm to loosen the if-else * sanity test pytorch * revert toml * test vllm ec2 * revert toml
1 parent 5cf5097 commit 58473eb

File tree

2 files changed

+33
-22
lines changed

2 files changed

+33
-22
lines changed

src/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def collect_installed_packages_information(self):
131131
for command in commands:
132132
command_responses.append(f"\n{command}")
133133
command_responses.append(
134-
bytes.decode(docker_client.containers.run(self.ecr_url, command))
134+
bytes.decode(docker_client.containers.run(self.ecr_url, command, entrypoint=""))
135135
)
136136
docker_client.containers.prune()
137137
return command_responses

test/testrunner.py

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,31 @@ def build_bai_docker_container():
283283
ctx.run("docker build -t bai_env_container -f Dockerfile .")
284284

285285

286+
def run_vllm_tests(test_type, all_image_list, new_test_structure_enabled):
287+
"""
288+
Helper function to run vLLM tests for different test types
289+
"""
290+
try:
291+
LOGGER.info(f"Running vLLM {test_type.upper()} tests with image: {all_image_list[0]}")
292+
if new_test_structure_enabled:
293+
project_root = os.path.dirname(os.path.dirname(os.getcwd()))
294+
spec = importlib.util.spec_from_file_location(
295+
"entrypoint",
296+
os.path.join(project_root, ".infra", "test_infra", "entrypoint.py"),
297+
)
298+
entrypoint_module = importlib.util.module_from_spec(spec)
299+
spec.loader.exec_module(entrypoint_module)
300+
run_new_tests = entrypoint_module.main
301+
LOGGER.info("Using new buildspec-based test system")
302+
run_new_tests()
303+
else:
304+
LOGGER.info("Using legacy test system")
305+
test_vllm()
306+
except Exception as e:
307+
LOGGER.error(f"vLLM {test_type.upper()} tests failed: {str(e)}")
308+
raise
309+
310+
286311
def main():
287312
# Define constants
288313
start_time = datetime.now()
@@ -429,27 +454,8 @@ def main():
429454
framework = frameworks_in_images[0]
430455

431456
if framework == "vllm":
432-
try:
433-
LOGGER.info(f"Running vLLM EKS EC2 tests with image: {all_image_list[0]}")
434-
if new_test_structure_enabled:
435-
project_root = os.path.dirname(os.path.dirname(os.getcwd()))
436-
spec = importlib.util.spec_from_file_location(
437-
"entrypoint",
438-
os.path.join(project_root, ".infra", "test_infra", "entrypoint.py"),
439-
)
440-
entrypoint_module = importlib.util.module_from_spec(spec)
441-
spec.loader.exec_module(entrypoint_module)
442-
run_new_tests = entrypoint_module.main
443-
LOGGER.info("Using new buildspec-based test system")
444-
run_new_tests()
445-
else:
446-
LOGGER.info("Using legacy test system")
447-
test_vllm()
448-
# Exit function after vLLM tests
449-
return
450-
except Exception as e:
451-
LOGGER.error(f"vLLM EKS EC2 tests failed: {str(e)}")
452-
raise
457+
run_vllm_tests(f"{specific_test_type}", all_image_list, new_test_structure_enabled)
458+
return
453459

454460
eks_cluster_name = f"dlc-{framework}-{build_context}"
455461
eks_utils.eks_setup()
@@ -550,6 +556,10 @@ def main():
550556
if os.path.exists(KEYS_TO_DESTROY_FILE):
551557
delete_key_pairs(KEYS_TO_DESTROY_FILE)
552558
elif specific_test_type == "sagemaker":
559+
if "vllm" in dlc_images:
560+
run_vllm_tests("sagemaker", all_image_list, new_test_structure_enabled)
561+
return
562+
553563
if "habana" in dlc_images:
554564
LOGGER.info(f"Skipping SM tests for Habana. Images: {dlc_images}")
555565
# Creating an empty file for because codebuild job fails without it
@@ -604,6 +614,7 @@ def main():
604614
"habana": "Skipping SM tests because SM does not yet support Habana",
605615
"neuron": "Skipping - there are no local mode tests for Neuron",
606616
"huggingface-tensorflow-training": "Skipping - there are no local mode tests for HF TF training",
617+
"vllm": "Skipping - there are no local mode tests for VLLM",
607618
}
608619

609620
for skip_condition, reason in sm_local_to_skip.items():

0 commit comments

Comments
 (0)