SlideShare a Scribd company logo
dh-virtualenv 
Packaging in packaging
@nailor 
Jyrki Pulliainen 
jyrki@spotify.com 
Photo credit: Pontus Persson
What’s in this talk? 
• Look at different, existing deployment strategies 
• What is dh-virtualenv? 
• Packaging sentry with dh-virtualenv
virtualenv
+ Stable 
+ Non-Python Dependencies 
+ Existing infrastructure 
+ Scripting
- Out of date 
- Complex 
- Global state
+ Has the new stuff 
+ De facto 
+ Battle tested 
+ Contained 
virtualenv
- Native dependency 
handling 
- Source installs 
- Random scripts 
sh: mysql_config: command not found
What is dh-virtualenv?
Virtualenv inside a Debian package
It’s Open Source! 
• GPL’d 
• Documented 
• Comes with a simple tutorial!
It’s a DebHelper Extension 
• Idea stolen adapted from @hynek 
* https://hynek.me/articles/python-app-deployment-with-native-packages/
In practice?
Package builder that… 
1. Creates a virtualenv 
2. Installs requirements.txt into that virtualenv 
3. Installs your project 
4. Fixes the virtualenv to match production
Packaging with dh-virtualenv 
Case in point: sentry
1. Install dh-virtualenv 
apt-get install dh-virtualenv 
2. Create ‘debian’ directory 
3. Insert the minimal boilerplate files in there
debian/control: 
Source: sentry 
Section: python 
Priority: extra 
Maintainer: Jyrki Pulliainen <jyrki@spotify.com> 
Build-Depends: debhelper (>= 9), python, dh-virtualenv, 
python-dev 
Standards-Version: 3.9.5 
Package: sentry 
Architecture: any 
Depends: ${python:Depends}, ${misc:Depends} 
Description: dh-virtualenv-packaged sentry 
Amazing tool, now packaged with dh-virtualenv!
debian/changelog: 
sentry (6.4.4-1) unstable; urgency=low 
* Initial packaging with dh-virtualenv 
-- Jyrki Pulliainen <jyrki@spotify.com> Wed, 23 Jul 2014 12:02:20 +0200
echo 9 > debian/compat
debian/rules: 
#!/usr/bin/make -f 
%: 
dh $@ --with python-virtualenv
5. Build your package! 
dpkg-buildpackage
dpkg-buildpackage: source package dh-virtualenv 
dpkg-buildpackage: source version 0.7-2 
dpkg-buildpackage: source distribution unstable 
dpkg-buildpackage: source changed by Jyrki Pulliainen <jyrki@spotify.com> 
dpkg-buildpackage: host architecture i386 
dpkg-source --before-build dh-virtualenv 
fakeroot debian/rules clean 
dh clean --with python2 --with sphinxdoc 
dh_testdir 
debian/rules override_dh_auto_clean 
make[1]: Entering directory `/vagrant_src/dh-virtualenv' 
rm -rf doc/_build 
rm -f doc/dh_virtualenv.1 
rm -rf dh_virtualenv.egg-info 
dh_auto_clean 
running clean 
'build/lib.linux-i686-2.7' does not exist -- can't clean it 
'build/bdist.linux-i686' does not exist -- can't clean it 
removing 'build/scripts-2.7' (and everything under it) 
make[1]: Leaving directory `/vagrant_src/dh-virtualenv' 
dh_clean 
dpkg-source -b dh-virtualenv 
dpkg-source: error: can't build with source format '3.0 (quilt)': no upstream tarball found at ../ 
dh-virtualenv_0.7.orig.tar.{bz2,gz,lzma,xz}
dh_virtualenv 
Running virtualenv with interpreter /usr/bin/python2 
New python executable in debian/sentry/usr/share/python/sentry/bin/python2 
Also creating executable in debian/sentry/usr/share/python/sentry/bin/python 
Installing setuptools, pip...done. 
Unpacking /vagrant_src/sentry-with-dh-virtualenv 
Running setup.py (path:/tmp/pip-ttX1Ip-build/setup.py) egg_info for package from file:/// 
vagrant_src/sentry-with-dh-virtualenv 
warning: no previously-included files matching '*~' found anywhere in distribution 
Downloading/unpacking BeautifulSoup>=3.2.1,<3.3.0 (from sentry==6.4.4) 
Downloading BeautifulSoup-3.2.1.tar.gz 
Running setup.py (path:/vagrant_src/sentry-with-dh-virtualenv/debian/sentry/usr/share/python/ 
sentry/build/BeautifulSoup/setup.py) egg_info for package BeautifulSoup 
Downloading/unpacking celery>=3.0.15,<3.1.0 (from sentry==6.4.4) 
Downloading celery-3.0.25.tar.gz (1.1MB): 1.1MB downloaded 
Running setup.py (path:/vagrant_src/sentry-with-dh-virtualenv/debian/sentry/usr/share/python/ 
sentry/build/celery/setup.py) egg_info for package celery 
Upgrade: no old version found. 
no previously-included directories found matching '*.pyc' 
no previously-included directories found matching '*.sw*’
5. Install the shiny Debian package in production!
+ Non-Python dependencies 
+ Existing Infrastructure 
+ The new hotness 
+ Contained 
dh-virtualenv
- Can be slow to build 
- Requires still digging for requirements 
- Build system needs to have the exactly 
same Python 
dh-virtualenv
Thanks! 
github.com/spotify/dh-virtualenv 
dh-virtualenv.readthedocs.org 
labs.spotify.com/2013/10/10/packaging-in-your- 
packaging-dh-virtualenv/

