Use GenAIComp base image to simplify Dockerfiles & reduce image sizes #1369
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Current application Dockerfiles copy other Dockerfiles, install unnecessary libraries (e.g. Perl), causing resulting images to be rather huge, many hundreds of MBs.
I've gone through all of them (20), and found that except for "EdgeCraftRAG"
Dockerfile.server
file, only unique part in each container is just the small application Python file.This changes all the other 19 application Dockerfiles to use common base image: opea-project/GenAIComps#1127
This will greatly speed up their building, and greatly reduce the resulting disk usage. Compared to current application images, new base image is just half of their size, and shared between applications using it.
Note: image size shown by
docker
&crictl
include also sizes of underlying images, but disk space is actually used only once per shared base image, so the real disk cost of each additional application image will be just few tens of KBs.Issues
There are several tickets about large disk usage, both for GenAIExamples and GenAIComps repo.
Type of change
Dependencies
No new 3rd party dependencies, but this PR will fail until the new GenAIComps base image is available in CI.
Tests
Did manual testing that ChatQnA & DocSum images build when GenAIComps image is available, and that those 2 applications still work fine.
For the other applications, I'm relying on CI tests in: #1031
Future work
This solves only application image size aspect. There are many other images which disk usage can and should still be optimized (app UIs, GenAIComps backend service images etc).