SlideShare a Scribd company logo
Building a continuous
deployment pipeline
Patrick Hamann

Web Performance Engineer | Fastly
Clint Shryock

Software Engineer | Hashicorp
Web Performance Engineer | Fastly
Patrick Hamann
Software Engineer | HashiCorp
Clint Shryock
Poll?
Why?
• Configuration drift
• Manual deployment
• Not reproducible
• Can’t see outcomes ahead of time
• Changes can’t be traced
• Can’t easily rollback state
The problem?
• Services can be easily reproduced
• Services are consistent
• Processes are repeatable & predictable
• Configuration is continuously tested
• Visibility and actionability
The goal
• Declare our service configuration in code
• Configuration is maintained in VCS
• Small changes get tested and continuously integrated
• Deployment is automated on every change
How?
Travis CI Terraform FastlyGitHub
1. Developer writes change
1
2. Tests changes locally
2
3. Pushes change to VCS
3
4. Triggers build in CI to integrate & test change
4
5. If successful, deploys change to Fastly
5
• How to apply changes to your services via the CLI
• What is Terraform?
• How we can define our Fastly configuration as code
• How to use CI to automate the application of your changes
• How to manage multiple environments*
What we'll learn today
Altitude SF 2017: Building a continuous deployment pipeline
Deploying a new version
• Find the active version of service
• Clone the active version
• Delete all the existing VCL files
• Upload the new VCL files
• Define the main VCL
• Validate the newly cloned version
• Activate version
Manually deploying a new version
Altitude SF 2017: Building a continuous deployment pipeline
Altitude SF 2017: Building a continuous deployment pipeline
Altitude SF 2017: Building a continuous deployment pipeline
Find active version
curl https://api.fastly.com/service/<SERVICE_ID>/version
-H 'Fastly-Key: <API_TOKEN>'
< HTTP/1.1 200 OK
< Status: 200 OK
< Content-Type: application/json
{
"testing": false,
"locked": true,
"number": 88,
"active": true,
"service_id": "5DYjgYJ8SeELWdjbdJtZdD",
"staging": false,
"created_at": "2017-06-06T16:28:31+00:00",
"deleted_at": null,
"comment": "",
"updated_at": "2017-06-06T16:28:41+00:00",
"deployed": false
}
Clone active version
curl https://api.fastly.com/service/<SERVICE_ID>/version
-H 'Fastly-Key: <API_TOKEN>'
< HTTP/1.1 200 OK
< Status: 200 OK
< Content-Type: application/json
{
"testing": false,
"locked": true,
"number": 88,
"active": true,
"service_id": "5DYjgYJ8SeELWdjbdJtZdD",
"staging": false,
"created_at": "2017-06-06T16:28:31+00:00",
"deleted_at": null,
"comment": "",
"updated_at": "2017-06-06T16:28:41+00:00",
"deployed": false
}
Introduction to Terraform
• Unify the view of resources using infrastructure as code
• Support the modern data center (IaaS, PaaS, SaaS)
• Expose a way to safely and predictably change infrastructure
• Provide a workflow that is technology agnostic
• Manage anything with an API
Terraform's Goals
• Provides a high-level abstraction of infrastructure (IaC)
• Allows for composition and combination
• Supports parallel management of resources (graph, fast)
• Separates planning from execution (dry-run)
Terraform vs. Other Tools
• Human-readable configuration (HCL) is designed for human
consumption so users can quickly interpret and understand their
infrastructure configuration.
• HCL includes a full JSON parser for machine-generated
configurations.
Infrastructure as Code (Terraform)
Infrastructure dependency graph
gcs_bucket
fastly_service
dnsimple_record
gcs
dnsimple
fastly
Walking the graph
2
4
3
2
3 gcs_bucket
fastly_service
dnsimple_record
gcs
dnsimple2
1
fastly
root
variable "fastly_api_token" {}
provider "fastly" {
api_key = "${var.fastly_api_token}"
}
resource "fastly_service_v1" "www-fastly-com" {
name = "www.fastly.com"
domain {
name = "www.fastly.com"
comment = "Production service"
}
}
main.tf
variable "fastly_api_token" {}
provider "fastly" {
api_key = "${var.fastly_api_token}"
}
resource "fastly_service_v1" "www-fastly-com" {
name = "www.fastly.com"
domain {
name = "www.fastly.com"
comment = "Production service"
}
}
main.tf
variable "fastly_api_token" {}
provider "fastly" {
api_key = "${var.fastly_api_token}"
}
resource "fastly_service_v1" "www-fastly-com" {
name = "www.fastly.com"
domain {
name = "www.fastly.com"
comment = "Production service"
}
}
main.tf
variable "fastly_api_token" {}
provider "fastly" {
api_key = "${var.fastly_api_token}"
}
resource "fastly_service_v1" "www-fastly-com" {
name = "www.fastly.com"
domain {
name = "www.fastly.com"
comment = "Production service"
}
}
main.tf
Questions?
Workshop!
Terminal
bit.ly/altitude-abcd
$ ssh -A fastly@a.b.c.d
$ password: altitude2017
$ cd workshop
Terminal
Questions?
Thank you.

More Related Content

PPTX
Altitude SF 2017: Fastly GSLB: Scaling your microservice and multi-cloud envi...
PDF
Altitude SF 2017: Logging at the edge
PDF
Building a better web
PDF
Altitude SF 2017: Optimizing your hit rate
PDF
Inside election night at The New York Times | Altitude NYC
PDF
Altitude SF 2017: The power of the network
PDF
Altitude SF 2017: Debugging Fastly VCL 101
PPTX
Fastly CEO Artur Bergman at Altitude NYC
Altitude SF 2017: Fastly GSLB: Scaling your microservice and multi-cloud envi...
Altitude SF 2017: Logging at the edge
Building a better web
Altitude SF 2017: Optimizing your hit rate
Inside election night at The New York Times | Altitude NYC
Altitude SF 2017: The power of the network
Altitude SF 2017: Debugging Fastly VCL 101
Fastly CEO Artur Bergman at Altitude NYC

What's hot (20)

PDF
Altitude San Francisco 2018: HTTP Invalidation Workshop
PPTX
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
PPTX
Altitude SF 2017: Security at the edge
PDF
Tips for going fast in a slow world: Michael May at OSCON 2015
PDF
Revisiting HTTP/2
PDF
Altitude SF 2017: Granular, Precached, & Under Budget
PPT
Alpha Five v10.NEW APPLICATION SERVER. CODELESS AJAX
PPTX
how to mesure web performance metrics
PDF
Using SaltStack to DevOps the enterprise
PDF
Varnish Cache Plus. Random notes for wise web developers
PDF
Prometheus meets Consul -- Consul Casual Talks
PDF
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeter
PDF
Service Discovery 101
PDF
Dave Williams - Nagios Log Server - Practical Experience
PPT
Find and Fix Performance Bottlenecks with New Relic and BlazeMeter
PDF
NGINX: The Past, Present and Future of the Modern Web
PPTX
Building the Real-Time Performance Panel
PDF
The Java Microservice Library
PPTX
Service workers: what and why UmbUKFest 2018!
PDF
We broke up with the monolith, and started dating #eventSourcing - #symfonyCat
Altitude San Francisco 2018: HTTP Invalidation Workshop
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
Altitude SF 2017: Security at the edge
Tips for going fast in a slow world: Michael May at OSCON 2015
Revisiting HTTP/2
Altitude SF 2017: Granular, Precached, & Under Budget
Alpha Five v10.NEW APPLICATION SERVER. CODELESS AJAX
how to mesure web performance metrics
Using SaltStack to DevOps the enterprise
Varnish Cache Plus. Random notes for wise web developers
Prometheus meets Consul -- Consul Casual Talks
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeter
Service Discovery 101
Dave Williams - Nagios Log Server - Practical Experience
Find and Fix Performance Bottlenecks with New Relic and BlazeMeter
NGINX: The Past, Present and Future of the Modern Web
Building the Real-Time Performance Panel
The Java Microservice Library
Service workers: what and why UmbUKFest 2018!
We broke up with the monolith, and started dating #eventSourcing - #symfonyCat
Ad

Similar to Altitude SF 2017: Building a continuous deployment pipeline (20)

