Giter VIP home page Giter VIP logo

my-linux-devbox's Introduction

Vagrant setup to work with Python 2 / 3 & SciPy

Use Vagrant to automatically configure a Ubuntu VM from scratch and bootstrap it with SaltStack to install the SciPy stack with a mix of Ubuntu packages and virtualenvs.

To get started install:

It can be helpful to tell vagrant to automatically install the virtualbox guest additions for the matching version to solve shared folder issues:

[host]$ vagrant plugin install vagrant-vbguest

Then you can start the VM with:

[host]$ vagrant up

The first start takes a couple of minutes to download the VM image, boot it, and install most of the Scipy stack packages with Salt. Subsequent calls to vagrant up will be much faster.

Once started you can ssh into the VM with:

[host]$ vagrant ssh

SSH agent forwarding is enabled by default to be able to use git from inside the VM if needed.

Once there you can activate one of the virtualenvs, for instance for the Python 3.4 virtualenv:

[guest]$ workon 3.4
(3.4)[guest]$ ipython

You can suspend / resume the VM with to temporarily free the memory on the host with vagrant suspend / vagrant resume. Or shutfown and destroy the VM completely to also free the disk with:

[host]$ vagrant destroy

Vagrant configuration

Edit the Vagrantfile to customize:

  • VM image (Ubuntu 13.04 64 bits by default)
  • VM RAM size
  • shared folders
  • port forwarding

Salt configuration

The configuration is a bunch of text files in:

salt/roots/salt/

In particular the Ubuntu packages and virtualenv configuration is in:

salt/roots/salt/python-venvs.sls

Read the SaltStack documentation to get started with custom state files.

If you edit the salt configuration you can ask salt to quickly take all your changes into accout from inside the VM:

[guest]$ sudo salt-call state.highstate

Alternatively you can reboot the whole VM with from outside of the VM:

[host]$ vagrant reload

You can even shutdown and delete the VM to restart the provisioning from scratch with:

[host]$ vagrant destroy
[host]$ vagrant up

Building numpy and scipy wheel packages

To speedup the dev setup, this repo comes with a wheelhouse folder with pre-built numpy and scipy whl packages.

To build wheel packages for newer versions of numpy and scipy you can use (for instance with Python 3.4):

[guest]$ workon 3.4
(3.4)[guest]$ pip wheel --download-cache=~/pip-cache \
                        --wheel-dir=/vagrant/wheelhouse numpy
(3.4)[guest]$ pip install /vagrant/wheelhouse/numpy-*-cp34-cp34m-linux_x86_64.whl

(3.4)[guest]$ pip wheel --download-cache=~/pip-cache \
                        --wheel-dir=/vagrant/wheelhouse scipy
(3.4)[guest]$ pip install /vagrant/wheelhouse/scipy-*-cp34-cp34m-linux_x86_64.whl

my-linux-devbox's People

Contributors

ogrisel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

my-linux-devbox's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.