More Related Content

What's hot

Dockerを利用したローカル環境から本番環境までの構築設計
Dockerを利用したローカル環境から本番環境までの構築設計Dockerを利用したローカル環境から本番環境までの構築設計
Dockerを利用したローカル環境から本番環境までの構築設計
Koichi Nagaoka
 
The Zen of High Performance Messaging with NATS (Strange Loop 2016)
The Zen of High Performance Messaging with NATS (Strange Loop 2016)The Zen of High Performance Messaging with NATS (Strange Loop 2016)
The Zen of High Performance Messaging with NATS (Strange Loop 2016)
wallyqs
 
Networking in Kubernetes
Networking in KubernetesNetworking in Kubernetes
Networking in Kubernetes
Minhan Xia
 
Reproducibility of computational workflows is automated using continuous anal...
Reproducibility of computational workflows is automated using continuous anal...Reproducibility of computational workflows is automated using continuous anal...
Reproducibility of computational workflows is automated using continuous anal...
Kento Aoyama
 
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Running High Performance and Fault Tolerant Elasticsearch Clusters on DockerRunning High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Sematext Group, Inc.
 
Wordpress y Docker, de desarrollo a produccion
Wordpress y Docker, de desarrollo a produccionWordpress y Docker, de desarrollo a produccion
Wordpress y Docker, de desarrollo a produccion
Sysdig
 
TAPIR PyWrapper3, at GBIF GB14 nodes meeting (2007)
TAPIR PyWrapper3, at GBIF GB14 nodes meeting (2007)TAPIR PyWrapper3, at GBIF GB14 nodes meeting (2007)
TAPIR PyWrapper3, at GBIF GB14 nodes meeting (2007)
Dag Endresen
 
Puppet Camp Charlotte 2015: Exporting Resources: There and Back Again
Puppet Camp Charlotte 2015: Exporting Resources: There and Back AgainPuppet Camp Charlotte 2015: Exporting Resources: There and Back Again
Puppet Camp Charlotte 2015: Exporting Resources: There and Back Again
Puppet
 
Docker Runtime Security
Docker Runtime SecurityDocker Runtime Security
Docker Runtime Security
Sysdig
 
Under the Hood with Docker Swarm Mode - Drew Erny and Nishant Totla, Docker
Under the Hood with Docker Swarm Mode - Drew Erny and Nishant Totla, DockerUnder the Hood with Docker Swarm Mode - Drew Erny and Nishant Totla, Docker
Under the Hood with Docker Swarm Mode - Drew Erny and Nishant Totla, Docker
Docker, Inc.
 
Openstack meetup lyon_2017-09-28
Openstack meetup lyon_2017-09-28Openstack meetup lyon_2017-09-28
Openstack meetup lyon_2017-09-28
Xavier Lucas
 
Tectonic Summit 2016: Kubernetes 1.5 and Beyond
Tectonic Summit 2016: Kubernetes 1.5 and BeyondTectonic Summit 2016: Kubernetes 1.5 and Beyond
Tectonic Summit 2016: Kubernetes 1.5 and Beyond
CoreOS
 
Debugging Network Issues
Debugging Network IssuesDebugging Network Issues
Debugging Network Issues
Apcera
 
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Yevgeniy Brikman
 
K8s上の containerized cloud foundryとcontainerized open stackをprometheusで監視してみる
K8s上の containerized cloud foundryとcontainerized open stackをprometheusで監視してみるK8s上の containerized cloud foundryとcontainerized open stackをprometheusで監視してみる
K8s上の containerized cloud foundryとcontainerized open stackをprometheusで監視してみる
JUNICHI YOSHISE
 
Cluster Lifecycle Landscape
Cluster Lifecycle LandscapeCluster Lifecycle Landscape
Cluster Lifecycle Landscape
Mike Danese
 
On-Demand Image Resizing from Part of the monolith to Containerized Microserv...
On-Demand Image Resizing from Part of the monolith to Containerized Microserv...On-Demand Image Resizing from Part of the monolith to Containerized Microserv...
On-Demand Image Resizing from Part of the monolith to Containerized Microserv...
Docker, Inc.
 
Software development practices in python
Software development practices in pythonSoftware development practices in python
Software development practices in python
Jimmy Lai
 
Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Docker workshop 0507 Taichung
Docker workshop 0507 Taichung
Paul Chao
 
Kubernetes: Beyond Baby Steps
Kubernetes: Beyond Baby StepsKubernetes: Beyond Baby Steps
Kubernetes: Beyond Baby Steps
DigitalOcean
 

What's hot (20)

Dockerを利用したローカル環境から本番環境までの構築設計
Dockerを利用したローカル環境から本番環境までの構築設計Dockerを利用したローカル環境から本番環境までの構築設計
Dockerを利用したローカル環境から本番環境までの構築設計
 
The Zen of High Performance Messaging with NATS (Strange Loop 2016)
The Zen of High Performance Messaging with NATS (Strange Loop 2016)The Zen of High Performance Messaging with NATS (Strange Loop 2016)
The Zen of High Performance Messaging with NATS (Strange Loop 2016)
 
Networking in Kubernetes
Networking in KubernetesNetworking in Kubernetes
Networking in Kubernetes
 
Reproducibility of computational workflows is automated using continuous anal...
Reproducibility of computational workflows is automated using continuous anal...Reproducibility of computational workflows is automated using continuous anal...
Reproducibility of computational workflows is automated using continuous anal...
 
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Running High Performance and Fault Tolerant Elasticsearch Clusters on DockerRunning High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
 
Wordpress y Docker, de desarrollo a produccion
Wordpress y Docker, de desarrollo a produccionWordpress y Docker, de desarrollo a produccion
Wordpress y Docker, de desarrollo a produccion
 
TAPIR PyWrapper3, at GBIF GB14 nodes meeting (2007)
TAPIR PyWrapper3, at GBIF GB14 nodes meeting (2007)TAPIR PyWrapper3, at GBIF GB14 nodes meeting (2007)
TAPIR PyWrapper3, at GBIF GB14 nodes meeting (2007)
 
Puppet Camp Charlotte 2015: Exporting Resources: There and Back Again
Puppet Camp Charlotte 2015: Exporting Resources: There and Back AgainPuppet Camp Charlotte 2015: Exporting Resources: There and Back Again
Puppet Camp Charlotte 2015: Exporting Resources: There and Back Again
 
Docker Runtime Security
Docker Runtime SecurityDocker Runtime Security
Docker Runtime Security
 
Under the Hood with Docker Swarm Mode - Drew Erny and Nishant Totla, Docker
Under the Hood with Docker Swarm Mode - Drew Erny and Nishant Totla, DockerUnder the Hood with Docker Swarm Mode - Drew Erny and Nishant Totla, Docker
Under the Hood with Docker Swarm Mode - Drew Erny and Nishant Totla, Docker
 
Openstack meetup lyon_2017-09-28
Openstack meetup lyon_2017-09-28Openstack meetup lyon_2017-09-28
Openstack meetup lyon_2017-09-28
 
Tectonic Summit 2016: Kubernetes 1.5 and Beyond
Tectonic Summit 2016: Kubernetes 1.5 and BeyondTectonic Summit 2016: Kubernetes 1.5 and Beyond
Tectonic Summit 2016: Kubernetes 1.5 and Beyond
 
Debugging Network Issues
Debugging Network IssuesDebugging Network Issues
Debugging Network Issues
 
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
 
