/devbox-python

A Vagrant/Docker/Virtualbox/Ansible powered vim-based development environment for python.

Primary LanguageShell

DevBox-Python

With Docker or Virtualbox as provider and Ansible provisioning

A Vagrant box (Virtualbox or Docker as providers and Ansible provisioning) with a vim-based development environment for python.

Note: There are currently problems with the docker version of the script, so please use the virtualbox version until this is solved!

Ingredients

Prerequisites

Installing the requirements in Ubuntu (tested with 14.04)

  1. Install Virtualbox:

    sudo apt-get install virtualbox
  2. Install Docker:

    sudo apt-get install docker.io
  3. Install a recent version of ansible:

    sudo apt-get install ansible/trusty-backports

    (if you ubuntu version is "trusty", otherwise, replace it with your appropriate version)

  4. Install Vagrant, by first downloadng the proper .deb file from vagrantup.com

  5. ... and then installing it with:

    sudo dpkg -i <deb-file>

Setup and Usage

Clone the github repository:

git clone git@github.com:samuell/devbox-python
cd devbox-python

Bring up the VM

With docker provider (Expect it to take at least ~8m):

vagrant up docker

With VirtualBox provider (Expect it to take at least ~20m):

vagrant up virtualbox

Log in to the VM

With docker provider:

vagrant ssh docker

With VirtualBox provider:

vagrant ssh virtualbox

A tip on how you can upload your existing git ssh keys to the new vm:

With the following command you can get the info you need to run scp against the machine:

vagrant ssh-config [docker | virtualbox]

Note the hostname and port number (and identity file, if you with), and run, for example:

scp -i <identity-file-path> -P <portno> \
	~/.ssh/id_rsa_<whateveryounamedit> \
	vagrant@<hostname>:/home/vagrant/.ssh/

Then, sometimes, in order to get the new key activated in your shell after logging in to the vm, you might need to do:

ssh-agent bash -l
ssh-add ~/.ssh/id_rsa_<whateveryounamedit>
  • Autocompletion will happen automatically
  • If you have turned off the YouCompleteMe role, you will get autocompletion with <C-x><C-o>

Known issues

  • There are some really red message from the docker daemon when running vagrant halt. Everything seems to work as expected though (including the shutdown)
  • There are some red message on vagrant up, but they are nothing serious, and can be ignored for now.

References