Fix CUDA downloads on unsupported platforms#770
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughCUDA binary downloads are now blocked on Linux. A new platform-check constant and three helper functions in ChangesLinux CUDA Download Block
Sequence DiagramsequenceDiagram
participant Client
participant DownloadRoute as POST /backend/download-cuda
participant CudaService as cuda.service
participant StatusEndpoint as GET /backend/cuda-status
Client->>DownloadRoute: Request download
DownloadRoute->>CudaService: get_cuda_download_unsupported_reason()
CudaService-->>DownloadRoute: Returns reason (if Linux)
alt Unsupported
DownloadRoute-->>Client: HTTP 409 + reason
else Supported (Windows)
DownloadRoute->>CudaService: _download_cuda_binary_locked()
CudaService->>CudaService: ensure_cuda_download_supported()
CudaService-->>DownloadRoute: Download proceeds
DownloadRoute-->>Client: HTTP 200
end
Client->>StatusEndpoint: Check CUDA status
StatusEndpoint->>CudaService: get_cuda_status()
CudaService->>CudaService: get_cuda_download_unsupported_reason()
CudaService-->>StatusEndpoint: Status with download_supported + unsupported_reason
StatusEndpoint-->>Client: Returns extended CudaStatus
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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.
Actionable comments posted: 1
🤖 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 `@app/src/lib/api/types.ts`:
- Around line 290-292: The CudaStatus type definition uses optional properties
(cuda_libs_version, unsupported_reason, and binary_path) but the backend
actually returns these as null values rather than omitting them. Change each of
these optional string properties from the form field?: string to field: string |
null to accurately reflect that these properties are always present in the
response but can have null values instead of being absent entirely.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3bf0eeec-cc64-4516-92ba-4b522a797ffc
📒 Files selected for processing (7)
README.mdapp/src/lib/api/types.tsbackend/routes/cuda.pybackend/services/cuda.pybackend/tests/test_cuda_download.pydocs/content/docs/overview/gpu-acceleration.mdxdocs/content/docs/overview/introduction.mdx
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@app/src/lib/api/types.ts`:
- Line 291: The download_supported field in the types file is currently marked
as optional with the `?` operator, but since the API always returns this field
as a boolean value, it should be required to accurately match the API contract.
Remove the `?` from the download_supported field declaration to change it from
optional to a required boolean property.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
Summary
download_supportedandunsupported_reasonin CUDA statusFixes #767
Testing
python -m pytest backend/tests/test_cuda_download.py -q --basetemp .pytest-tmppython -m py_compile backend/services/cuda.py backend/routes/cuda.py backend/tests/test_cuda_download.pypython -m ruff format --check backend/services/cuda.py backend/routes/cuda.py backend/tests/test_cuda_download.pypython -m ruff check --select I backend/services/cuda.py backend/routes/cuda.py backend/tests/test_cuda_download.pygit diff --checkSummary by CodeRabbit