K8s上の containerized cloud foundryとcontainerized open stackをprometheusで監視してみる
K8s上の containerized cloud foundryとcontainerized open stackをprometheusで監視してみるK8s上の containerized cloud foundryとcontainerized open stackをprometheusで監視してみる
K8s上の containerized cloud foundryとcontainerized open stackをprometheusで監視してみる
 
Cluster Lifecycle Landscape
Cluster Lifecycle LandscapeCluster Lifecycle Landscape
Cluster Lifecycle Landscape
 
On-Demand Image Resizing from Part of the monolith to Containerized Microserv...
On-Demand Image Resizing from Part of the monolith to Containerized Microserv...On-Demand Image Resizing from Part of the monolith to Containerized Microserv...
On-Demand Image Resizing from Part of the monolith to Containerized Microserv...
 
Software development practices in python
Software development practices in pythonSoftware development practices in python
Software development practices in python
 
Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Docker workshop 0507 Taichung
Docker workshop 0507 Taichung
 
Kubernetes: Beyond Baby Steps
Kubernetes: Beyond Baby StepsKubernetes: Beyond Baby Steps
Kubernetes: Beyond Baby Steps
 

Similar to Packaging in packaging: dh-virtualenv

Debian Packaging
Debian PackagingDebian Packaging
Debian Packaging
Javier Carranza
 
Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenv
Markus Zapke-Gründemann
 
5 minute intro to virtualenv
5 minute intro to virtualenv5 minute intro to virtualenv
5 minute intro to virtualenv
amenasse
 
Software Packaging for Cross OS Distribution
Software Packaging for Cross OS DistributionSoftware Packaging for Cross OS Distribution
Software Packaging for Cross OS Distribution
Jian-Hong Pan
 
Python packaging and dependency resolution
Python packaging and dependency resolutionPython packaging and dependency resolution
Python packaging and dependency resolution
Tatiana Al-Chueyr
 
Virtualenv
VirtualenvVirtualenv
Virtualenv
WEBdeBS
 
Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenv
Markus Zapke-Gründemann
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutes
Larry Cai
 
Virtualenv
VirtualenvVirtualenv
Virtualenv
Jon Nials
 
Docker and DevOps --- new IT culture
Docker and DevOps --- new IT cultureDocker and DevOps --- new IT culture
Docker and DevOps --- new IT culture
Terry Chen
 
Python+gradle
Python+gradlePython+gradle
Python+gradle
Stephen Holsapple
 
Debian packaging
Debian packagingDebian packaging
Debian packaging
Knoldus Inc.
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-way
Robert Lujo
 
AWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
AWS EC2 Ubuntu Instance - Step-by-Step Deployment GuideAWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
AWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
RapidValue
 
Empacotamento e backport de aplicações em debian
Empacotamento e backport de aplicações em debianEmpacotamento e backport de aplicações em debian
Empacotamento e backport de aplicações em debian
Andre Ferraz
 
Binary Packaging for HPC with Spack
Binary Packaging for HPC with SpackBinary Packaging for HPC with Spack
Binary Packaging for HPC with Spack
inside-BigData.com
 
How to make debian package from scratch (linux)
How to make debian package from scratch (linux)How to make debian package from scratch (linux)
How to make debian package from scratch (linux)
Thierry Gayet
 
Vagrant crash course
Vagrant crash courseVagrant crash course
Vagrant crash course
Marcus Deglos
 
Introduction to Docker
Introduction  to DockerIntroduction  to Docker
Introduction to Docker
Jian Wu
 
ABCs of docker
ABCs of dockerABCs of docker
ABCs of docker
Sabyrzhan Tynybayev
 

Similar to Packaging in packaging: dh-virtualenv (20)

Debian Packaging
Debian PackagingDebian Packaging
Debian Packaging
 
Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenv
 
5 minute intro to virtualenv
5 minute intro to virtualenv5 minute intro to virtualenv
5 minute intro to virtualenv
 
Software Packaging for Cross OS Distribution
Software Packaging for Cross OS DistributionSoftware Packaging for Cross OS Distribution
Software Packaging for Cross OS Distribution
 
Python packaging and dependency resolution
Python packaging and dependency resolutionPython packaging and dependency resolution
Python packaging and dependency resolution
 
Virtualenv
VirtualenvVirtualenv
Virtualenv
 
Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenv
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutes
 
