fgrehm / vagrant-cachier

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

Doesn't create symlinks... #186

Closed klongbeard closed 1 year ago

klongbeard commented 6 years ago

Hey so I just installed vagrant-cachier to speed up my local env running symfony 2. Whilst there is a noticeable speed difference it wasn't as fast I was expecting (still ≈ 10s) so I did a little digging in my box and found that running ls -al on my /vendor folder from within /tmp/vagrant-cache/ returned the following:

total 48
drwxrwxrwx  10  502 dialout  340 Oct 16 11:50 .
drwxrwxrwt   6 root root    4096 Oct 17 15:35 ..
drwxrwxr-x 262  502 dialout 8908 Oct 16 11:50 apt
drwxrwxr-x  85  502 dialout 2890 Oct 17 12:51 apt_lists
drwxrwxr-x   4  502 dialout  136 Oct 17 13:03 cache
drwxrwxr-x   5  502 dialout  170 Oct 16 12:07 composer
drwxrwxr-x   3  502 dialout  102 Oct 16 11:50 gem
drwxrwxr-x   4  502 dialout  136 Oct 17 13:23 logs
drwxrwxr-x   2  502 dialout   68 Oct 16 11:50 npm
drwxrwxr-x  67  502 dialout 2278 Oct 17 14:58 vendor

Likewise from within the vendor folder, none of the dirs are symlinked, it looks like it's just ripped the vendor folder straight out of my app and put it in a new place which, whilst marginally faster is essentially no different except that it ruins my autocomplete functions when referring to functions belonging to vendor classes. Here's my Vagrantfile:

IP = "192.168.10.10"
VM_NAME = "myproj"
VM_MEMORY = 512
VM_CPUS = 1
SYNCED_FOLDER_VM_PATH = "/var/www/myproj/current"

Vagrant.configure("2") do |config|
    config.vm.box = "geerlingguy/ubuntu1604"
    config.vm.provider :virtualbox do |v|
        v.name = VM_NAME
        v.customize [
            "modifyvm", :id,
            "--name", VM_NAME,
            "--memory", VM_MEMORY,
            "--natdnshostresolver1", "on",
            "--cpus", VM_CPUS,
        ]
    end

    config.vm.network :private_network, ip: IP
    config.ssh.forward_agent = true

    config.vm.provision "ansible" do |ansible|
        ansible.playbook = "devops/provisioning/playbook.yml"
        ansible.inventory_path = "devops/provisioning/hosts/vagrant"
        ansible.limit = 'all'
    end

    config.vm.synced_folder "./", SYNCED_FOLDER_VM_PATH, :nfs => true

    if Vagrant.has_plugin?("vagrant-cachier")
        config.cache.scope = :machine

        config.cache.synced_folder_opts = {
            type: :nfs,
            mount_options: ['rw', 'vers=3', 'tcp', 'nolock']
        }

        config.cache.enable :generic, {
            "cache"  => { cache_dir: "/var/www/project.local/htdocs/current/app/cache" },
            "logs"   => { cache_dir: "/var/www/project.local/htdocs/current/app/logs" },
            "vendor" => { cache_dir: "/var/www/project.local/htdocs/current/vendor" },
        }
    end
end

Any help would be greatly appreciated, cheers.

fgrehm commented 1 year ago

Hey, sorry for the silence here but this project is looking for maintainers :sweat_smile:

As per https://github.com/fgrehm/vagrant-cachier/issues/193, I've added the ignored label and will close this issue. Thanks for the interest in the project and LMK if you want to step up and take ownership of this project on that other issue :wave: