-
Notifications
You must be signed in to change notification settings - Fork 194
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
Use staged builds to minimize final image sizes #1031
base: main
Are you sure you want to change the base?
Conversation
None of the test failures are due to my changes. CodeGen Gaudi test TGI fail is due to it trying to load HuggingFace model it has no rights for:
CodeGen Xeon test TGI seems to fail due to: VisualQnA Gaudi & Xeon tests fail is due to NPM dependency conflict for it's Node.js Svelte UI container build (which spec is not touched by this PR). |
3e49050
to
07051a7
Compare
Rebased this example to latest Note: I did not update the
|
07051a7
to
f43ab84
Compare
Updated also the new Rebased to latest |
No idea why guardrails times out:
And translation fails:
As CI does not provide enough information. |
So that redundant things do not end in final image: - Git repo history - Test directories - Git tool and its deps And drop explicit installation of: - jemalloc & GLX: nothing uses them (in ChatQnA at least), and for testing it's trivial to create image adding those on top: https://pytorch.org/tutorials/recipes/recipes/tuning_guide.html#switch-memory-allocator - langchain_core: GenAIComps install langchain which already depends on that This demonstrates that only 2-3 lines in the Dockerfiles are unique, and everything before those can be removed with a common base image. Signed-off-by: Eero Tamminen <[email protected]>
f43ab84
to
95e0c76
Compare
Rebased to EdgeCraftRAG was not updated because it's using |
@lvliang-intel CI seems to be in rather bad state, as CMake is segfaulting on image builds:
|
Description
Staged image builds so that final images do not have redundant things like:
And drop explicit installation of:
langchain_core
: GenAIComps installslangchain
which already depends on thatjemalloc
& GLX: nothing uses them (in any of the ChatQnA services), and for testing[1] it's trivial to create separate image adding those on top~/.bashrc
(as these images run Python programs directly, not through Bash scripts)=> This demonstrates that only 2-3 lines in the Dockerfiles are unique, and everything preceding those could be removed with a common base image.
[1] I assume those files were there to test this: https://pytorch.org/tutorials/recipes/recipes/tuning_guide.html#switch-memory-allocator
Issues
Fixes: #225
Type of change
Dependencies
n/a
(this removes redundant Git, Perl, jemalloc, GLX dependencies from final images)Tests
This is draft / example for fixing #225
I have not tested it apart from verifying that images still build.
Notes
In a proper fix, non-unique part of the Dockerfiles would be a separate base image, generated with GenAIComps repo Dockerfile, and Dockerfiles in this repository would depend on that image instead of
python-slim
.However, that requires co-operation between these two repositories (unless components base image Dockerfile is also in this repo) and:
(I.e. it needs to be done by a member of this project, I cannot do it.)