May 2014
12 Mon
13 Tue
14 Wed 10:00 AM – 06:30 PM IST
15 Thu 10:00 AM – 06:30 PM IST
16 Fri 09:30 AM – 10:30 PM IST
17 Sat 09:30 AM – 06:15 PM IST
18 Sun
Akshar Raaj
People attending this talk will leave with an understanding of continous deployment and continous deployment tools in general and Fabric in particular.
They will appreciate the usefulness of a continous deployment tool like Fabric. Essentially they will realise the time they save by using a single step build process. By the time they leave, they would have learned how to write a Fabric script which can automate deployment.
Your time is precious and is best spent writing code. It should not be wasted on a production server doing the repetitive task again and again. And by repetitive task I mean fetching the code changes to server, installing the libraries, restarting the web server, restarting the proxy server and so on.
Code changes continously. And you need to deploy the code to production every day, possibly you want to deploy with every code push. And sshing to the server everytime you want to deploy, and doing the repetitive tasks is a waste of time and energy.
So, deployment of code should be automated. Joel’s test has a requirement that build should be a one step process.
Fabric is a command-line tool for streamlining the use of SSH for application deployment (taken from docs).
We will write a basic web application using Python. This application will serve few urls, it will depend on certain third party libraries which are installble from PyPI. We will use gunicorn as the web server and nginx as the reverse proxy.
Everytime we want to deploy we need to do the following:
cd
to required directory.We will ssh to a server and will deploy the code there. We will perform the steps mentioned above. You will notice the time it takes and pain involved in performing those steps manually. And then we will write a Fabric script which can automate these steps for us, which will be much faster than the previous approach where we manually had to do every step involved in build.
We need a web application for this workshop. We will use Python to write our web application. So, you must know the basics of Python.
Every person attending the workshop would not be aware about the same Python web framework, so we can’t use a framework for the web application. Our web application will only use standard Python library. Our web application will be WSGI compliant, and we will use Gunicorn which is WSGI compliant too. Read this to get a basic idea of WSGI.
Gunicorn is a wsgi server. Read about gunicorn here.
You need a deployment server to gain a first hand experience of deployment. I have an ec2 server, and suggest you to have a server too.
Make sure you have port 8000 and 8001 open on your server.
Have the following things installed on your development machine as well as on deployment server.
Make sure your server public key is added on github, so you would be able to pull from github.
I have created the web application which we will use throughout this workshop. Check it here.
I am a web developer at Agiliq. I primarily work with Python, Django and the related technology stack. I help people by writing open source code, blog, and by answering questions on Stack Overflow.
{{ gettext('Login to leave a comment') }}
{{ gettext('Post a comment…') }}{{ errorMsg }}
{{ gettext('No comments posted yet') }}