Closed antifuchs closed 4 years ago
:exclamation: No coverage uploaded for pull request base (
master@fc64975
). Click here to learn what that means. The diff coverage isn/a
.
@@ Coverage Diff @@
## master #128 +/- ##
=========================================
Coverage ? 82.07%
=========================================
Files ? 10
Lines ? 1328
Branches ? 0
=========================================
Hits ? 1090
Misses ? 238
Partials ? 0
Impacted Files | Coverage Δ | |
---|---|---|
bw_plex/plex.py | 76.90% <0.00%> (ø) |
|
bw_plex/video.py | 93.75% <0.00%> (ø) |
|
bw_plex/cli.py | 100.00% <0.00%> (ø) |
|
bw_plex/audio.py | 87.50% <0.00%> (ø) |
|
bw_plex/config.py | 84.00% <0.00%> (ø) |
|
bw_plex/hashing.py | 73.62% <0.00%> (ø) |
|
bw_plex/misc.py | 81.43% <0.00%> (ø) |
|
bw_plex/credits.py | 88.48% <0.00%> (ø) |
|
bw_plex/db.py | 95.00% <0.00%> (ø) |
|
bw_plex/edl.py | 78.00% <0.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update fc64975...29669f4. Read the comment docs.
Thanks for this PR! and for taking the time to write how this build work. Really great. I'll hold off on for this now. ATM there is no error handling and starting the docker for the first time without the config file edited will fail. (this is when the config is written to disk)
About the dev stuff, lets leave it in. It make things easier to test and verify. Saving 470 MB is great
This PR makes a bunch of adjustments to the docker build process that result in a smaller image: From what I can tell, it's about 400MB thinner:
This PR also adjusts the
CMD
in use to launch bw_plex in the container, as the previous iteration relied on env variablesurl
andtoken
being set, which I believe most people will want to set in the/config
ini file instead.How does this work?
Via https://pythonspeed.com/articles/multi-stage-docker-python/, the technique for getting the multi-stage build to improve the image size is this:
ADD
allows developers to try their changes in isolation)Then, we make a container containing only the runtime libraries needed to run bw_plex (rather than the
-dev
ones), and copy the venv over. Voila, lots fewer build steps with less caching in between them.This could still be better
We could still save a bunch more space by not installing those test/dev-looking dependencies, like pytest below and leaving out pandoc. I'll leave that to you to figure out whether that's desired (: