Coolblue - Behind the Scenes Continuous Integration & Deployment

109
July 2016 | Behind the Scenes

Transcript of Coolblue - Behind the Scenes Continuous Integration & Deployment

Page 1: Coolblue - Behind the Scenes Continuous Integration & Deployment

July 2016 | Behind the Scenes

Page 2: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 3: Coolblue - Behind the Scenes Continuous Integration & Deployment

Agenda.

● Welcome & introduction● From Code to Node● Short Break● A look to the future of deployment● Tour of our office● Drinks● Fin

Page 4: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 5: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 6: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 7: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 8: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 9: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 10: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 11: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 12: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 13: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 14: Coolblue - Behind the Scenes Continuous Integration & Deployment

July 2016 | Behind the Scenes Flynn Bundy <@bundyfx> & Matthew Hodgkins <@matthodge>

Page 15: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 16: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 17: Coolblue - Behind the Scenes Continuous Integration & Deployment

“I was trying to sleep last night but all I could think about was how to make our pipelines better.”

Matt

Page 18: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 19: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 20: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 21: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 22: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 23: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 24: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 25: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 26: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 27: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 28: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 29: Coolblue - Behind the Scenes Continuous Integration & Deployment

PLAN.

Page 30: Coolblue - Behind the Scenes Continuous Integration & Deployment

CODE.[sensu]Get(){...}

[void]Set(){...}

[boolean]Test(){...}

static [void] XMLConversion (){...}

static [void] InstallService (){...}

static [void] ConfigureAgentTransport([Transport]$Transport){...}

Page 31: Coolblue - Behind the Scenes Continuous Integration & Deployment

CODE.node $AllNodes.Where{$_.Role -eq "our_app"}.role{...}

node $AllNodes.Where{$_.Role -eq "our_app_1"}.role{...}

node $AllNodes.Where{$_.Role -eq "our_app_2"}.role{...}

node $AllNodes.Where{$_.Role -eq "our_app_3"}.role{...}

node $AllNodes.Where{$_.Role -eq "our_app_4"}.role{...}

Page 32: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 33: Coolblue - Behind the Scenes Continuous Integration & Deployment

BUILD.

Page 34: Coolblue - Behind the Scenes Continuous Integration & Deployment

BUILD.

Page 35: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 36: Coolblue - Behind the Scenes Continuous Integration & Deployment

TEST. Context Download Agent Method [+] Should download the Sensu client 7.58s [+] Should be the full file 101ms Context Install Agent Method [+] Should Install the Sensu client 38.49s Context ConfigureAgentClient Method [+] Should be correctly formatted into JSON 1.77s [+] Should contain the Correct Information in the JSON | Subscriptions 20ms [+] Should contain the Correct Information in the JSON | Name 19ms [+] Should contain the Correct Information in the JSON | Private IPv4 Address 15ms Context ConfigureAgentTransport Method [+] Should be formatted correctly into JSON 154ms [+] Should contain the Correct Information in the JSON | Name 16ms [+] Should contain the Correct Information in the JSON | Reconnect on Error 13ms Context InstallService Method [+] Should deploy and install the Sensu client service 256ms Context Conversion XML Method [+] Should correctly create an valid XML configuration file 119ms Context RemoveAgent Method [+] It should remove the agent 239.16sDescribing DSC Based methods Context Testing DSC based methods [+] Test() Method should return a Boolean Type 283ms [+] Get() Method should return a Sensu Type 31ms

Page 37: Coolblue - Behind the Scenes Continuous Integration & Deployment

TEST.

Page 38: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 39: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 40: Coolblue - Behind the Scenes Continuous Integration & Deployment

Move fast and break things. Unless you are breaking stuff, you are not moving fast enough.

Mark Zuckerberg

Page 41: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 42: Coolblue - Behind the Scenes Continuous Integration & Deployment

DEPLOY.

