MARK ADAMS • SOFTWARE DEVELOPER • BITBUCKET • @MARKADAMS
How we use Python at Bitbucket
(tldr; We use it for everything)
WHAT IS BITBUCKET
What is Bitbucket?
•Distributed code hosting
•Perfect for individuals or teams
• Git or Mercurial
• Free for 5 users +

Unlimited private repositories

Try it out! - http://bitbucket.org
•Main web application

https://bitbucket.org

•REST API

https://api.bitbucket.org
Web Tier
•HA Proxy

TCP load balancing
•Nginx

SSL Termination
•PostgreSQL

Relational database
•Redis

Caching
Web Tier
CELERY
Distributed Tasks
• Celery
• Used for asynchronous event processing
• Sending notifications
• Updating pull requests
• Updating activity feed

• RabbitMQ used as the message broker
OROCHI
Orochi
• Translated “8-branched giant snake"
• Abstraction library for Git and Mercurial
• Written entirely in Python
• Simplifies the interaction with repositories

Git & Hg have similarities:
• Both store your code
• Both have commits
• Both have branches
Django Celery
Orochi
Storage Layer
GIT + HG OPERATIONS
Git & Hg Operations
•HTTP
• WSGI apps - One for Git, One for Hg
•SSH
• OpenSSH - Customized!
• Launches another process (conq) to
perform authentication and execute
DVCS operations
Can you guess what
language?
Nope, Go
But really Python
We dogfood our stuff!
Feedback?
MARK ADAMS • SOFTWARE DEVELOPER • BITBUCKET • @MARKADAMS
We’re hiring!
MARK ADAMS • SOFTWARE DEVELOPER • BITBUCKET • @MARKADAMS

How we use Python at Bitbucket

  • 1.
    MARK ADAMS •SOFTWARE DEVELOPER • BITBUCKET • @MARKADAMS How we use Python at Bitbucket (tldr; We use it for everything)
  • 2.
    WHAT IS BITBUCKET Whatis Bitbucket? •Distributed code hosting •Perfect for individuals or teams • Git or Mercurial • Free for 5 users +
 Unlimited private repositories
 Try it out! - http://bitbucket.org
  • 3.
    •Main web application
 https://bitbucket.org
 •RESTAPI
 https://api.bitbucket.org Web Tier
  • 4.
    •HA Proxy
 TCP loadbalancing •Nginx
 SSL Termination •PostgreSQL
 Relational database •Redis
 Caching Web Tier
  • 5.
    CELERY Distributed Tasks • Celery •Used for asynchronous event processing • Sending notifications • Updating pull requests • Updating activity feed
 • RabbitMQ used as the message broker
  • 6.
    OROCHI Orochi • Translated “8-branchedgiant snake" • Abstraction library for Git and Mercurial • Written entirely in Python • Simplifies the interaction with repositories
 Git & Hg have similarities: • Both store your code • Both have commits • Both have branches Django Celery Orochi Storage Layer
  • 7.
    GIT + HGOPERATIONS Git & Hg Operations •HTTP • WSGI apps - One for Git, One for Hg •SSH • OpenSSH - Customized! • Launches another process (conq) to perform authentication and execute DVCS operations
  • 8.
    Can you guesswhat language?
  • 9.
  • 10.
  • 11.
  • 13.
    Feedback? MARK ADAMS •SOFTWARE DEVELOPER • BITBUCKET • @MARKADAMS
  • 14.
    We’re hiring! MARK ADAMS• SOFTWARE DEVELOPER • BITBUCKET • @MARKADAMS