SlideShare a Scribd company logo
Python Dependencies
The Right* Way
Bazel + Python @ Beeswax
Ron Rothman
* For us. YMMV.
● 30 engineers
● monorepo
● 100 applications
● 300 kLoPyC
1.Global requirements.txt
2.rules_python
3.pipenv
We have: We tried:
● bazel test
● bazel run
● deployments
We need deps for:
Bazel
pip-tools
Virtualenvs
Wheels
Beeve
lockfiles
# requirements.lock
boto3==1.10.2
botocore==1.13.2 # via boto3, s3transfer
certifi==2019.9.11 # via requests
chardet==3.0.4 # via requests
docutils==0.15.2 # via botocore
futures==3.3.0 # via s3transfer
idna==2.8 # via requests
jmespath==0.9.4 # via boto3, botocore
python-dateutil==2.8.0 # via botocore
requests==2.22.0
s3transfer==0.2.1 # via boto3
six==1.12.0 # via python-dateutil
urllib3==1.25.6 # via botocore,
requests
py_binary(
name = "my_app",
deps = ["lib_a"],
requires = ["requests>=2.21"],
)
py_library(
name = "lib_a",
deps = ["lib_b"],
requires = ["requests>=2.18"],
)
py_library(
name = "lib_b",
deps = ["lib_c"],
requires = ["boto3~=1.9"],
)
py_venv(
name = "my_app_env",
targets = [":my_app"],
)
# requirements.in
boto3~=1.9
requests>=2.18
requests>=2.21
Needs improvement:
● Dev/CI workflow more complicated than before
● Bazel cache misses
● Dependency changes are not propagated automatically
Working well:
● 100% correct (and minimal) dependencies!
● Monorepo-friendly
● History of dependency changes (lock files)
● Wheels are easy
Thank You 🙏🏻
ron {at} beeswax.com

More Related Content

What's hot

skipfish
skipfishskipfish
Gitosis on Mac OS X Server
Gitosis on Mac OS X ServerGitosis on Mac OS X Server
Gitosis on Mac OS X ServerYasuhiro Asaka
 
Spatial script for my JS.Everywhere 2012
Spatial script for my JS.Everywhere 2012Spatial script for my JS.Everywhere 2012
Spatial script for my JS.Everywhere 2012Steven Pousty
 
Go破壊
Go破壊Go破壊
Go破壊
Hattori Hideo
 
Openshift GeoSpatial Capabilities
Openshift GeoSpatial CapabilitiesOpenshift GeoSpatial Capabilities
Openshift GeoSpatial Capabilities
Steven Pousty
 
Spatial Mongo and Node.JS on Openshift JS.Everywhere 2012
Spatial Mongo and Node.JS on Openshift JS.Everywhere 2012Spatial Mongo and Node.JS on Openshift JS.Everywhere 2012
Spatial Mongo and Node.JS on Openshift JS.Everywhere 2012Steven Pousty
 
Rustでパケットと戯れる
Rustでパケットと戯れるRustでパケットと戯れる
Rustでパケットと戯れる
ShuyaMotouchi1
 
A curious case of broken DNS responses (Coloclue Presents - Nov 2019)
A curious case of broken DNS responses (Coloclue Presents - Nov 2019)A curious case of broken DNS responses (Coloclue Presents - Nov 2019)
A curious case of broken DNS responses (Coloclue Presents - Nov 2019)
Babak Farrokhi
 
Highload осень 2012 лекция 1
Highload осень 2012 лекция 1Highload осень 2012 лекция 1
Highload осень 2012 лекция 1Technopark
 
3 rd animation
3 rd animation3 rd animation
3 rd animation
divyalakshmi77
 
Infrastructure coders logstash
Infrastructure coders logstashInfrastructure coders logstash
Infrastructure coders logstash
David Lutz
 
Searching the Now
Searching the NowSearching the Now
Searching the Now
lucasjosh
 
