Skip to content
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

Feature/docker opt #121

Merged
merged 67 commits into from
Mar 22, 2024
Merged

Feature/docker opt #121

merged 67 commits into from
Mar 22, 2024

Conversation

lmwilkigov
Copy link
Collaborator

@lmwilkigov lmwilkigov commented Mar 18, 2024

Context

Some of the docker images are overly heavy, leading to long builds and lots of RAM consumption

Changes proposed in this pull request

Original

redbox-ingest                       latest                d7385c49a8dc   7 minutes ago    3.94GB
redbox-streamlit-app                latest                af474fc7a8f3   11 minutes ago   4.42GB
redbox-embed                        latest                676dfaac7228   3 days ago       3.47GB
redbox-tests                        latest                c7bd1067fc9a   3 days ago       2.08GB
redbox-core-api                     latest                3704ed9f2358   3 days ago       2.1GB

CURRENT SIZE TOTAL: 16.01 GB

OPTIMISATION 1: Remove streamlit-app deps from installs (These got left in accidentally)

redbox-ingest                       latest                afb627d3cb28   9 minutes ago       3.62GB (-0.32 GB)
redbox-streamlit-app                latest                98a5cd226a4f   4 minutes ago       4.42GB (0 GB)
redbox-embed                        latest                35b8b6bf549e   6 minutes ago       3.02GB (-0.45 GB)
redbox-tests                        latest                729677e25020   7 minutes ago       1.64GB (-0.44 GB)
redbox-core-api                     latest                80b48e6f5b81   7 minutes ago       1.62GB (-0.48 GB)

SAVING: 1.69 GB

OPTIMISATION 2: Build Streamlit app with Buildkit (multistage build process with copied venv, see links)

redbox-streamlit-app latest 76e848f9fdcf 8 minutes ago 2.33GB

SAVING: 2.09 GB

============================
TOTAL OPTIMISATION SAVING = 3.78 GB

Relevant links

Guide on the optimisations
https://medium.com/@albertazzir/blazing-fast-python-docker-builds-with-poetry-a78a66f5aed0

Things to check

  • I have added any new ENV vars in all deployed environments
  • I have tested any code added or changed

@lmwilkigov lmwilkigov marked this pull request as ready for review March 18, 2024 23:35
Copy link
Collaborator

@gecBurton gecBurton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, wish I had thought of this!

@lmwilkigov lmwilkigov merged commit 25d071d into main Mar 22, 2024
7 checks passed
@252afh 252afh deleted the feature/docker-opt branch May 13, 2024 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants