Vagrant - Vagrantfile

Card Puncher Data Processing


The purpose of the Vagrantfile is twofold:

  • Mark the root directory of your project. Many of the configuration options in Vagrant are relative to this root directory.
  • Describe the kind of machine and resources you need to run your project, as well as what software to install and how you want to access it.

The Vagrantfile is meant to be committed to version control


vagrant file example named Vagrantfile (without extension) from the Spark MOOC

# -*- mode: ruby -*-
# vi: set ft=ruby :

ipythonPort = 8001                 # Ipython port to forward (also set in IPython notebook config)

Vagrant.configure(2) do |config|
  config.ssh.insert_key = true
  config.vm.define "sparkvm" do |master| = "sparkmooc/base"
    master.vm.box_download_insecure = true
    master.vm.boot_timeout = 900 :forwarded_port, host: ipythonPort, guest: ipythonPort, auto_correct: true   # IPython port (set in notebook config) :forwarded_port, host: 4040, guest: 4040, auto_correct: true                 # Spark UI (Driver)
    master.vm.hostname = "sparkvm"
    master.vm.usable_port_range = 4040..4090

    master.vm.provider :virtualbox do |v| = master.vm.hostname.to_s

Discover More
Card Puncher Data Processing
Vagrant - Box (base image)

Vagrant uses a base image known as Box to quickly clone a virtual machine. Each project uses a box as an initial image to clone from, and never modifies the actual base image. the username and...
Card Puncher Data Processing
Vagrant - Network

Networking configuration Networking page
Card Puncher Data Processing
Vagrant - Project

A project is composed of a project directory where the vagrantfile is located. Init a project directory to be used with vagrant. It will create a .vagrant directory into the directory project myVagrantProjectDirectory...
Card Puncher Data Processing
Vagrant - Provision (Code, Software Installation)

in Vagrant. where: :shell is the provisioner mydir/ is relative to the project directory the packaging custom boxes documentation ...

Share this page:
Follow us:
Task Runner