theastropath / turbot

A Discord bot for tracking Animal Crossing: New Horizons turnip prices and fossil collections
MIT License
8 stars 1 forks source link

WIP Docker #154

Closed shughes-uk closed 4 years ago

shughes-uk commented 4 years ago

Quick dockerfile for turbot.

Definitely not optimized and creates a 1.28gb image, I suspect a lot of that is the scientific libraries though.

Needs instructions on use too.

codecov-io commented 4 years ago

Codecov Report

Merging #154 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #154   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines         1148      1148           
  Branches       224       224           
=========================================
  Hits          1148      1148           

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 410fc75...e3f5a89. Read the comment docs.

lexicalunit commented 4 years ago

WDYT about using pip install . instead of installing it off PyPI?

lexicalunit commented 4 years ago

Might also be worth reading thru https://pythonspeed.com/articles/pipenv-docker/ and especially the section titled Fast reproducible Docker builds with poetry. Maybe to support this we could add poetry export -f requirements.txt -o requirements.txt to the publish.sh script.

One thing I've been thinking about how to solve for a while now is how to make it so turbot knows if it's on a release or if it's on a development branch (or on master with changes past the last release). Right now if you do a turbot -v it'll give you the version of the last published release, even if there's been a ton of changes since then. Ideally I'd want it to be able to somehow know that it's a different version if things have been changed. Whatever process allowed this to be done would need to ensure that the generated requirements.txt file was also kept up-to-date so it would have to be done somewhere other than in publish.sh. Maybe as a git push hook perhaps? Dunno.

shughes-uk commented 4 years ago

So my first port of call was trying pip install . but it does not seem to be able to handle the vendorized dep and breaks. Export could maybe work but I think it'll run into the same issue.

lexicalunit commented 4 years ago

@shughes-uk Sorry, try again now that I've removed the vendorized dep. No idea why that just simply didn't work.