Skip to content

Commit 99bb3ee

Browse files
authored
fix: fix test failure due to curl not found (#600)
Signed-off-by: lkomali <lkomali@nvidia.com>
1 parent bbfd30e commit 99bb3ee

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,21 @@ COPY --from=wheel-builder /dist /dist
130130
RUN uv pip install /dist/aiperf-*.whl \
131131
&& rm -rf /dist /workspace/pyproject.toml
132132

133+
############################################
134+
############### Test Image #################
135+
############################################
136+
# Test stage: env-builder has aiperf, just add curl
137+
FROM env-builder AS test
138+
139+
RUN apt-get update -y && \
140+
apt-get install -y curl && \
141+
rm -rf /var/lib/apt/lists/*
142+
143+
ENV VIRTUAL_ENV=/opt/aiperf/venv \
144+
PATH="/opt/aiperf/venv/bin:${PATH}"
145+
146+
ENTRYPOINT ["/bin/bash", "-c"]
147+
133148
############################################
134149
############# Runtime Image ################
135150
############################################

tests/ci/test_docs_end_to_end/test_runner.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ def _build_aiperf_container(self) -> bool:
8989
# Get repo root using centralized function
9090
repo_root = get_repo_root()
9191

92-
# Build the container
93-
build_command = f"cd {repo_root} && docker build -t aiperf:test ."
92+
build_command = f"cd {repo_root} && docker build --target test -t aiperf:test ."
9493

9594
logger.info("Building AIPerf Docker image...")
9695
logger.info(f"Build command: {build_command}")
@@ -143,9 +142,9 @@ def _build_aiperf_container(self) -> bool:
143142
self.aiperf_container_id = container_name
144143
logger.info(f"AIPerf container ready: {container_name}")
145144

146-
# Verify aiperf works by checking the virtual environment
145+
# Verify aiperf works
147146
verify_result = subprocess.run(
148-
f"docker exec {container_name} bash -c 'source /opt/aiperf/venv/bin/activate && aiperf --version'",
147+
f"docker exec {container_name} aiperf --version",
149148
shell=True,
150149
capture_output=True,
151150
text=True,
@@ -323,12 +322,12 @@ def _test_server(self, server: Server) -> bool:
323322
f"Running AIPerf test {i + 1}/{len(server.aiperf_commands)} for {server.name}"
324323
)
325324

326-
# Execute aiperf command in the container with verbose output (use the virtual environment)
325+
# Execute aiperf command in the container with verbose output
327326
# Add --ui-type simple to all aiperf commands
328327
aiperf_command_with_ui = aiperf_cmd.command.replace(
329328
"aiperf profile", f"aiperf profile --ui-type {AIPERF_UI_TYPE}"
330329
)
331-
exec_command = f"docker exec {self.aiperf_container_id} bash -c 'source /opt/aiperf/venv/bin/activate && {aiperf_command_with_ui}'"
330+
exec_command = f"docker exec {self.aiperf_container_id} bash -c '{aiperf_command_with_ui}'"
332331

333332
logger.info(
334333
f"Executing AIPerf command {i + 1}/{len(server.aiperf_commands)} against {server.name}:"

0 commit comments

Comments
 (0)