Virtualenv
VirtualenvVirtualenv
Virtualenv
 
Docker and DevOps --- new IT culture
Docker and DevOps --- new IT cultureDocker and DevOps --- new IT culture
Docker and DevOps --- new IT culture
 
Python+gradle
Python+gradlePython+gradle
Python+gradle
 
Debian packaging
Debian packagingDebian packaging
Debian packaging
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-way
 
AWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
AWS EC2 Ubuntu Instance - Step-by-Step Deployment GuideAWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
AWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
 
Empacotamento e backport de aplicações em debian
Empacotamento e backport de aplicações em debianEmpacotamento e backport de aplicações em debian
Empacotamento e backport de aplicações em debian
 
Binary Packaging for HPC with Spack
Binary Packaging for HPC with SpackBinary Packaging for HPC with Spack
Binary Packaging for HPC with Spack
 
How to make debian package from scratch (linux)
How to make debian package from scratch (linux)How to make debian package from scratch (linux)
How to make debian package from scratch (linux)
 
Vagrant crash course
Vagrant crash courseVagrant crash course
Vagrant crash course
 
Introduction to Docker
Introduction  to DockerIntroduction  to Docker
Introduction to Docker
 
ABCs of docker
ABCs of dockerABCs of docker
ABCs of docker
 

Recently uploaded

"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin..."$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
Fwdays
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
ScyllaDB
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
Ajin Abraham
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
Christine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptxChristine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptx
christinelarrosa
 
Day 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio FundamentalsDay 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio Fundamentals
UiPathCommunity
 
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham HillinQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
LizaNolte
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
c5vrf27qcz
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
Fwdays
 
ScyllaDB Tablets: Rethinking Replication
ScyllaDB Tablets: Rethinking ReplicationScyllaDB Tablets: Rethinking Replication
ScyllaDB Tablets: Rethinking Replication
ScyllaDB
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
"Scaling RAG Applications to serve millions of users",  Kevin Goedecke"Scaling RAG Applications to serve millions of users",  Kevin Goedecke
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
Fwdays
 
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeckPoznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
FilipTomaszewski5
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Pablo Gómez Abajo
 
What is an RPA CoE? Session 2 – CoE Roles
What is an RPA CoE?  Session 2 – CoE RolesWhat is an RPA CoE?  Session 2 – CoE Roles
What is an RPA CoE? Session 2 – CoE Roles
DianaGray10
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
christinelarrosa
 
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Ukraine
 
From Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMsFrom Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMs
Sease
 

Recently uploaded (20)

"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin..."$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
Christine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptxChristine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptx
 
Day 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio FundamentalsDay 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio Fundamentals
 
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham HillinQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
 
ScyllaDB Tablets: Rethinking Replication
ScyllaDB Tablets: Rethinking ReplicationScyllaDB Tablets: Rethinking Replication
ScyllaDB Tablets: Rethinking Replication
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
"Scaling RAG Applications to serve millions of users",  Kevin Goedecke"Scaling RAG Applications to serve millions of users",  Kevin Goedecke
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
 
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeckPoznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
 
What is an RPA CoE? Session 2 – CoE Roles
What is an RPA CoE?  Session 2 – CoE RolesWhat is an RPA CoE?  Session 2 – CoE Roles
What is an RPA CoE? Session 2 – CoE Roles
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
 
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
 
From Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMsFrom Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMs
 

