SlideShare a Scribd company logo
1

Spotify Tech
Web/iOS/Android/Native clients
Service oriented architecture > 50 services in Java and Python
Primarily using Cassandra for persistent storage
7,000 Servers in production
~500 in Engineers worldwide
2

What have we been
doing?
Lost in the forest of dependency building
3

Deploy via Debian Packages
Use Debian Stable repositories
Package/Backport needed libraries as needed
All Dependencies defined in Debian package
Deployed via Puppet/Aptitude
4

Mirroring	
  

P
a
c
k
a
g
e
	
  

A
p
p
s	
  

P
y
P
i	
  
5

What’s wrong with
that?
Spending too much time managing
dependencies and not enough building cool
shit
6

Using Debian Stable does not included latest and
greatest
7

Requires “Backporting” for newer libraries
8

Does not used normal python packaging
9

Limited use on developer systems
(or bad/duplicated information)
10

Full rollback non-existent
11

What you test is NOT what you deploy
12

Dependency lock in due to sharing a common python
environment
13

There MUST be a better way
Avoid duplication of effort
14

There MUST be a better way
Increase stability and repeatability
15

There MUST be a better way
Offer easy rollback
16

There MUST be a better way
Scale
17

What about now?
Deploying Python @ Scale
18

Enter Dh-viurtualenv
19

Dh == Debian Helper
• 
• 
• 
• 
• 

Registers itself as a Debian Helper
Bundles the requirements in requirements.txt into virtual environment
Deploys virtualenv into /usr/share/python/<package-name>
Still requires native dependencies to be installed via packaging
Just include the following in the debian/rules:
%:	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  dh	
  $@	
  -­‐-­‐with	
  python-­‐virtualenv
20

Mirroring	
  

V
i
r
t
u
a
l
e
n
v
	
  

Pip	
  

A
p
p
s	
  
21

IT Works!
22

Example: Using Sentry
Define Dependencies in requirements.txt
sentry[postgres]==6.2.0	
  
eventlet==0.13.0	
  
hiredis==0.1.1	
  
django-­‐auth-­‐ldap==1.1.4
23

Example: Using Sentry
Define Debian dependencies in control file
Build-Depends:
python (>= 2.6.6-3~),
debhelper (>= 8),
dh-virtualenv,
python-dev,
libpq-dev,
libldap2-dev,
libsasl2-dev,
Standards-Version: 3.9.3
X-Python-Version: >= 2.6
24

Example: Using Sentry
Use dh_virtualenv in Debian rules file
%:
dh $@ --with python-virtualenv
override_dh_virtualenv:
dh_virtualenv --index-url='http://localhost/simple'
25

Have done this with RPMs as well (@ Amplify)

Within RPM build virtaulenv and mark it as
relocatable:
/usr/local/bin/virtualenv --no-site-packages build_venv
source build_venv/bin/activate
env CFLAGS="$RPM_OPT_FLAGS" easy_install -Z .
deactivate
/usr/local/bin/virtualenv --relocatable build_venv
26

Benefits

No longer stuck on Debian stable
27

Benefits

No more backporting of new libraries or versions
28

Benefits

Code isolation/use own dependencies
29

Benefits

Single package rollback option
30

Benefits

Development and Deployed systems using same
cross-platform setup
31

What’s Next?
32

Not Sure…
33

Dh_virtualenv now available (ironically) in Debian
Unstable repositories
34

Still requires managing native dependencies locally
35

But experimenting with containers!
36

Stay Tuned!
37

Thanks to Jyrki
Pulliainen and Jim
Whitehead @ Spotify
Stockholm!
Whitepaper:
http://labs.spotify.com/2013/10/10/packagingin-your-packaging-dh-virtualenv/
Code: https://github.com/spotify/dh-virtualenv
38

Questions?
Chris Angove, Chapter Lead - Backend
Email: cangove@spotify.com
Blog: http://labs.spotify.com/
Listen: https://play.spotify.com/
Want to join the band?
Check out spotify.com/jobs or
@Spotifyjobs for more information.

January 24, 2014

More Related Content

PDF
Packaging in packaging: dh-virtualenv
PDF
Boycott Docker
PPTX
Data science bootcamp day2
PDF
Drupal Camp Brighton 2015: Ansible Drupal Medicine show
PDF
Using Nix and Docker as automated deployment solutions
PDF
Deploying NPM packages with the Nix package manager
PDF
Cluster Networking with Docker
ODP
Testing Wi-Fi with OSS Tools
Packaging in packaging: dh-virtualenv
Boycott Docker
Data science bootcamp day2
Drupal Camp Brighton 2015: Ansible Drupal Medicine show
Using Nix and Docker as automated deployment solutions
Deploying NPM packages with the Nix package manager
Cluster Networking with Docker
Testing Wi-Fi with OSS Tools

What's hot (20)

PDF
Puppet Camp Charlotte 2015: Exporting Resources: There and Back Again
PDF
Openstack meetup lyon_2017-09-28
PDF
Debugging Network Issues
PDF
Networking in Kubernetes
PPT
TAPIR PyWrapper3, at GBIF GB14 nodes meeting (2007)
PDF
Wordpress y Docker, de desarrollo a produccion
PPT
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
PDF
Docker Runtime Security
PPTX
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
PDF
Under the Hood with Docker Swarm Mode - Drew Erny and Nishant Totla, Docker
PDF
NATS: Simple, Secure and Scalable Messaging For the Cloud Native Era
PDF
DNS over HTTPS
PPTX
Tectonic Summit 2016: Kubernetes 1.5 and Beyond
PDF
Kubernetes: Beyond Baby Steps
PDF
Software development practices in python
PDF
Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016
PDF
On-Demand Image Resizing from Part of the monolith to Containerized Microserv...
PDF
From pets to cattle - powered by CoreOS, docker, Mesos & nginx
PDF
Docker Intro
PDF
The Zen of High Performance Messaging with NATS (Strange Loop 2016)
Puppet Camp Charlotte 2015: Exporting Resources: There and Back Again
Openstack meetup lyon_2017-09-28
Debugging Network Issues
Networking in Kubernetes
TAPIR PyWrapper3, at GBIF GB14 nodes meeting (2007)
Wordpress y Docker, de desarrollo a produccion
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Docker Runtime Security
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Under the Hood with Docker Swarm Mode - Drew Erny and Nishant Totla, Docker
NATS: Simple, Secure and Scalable Messaging For the Cloud Native Era
DNS over HTTPS
Tectonic Summit 2016: Kubernetes 1.5 and Beyond
Kubernetes: Beyond Baby Steps
Software development practices in python
Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016
On-Demand Image Resizing from Part of the monolith to Containerized Microserv...
From pets to cattle - powered by CoreOS, docker, Mesos & nginx
Docker Intro
The Zen of High Performance Messaging with NATS (Strange Loop 2016)
Ad

Viewers also liked (6)

PDF
CASE Network Studies and Analyses 423 - Fiscal policy in the EU in the crisis...
PPT
EasyAccountPlus - totaaloplossing voor de bibliotheek
PDF
Optimize DevOps and Agile Strategies with Deployment Automation
PPT
Release Management
PPT
Itil v3 release and deployment management
PDF
Agile at Spotify
CASE Network Studies and Analyses 423 - Fiscal policy in the EU in the crisis...
EasyAccountPlus - totaaloplossing voor de bibliotheek
Optimize DevOps and Agile Strategies with Deployment Automation
Release Management
Itil v3 release and deployment management
Agile at Spotify
Ad

Similar to Deployment Tools and Techniques at Spotify: Virtualenv in debian by Chris Angove (20)

PDF
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
PDF
From Dev to DevOps
KEY
From Dev to DevOps - ApacheCON NA 2011
ODP
The Gory Details of Debian packages
PDF
Generating Linked Data descriptions of Debian packages in the Debian PTS
PDF
Architecting the Future: Abstractions and Metadata - GlueCon
PDF
A DevOps guide to Kubernetes
PDF
Node.js Build, Deploy and Scale Webinar
PDF
Python packaging and dependency resolution
PDF
Princeton RSE: Building Python Packages (+binary)
PDF
Arbeiten mit distribute, pip und virtualenv
PDF
2012 09-08-josug-jeff
PDF
Python+gradle
KEY
From Dev to DevOps - Apache Barcamp Spain 2011
PDF
AIDevWorldApacheNiFi101
PDF
Chef - industrialize and automate your infrastructure
PDF
Becoming a Plumber: Building Deployment Pipelines - All Day DevOps
PDF
How to Install Python on Debian 12 Server
DOCX
Dean Hagen
PDF
Debian Packaging tutorial
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
From Dev to DevOps
From Dev to DevOps - ApacheCON NA 2011
The Gory Details of Debian packages
Generating Linked Data descriptions of Debian packages in the Debian PTS
Architecting the Future: Abstractions and Metadata - GlueCon
A DevOps guide to Kubernetes
Node.js Build, Deploy and Scale Webinar
Python packaging and dependency resolution
Princeton RSE: Building Python Packages (+binary)
Arbeiten mit distribute, pip und virtualenv
2012 09-08-josug-jeff
Python+gradle
From Dev to DevOps - Apache Barcamp Spain 2011
AIDevWorldApacheNiFi101
Chef - industrialize and automate your infrastructure
Becoming a Plumber: Building Deployment Pipelines - All Day DevOps
How to Install Python on Debian 12 Server
Dean Hagen
Debian Packaging tutorial

More from Hakka Labs (20)

PDF
Always Valid Inference (Ramesh Johari, Stanford)
PPTX
DataEngConf SF16 - High cardinality time series search
PDF
DataEngConf SF16 - Data Asserts: Defensive Data Science
PDF
DatEngConf SF16 - Apache Kudu: Fast Analytics on Fast Data
PDF
DataEngConf SF16 - Recommendations at Instacart
PDF
DataEngConf SF16 - Running simulations at scale
PDF
DataEngConf SF16 - Deriving Meaning from Wearable Sensor Data
PDF
DataEngConf SF16 - Collecting and Moving Data at Scale
PDF
DataEngConf SF16 - BYOMQ: Why We [re]Built IronMQ
PDF
DataEngConf SF16 - Unifying Real Time and Historical Analytics with the Lambd...
PDF
DataEngConf SF16 - Three lessons learned from building a production machine l...
PDF
DataEngConf SF16 - Scalable and Reliable Logging at Pinterest
PDF
DataEngConf SF16 - Bridging the gap between data science and data engineering
PDF
DataEngConf SF16 - Multi-temporal Data Structures
PDF
DataEngConf SF16 - Entity Resolution in Data Pipelines Using Spark
PDF
DataEngConf SF16 - Beginning with Ourselves
PDF
DataEngConf SF16 - Routing Billions of Analytics Events with High Deliverability
PDF
DataEngConf SF16 - Tales from the other side - What a hiring manager wish you...
PDF
DataEngConf SF16 - Methods for Content Relevance at LinkedIn
PDF
DataEngConf SF16 - Spark SQL Workshop
Always Valid Inference (Ramesh Johari, Stanford)
DataEngConf SF16 - High cardinality time series search
DataEngConf SF16 - Data Asserts: Defensive Data Science
DatEngConf SF16 - Apache Kudu: Fast Analytics on Fast Data
DataEngConf SF16 - Recommendations at Instacart
DataEngConf SF16 - Running simulations at scale
DataEngConf SF16 - Deriving Meaning from Wearable Sensor Data
DataEngConf SF16 - Collecting and Moving Data at Scale
DataEngConf SF16 - BYOMQ: Why We [re]Built IronMQ
DataEngConf SF16 - Unifying Real Time and Historical Analytics with the Lambd...
DataEngConf SF16 - Three lessons learned from building a production machine l...
DataEngConf SF16 - Scalable and Reliable Logging at Pinterest
DataEngConf SF16 - Bridging the gap between data science and data engineering
DataEngConf SF16 - Multi-temporal Data Structures
DataEngConf SF16 - Entity Resolution in Data Pipelines Using Spark
DataEngConf SF16 - Beginning with Ourselves
DataEngConf SF16 - Routing Billions of Analytics Events with High Deliverability
DataEngConf SF16 - Tales from the other side - What a hiring manager wish you...
DataEngConf SF16 - Methods for Content Relevance at LinkedIn
DataEngConf SF16 - Spark SQL Workshop

Recently uploaded (20)

PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Network Security Unit 5.pdf for BCA BBA.
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Electronic commerce courselecture one. Pdf
Encapsulation_ Review paper, used for researhc scholars
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
NewMind AI Weekly Chronicles - August'25 Week I
MIND Revenue Release Quarter 2 2025 Press Release
Network Security Unit 5.pdf for BCA BBA.
The AUB Centre for AI in Media Proposal.docx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
The Rise and Fall of 3GPP – Time for a Sabbatical?
Digital-Transformation-Roadmap-for-Companies.pptx
Spectral efficient network and resource selection model in 5G networks
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Building Integrated photovoltaic BIPV_UPV.pdf

Deployment Tools and Techniques at Spotify: Virtualenv in debian by Chris Angove