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

Speed up api docker build time #964

Open
ericboucher opened this issue Nov 9, 2023 · 1 comment
Open

Speed up api docker build time #964

ericboucher opened this issue Nov 9, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request triage to be triaged for next action

Comments

@ericboucher
Copy link
Collaborator

Provide a clear and concise description of what you want to happen.

Docker build time is quite slow atm, in part due to playwright. Could we re-order docker build steps for smarter caching?
i.e. install playwright before the rest of the packages so that if we change one package we don't have to re-do these steps?

Thoughts @laurentS ?

Is there anything else you can add about the proposal? You might want to link to related issues here, if you haven't already.

No response

@ericboucher ericboucher added enhancement New feature or request triage to be triaged for next action labels Nov 9, 2023
@laurentS
Copy link
Collaborator

I looked into this a bit while working on #929, mostly by using caching in docker buildx.
Some steps would drop to much shorter build times (say 2s instead of 20+), but I never managed to get the entire chain to work correctly.
playwright is annoying in that it expects to install the python package, and THEN to install the heavy stuff which is going to change less often.

What I would try:

  • figure out where the install-deps step of playwright caches its stuff, and see if we can mount it like here
  • if that doesn't work, we could figure out a way to do a multi-step docker build, where we build a first image with poetry+playwright and its dependencies, and then install the rest of python packages in the second build step. We'd have to look into poetry's options, but I think using group dependencies we could put playwright in an optional group, install only that, then its dependencies, then the rest of python packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage to be triaged for next action
Projects
None yet
Development

No branches or pull requests

2 participants