Packaging in packaging: dh-virtualenv

  • 2. @nailor Jyrki Pulliainen jyrki@spotify.com Photo credit: Pontus Persson
  • 3. What’s in this talk? • Look at different, existing deployment strategies • What is dh-virtualenv? • Packaging sentry with dh-virtualenv
  • 5. + Stable + Non-Python Dependencies + Existing infrastructure + Scripting
  • 6.
  • 7. - Out of date - Complex - Global state
  • 8. + Has the new stuff + De facto + Battle tested + Contained virtualenv
  • 9.
  • 10. - Native dependency handling - Source installs - Random scripts sh: mysql_config: command not found
  • 12. Virtualenv inside a Debian package
  • 13. It’s Open Source! • GPL’d • Documented • Comes with a simple tutorial!
  • 14. It’s a DebHelper Extension • Idea stolen adapted from @hynek * https://hynek.me/articles/python-app-deployment-with-native-packages/
  • 16. Package builder that… 1. Creates a virtualenv 2. Installs requirements.txt into that virtualenv 3. Installs your project 4. Fixes the virtualenv to match production
  • 17. Packaging with dh-virtualenv Case in point: sentry
  • 18. 1. Install dh-virtualenv apt-get install dh-virtualenv 2. Create ‘debian’ directory 3. Insert the minimal boilerplate files in there
  • 19. debian/control: Source: sentry Section: python Priority: extra Maintainer: Jyrki Pulliainen <jyrki@spotify.com> Build-Depends: debhelper (>= 9), python, dh-virtualenv, python-dev Standards-Version: 3.9.5 Package: sentry Architecture: any Depends: ${python:Depends}, ${misc:Depends} Description: dh-virtualenv-packaged sentry Amazing tool, now packaged with dh-virtualenv!
  • 20. debian/changelog: sentry (6.4.4-1) unstable; urgency=low * Initial packaging with dh-virtualenv -- Jyrki Pulliainen <jyrki@spotify.com> Wed, 23 Jul 2014 12:02:20 +0200
  • 21. echo 9 > debian/compat
  • 22. debian/rules: #!/usr/bin/make -f %: dh $@ --with python-virtualenv
  • 23. 5. Build your package! dpkg-buildpackage
  • 24. dpkg-buildpackage: source package dh-virtualenv dpkg-buildpackage: source version 0.7-2 dpkg-buildpackage: source distribution unstable dpkg-buildpackage: source changed by Jyrki Pulliainen <jyrki@spotify.com> dpkg-buildpackage: host architecture i386 dpkg-source --before-build dh-virtualenv fakeroot debian/rules clean dh clean --with python2 --with sphinxdoc dh_testdir debian/rules override_dh_auto_clean make[1]: Entering directory `/vagrant_src/dh-virtualenv' rm -rf doc/_build rm -f doc/dh_virtualenv.1 rm -rf dh_virtualenv.egg-info dh_auto_clean running clean 'build/lib.linux-i686-2.7' does not exist -- can't clean it 'build/bdist.linux-i686' does not exist -- can't clean it removing 'build/scripts-2.7' (and everything under it) make[1]: Leaving directory `/vagrant_src/dh-virtualenv' dh_clean dpkg-source -b dh-virtualenv dpkg-source: error: can't build with source format '3.0 (quilt)': no upstream tarball found at ../ dh-virtualenv_0.7.orig.tar.{bz2,gz,lzma,xz}
  • 25. dh_virtualenv Running virtualenv with interpreter /usr/bin/python2 New python executable in debian/sentry/usr/share/python/sentry/bin/python2 Also creating executable in debian/sentry/usr/share/python/sentry/bin/python Installing setuptools, pip...done. Unpacking /vagrant_src/sentry-with-dh-virtualenv Running setup.py (path:/tmp/pip-ttX1Ip-build/setup.py) egg_info for package from file:/// vagrant_src/sentry-with-dh-virtualenv warning: no previously-included files matching '*~' found anywhere in distribution Downloading/unpacking BeautifulSoup>=3.2.1,<3.3.0 (from sentry==6.4.4) Downloading BeautifulSoup-3.2.1.tar.gz Running setup.py (path:/vagrant_src/sentry-with-dh-virtualenv/debian/sentry/usr/share/python/ sentry/build/BeautifulSoup/setup.py) egg_info for package BeautifulSoup Downloading/unpacking celery>=3.0.15,<3.1.0 (from sentry==6.4.4) Downloading celery-3.0.25.tar.gz (1.1MB): 1.1MB downloaded Running setup.py (path:/vagrant_src/sentry-with-dh-virtualenv/debian/sentry/usr/share/python/ sentry/build/celery/setup.py) egg_info for package celery Upgrade: no old version found. no previously-included directories found matching '*.pyc' no previously-included directories found matching '*.sw*’
  • 26. 5. Install the shiny Debian package in production!
  • 27.
  • 28. + Non-Python dependencies + Existing Infrastructure + The new hotness + Contained dh-virtualenv
  • 29. - Can be slow to build - Requires still digging for requirements - Build system needs to have the exactly same Python dh-virtualenv
  • 30. Thanks! github.com/spotify/dh-virtualenv dh-virtualenv.readthedocs.org labs.spotify.com/2013/10/10/packaging-in-your- packaging-dh-virtualenv/