PDF
Dipping Your Toes Into Cloud Native Application Development
PDF
Zero to hero - Geoff Webb
PDF
DevOps Fest 2020. immutable infrastructure as code. True story.
PDF
Dev Ops without the Ops
PDF
Continuously serving the OSS community with Continuous Integration and Delive...
PDF
FISL 15: Continuously serving the OSS community with Continuous Integration a...
PPTX
How to Adopt Infrastructure as Code
PDF
2013 10-25 dev-opsdays
ODP
Continuous Delivery of (y)our infrastructure.
PDF
The road to continuous deployment (PHPCon Poland 2016)
PDF
Pipeline as code for your infrastructure as Code
ODP
Continuous delivery of Windows micro services in the cloud
PDF
Continuous Deployment: Beyond Continuous Delivery
PPTX
Infrastructure as Code - Getting Started, Concepts & Tools
PPTX
Cloud native Continuous Delivery
PDF
The road to continuous deployment (DomCode September 2016)
PDF
A DevOps State of Mind with Microservices, Containers and Kubernetes
PDF
DevOps and AWS
PDF
Continuous Delivery: 5 years later (Incontro DevOps 2018)
PDF
Evolutionary infrastructure agile 2018 - kief morris
Dipping Your Toes Into Cloud Native Application Development
Zero to hero - Geoff Webb
DevOps Fest 2020. immutable infrastructure as code. True story.
Dev Ops without the Ops
Continuously serving the OSS community with Continuous Integration and Delive...
FISL 15: Continuously serving the OSS community with Continuous Integration a...
How to Adopt Infrastructure as Code
2013 10-25 dev-opsdays
Continuous Delivery of (y)our infrastructure.
The road to continuous deployment (PHPCon Poland 2016)
Pipeline as code for your infrastructure as Code
Continuous delivery of Windows micro services in the cloud
Continuous Deployment: Beyond Continuous Delivery
Infrastructure as Code - Getting Started, Concepts & Tools
Cloud native Continuous Delivery
The road to continuous deployment (DomCode September 2016)
A DevOps State of Mind with Microservices, Containers and Kubernetes
DevOps and AWS
Continuous Delivery: 5 years later (Incontro DevOps 2018)
Evolutionary infrastructure agile 2018 - kief morris
Ad

More from Fastly (20)

PPTX
Altitude San Francisco 2018: Preparing for Video Streaming Events at Scale
PPTX
Altitude San Francisco 2018: Building the Souther Hemisphere of the Internet
PDF
Altitude San Francisco 2018: The World Cup Stream
PDF
Altitude San Francisco 2018: We Own Our Destiny
PDF
Altitude San Francisco 2018: Scale and Stability at the Edge with 1.4 Billion...
PDF
Altitude San Francisco 2018: Moving Off the Monolith: A Seamless Migration
PDF
Altitude San Francisco 2018: Bringing TLS to GitHub Pages
PDF
Altitude San Francisco 2018: HTTP/2 Tales: Discovery and Woe
PPTX
Altitude San Francisco 2018: How Magento moved to the cloud while maintaining...
PDF
Altitude San Francisco 2018: Scaling Ethereum to 10B requests per day
PPTX
Altitude San Francisco 2018: Authentication at the Edge
PDF
Altitude San Francisco 2018: WebAssembly Tools & Applications
PPTX
Altitude San Francisco 2018: Testing with Fastly Workshop
PDF
Altitude San Francisco 2018: Fastly Purge Control at the USA TODAY NETWORK
PPTX
Altitude San Francisco 2018: WAF Workshop
PPTX
Altitude San Francisco 2018: Logging at the Edge
PPTX
Altitude San Francisco 2018: Video Workshop Docs
PPTX
Altitude San Francisco 2018: Programming the Edge
PDF
Enabling lightning fast content delivery for Spotify
PDF
What's next in edge computing?
Altitude San Francisco 2018: Preparing for Video Streaming Events at Scale
Altitude San Francisco 2018: Building the Souther Hemisphere of the Internet
Altitude San Francisco 2018: The World Cup Stream
Altitude San Francisco 2018: We Own Our Destiny
Altitude San Francisco 2018: Scale and Stability at the Edge with 1.4 Billion...
Altitude San Francisco 2018: Moving Off the Monolith: A Seamless Migration
Altitude San Francisco 2018: Bringing TLS to GitHub Pages
Altitude San Francisco 2018: HTTP/2 Tales: Discovery and Woe
Altitude San Francisco 2018: How Magento moved to the cloud while maintaining...
Altitude San Francisco 2018: Scaling Ethereum to 10B requests per day
Altitude San Francisco 2018: Authentication at the Edge
Altitude San Francisco 2018: WebAssembly Tools & Applications
Altitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Fastly Purge Control at the USA TODAY NETWORK
Altitude San Francisco 2018: WAF Workshop
Altitude San Francisco 2018: Logging at the Edge
Altitude San Francisco 2018: Video Workshop Docs
Altitude San Francisco 2018: Programming the Edge
Enabling lightning fast content delivery for Spotify
What's next in edge computing?

Recently uploaded (20)

PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Encapsulation theory and applications.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Big Data Technologies - Introduction.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Spectral efficient network and resource selection model in 5G networks
PPT
Teaching material agriculture food technology
PDF
Machine learning based COVID-19 study performance prediction
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
KodekX | Application Modernization Development
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Encapsulation theory and applications.pdf
The AUB Centre for AI in Media Proposal.docx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Diabetes mellitus diagnosis method based random forest with bat algorithm
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Spectroscopy.pptx food analysis technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Big Data Technologies - Introduction.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
“AI and Expert System Decision Support & Business Intelligence Systems”
Spectral efficient network and resource selection model in 5G networks
Teaching material agriculture food technology
Machine learning based COVID-19 study performance prediction
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Approach and Philosophy of On baking technology
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
KodekX | Application Modernization Development

