fgrehm / vagrant-cachier

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

Add mount_options option. #68

Closed purpleidea closed 10 years ago

purpleidea commented 10 years ago

This option can be very useful with the existing enable_nfs option to choose a different protocol like tcp (udp is the default), and to add other nfs options like nolock.

fgrehm commented 10 years ago

And BTW, the plugin works fine for vagrant-libvirt? If that's the case we can add it to the compatible providers list :smiley:

purpleidea commented 10 years ago

@fgrehm Sorry for my late reply. So far it seems to (I think). There's at least one reasonably bad bug, but I can't reproduce it reliably yet. Basically what happens is when you provision a host, you'll get a permission denied error on /tmp/vagrant-cache/yum

Should probably be another bug, but I've been busy.

Also, tell me if you like this vagrantfile hack (the no-parallel). Technically there could still be an issue, but it's less risky. Which is why I hacked it in, and didn't patch it upstream:

    #
    #   cache
    #
    # TODO: this doesn't cache metadata, full offline operation not possible
    config.cache.auto_detect = true
    config.cache.enable :yum
    #config.cache.enable :apt
    if not ARGV.include?('--no-parallel')   # when running in parallel,
        config.cache.scope = :machine   # use the per machine cache
    end
    config.cache.enable_nfs = true  # sets nfs => true on the synced_folder
    # the nolock option is required, otherwise the NFSv3 client will try to
    # access the NLM sideband protocol to lock files needed for /var/cache/
    # all of this can be avoided by using NFSv4 everywhere. die NFSv3, die!
    config.cache.mount_options = ['rw', 'vers=3', 'tcp', 'nolock']

Also it would be cool if there was a way to preemptively pre-warm the future hosts... Eg: hardlink over into the respective machine dirs any .rpm's. You could do this if :machine set, and for the list of machines in vagrant status.

purpleidea commented 10 years ago

@fgrehm ping?

purpleidea commented 10 years ago

ping ping?

fgrehm commented 10 years ago

@purpleidea sorry for the silence, I've been on vacations and pretty much offline from github for a while, but I'm back in action and cachier is my current focus :-) expect some progress on it soonish

purpleidea commented 10 years ago

On Tue, Jan 28, 2014 at 4:48 PM, Fabio Rehm notifications@github.com wrote:

@purpleidea sorry for the silence, I've been on vacations and pretty much offline from github for a while, but I'm back in action and cachier is my current focus :-) expect some progress on it soonish

Great! I had assumed you got abducted by a competing caching product!

fgrehm commented 10 years ago

@purpleidea I'm finally getting to this, sorry for taking so long to get back to you.

After some thinking and looking around I realized that GH-78 allow us to implement this in a more general way making things future proof down here. Please see my comments over there to better understand my decision on closing this PR.

Thanks for putting this up and stay tuned for updates, if all goes well I'll be able to cut a new release over the weekend.