Automated deployments 
for mission-critical 
financial services 
Jeremy Alons 
Systems Engineer, Spot Trading LLC 
Views and statements are my own and may not reflect those of my employer 
v.8
A case study in 
continuous delivery
Why? 
• Previously, deployments were time consuming 
• Took hours of developer time, sometimes spread 
over weeks 
• Manual process meant many problems at many 
points
Our goals 
• Rapid feedback 
• Tie configuration to deployment 
• Be highly parallelized, if possible 
• Infrastructure as code 
• Repeatable
Challenges 
• Lots of unique software 
• Differences force complexity 
• Misused the tools we had originally 
• Required additional tooling (that continues today)
Steps: 
Build 
Deploy 
Config 
Run
Steps: 
Build 
Deploy! 
Config 
Run
Steps: 
Build 
Deploy 
Config! 
Run
Build: Bamboo (or Jenkins, travis-ci, etc) executes 
commands 
i.e. gcc -o foo foo.c 
sh tests.sh 
etc
Source code in. 
Artifacts out.
Now what? 
We need to get artifacts 
to where they need to go
This poses problems. 
• What hosts? 
• How do we get correct versions to those hosts? 
• Are we sure those hosts are suitable for the 
application?
SaltStack to the 
rescue!
Fast, scalable and flexible systems 
management software for data center 
automation, cloud orchestration, server 
provisioning, configuration management 
and more 
- www.saltstack.com
Fast, scalable and flexible systems 
management software for data center 
automation, cloud orchestration, server 
provisioning, configuration management 
and more 
- www.saltstack.com
Fast, scalable and flexible systems 
management software for data center 
automation, cloud orchestration, server 
provisioning, configuration management 
and more 
- www.saltstack.com
Fast, scalable and flexible systems 
management software for data center 
automation, cloud orchestration, server 
provisioning, configuration management 
and more 
- www.saltstack.com
Fast, scalable and flexible systems 
management software for data center 
automation, cloud orchestration, server 
provisioning, configuration management 
and more 
- www.saltstack.com
Salt is extremely extensible 
• External pillars 
* Just python 
• Interface with ZooKeeper for host discovery 
• ZooKeeper maintains source of truth 
• But how does Bamboo talk to ZooKeeper? 
• Facilitate the communication through Salt
Grains 
Interface to derive information about the underlying system 
• Static information about 
systems 
• Loaded at minion start time 
• OS (major, minor), ipv[4|6], etc 
• Something you ask the server
Pillar 
Pillar is an interface for Salt designed to offer global values 
that can be distributed to all minions. 
• Something you tell a server 
• “pillar” is a dictionary of items 
sent to minions 
• ext_pillar are derived by the 
master by executing python 
• Still sent to minions
Grain: Ask 
Pillar: Tell
Build triggered 
server1 
server2 
Salt Master 
ZooKeeper 
Stash 
Bamboo 
Zoom 
Selects build to deploy 
Tells salt to find 
matching daemons 
Returns results 
Runs deploy state 
Asks for 
hosts 
8 
Return hosts 
to target 
Displays real time 
status and 
dependency map 
Developer 
1 Pushes commit 
3 2 
4 
5 
6 
7 
0
Bamboo talks to salt via Salt’s 
RESTful api 
Salt talks to ZooKeeper via an 
external pillar
Salt asks ZooKeeper 
“What hosts are currently 
responsible for app Foo?”
ZooKeeper responds, we 
run a series of state files 
on the targeted servers
States 
• Check stats (memory, disk, etc) 
• - cmd.run salt://deploy/check_host.py 
• Apply system settings (buffers, os monitoring, etc) 
• Install software 
• yum install Foo-release-2.3-10
After build, package into 
rpm 
• Use the tools available 
• Versioning 
• Well understood 
• Reporting baked in
RPM 
• Specify version 
• Allows control over latest build, n-1, etc 
• Passed through via pillar at install time, fed by 
Bamboo deployment plan 
• Allows Bamboo to drive version released
API wrapper 
• Home grown deployment software 
• Command line utility that converts bamboo 
variables to salt states 
• Deploys itself via the deployment process 
- Dog fooding the deployment process
deploy state 
# Run the installation on the targeted server 
deploy_{{ application_name }}: 
pkg.installed: 
- name: {{ application_name }} 
- version: {{ pillar[‘deploy_pillar’][‘version’] }} 
- refresh: True 
- enablerepo: spot_applications 
- require: 
- sls: spot_applications_repo
Things we’ve learned 
• In the end, it’s all just bits on disk 
• All software is just software, and (should be) equal 
• Be specific and exact 
• Catch issues soon (test early, test often) 
• Being clever will come back to haunt you (after all, 
this is just software development)
Highlights 
• Implemented deployment pipeline 
• Artifact of the build 
• Bringing components together 
• Repeatable, rapid feedback
Thank you. 
For more about some of the interesting work Spot is doing, 
check our Engineering Blog at 
http://www.spottradingllc.com/technology/ 
email: jeremy.alons@spottradingllc.com 
Questions?

