Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Vagrant file to automatically deploy an Ubuntu 14.04 development VM #711

Merged
merged 1 commit into from
Mar 28, 2015

Conversation

bbenoist
Copy link
Contributor

Mostly inspired from the existing Vagrantfile in Math.Net Numerics.

See https://www.vagrantup.com/ for more information about the Vagrant software.

…t VM

Mostly inspired from the existing Vagrantfile in Math.Net Numerics:
http://numerics.mathdotnet.com/

See https://www.vagrantup.com/ for more information about the Vagrant software.
@bbenoist
Copy link
Contributor Author

If you want to test the PR:

  1. Install VirtualBox and the VirtualBox Extension Pack from https://www.virtualbox.org/wiki/Downloads or with your favorite package manager (which should respect the PUEL 😫).
  2. Install Vagrant from https://www.vagrantup.com/downloads.html or with your favorite package manager.
  3. With a shell, cd to the FAKE root directory and run vagrant up. The VM will be automatically downloaded, imported into VirtualBox, configured and started.
  4. Run vagrant ssh to directly connect via SSH to the VM and start working. The FAKE source directory is automatically shared with the VM under the /vagrant directory.
  5. Once you have finished, you can either:
    • Run vagrant suspend to pause the VM.
    • Run vagrant halt to shutdown the VM.
    • Run vagrant destroy -f to delete the imported VM.
    • Run vagrant box remove ubuntu/trusty64 to remove the base box from your computer.
  6. Simply re-run vagrant up to reload the VM.

⚠️ The file build.sh had crlf on Windows and I had to update the .gitconfig file to force the use of lf. You may need to change it manually on your local Git clone.

@forki
Copy link
Member

forki commented Mar 28, 2015

What does this give us? I never used vagrant.

@bbenoist
Copy link
Contributor Author

Well, Vagrant helps in the creation and configuration of lightweight, reproducible and portable development environments.

It places itself on top of most virtualization products (e.g. VirtualBox, VMware) and uses SSH or WinRM to leverage the provisioning (e.g. shell commands, puppet, chef) on booted virtual machines.

Thus, by writing a Vagrantfile, you can give developers the possibility to deploy an appropriate OS and configuration with only one vagrant up command.

As an example, here is how I managed to build FAKE on Ubuntu (I omitted the crlf issue with build.sh to be more concise):

  1. Created a Vagrantfile template with vagrant init ubuntu/trusty64.
  2. Edited the Vagrantfile to fit with the needs of F# development on Ubuntu 14.04 LTS. Mostly taken from Math.NET Numerics.
  3. Ran vagrant up. The tool automatically:
    • Downloaded the base box from the Vagrant public repository.
    • Imported it into VirtualBox.
    • Started it and waited for SSH to be accessible.
    • Connected via SSH to install the required tools.
  4. Built FAKE with vagrant ssh -c "cd /vagrant && bash build.sh"

Because I created my Ubuntu development VM with a Vagrantfile, other people now just have to install the system-wide prerequisites then reproduce steps 3 and 4 to get an Ubuntu development environment ready.

Also, as everything is in a VM, they just have to vagrant provision or vagrant destroy -f whenever it has to be updated or gets updated.

IHMO, its biggest usage would be for Windows people testing their development on a *nix system. However it's use can be extended up to many other scenarios (more to come).

@forki
Copy link
Member

forki commented Mar 28, 2015

ok cool

forki added a commit that referenced this pull request Mar 28, 2015
Add a Vagrant file to automatically deploy an Ubuntu 14.04 development VM
@forki forki merged commit 32b003f into fsprojects:master Mar 28, 2015
@bbenoist bbenoist deleted the feature/vagrant branch March 28, 2015 18:32
@bbenoist
Copy link
Contributor Author

Nice 😎 Dedicaded markdown documentation incoming...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants