fgrehm / vagrant-cachier

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

Alternative solution for concurrent cache usage #44

Closed gwillem closed 11 years ago

gwillem commented 11 years ago

BTW: thanks for all your good work on vagrant-lxc and vagrant-cachier! I love it.

We use vagrant extensively to test cooperation of many machines, so the issues with apt-cache locking are prohibitive (and machine isolation means that all the packages are redownloaded all the time). For an apt based system, the following might suffice:

apt-get install apt-cacher-ng on the host add vagrant shell provisioner:

$shell_provisioning = <<SCRIPT

## requires local proxy (eg apt-cacher-ng)
echo 'Acquire::http { Proxy "http://10.0.3.1:3142"; };' > /etc/apt/apt.conf.d/02proxy

SCRIPT

config.vm.provision "shell", inline: $shell_provisioning
patcon commented 11 years ago

I'm not using this approach myself, but it sounds like this plugin's approach might be what you're talking about :) https://github.com/tmatilai/vagrant-proxyconf

The efforts for that plugin were intentionally separated from the goals of this plugin: https://github.com/fgrehm/vagrant-cachier/pull/19

cc: @tmatilai

gwillem commented 11 years ago

Thanks!

tmatilai commented 11 years ago

@gwillem, what @patcon said. =) With vagrant-proxyconf you can configure all VMs globally in $HOME/.vagrant.d/Vagrantfile:

Vagrant.configure("2") do |config|
  config.apt_proxy.http = "http://10.0.3.1:3142"
  # ...

I like to run also the proxy in a VM. Here is a Vagrant setup for reference. Works also with other host OSs and can be easily modified for use with could providers.

fgrehm commented 11 years ago

BTW, https://github.com/fgrehm/vagrant-cachier/pull/30 might come in hand for those willing to have the apt-cacher-ng running on a Vagrant box ;)

fgrehm commented 11 years ago

@gwillem almost forgot, thanks for the nice words too :)