Spatial mongo for PHP and Zend
Spatial mongo for PHP and ZendSpatial mongo for PHP and Zend
Spatial mongo for PHP and Zend
Steven Pousty
 
Lab report
Lab reportLab report
Lab report
Md Selim Hossain
 
Mongo sf spatialmongo
Mongo sf spatialmongoMongo sf spatialmongo
Mongo sf spatialmongoSteven Pousty
 
Is ruby logger thread(process)-safe? at RubyConf 2013
Is ruby logger thread(process)-safe? at RubyConf 2013Is ruby logger thread(process)-safe? at RubyConf 2013
Is ruby logger thread(process)-safe? at RubyConf 2013Naotoshi Seo
 
A curious case of broken dns responses - RIPE75
A curious case of broken dns responses - RIPE75A curious case of broken dns responses - RIPE75
A curious case of broken dns responses - RIPE75
Babak Farrokhi
 
faastCrystal
faastCrystalfaastCrystal
faastCrystal
Sachirou Inoue
 
Comets notes
Comets notesComets notes
Comets notes
Ilija Dukovski
 
nouka inventry manager
nouka inventry managernouka inventry manager
nouka inventry manager
Toshiaki Baba
 

What's hot (20)

skipfish
skipfishskipfish
skipfish
 
Gitosis on Mac OS X Server
Gitosis on Mac OS X ServerGitosis on Mac OS X Server
Gitosis on Mac OS X Server
 
Spatial script for my JS.Everywhere 2012
Spatial script for my JS.Everywhere 2012Spatial script for my JS.Everywhere 2012
Spatial script for my JS.Everywhere 2012
 
Go破壊
Go破壊Go破壊
Go破壊
 
Openshift GeoSpatial Capabilities
Openshift GeoSpatial CapabilitiesOpenshift GeoSpatial Capabilities
Openshift GeoSpatial Capabilities
 
Spatial Mongo and Node.JS on Openshift JS.Everywhere 2012
Spatial Mongo and Node.JS on Openshift JS.Everywhere 2012Spatial Mongo and Node.JS on Openshift JS.Everywhere 2012
Spatial Mongo and Node.JS on Openshift JS.Everywhere 2012
 
Rustでパケットと戯れる
Rustでパケットと戯れるRustでパケットと戯れる
Rustでパケットと戯れる
 
A curious case of broken DNS responses (Coloclue Presents - Nov 2019)
A curious case of broken DNS responses (Coloclue Presents - Nov 2019)A curious case of broken DNS responses (Coloclue Presents - Nov 2019)
A curious case of broken DNS responses (Coloclue Presents - Nov 2019)
 
Highload осень 2012 лекция 1
Highload осень 2012 лекция 1Highload осень 2012 лекция 1
Highload осень 2012 лекция 1
 
3 rd animation
3 rd animation3 rd animation
3 rd animation
 
Infrastructure coders logstash
Infrastructure coders logstashInfrastructure coders logstash
Infrastructure coders logstash
 
Searching the Now
Searching the NowSearching the Now
Searching the Now
 
Spatial mongo for PHP and Zend
Spatial mongo for PHP and ZendSpatial mongo for PHP and Zend
Spatial mongo for PHP and Zend
 
Lab report
Lab reportLab report
Lab report
 
Mongo sf spatialmongo
Mongo sf spatialmongoMongo sf spatialmongo
Mongo sf spatialmongo
 
Is ruby logger thread(process)-safe? at RubyConf 2013
Is ruby logger thread(process)-safe? at RubyConf 2013Is ruby logger thread(process)-safe? at RubyConf 2013
Is ruby logger thread(process)-safe? at RubyConf 2013
 
A curious case of broken dns responses - RIPE75
A curious case of broken dns responses - RIPE75A curious case of broken dns responses - RIPE75
A curious case of broken dns responses - RIPE75
 
faastCrystal
faastCrystalfaastCrystal
faastCrystal
 
Comets notes
Comets notesComets notes
Comets notes
 
nouka inventry manager
nouka inventry managernouka inventry manager
nouka inventry manager
 

Similar to Python Dependencies at Beeswax - BazelCon 2019 Lightning Talk - Ron Rothman

Pycon taiwan 2018_claudiu_popa
Pycon taiwan 2018_claudiu_popaPycon taiwan 2018_claudiu_popa
Pycon taiwan 2018_claudiu_popa
Claudiu Popa
 
PyConUK 2018 - Journey from HTTP to gRPC
PyConUK 2018 - Journey from HTTP to gRPCPyConUK 2018 - Journey from HTTP to gRPC
PyConUK 2018 - Journey from HTTP to gRPC
Tatiana Al-Chueyr
 
Python 2 is dead! Drag your old code into the modern age
Python 2 is dead! Drag your old code into the modern agePython 2 is dead! Drag your old code into the modern age
Python 2 is dead! Drag your old code into the modern age
Becky Smith
 
Relational Database Access with Python ‘sans’ ORM
Relational Database Access with Python ‘sans’ ORM  Relational Database Access with Python ‘sans’ ORM
Relational Database Access with Python ‘sans’ ORM
Mark Rees
 
Introduction to robot framework
Introduction to robot frameworkIntroduction to robot framework
Introduction to robot framework
Chonlasith Jucksriporn
 
Python仮想環境構築の基礎と ツールの比較
Python仮想環境構築の基礎と ツールの比較Python仮想環境構築の基礎と ツールの比較
Python仮想環境構築の基礎と ツールの比較
cocodrips
 
Time series denver an introduction to prometheus
Time series denver   an introduction to prometheusTime series denver   an introduction to prometheus
Time series denver an introduction to prometheus
Bob Cotton
 
MongoDB Days UK: Using MongoDB and Python for Data Analysis Pipelines
MongoDB Days UK: Using MongoDB and Python for Data Analysis PipelinesMongoDB Days UK: Using MongoDB and Python for Data Analysis Pipelines
MongoDB Days UK: Using MongoDB and Python for Data Analysis Pipelines
MongoDB
 
Ladypy 01
Ladypy 01Ladypy 01
Ladypy 01
Calvin Cheng
 
Rolling with the Times: Using wheels, pbr, and Twine for Distributing and Ins...
Rolling with the Times: Using wheels, pbr, and Twine for Distributing and Ins...Rolling with the Times: Using wheels, pbr, and Twine for Distributing and Ins...
Rolling with the Times: Using wheels, pbr, and Twine for Distributing and Ins...
doughellmann
 
Pipenv - Melbourne Python User Group (MPUG)
Pipenv - Melbourne Python User Group (MPUG)Pipenv - Melbourne Python User Group (MPUG)
Pipenv - Melbourne Python User Group (MPUG)
Rory Hart
 
2018 jPrime Deconstructing and Evolving REST Security
2018 jPrime Deconstructing and Evolving REST Security2018 jPrime Deconstructing and Evolving REST Security
2018 jPrime Deconstructing and Evolving REST Security
David Blevins
 
Zn task - defcon russia 20
Zn task  - defcon russia 20Zn task  - defcon russia 20
Zn task - defcon russia 20
DefconRussia
 
基于 Google protobuf 的 webgame 网络协议设计
基于 Google protobuf 的 webgame 网络协议设计基于 Google protobuf 的 webgame 网络协议设计
基于 Google protobuf 的 webgame 网络协议设计勇浩 赖
 
Consul administration at scale
Consul administration at scaleConsul administration at scale
Consul administration at scale
Pierre Souchay
 
Relational Database Access with Python
Relational Database Access with PythonRelational Database Access with Python
Relational Database Access with Python
Mark Rees
 
Python para equipos de ciberseguridad
Python para equipos de ciberseguridad Python para equipos de ciberseguridad
Python para equipos de ciberseguridad
Jose Manuel Ortega Candel
 
Using PyPy instead of Python for speed
Using PyPy instead of Python for speedUsing PyPy instead of Python for speed
Using PyPy instead of Python for speed
Enplore AB
 
[1C2]webrtc 개발, 현재와 미래
[1C2]webrtc 개발, 현재와 미래[1C2]webrtc 개발, 현재와 미래
[1C2]webrtc 개발, 현재와 미래
NAVER D2
 
Writing dumb tests
Writing dumb testsWriting dumb tests
Writing dumb tests
Luke Lee
 

Similar to Python Dependencies at Beeswax - BazelCon 2019 Lightning Talk - Ron Rothman (20)

Pycon taiwan 2018_claudiu_popa
Pycon taiwan 2018_claudiu_popaPycon taiwan 2018_claudiu_popa
Pycon taiwan 2018_claudiu_popa
 
PyConUK 2018 - Journey from HTTP to gRPC
PyConUK 2018 - Journey from HTTP to gRPCPyConUK 2018 - Journey from HTTP to gRPC
PyConUK 2018 - Journey from HTTP to gRPC
 
Python 2 is dead! Drag your old code into the modern age
Python 2 is dead! Drag your old code into the modern agePython 2 is dead! Drag your old code into the modern age
Python 2 is dead! Drag your old code into the modern age
 
Relational Database Access with Python ‘sans’ ORM
Relational Database Access with Python ‘sans’ ORM  Relational Database Access with Python ‘sans’ ORM
Relational Database Access with Python ‘sans’ ORM
 
Introduction to robot framework
Introduction to robot frameworkIntroduction to robot framework
Introduction to robot framework
 
Python仮想環境構築の基礎と ツールの比較
Python仮想環境構築の基礎と ツールの比較Python仮想環境構築の基礎と ツールの比較
Python仮想環境構築の基礎と ツールの比較
 
Time series denver an introduction to prometheus
Time series denver   an introduction to prometheusTime series denver   an introduction to prometheus
Time series denver an introduction to prometheus
 
MongoDB Days UK: Using MongoDB and Python for Data Analysis Pipelines
MongoDB Days UK: Using MongoDB and Python for Data Analysis PipelinesMongoDB Days UK: Using MongoDB and Python for Data Analysis Pipelines
MongoDB Days UK: Using MongoDB and Python for Data Analysis Pipelines
 
Ladypy 01
Ladypy 01Ladypy 01
Ladypy 01
 
Rolling with the Times: Using wheels, pbr, and Twine for Distributing and Ins...
Rolling with the Times: Using wheels, pbr, and Twine for Distributing and Ins...Rolling with the Times: Using wheels, pbr, and Twine for Distributing and Ins...
Rolling with the Times: Using wheels, pbr, and Twine for Distributing and Ins...
 
Pipenv - Melbourne Python User Group (MPUG)
Pipenv - Melbourne Python User Group (MPUG)Pipenv - Melbourne Python User Group (MPUG)
Pipenv - Melbourne Python User Group (MPUG)
 
2018 jPrime Deconstructing and Evolving REST Security
2018 jPrime Deconstructing and Evolving REST Security2018 jPrime Deconstructing and Evolving REST Security
2018 jPrime Deconstructing and Evolving REST Security
 
Zn task - defcon russia 20
Zn task  - defcon russia 20Zn task  - defcon russia 20
Zn task - defcon russia 20
 
基于 Google protobuf 的 webgame 网络协议设计
基于 Google protobuf 的 webgame 网络协议设计基于 Google protobuf 的 webgame 网络协议设计
基于 Google protobuf 的 webgame 网络协议设计
 
Consul administration at scale
Consul administration at scaleConsul administration at scale
Consul administration at scale
 
Relational Database Access with Python
Relational Database Access with PythonRelational Database Access with Python
Relational Database Access with Python
 
Python para equipos de ciberseguridad
Python para equipos de ciberseguridad Python para equipos de ciberseguridad
Python para equipos de ciberseguridad
 
Using PyPy instead of Python for speed
Using PyPy instead of Python for speedUsing PyPy instead of Python for speed
Using PyPy instead of Python for speed
 