Spot Trading - A case study in continuous delivery for mission critical financial services

  • 1.
    Automated deployments formission-critical financial services Jeremy Alons Systems Engineer, Spot Trading LLC Views and statements are my own and may not reflect those of my employer v.8
  • 2.
    A case studyin continuous delivery
  • 3.
    Why? • Previously,deployments were time consuming • Took hours of developer time, sometimes spread over weeks • Manual process meant many problems at many points
  • 4.
    Our goals •Rapid feedback • Tie configuration to deployment • Be highly parallelized, if possible • Infrastructure as code • Repeatable
  • 5.
    Challenges • Lotsof unique software • Differences force complexity • Misused the tools we had originally • Required additional tooling (that continues today)
  • 6.
  • 7.
  • 8.
    Steps: Build Deploy Config! Run
  • 9.
    Build: Bamboo (orJenkins, travis-ci, etc) executes commands i.e. gcc -o foo foo.c sh tests.sh etc
  • 10.
    Source code in. Artifacts out.
  • 11.
    Now what? Weneed to get artifacts to where they need to go
  • 12.
    This poses problems. • What hosts? • How do we get correct versions to those hosts? • Are we sure those hosts are suitable for the application?
  • 13.
  • 14.
    Fast, scalable andflexible systems management software for data center automation, cloud orchestration, server provisioning, configuration management and more - www.saltstack.com
  • 15.
    Fast, scalable andflexible systems management software for data center automation, cloud orchestration, server provisioning, configuration management and more - www.saltstack.com
  • 16.
    Fast, scalable andflexible systems management software for data center automation, cloud orchestration, server provisioning, configuration management and more - www.saltstack.com
  • 17.
    Fast, scalable andflexible systems management software for data center automation, cloud orchestration, server provisioning, configuration management and more - www.saltstack.com
  • 18.
    Fast, scalable andflexible systems management software for data center automation, cloud orchestration, server provisioning, configuration management and more - www.saltstack.com
  • 19.
    Salt is extremelyextensible • External pillars * Just python • Interface with ZooKeeper for host discovery • ZooKeeper maintains source of truth • But how does Bamboo talk to ZooKeeper? • Facilitate the communication through Salt
  • 20.
    Grains Interface toderive information about the underlying system • Static information about systems • Loaded at minion start time • OS (major, minor), ipv[4|6], etc • Something you ask the server
  • 21.
    Pillar Pillar isan interface for Salt designed to offer global values that can be distributed to all minions. • Something you tell a server • “pillar” is a dictionary of items sent to minions • ext_pillar are derived by the master by executing python • Still sent to minions
  • 22.
  • 23.
    Build triggered server1 server2 Salt Master ZooKeeper Stash Bamboo Zoom Selects build to deploy Tells salt to find matching daemons Returns results Runs deploy state Asks for hosts 8 Return hosts to target Displays real time status and dependency map Developer 1 Pushes commit 3 2 4 5 6 7 0
  • 24.
    Bamboo talks tosalt via Salt’s RESTful api Salt talks to ZooKeeper via an external pillar
  • 25.
    Salt asks ZooKeeper “What hosts are currently responsible for app Foo?”
  • 26.
    ZooKeeper responds, we run a series of state files on the targeted servers
  • 27.
    States • Checkstats (memory, disk, etc) • - cmd.run salt://deploy/check_host.py • Apply system settings (buffers, os monitoring, etc) • Install software • yum install Foo-release-2.3-10
  • 28.
    After build, packageinto rpm • Use the tools available • Versioning • Well understood • Reporting baked in
  • 29.
    RPM • Specifyversion • Allows control over latest build, n-1, etc • Passed through via pillar at install time, fed by Bamboo deployment plan • Allows Bamboo to drive version released
  • 30.
    API wrapper •Home grown deployment software • Command line utility that converts bamboo variables to salt states • Deploys itself via the deployment process - Dog fooding the deployment process
  • 31.
    deploy state #Run the installation on the targeted server deploy_{{ application_name }}: pkg.installed: - name: {{ application_name }} - version: {{ pillar[‘deploy_pillar’][‘version’] }} - refresh: True - enablerepo: spot_applications - require: - sls: spot_applications_repo
  • 32.
    Things we’ve learned • In the end, it’s all just bits on disk • All software is just software, and (should be) equal • Be specific and exact • Catch issues soon (test early, test often) • Being clever will come back to haunt you (after all, this is just software development)
  • 33.
    Highlights • Implementeddeployment pipeline • Artifact of the build • Bringing components together • Repeatable, rapid feedback
  • 34.
    Thank you. Formore about some of the interesting work Spot is doing, check our Engineering Blog at http://www.spottradingllc.com/technology/ email: jeremy.alons@spottradingllc.com Questions?