Skip to content

add a smoke test to ensure server images start correctly - #1646

Open
tmckayus wants to merge 1 commit into
NVIDIA:mainfrom
tmckayus:smokeimages
Open

add a smoke test to ensure server images start correctly#1646
tmckayus wants to merge 1 commit into
NVIDIA:mainfrom
tmckayus:smokeimages

Conversation

@tmckayus

Copy link
Copy Markdown
Contributor

This adds a simple smoke test after image builds to make sure the server instances start. The goal is to detect defects in the Dockerfile used to build the image (like faulty configuration of shared library paths, etc).

@tmckayus tmckayus added this to the 26.10 milestone Jul 31, 2026
@tmckayus
tmckayus requested a review from a team as a code owner July 31, 2026 16:49
@tmckayus
tmckayus requested a review from jakirkham July 31, 2026 16:49
@tmckayus tmckayus added non-breaking Introduces a non-breaking change improvement Improves an existing functionality labels Jul 31, 2026
@tmckayus
tmckayus requested a review from ramakrishnap-nv July 31, 2026 16:49
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Image startup smoke testing

Layer / File(s) Summary
Smoke script execution
ci/docker/smoke_image.sh
Adds image acquisition with local fallback, REST and gRPC container startup checks, readiness polling, failure detection, log reporting, cleanup, and configurable timeout and GPU arguments.
CI workflow and documentation
.github/workflows/test_images.yaml, ci/docker/README.md
Runs Ubuntu REST/gRPC smoke tests and conditional CUDA 13 UBI10 tests. Documents the smoke-test commands and CI job.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: jakirkham

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding smoke tests to verify server image startup.
Description check ✅ Passed The description explains the smoke test purpose and its role in detecting Dockerfile defects.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ci/docker/README.md`:
- Line 42: Update the reference in the smoke job note to use the official
product name “GitHub” instead of “GITHUB,” without changing the referenced
workflow or job identifiers.

In `@ci/docker/smoke_image.sh`:
- Around line 40-79: Update smoke_one’s cleanup flow so every failure path
performs cleanup before terminating: handle a failed docker run, replace
fail/exit-based paths with nonzero returns followed by cleanup, or use an EXIT
trap that safely removes the container and temporary log. Preserve log output
and failure status for loader errors, early exits, and timeouts.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 521d87c9-d77d-49a0-8e5f-2bc77bf28770

📥 Commits

Reviewing files that changed from the base of the PR and between 2842c1b and 3b63567.

📒 Files selected for processing (3)
  • .github/workflows/test_images.yaml
  • ci/docker/README.md
  • ci/docker/smoke_image.sh

Comment thread ci/docker/README.md
```

CI runs this for both variants after the multiarch manifests are published
(see `.github/workflows/test_images.yaml` job `smoke`).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use the official GitHub product name.

Replace GITHUB with GitHub.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~42-~42: The official name of this software platform is spelled with a capital “H”.
Context: ... multiarch manifests are published (see .github/workflows/test_images.yaml job smoke...

(GITHUB)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ci/docker/README.md` at line 42, Update the reference in the smoke job note
to use the official product name “GitHub” instead of “GITHUB,” without changing
the referenced workflow or job identifiers.

Source: Linters/SAST tools

Comment thread ci/docker/smoke_image.sh
Comment on lines +40 to +79
cleanup() {
if [[ -n "${cid}" ]]; then
docker rm -f "${cid}" >/dev/null 2>&1 || true
fi
rm -f "${log}"
}
trap cleanup RETURN

info "Starting ${label} server from ${IMAGE}"
# Do not use --rm: a fast crash (e.g. missing libnccl.so.2) would delete the
# container before we can collect logs.
cid="$(docker run -d --name "${name}" "${GPU_ARGS[@]}" "$@" "${IMAGE}")"

for ((i = 1; i <= TIMEOUT_SECS; i++)); do
docker logs "${cid}" >"${log}" 2>&1 || true

if grep -qiE 'error while loading shared libraries|libnccl\.so|FATAL FIPS SELFTEST|OpenSSL internal error' "${log}"; then
echo "----- ${label} logs -----"
cat "${log}"
fail "${label}: loader/crypto failure while starting"
fi

if grep -qE "${expect_re}" "${log}"; then
pass "${label}: matched /${expect_re}/"
return 0
fi

# Container exited before listen — dump logs and fail.
if ! docker inspect -f '{{.State.Running}}' "${cid}" 2>/dev/null | grep -qx true; then
echo "----- ${label} logs -----"
cat "${log}"
fail "${label}: container exited before becoming ready"
fi

sleep 1
done

echo "----- ${label} logs -----"
cat "${log}"
fail "${label}: timed out after ${TIMEOUT_SECS}s waiting for /${expect_re}/"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Run cleanup when a smoke test fails.

trap cleanup RETURN runs only when smoke_one returns. The fail calls use exit 1, so Bash terminates before the function returns. A container that starts and then fails, and its temporary log, remain on the runner. The docker run command at Line 51 can cause the same result through set -e.

Return a nonzero status from smoke_one after each failure path, including a failed docker run, or use an EXIT cleanup design that safely retains the required container and log state.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ci/docker/smoke_image.sh` around lines 40 - 79, Update smoke_one’s cleanup
flow so every failure path performs cleanup before terminating: handle a failed
docker run, replace fail/exit-based paths with nonzero returns followed by
cleanup, or use an EXIT trap that safely removes the container and temporary
log. Preserve log output and failure status for loader errors, early exits, and
timeouts.

@github-actions

Copy link
Copy Markdown

CI Test Summary

✅ All 31 test job(s) passed.

# CUOPT_SERVER_TYPE=grpc. The jobs above run *inside* the image as a GHA
# container and never launch the servers, so they cannot catch packaging
# gaps such as UBI10's RHEL lib/lib64 NCCL path miss.
smoke:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we add the test script as part of test_image.sh ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants