-
Notifications
You must be signed in to change notification settings - Fork 3
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
Optimize docker build #125
Comments
https://github.com/jacksmith15/poetry-workspace-plugin is one of the PoC of the python workspaces for poetry. It's just quite an early stage of the development but it basically shares packages/libs used in different projects in monorepo. |
Some notes on slow docker build for Python apps. |
That makes sense. I wonder if it's worth trying |
Closing this since the task is completed as originally defined. Will add an icebox issue for exploring other base images. |
Split from #109
Cause of slow build
From the logs on building Docker images using skaffold. There are 2 main time-consuming processes. They are PNPM package installation and Poetry package installation.
Proposed optimization
Make use of PNPM workspace
PNPM could define dependencies for different packages in the monorepo. The way it works is similar to our implementation on
subset.config.js
. The main difference is that the PNPM workspace shares a singlenode_modules
for all packages. It will save a lot of time on downloading packages/building packages.https://pnpm.io/workspaces
@solomondefi-dev could look into this.
Extract base build stage for Python apps
The current base build stage for each Python apps is duplicated. We could extract it into another image and save some build time.
Another potential optimization could be a similar workflow like PNPM workspace as Poetry cache packages in
.cache
folder by default, the cached packages could be shared across different Python apps.The text was updated successfully, but these errors were encountered: