SlideShare a Scribd company logo
1 of 30
Download to read offline
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 KubernetesMinhan 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 DockerSematext 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 produccionSysdig
 
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 AgainPuppet
 
Docker Runtime Security
Docker Runtime SecurityDocker Runtime Security
Docker Runtime SecuritySysdig
 
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, DockerDocker, Inc.
 
Openstack meetup lyon_2017-09-28
Openstack meetup lyon_2017-09-28Openstack meetup lyon_2017-09-28
Openstack meetup lyon_2017-09-28Xavier 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 BeyondCoreOS
 
Debugging Network Issues
Debugging Network IssuesDebugging Network Issues
Debugging Network IssuesApcera
 
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 LandscapeMike 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 pythonJimmy 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 StepsDigitalOcean
 

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

Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvMarkus Zapke-Gründemann
 
5 minute intro to virtualenv
5 minute intro to virtualenv5 minute intro to virtualenv
5 minute intro to virtualenvamenasse
 
Software Packaging for Cross OS Distribution
Software Packaging for Cross OS DistributionSoftware Packaging for Cross OS Distribution
Software Packaging for Cross OS DistributionJian-Hong Pan
 
Python packaging and dependency resolution
Python packaging and dependency resolutionPython packaging and dependency resolution
Python packaging and dependency resolutionTatiana Al-Chueyr
 
Virtualenv
VirtualenvVirtualenv
VirtualenvWEBdeBS
 
Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvMarkus 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 minutesLarry Cai
 
Docker and DevOps --- new IT culture
Docker and DevOps --- new IT cultureDocker and DevOps --- new IT culture
Docker and DevOps --- new IT cultureTerry Chen
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-wayRobert 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 GuideRapidValue
 
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 debianAndre Ferraz
 
Binary Packaging for HPC with Spack
Binary Packaging for HPC with SpackBinary Packaging for HPC with Spack
Binary Packaging for HPC with Spackinside-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 courseMarcus Deglos
 
Introduction to Docker
Introduction  to DockerIntroduction  to Docker
Introduction to DockerJian Wu
 

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

AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101vincent683379
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfFIDO Alliance
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPTiSEO AI
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGDSC PJATK
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty SecureFemke de Vroome
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FIDO Alliance
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftshyamraj55
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxJennifer Lim
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfSrushith Repakula
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceSamy Fodil
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024Stephen Perrenod
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?Mark Billinghurst
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsStefano
 

Recently uploaded (20)

Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 

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/