fgrehm / vagrant-cachier

Caffeine reducer
http://fgrehm.viewdocs.io/vagrant-cachier
MIT License
1.07k stars 111 forks source link

pip cache support #18

Closed narkisr closed 10 years ago

narkisr commented 11 years ago

It will be awesome to support python caching as well

fgrehm commented 11 years ago

@narkisr yup :) u know where they get stored?

narkisr commented 11 years ago

It looks like its configurable:

http://stackoverflow.com/questions/10336308/how-to-cache-downloaded-pip-packages

Couldn't find the default value tough

Ronen

fgrehm commented 11 years ago

@narkisr I'm not a phyton dev so I'd love some help here :) would u mind trying out this approach to see if it works? you can manually share the cache folder with the guest as we'd do with this plugin and check if things work fine. if u need any help just LMK

narkisr commented 11 years ago

Im not a python dev either ;) (more of a ruby and Clojure guy), ill give it a shoot and let you know if it works

thedrow commented 11 years ago

You summoned me master? @fgrehm

fgrehm commented 11 years ago

@thedrow not sure if I got it right, but are you signing up to handle this one? if you are, be my guest :)

thedrow commented 11 years ago

@fgrehm I might if you tell me what exactly needs to be done. I'm no ruby dev so I can't write code but I can direct you exactly where you should be headed.

fgrehm commented 11 years ago

@thedrow we need to automatically detect pip places downloaded tarballs or, if not possible, how if there is a way to configure it to use a cache. based on this post on SO we should be able to set PIP_DOWNLOAD_CACHE but according to this comment it is "seriously flawed". after we know how to set things up, making it work from within vagrant-cachier should be dead easy :)

narkisr commented 11 years ago

In my setting PIP_DOWNLOAD_CACHE did not seem to work,

thedrow commented 11 years ago

@fgrehm Yup, it is seriously flawed. You should be using Basket instead which makes caching much easier and safer.

thedrow commented 11 years ago

@fgrehm Ok Basket doesn't fit here since it has no feature that enables you to cache a specific version of a dependency. This should be added or an alternative should be found before implementing this feature request,

fgrehm commented 11 years ago

@thedrow oh well, just to check, is PIP_DOWNLOAD_CACHE usable by any chance or it doesn't work at all?

thedrow commented 11 years ago

@fgrehm PIP_DOWNLOAD_CACHE is usable for pip, not you. You cannot control what happens there. You might want to wait until Wheel is stable. Wheel is the new packaging format for python and it will be available to all using the next version of pip. One of pip's features is to download and store Wheels in order to use them later. See here for usage. Wheel can certainly be controlled by you in order to cache packages for further use. This is the best solution I've got for you but you have to wait until pip 1.4 & setuptools 0.8 are released.

fgrehm commented 11 years ago

@thedrow tks for the information! I'll mark this as blocked while we don't have a way to make it work

thedrow commented 11 years ago

Quick update. Setuptools is now at version 0.9.x which is really good. Python packaging has been a mess in the last few months. The next pip release (1.4) should be out this week which means that we will be able to use wheel. That means that this issue won't be blocked.

thedrow commented 11 years ago

@fgrehm Ping? This issue shouldn't be blocked anymore.

patcon commented 11 years ago

Rockin. Removed label :)

fgrehm commented 11 years ago

Awesome!

@thedrow would you be able to send a PR for this? if not, how about a detailed step by step on how to set things up using plain old bash script? if you are up for doing the script please LMK and I'll try to write you a short high level overview on what we need to get this implemented. thanks in advance :)

thedrow commented 11 years ago

I have no ruby knowledge almost at all. I can provide a step by step guide to how to do this only that it will require some research as I haven't used wheel yet.

fgrehm commented 11 years ago

@thedrow here's some information I just wrote and thought would be nice to have available on the readme https://gist.github.com/fgrehm/fd3907dafde6aa7272b9

@patcon @cromulus @tmatilai @mindreframer @laggyluke @fh sorry for the spam but if any of you could review it and lemme know if that is a good explanation before I push it to master it would be awesome :)

patcon commented 11 years ago

No worries. Looks like a pretty sound explanation. The first paragraph is a little dense, but not sure if it can be made any clearer outside of providing a diagram :)

gmiroshnykov commented 11 years ago

That explanation looks good for me too! There's a small typo though: "if it is has". Also, "VMs rebuilds" doesn't sound right - maybe it should be "VM's rebuilds" or "VM rebuilds". Disclaimer: English is not my native language :)

thedrow commented 11 years ago

@fgrehm Yeh that works. I'll try to come up with something on Friday.

fgrehm commented 11 years ago

Thanks for the feedback everyone :) I've updated the gist accordingly: https://gist.github.com/fgrehm/fd3907dafde6aa7272b9/revisions

fgrehm commented 10 years ago

We now have docs for creating new buckets under http://fgrehm.viewdocs.io/vagrant-cachier/development

If someone is up for implementing this, please shoot us a PR :-)

egasimus commented 10 years ago

Has anyone gotten around to building a bucket for Pip? I sorely need one, but don't have the time to put it together with my rudimentary Ruby skills.

fgrehm commented 10 years ago

@egasimus if you know where pip keeps its cache we might be able to help, please see the "How to create a new bucket?" section of http://fgrehm.viewdocs.io/vagrant-cachier/development for the information we need.

esmail commented 10 years ago

It's configurable with the environment variable PIP_DOWNLOAD_CACHE since way back in pip 0.1.4 per the release notes.

fgrehm commented 10 years ago

@esmail there's some discussion around this at GH-80