Altitude SF 2017: Building a continuous deployment pipeline

  • 1. Building a continuous deployment pipeline Patrick Hamann
 Web Performance Engineer | Fastly Clint Shryock
 Software Engineer | Hashicorp
  • 2. Web Performance Engineer | Fastly Patrick Hamann Software Engineer | HashiCorp Clint Shryock
  • 5. • Configuration drift • Manual deployment • Not reproducible • Can’t see outcomes ahead of time • Changes can’t be traced • Can’t easily rollback state The problem?
  • 6. • Services can be easily reproduced • Services are consistent • Processes are repeatable & predictable • Configuration is continuously tested • Visibility and actionability The goal
  • 7. • Declare our service configuration in code • Configuration is maintained in VCS • Small changes get tested and continuously integrated • Deployment is automated on every change How?
  • 8. Travis CI Terraform FastlyGitHub
  • 10. 2. Tests changes locally 2
  • 11. 3. Pushes change to VCS 3
  • 12. 4. Triggers build in CI to integrate & test change 4
  • 13. 5. If successful, deploys change to Fastly 5
  • 14. • How to apply changes to your services via the CLI • What is Terraform? • How we can define our Fastly configuration as code • How to use CI to automate the application of your changes • How to manage multiple environments* What we'll learn today
  • 16. Deploying a new version
  • 17. • Find the active version of service • Clone the active version • Delete all the existing VCL files • Upload the new VCL files • Define the main VCL • Validate the newly cloned version • Activate version Manually deploying a new version
  • 21. Find active version curl https://api.fastly.com/service/<SERVICE_ID>/version -H 'Fastly-Key: <API_TOKEN>' < HTTP/1.1 200 OK < Status: 200 OK < Content-Type: application/json { "testing": false, "locked": true, "number": 88, "active": true, "service_id": "5DYjgYJ8SeELWdjbdJtZdD", "staging": false, "created_at": "2017-06-06T16:28:31+00:00", "deleted_at": null, "comment": "", "updated_at": "2017-06-06T16:28:41+00:00", "deployed": false }
  • 22. Clone active version curl https://api.fastly.com/service/<SERVICE_ID>/version -H 'Fastly-Key: <API_TOKEN>' < HTTP/1.1 200 OK < Status: 200 OK < Content-Type: application/json { "testing": false, "locked": true, "number": 88, "active": true, "service_id": "5DYjgYJ8SeELWdjbdJtZdD", "staging": false, "created_at": "2017-06-06T16:28:31+00:00", "deleted_at": null, "comment": "", "updated_at": "2017-06-06T16:28:41+00:00", "deployed": false }
  • 24. • Unify the view of resources using infrastructure as code • Support the modern data center (IaaS, PaaS, SaaS) • Expose a way to safely and predictably change infrastructure • Provide a workflow that is technology agnostic • Manage anything with an API Terraform's Goals
  • 25. • Provides a high-level abstraction of infrastructure (IaC) • Allows for composition and combination • Supports parallel management of resources (graph, fast) • Separates planning from execution (dry-run) Terraform vs. Other Tools
  • 26. • Human-readable configuration (HCL) is designed for human consumption so users can quickly interpret and understand their infrastructure configuration. • HCL includes a full JSON parser for machine-generated configurations. Infrastructure as Code (Terraform)
  • 28. Walking the graph 2 4 3 2 3 gcs_bucket fastly_service dnsimple_record gcs dnsimple2 1 fastly root
  • 29. variable "fastly_api_token" {} provider "fastly" { api_key = "${var.fastly_api_token}" } resource "fastly_service_v1" "www-fastly-com" { name = "www.fastly.com" domain { name = "www.fastly.com" comment = "Production service" } } main.tf
  • 30. variable "fastly_api_token" {} provider "fastly" { api_key = "${var.fastly_api_token}" } resource "fastly_service_v1" "www-fastly-com" { name = "www.fastly.com" domain { name = "www.fastly.com" comment = "Production service" } } main.tf
  • 31. variable "fastly_api_token" {} provider "fastly" { api_key = "${var.fastly_api_token}" } resource "fastly_service_v1" "www-fastly-com" { name = "www.fastly.com" domain { name = "www.fastly.com" comment = "Production service" } } main.tf
  • 32. variable "fastly_api_token" {} provider "fastly" { api_key = "${var.fastly_api_token}" } resource "fastly_service_v1" "www-fastly-com" { name = "www.fastly.com" domain { name = "www.fastly.com" comment = "Production service" } } main.tf
  • 35. Terminal bit.ly/altitude-abcd $ ssh -A fastly@a.b.c.d $ password: altitude2017 $ cd workshop Terminal