vagrant 1


by Malik BOUGACHA, EBU on 14 Sep 2013

Developpement sandboxing

Vagrant is a way to sandbox the devloppement environement. I will take python as an example of sandbox and explain how we come from a simple os based devloppement environement and test to a vm env.

machine

Let's start with a simple machine environement

python server.py 

The server.py being a very simple flask server:

from Flask import Flask 

app = Flask() 

if __name__ == "__main__": 
    app.run() 

Great right ?
But what happens if we add more dependencies, for example requests, a python module for doing http request.

from Flask import Flask 
import requests 

app = Flask() 

@app.route("/") 
def main(): 
    return request.get("http://example.com/json").json() 

if __name__ == "__main__": 
    app.run() 

The example is pretty simple right ? What does happen when we want to deploy it ? It will crash depending on the version of the requests module we have. As we have a stable version of debian, we don't have the right version of the library and of course we don't want to install it at a system wide level But there is a solution for this in python: virtualenv.


dependencies python vagrant virtualenv

Comments

  • Malik BOUGACHA

Recent posts



23 May 2016
OSCON 2016
Michael Barroco

15 Jan 2015
Version support
Frans De Jong

03 Jan 2015
Quality Wishes for 2015
Frans De Jong

22 Dec 2014

17 Dec 2014
Responsive QC
Frans De Jong

30 Sep 2014
Open Source Meetup at IBC
Mathias COINCHON

25 Mar 2014
EBU.io - February Update
Michael Barroco

31 Jan 2014
EBU.io - January Update
Michael Barroco