Page 43: Coolblue - Behind the Scenes Continuous Integration & Deployment

DEPLOY.

Page 44: Coolblue - Behind the Scenes Continuous Integration & Deployment

WHAT IS DSC?.

Page 45: Coolblue - Behind the Scenes Continuous Integration & Deployment

WHAT IS DSC?.

Page 46: Coolblue - Behind the Scenes Continuous Integration & Deployment

WHAT IS DSC?.

Page 47: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 48: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 49: Coolblue - Behind the Scenes Continuous Integration & Deployment

OPERATE.

Page 50: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 51: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 52: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 53: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 54: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 55: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 56: Coolblue - Behind the Scenes Continuous Integration & Deployment

PILLARS OF MONITORING.

Page 57: Coolblue - Behind the Scenes Continuous Integration & Deployment

WHY MONITORING IS HARD.

▪Automation is an after thought▪Forgetting to add new services▪Checks are hard to write▪Don’t want to do annoying things

Page 58: Coolblue - Behind the Scenes Continuous Integration & Deployment

ENTER SENSU.

IIS

/purchases

Sensu Agent

Sensu Server

RabbitMQ

Page 59: Coolblue - Behind the Scenes Continuous Integration & Deployment

STEP 1 - DEPLOY AGENT WITH DSC.Sensu Install{ Ensure = "Present" DownloadURL = 'https://sensu.global.net/msi/sensu-0.24.0-1.msi' RabbitMQServer = 'coolblue-rabbitmq.internal.fake' Transport = 'rabbitmq' vHost = 'sensu' User = 'sensu' Port = '5672' Password = 'some_password' #Encrypted of course Subscription = 'windows_base'}

Page 60: Coolblue - Behind the Scenes Continuous Integration & Deployment

IIS

/purchases

Sensu Agent

Sensu Server

RabbitMQ Deploy Agent

Page 61: Coolblue - Behind the Scenes Continuous Integration & Deployment

STEP 2 - CREATE SOME CHECKS.{ "checks": { "disk_usage": { "command": "check-windows-disk.rb.bat -w 85 -c 95", "interval": 600, "subscribers": [ "windows" ] }, "windows_update": { "command": "powershell.exe -file C:/coolblue_checks/win_last_updated.ps1 -w 30 -c 60", "interval": 86400, "subscribers": [ "windows" ] } }}

Page 62: Coolblue - Behind the Scenes Continuous Integration & Deployment

SENSU CHECK DEFINITIONS.

IIS

/purchases

Sensu Agent

Sensu Server

RabbitMQ

Add Check Definitions

Page 63: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 64: Coolblue - Behind the Scenes Continuous Integration & Deployment

STEP 3 - UPDATE THE CONFIG.Sensu Install{ Ensure = "Present" DownloadURL = 'https://sensu.global.net/msi/sensu-0.24.0-1.msi' RabbitMQServer = 'coolblue-rabbitmq.internal.fake' Transport = 'rabbitmq' vHost = 'sensu' User = 'sensu' Port = '5672' Password = 'some_password' #Encrypted of course Subscription = 'windows_base','my_iis_app'}

Page 65: Coolblue - Behind the Scenes Continuous Integration & Deployment

STEP 4 - ADD APP SPECIFIC CHECKS.{ "checks": { "iis_purchases": { "command": "check-http.rb http://localhost/purchases", "interval": 60, "playbook": "https://github.com/devTeam/readme.md", "subscribers": [ "my_iis_app" ] } }}

Page 66: Coolblue - Behind the Scenes Continuous Integration & Deployment

WHY MONITORING IS HARD.

▪Automation is an after thought▪Forgetting to add new services▪Checks are hard to write▪Don’t want to do annoying things

Page 67: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 68: Coolblue - Behind the Scenes Continuous Integration & Deployment

THE SENSU SOCKET INPUT.

IIS

/purchases

Sensu Agent

Sensu Server

RabbitMQ

3030TCP/UDP

My App

Page 69: Coolblue - Behind the Scenes Continuous Integration & Deployment

JUST SEND IN JSON.

{ "name": "ravendb_connectivity", "output": "Could not connect to RavenDB!", "status": 2, "team": "TeamName", "application": "My App", "playbook": "https://github.com/devTeam/readme.md"}

Page 70: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 71: Coolblue - Behind the Scenes Continuous Integration & Deployment

USING A DEAD-MAN SWITCH.

{ "name": "daily_sql_backup", "output": "Backup of SQL databases performed", "status": 0, "team": "OpsTeamName", "application": "sql_backups", "playbook": "https://github.com/opsTeam/readme.md", "ttl": 86400}

Page 72: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 73: Coolblue - Behind the Scenes Continuous Integration & Deployment

MONITORING CAN BE EASY.

▪Automation is an after thought▪Forgetting to add new services▪Checks are hard to write▪Don’t want to do annoying things

Page 74: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 75: Coolblue - Behind the Scenes Continuous Integration & Deployment

FIN.

Matthew Hodgkins

@matthodge

hodgkins.io

Flynn Bundy

@bundyfx

flynnbundy.com

Page 76: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 77: Coolblue - Behind the Scenes Continuous Integration & Deployment

BREAK TIME.

Page 78: Coolblue - Behind the Scenes Continuous Integration & Deployment

July 2016 | Behind the Scenes Flynn Bundy <@bundyfx> & Chris Thorp <@thorpgeek>

Page 79: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 80: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 81: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 82: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 83: Coolblue - Behind the Scenes Continuous Integration & Deployment

Challenges.

● OS Base Memory Usage

● Large HDD Usage

● Build Times for Servers

● Further increase the development speed of Coolblue

Page 84: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 85: Coolblue - Behind the Scenes Continuous Integration & Deployment

SAD (Server And a Desktop).

Install web server feature

Page 86: Coolblue - Behind the Scenes Continuous Integration & Deployment

Server Core.

Page 87: Coolblue - Behind the Scenes Continuous Integration & Deployment

WE

Page 88: Coolblue - Behind the Scenes Continuous Integration & Deployment

Nano Server.

Page 89: Coolblue - Behind the Scenes Continuous Integration & Deployment

Nano Server Features.

Page 90: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 91: Coolblue - Behind the Scenes Continuous Integration & Deployment

Results.

Server Core Nano Server

Build Time: 6 min ~40 Seconds

Start Time: 25 Seconds 2 Seconds

Restart Time: 15 Seconds 1 Seconds

Hard Drive Space used:

8 GB 600 MB

Basic Memory Usage 250 MB 160 MB

Page 92: Coolblue - Behind the Scenes Continuous Integration & Deployment

Nano Server Thoughts.

● No 32 Bit Support

● MSI is gone

● Not all server core features available

● No Full .Net Framework Support

Page 93: Coolblue - Behind the Scenes Continuous Integration & Deployment

Challenges.

● OS base Memory Usage

● Large HDD Usage

● Build and Deployment Times for Servers

● Further increase the development speed of Coolblue

Page 94: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 95: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 96: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 97: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 98: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 99: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 100: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 101: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 102: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 103: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 104: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 105: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 106: Coolblue - Behind the Scenes Continuous Integration & Deployment

Summing up challenges.

● OS Base Memory Usage

● Large HDD Usage

● Build Deployment Times for Servers

● Further increase the development speed of Coolblue

Page 107: Coolblue - Behind the Scenes Continuous Integration & Deployment

FIN.

Chris Thorp

@thorpgeek

Flynn Bundy

@bundyfx

flynnbundy.com

Page 108: Coolblue - Behind the Scenes Continuous Integration & Deployment
Page 109: Coolblue - Behind the Scenes Continuous Integration & Deployment

Events: coolblue.nl/behindthescenes DevBlog: devblog.coolblue.nl