[1C2]webrtc 개발, 현재와 미래
[1C2]webrtc 개발, 현재와 미래[1C2]webrtc 개발, 현재와 미래
[1C2]webrtc 개발, 현재와 미래
 
Writing dumb tests
Writing dumb testsWriting dumb tests
Writing dumb tests
 

Recently uploaded

top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 

Recently uploaded (20)

top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 

Python Dependencies at Beeswax - BazelCon 2019 Lightning Talk - Ron Rothman

  • 1. Python Dependencies The Right* Way Bazel + Python @ Beeswax Ron Rothman * For us. YMMV.
  • 2. ● 30 engineers ● monorepo ● 100 applications ● 300 kLoPyC 1.Global requirements.txt 2.rules_python 3.pipenv We have: We tried: ● bazel test ● bazel run ● deployments We need deps for:
  • 4. # requirements.lock boto3==1.10.2 botocore==1.13.2 # via boto3, s3transfer certifi==2019.9.11 # via requests chardet==3.0.4 # via requests docutils==0.15.2 # via botocore futures==3.3.0 # via s3transfer idna==2.8 # via requests jmespath==0.9.4 # via boto3, botocore python-dateutil==2.8.0 # via botocore requests==2.22.0 s3transfer==0.2.1 # via boto3 six==1.12.0 # via python-dateutil urllib3==1.25.6 # via botocore, requests py_binary( name = "my_app", deps = ["lib_a"], requires = ["requests>=2.21"], ) py_library( name = "lib_a", deps = ["lib_b"], requires = ["requests>=2.18"], ) py_library( name = "lib_b", deps = ["lib_c"], requires = ["boto3~=1.9"], ) py_venv( name = "my_app_env", targets = [":my_app"], ) # requirements.in boto3~=1.9 requests>=2.18 requests>=2.21
  • 5. Needs improvement: ● Dev/CI workflow more complicated than before ● Bazel cache misses ● Dependency changes are not propagated automatically Working well: ● 100% correct (and minimal) dependencies! ● Monorepo-friendly ● History of dependency changes (lock files) ● Wheels are easy
  • 6. Thank You 🙏🏻 ron {at} beeswax.com

Editor's Notes

  1. Hi everyone...
  2. We're 30 / monorepo / 100 / 300k The problem... how to manage our Py 3p deps By third-party... [C]When we bāzel-test or bāzel-run some target... also deps of every other target in its xtive clo same in prod [C]When had one or two apps, we solved... reqs.txt ...this didn't scale well once critical mass by multiple engs rules_python - can't guarantee import correct version pipenv Which led us to roll...
  3. Our solution, which we call Beeve... set of tools pip-tools is... composed of starlark macros/rules/aspects + command line tools [C]Beeve's output is... A lockfile is a set of 3p deps, each pinned an application's reqs.txt, but autogenerated as needed We leveraged: Bāzel's... walk the graph, collect 3pd; pip-tools's... resolve deps [C]We take each app's lockfile and use it...
  4. Here's an example. toy BUILD Note we've annotated each py rule... new attr requires... dep spec a dep spec is just a constraint on py_venv - tells Beeve we want lockfile for the... When run Bāzel on py_venv rule, our Starlark code... [C] requirements.in... union [C]then calls pip-compile to generate... the lockfile contains pinned versions of... as well as their transitive deps... ie it's the complete set of Py pkgs that our py_binary... not hermetic; nor reproducible; current state PyPI if you run... different lockfiles guaranteed that any resulting lockfile conforms to constraints... !!!
  5. one downside is... devs must now be aware of py envs, switch between them Bāzel-test error prone Bāzel caching less effective 3p dep changes are not propagated automatically to downstream... [C]on plus side... most important goal... reliably know precise set of 3p deps... contains everything/nothing monorepo-friendly... go without saying nice side benefit... track dep changes over time, since... can easily produce wheels for our Py apps, has made deployments...
  6. I'm happy to talk more about Beeve or Python dependencies ...email me with any questions or just find me at the conference. Thank you!