-
Notifications
You must be signed in to change notification settings - Fork 38
dockerfile: reduce the final image size #177
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
base: releases/v0.10.2
Are you sure you want to change the base?
Conversation
Signed-off-by: Hank <[email protected]>
|
cc: @dtrifiro |
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.
Code Review
This pull request refactors the Dockerfile to use a multi-stage build, which is a great step towards reducing the final image size. The changes are well-structured. However, I've found a few critical issues that undermine the size reduction effort and introduce maintenance problems. My main concerns are:
- The final image incorrectly copies the entire
/usrdirectory from a build stage, including many unnecessary build tools and bloating the image. - There are hardcoded versions in
rpmandARGcommands, which will cause issues when versions are updated.
I've provided detailed comments and suggestions to address these points. Fixing them should further reduce the image size significantly and improve the Dockerfile's maintainability.
Signed-off-by: Hank <[email protected]>
| --extra-index-url ${UV_EXTRA_INDEX_URL} \ | ||
| . -v && \ | ||
| vllm_metax_init | ||
| uv build --wheel --out-dir=/workspace/vllm_metax_wheel_dist |
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.
this commands fails because torch==2.6.0+metax3.2.1.3 is not available, does it need a --index=https://repos.metax-tech.com/r/maca-pypi/simple ?
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.
It's weird I didnt got the problem in my local environment. I've alreay set the UV_EXTRA_INDEX_URL to the index so it should not happen.
Purpose
The image size are too large for now. This PR reduce the image size from ~30g to ~23g