docker-scripts-archived / dev--LTSP

Virtual LTSP server with vagrant and/or docker-scripts.
GNU General Public License v3.0
7 stars 6 forks source link

Vagrant caching #69

Closed dashohoxha closed 6 years ago

dashohoxha commented 6 years ago

As suggested by Akash, explore and try to use caching for vagrant, in order to speed up testing:

d78ui98 commented 6 years ago

I have implemented caching with vagrant cachier plugin. Now studying about how to create custom vagrant box from the links you provided.

dashohoxha commented 6 years ago

Is it worth to make a PR about this, or is it only for personal use?

d78ui98 commented 6 years ago

It is for someone who provision their vagrant boxes are lot (like me). Akash and I were discussing about this. The users of Virtual LTSP will create their LTSP server for only once. So it does not make sense to add it here. If users want to change their IP address then they can do it without provisioning. As every time we do vagrant up and vagrant halt new virtual network devices are created. Moreover vagrant-cachier when used for the first time it increases installation time as it has to configure cache buckets. So pros weigh the cons. Caching should be done for personal use only.

dashohoxha commented 6 years ago

It is for someone who provision their vagrant boxes are lot (like me).

Ok, you can share it for the likes of you, who may be testers and/or developers of this project. This includes Akash and me. You have to make it easy for other developers as well, who may want to contribute to the project.

Why don't you add a variable called DEV on settings.sh. If this is "true", then you activate the caching, otherwise you don't activate it.

d78ui98 commented 6 years ago

okay. Here is a sample vagrant file that I am using.

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

    config.cache.synced_folder_opts = {
      owner: "_apt",
      group: "vagrant"
    }
   end

Notice how it says if vagrant has_plugin then perform these steps. This is done so that Vagrantfile does not break if shared with people that don't have the plugin installed. Source - https://github.com/fgrehm/vagrant-cachier/blob/master/docs/usage.md#being-nice-to-others

So we the devlopers working on the project will just need to install vagrant-cachier plugin. DEV variable wont be needed. Vagrantfile will work normally for users that dont have plugin installed.

dashohoxha commented 6 years ago

This is better. Maybe you can add a section on README about how to install this plugin (for developers and testers). This is also about being nice to the others.

d78ui98 commented 6 years ago

Sure. I am writing the blog post on creating vagrant box. Will push these changes after that.