Coder Social home page Coder Social logo

sbellem / numpybox Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sciboxes/numpybox

0.0 3.0 0.0 197 KB

Provisioning scripts for a Ubuntu-based virtual machine with numpy, and the ipython notebook.

License: MIT License

Scheme 9.75% Python 90.25%

numpybox's Introduction

image

numpybox

This repository provides the necessary files to provision a virtual machine with a python virtual environment with numpy, ipython, matplotlib, and the required packages (jinja2, pyzmq, tornado) to run the ipython notebook.

At the time of this writing the box used is the official Ubuntu Server 14.04 LTS (Trusty Tahr) build as found at Vagrant Cloud at https://vagrantcloud.com/ubuntu/trusty64.

Prerequisites

You should have recent versions of the following installed:

and the following vagrant plugins:

$ vagrant plugin install vagrant-cachier vagrant-vbguest

Building the virtual machine

Run:

$ vagrant up

NOTE: Especially if it is the first time you build the machine, it'll take a while. (Perhaps in between 10 to 15 minutes plus the time to download the ubuntu image.)

Connect:

$ vagrant ssh

Python virtual environment

The box is provisioned to have a pre-built python virtual environment, named env under /home/vagrant.

Active it

vagrant@(...)~$ source ~/env/bin/activate

The provisioning phase should also install the python packages listed under requirements.txt. Consequently, if you run pip freeze you should see the following packages:

  • jinja2
  • ipython
  • matplotlib
  • numpy
  • pyzmq
  • tornado

Running the ipython notebook

Before running the notebook, check the ip address (<box_ip>) of the virtual machine. You can run ifconfig to do so.

In the virtual environment run:

(env)vagrant@(...)~$ ipython notebook --ip=0.0.0.0 --no-browser

You should then be able to access the notebook from the host machine at http://<box_ip>:8888

Vagrant tips

Using an automatic vagrant bash completion, may be helpful to speed up your work when using vagrant.

The first time you run vagrant up the box will be provisioned, but afterwards it will not as this takes more time, and may not be needed. You can instruct vagrant to provision the box like so:

$ vagrant up --provision

If the box is already running then you can use the reload command like so:

$ vagrant reload --provision

Running the salt states

You can execute the salt states manually within the virtual machine, using the salt-call command:

vagrant@(...)~$ salt-call --local state.highstate -l debug

This will "re-provision" the machine, and is usually faster than getting out of the virtual machine, and invoking vagrant reload --provision.

It is useful to use this approach when troubleshooting the provisioning phase, and trying different configurations to fix the issue. That is, you can modify one or more salt states, and run salt-call to see the effect.

numpybox's People

Contributors

sbellem avatar

Watchers

 avatar James Cloos avatar  avatar

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.