Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.
Building a continuous
deployment pipeline
Patrick Hamann

Web Performance Engineer | Fastly
Clint Shryock

Software Engine...
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
...
• Services can be easily reproduced
• Services are consistent
• Processes are repeatable & predictable
• Configuration is ...
• Declare our service configuration in code
• Configuration is maintained in VCS
• Small changes get tested and continuous...
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 c...
Deploying a new version
• Find the active version of service
• Clone the active version
• Delete all the existing VCL files
• Upload the new VCL f...
Find active version
curl https://api.fastly.com/service/<SERVICE_ID>/version
-H 'Fastly-Key: <API_TOKEN>'
< HTTP/1.1 200 O...
Clone active version
curl https://api.fastly.com/service/<SERVICE_ID>/version
-H 'Fastly-Key: <API_TOKEN>'
< HTTP/1.1 200 ...
Introduction to Terraform
• Unify the view of resources using infrastructure as code
• Support the modern data center (IaaS, PaaS, SaaS)
• Expose a ...
• Provides a high-level abstraction of infrastructure (IaC)
• Allows for composition and combination
• Supports parallel m...
• Human-readable configuration (HCL) is designed for human
consumption so users can quickly interpret and understand their...
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...
variable "fastly_api_token" {}
provider "fastly" {
api_key = "${var.fastly_api_token}"
}
resource "fastly_service_v1" "www...
variable "fastly_api_token" {}
provider "fastly" {
api_key = "${var.fastly_api_token}"
}
resource "fastly_service_v1" "www...
variable "fastly_api_token" {}
provider "fastly" {
api_key = "${var.fastly_api_token}"
}
resource "fastly_service_v1" "www...
Questions?
Workshop!
Terminal
bit.ly/altitude-abcd
$ ssh -A fastly@a.b.c.d
$ password: altitude2017
$ cd workshop
Terminal
Questions?
Thank you.
Altitude SF 2017: Building a continuous deployment pipeline
Altitude SF 2017: Building a continuous deployment pipeline
Altitude SF 2017: Building a continuous deployment pipeline
Altitude SF 2017: Building a continuous deployment pipeline
Prochain SlideShare
Chargement dans…5
×

Altitude SF 2017: Building a continuous deployment pipeline

1 171 vues

Publié le

In the first part of this workshop, we’ll introduce you to the core concepts needed to deploy a new version of your Fastly service via the API and the benefits of automating this process.

We’ll then advance together building a continuous deployment pipeline around an example Fastly config. Combining Fastly’s 5-second deploys, API control, and some open-source tooling (Travis, Terraform), attendees will contribute live changes and see their results in the demo. We’ll also gain some tips and tricks on along the way, such as how to manage multiple environments (staging, prod), Custom VCL, and secrets.

Publié dans : Technologie
  • Soyez le premier à commenter

  • Soyez le premier à aimer ceci

Altitude SF 2017: Building a continuous deployment pipeline

  1. 1. Building a continuous deployment pipeline Patrick Hamann
 Web Performance Engineer | Fastly Clint Shryock
 Software Engineer | Hashicorp
  2. 2. Web Performance Engineer | Fastly Patrick Hamann Software Engineer | HashiCorp Clint Shryock
  3. 3. Poll?
  4. 4. Why?
  5. 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. 6. • Services can be easily reproduced • Services are consistent • Processes are repeatable & predictable • Configuration is continuously tested • Visibility and actionability The goal
  7. 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. 8. Travis CI Terraform FastlyGitHub
  9. 9. 1. Developer writes change 1
  10. 10. 2. Tests changes locally 2
  11. 11. 3. Pushes change to VCS 3
  12. 12. 4. Triggers build in CI to integrate & test change 4
  13. 13. 5. If successful, deploys change to Fastly 5
  14. 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
  15. 15. Deploying a new version
  16. 16. • 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
  17. 17. 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 }
  18. 18. 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 }
  19. 19. Introduction to Terraform
  20. 20. • 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
  21. 21. • 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
  22. 22. • 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)
  23. 23. Infrastructure dependency graph gcs_bucket fastly_service dnsimple_record gcs dnsimple fastly
  24. 24. Walking the graph 2 4 3 2 3 gcs_bucket fastly_service dnsimple_record gcs dnsimple2 1 fastly root
  25. 25. 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
  26. 26. 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
  27. 27. 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
  28. 28. 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
  29. 29. Questions?
  30. 30. Workshop!
  31. 31. Terminal bit.ly/altitude-abcd $ ssh -A fastly@a.b.c.d $ password: altitude2017 $ cd workshop Terminal
  32. 32. Questions?
  33. 33. Thank you.

×