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

build requirements + system packages before copying app code #1914

Merged

Conversation

cwar
Copy link
Contributor

@cwar cwar commented Mar 6, 2024

Description

While I was working on #1913 I noticed that the Dockerfile busted the cache on every code change because the code is copied, then the requirements are built and the system packages are installed.

A common technique is to copy the requirements files and install system packages (less likely to change) before application code (most likely to change).

Ideally, the system packages would be installed by themselves first, then the requirements, then copy the app code. Even with this improvement, a change in either python dependencies or system packages would cause both dependencies and packages to be re-installed.. but everything seems to be quite tangled and this change here will be far be the greatest decrease in average build time via the structure of the Dockerfile.

TLDR - This decreased my build time from a few minutes per build to a few seconds by taking advantage of Docker Layer Caching

Issues Fixed or Closed

  • Fixes #(issue)

Type of Change

Please delete options that are not relevant.

  • Infrastructure change (changes related to the github repo, build process, or the like)

Checklist

  • My code was submitted to the nightly branch of the repository.

@meisnate12 meisnate12 merged commit 5111eef into Kometa-Team:nightly Mar 19, 2024
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.

2 participants