-
Notifications
You must be signed in to change notification settings - Fork 739
feat(fault-injection): Add GPU fault injector agent #4043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughIntroduces a new GPU Fault Injector Agent service for testing GPU fault scenarios. Includes a FastAPI-based agent with endpoints for health checks, XID 79 fault injection via kernel methods, and fault listing; kernel-level injection module; Docker container setup; and Python dependencies. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Areas requiring extra attention:
Poem
Pre-merge checks✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
tests/fault_tolerance/hardware/fault-injection-service/agents/gpu-fault-injector/Dockerfile(1 hunks)tests/fault_tolerance/hardware/fault-injection-service/agents/gpu-fault-injector/agent.py(1 hunks)tests/fault_tolerance/hardware/fault-injection-service/agents/gpu-fault-injector/gpu_xid_injector.py(1 hunks)tests/fault_tolerance/hardware/fault-injection-service/agents/gpu-fault-injector/requirements.txt(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
tests/fault_tolerance/hardware/fault-injection-service/agents/gpu-fault-injector/agent.py (1)
tests/fault_tolerance/hardware/fault-injection-service/agents/gpu-fault-injector/gpu_xid_injector.py (2)
GPUXIDInjectorKernel(23-153)inject_xid_79_gpu_fell_off_bus(56-79)
🪛 OSV Scanner (2.2.4)
tests/fault_tolerance/hardware/fault-injection-service/agents/gpu-fault-injector/requirements.txt
[HIGH] 1-1: fastapi 0.109.0: undefined
(PYSEC-2024-38)
[HIGH] 1-1: python-multipart 0.0.6: python-multipart vulnerable to Content-Type Header ReDoS
[HIGH] 1-1: python-multipart 0.0.6: Denial of service (DoS) via deformation multipart/form-data boundary
[HIGH] 1-1: starlette 0.35.1: Starlette has possible denial-of-service vector when parsing large files in multipart forms
[HIGH] 1-1: starlette 0.35.1: Starlette Denial of service (DoS) via multipart/form-data
🪛 Ruff (0.14.3)
tests/fault_tolerance/hardware/fault-injection-service/agents/gpu-fault-injector/agent.py
82-82: Do not catch blind exception: Exception
(BLE001)
94-94: Starting a process with a partial executable path
(S607)
96-96: Consider moving this statement to an else block
(TRY300)
97-97: Do not catch blind exception: Exception
(BLE001)
105-105: Starting a process with a partial executable path
(S607)
112-112: Consider moving this statement to an else block
(TRY300)
113-113: Do not catch blind exception: Exception
(BLE001)
114-114: Use logging.exception instead of logging.error
Replace with exception
(TRY400)
120-120: subprocess call: check for execution of untrusted input
(S603)
128-128: Do not catch blind exception: Exception
(BLE001)
210-210: Possible binding to all interfaces
(S104)
tests/fault_tolerance/hardware/fault-injection-service/agents/gpu-fault-injector/gpu_xid_injector.py
93-93: subprocess call: check for execution of untrusted input
(S603)
94-100: Starting a process with a partial executable path
(S607)
136-136: subprocess call: check for execution of untrusted input
(S603)
146-149: Consider moving this statement to an else block
(TRY300)
151-151: Do not catch blind exception: Exception
(BLE001)
152-152: Use logging.exception instead of logging.error
Replace with exception
(TRY400)
.../fault_tolerance/hardware/fault-injection-service/agents/gpu-fault-injector/requirements.txt
Outdated
Show resolved
Hide resolved
.../fault_tolerance/hardware/fault-injection-service/agents/gpu-fault-injector/requirements.txt
Outdated
Show resolved
Hide resolved
- Agent runs as DaemonSet on GPU nodes - gpu_xid_injector.py: Injects XID errors into kernel logs - agent.py: HTTP server that receives injection requests - Dockerfile and requirements for deployment Enables API service to trigger XID injection on specific nodes. Signed-off-by: Oviya Seeniraj <[email protected]>
Signed-off-by: Oviya Seeniraj <[email protected]>
Signed-off-by: Oviya Seeniraj <[email protected]>
01e98d9 to
01aa768
Compare
tests/fault_tolerance/hardware/fault-injection-service/agents/gpu-fault-injector/agent.py
Show resolved
Hide resolved
tests/fault_tolerance/hardware/fault-injection-service/agents/gpu-fault-injector/agent.py
Show resolved
Hide resolved
|
suggest adding xid-31 (memory page fault) to the list. |
...ult_tolerance/hardware/fault-injection-service/agents/gpu-fault-injector/gpu_xid_injector.py
Show resolved
Hide resolved
tests/fault_tolerance/hardware/fault-injection-service/agents/gpu-fault-injector/agent.py
Outdated
Show resolved
Hide resolved
…es for all the DCGM/NVSentinel monitored XIDs Signed-off-by: Oviya Seeniraj <[email protected]>
tests/fault_tolerance/hardware/fault-injection-service/agents/gpu-fault-injector/Dockerfile
Outdated
Show resolved
Hide resolved
…gpu-fault-injector/Dockerfile Signed-off-by: Harrison Saturley-Hall <[email protected]>
Signed-off-by: Harrison King Saturley-Hall <[email protected]>
Signed-off-by: Oviya Seeniraj <[email protected]> Signed-off-by: Harrison Saturley-Hall <[email protected]> Signed-off-by: Harrison King Saturley-Hall <[email protected]> Co-authored-by: Harrison Saturley-Hall <[email protected]>
Overview:
This PR adds a DaemonSet agent that runs on every GPU node and performs actual XID injection into kernel logs. The API service (PR #4042) communicates with these agents to trigger faults on specific nodes.
Details:
agents/gpu-fault-injector/gpu_xid_injector.py: XID injection implementationinject_xid_error(): Writes XID error to kernel log via nsenternsenterto access host's kernel log from containeragents/gpu-fault-injector/agent.py: Flask API server/health: Health check/inject-xid: Endpoint to trigger XID injection (called by API service)agents/gpu-fault-injector/requirements.txt: Flask dependenciesagents/gpu-fault-injector/Dockerfile: Agent container imagensenterutility for host accessWhere should the reviewer start?
gpu_xid_injector.py- Core XID injection:nsenter --target 1 --mount --uts --ipc --net --pidto access host/dev/kmsg(kernel log) with proper formatagent.py- Flask API server:/inject-xidendpoint implementationDockerfile*:nsenterpackage for host accessSecurity considerations:
/dev/kmsghostPID: trueto use nsenterTesting note:
dmesgandjournalctl -kRelated Issues:
Summary by CodeRabbit
New Features
Chores