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

Improve docker container rebuild speed #1623

Merged
merged 1 commit into from
Oct 8, 2022

Conversation

peleccom
Copy link
Contributor

@peleccom peleccom commented Oct 8, 2022

Title

This pull request improve docker container improve process for development.

Description

Before:

Every change in codebase triggered poetry to install all requirements again since ADD . . and docker cache layer break.

After

New approach it to do installation in two steps

  1. Copy dependecy locak files and do poetry isntall to install dependecies. Now only changes in poetry.lock or pyproject.toml
    will trigger poetry to install these dependecies again. In all other cases docker will use cached layer

  2. Install package itself with poetry install

Related Issue

This fix the following issue
#1622

Motivation and Context

It improve speed for docker container rebuild

How Has This Been Tested?

Tested locally with the following command

  1. docker build -t spotdl .
  2. Change any files except poetry.lock pyproject.toml
  3. Docker should use cached layer for dependencies installation

Screenshots (if appropriate)

Before the change

image

After the change

image

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the CONTRIBUTING document
  • I have read the CORE VALUES document
  • I have added tests to cover my changes
  • All new and existing tests passed

@peleccom peleccom force-pushed the improve_docker_build branch from 766416e to a91033f Compare October 8, 2022 15:34
@peleccom peleccom force-pushed the improve_docker_build branch from a91033f to 1606b66 Compare October 8, 2022 15:34
@xnetcat xnetcat merged commit 7bd45db into spotDL:master Oct 8, 2022
xnetcat pushed a commit that referenced this pull request Oct 10, 2022
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