feat: control CUDA deps#11355
Conversation
- Pre-install CPU-only PyTorch to avoid GPU version (saves ~4-5GB) - Add BUILD_MINERU build arg for optional mineru installation - Modify pip_install_torch() to default to CPU-only PyTorch - Update entrypoint to handle CPU-only PyTorch for mineru - Add comprehensive documentation for CUDA optimizations Benefits: - Reduces image size from ~6-8GB to ~2-3GB (60-70% reduction) - Eliminates massive CUDA package downloads during build/runtime - Maintains full functionality with CPU processing - Optional GPU support via GPU_PYTORCH=true environment variable - Significantly faster build times and reduced bandwidth usage Fixes: Docker image downloading tons of CUDA packages unnecessarily
- Fix uv pip install syntax to use --python flag instead of incorrect venv activation - Add proper CPU-only PyTorch installation in main and mineru environments - Update entrypoint scripts to check for pre-installed packages first - Ensure proper fallback to runtime installation when needed The previous commit only included documentation files, this commit adds the actual implementation.
Signed-off-by: Björn thorwirth <moonstruxx@googlemail.com>
|
srry .. firs request was accident .. now it's tested |
| return 1 | ||
| else | ||
| echo "[mineru] installed: ${MINERU_EXECUTABLE}" | ||
| return 1 |
There was a problem hiding this comment.
Hi, @moonstruxx
Thank you for your contribution. This looks good to me.
But I think here it should return 0 to indicate that MinerU has been installed successfully. Returning a non-zero value will cause the program to fail unexpectedly. However, since we have the restart: on-failure strategy, it will succeed on the next try.
I personally recommend changing it to express the correct semantic meaning. However, as I said, it doesn't really matter. It's up to you.
Cheers.
|
@yongtenglei It's better to add a group to |
1 similar comment
|
@yongtenglei It's better to add a group to |
|
Appreciations! |

What problem does this PR solve?
Benefits:
Fixes: Docker image downloading tons of CUDA packages unnecessarily
Type of change