Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
The Twelve Factor App - Pivotal Tracker
1. The Twelve-Factor App
A Case Study of Pivotal Tracker on Cloud Foundry
Glenn Oppegard
goppegard@pivotal.io
2. Pivotal Tracker
• Development started in 2006, when Pivotal Labs
was starting their Ruby practice
• Ruby 1.8.7 → Ruby 2.1
• Rails 2.3 → Rails 3.2
3. 1. Codebase
• Single codebase
• Many deploys
Image from 12factor.net, MIT License
4. Tracker codebase
• Single bosh release git repository
cf-tracker-release/
src/
cf-tracker/
memcached/
tracker/
tracker-frontend/
tracker-solr-home/
5. 2. Dependencies
• Explicitly declare and isolate dependencies
• Ruby: bundler and Gemfile
• Node: npm and package.json
6. Tracker dependencies
• Bundler
• NPM
• Git sub-modules
• Single artifact containing all dependencies: BOSH
final release tarball: cf-tracker-1.2.1.9.tgz
7. 3. Config
• Resource handles to the database, Memcached,
and other backing services
• Credentials to external services such as Amazon
S3 or Twitter
• Per-deploy values such as the canonical hostname
for the deploy
8. Tracker config
• All config is centralized to a singleton object
• t2config(:smtp_host)
• Reads from environment variables, but also
allows for computed values via Ruby
• Out of 200 config parameters, 25 apply to CF
• Created app_env gem to load static values from
JSON files into environment
9. • Treat backing services as attached resources.
• The code for a twelve-factor app makes no
distinction between local and third party services.
4. Backing Services
Image from 12factor.net, MIT License
22. 12. Admin processes
• Run admin/management tasks as one-off
processes
• Run tasks in an identical environment to the deploy
(same build and same config → same release)
23. Tracker admin tasks
• Restrict tasks to index 0 of app
• Future: diego one-off processes