Download - Baking Wins

Transcript
Page 1: Baking Wins

B A K I N G W I N S

@brightfulton

Page 2: Baking Wins

The bake vs. fry debate is over

and baking wins

Page 3: Baking Wins

THEORYRESOLUTIO

NPRACTICE

Page 4: Baking Wins

THEORYRESOLUTIO

NPRACTICE

Baking makes deployment better

Page 5: Baking Wins

GOALS

reliability

scalability

availability

Page 6: Baking Wins

GOALS

reliability

scalability

availability

HURDLES

mutable state

startup latency

dependencies

Page 7: Baking Wins

GOALS

reliability

scalability

availability

HURDLES

mutable state

startup latency

dependencies

SOLUTION

baking

Page 8: Baking Wins

The bake vs. fry debate is over

and baking wins

*

* for some the debate was over long ago

Page 9: Baking Wins

The bake vs. fry debate is over

and baking wins

*

* for some the debate was over long ago

Page 10: Baking Wins

THEORYRESOLUTIO

NPRACTICE

Baking improves deployment

reliability, scalability, availability

Page 11: Baking Wins

THEORYRESOLUTIO

NPRACTICE

But, baking isn’t very fun

Page 12: Baking Wins

http://techblog.netflix.com/2013/03/ami-creation-with-aminator.html

B A K IN G TOOLS

P R E S U ME A N A R C H ITE C TU R E

Bakery

Aminator

(Asgard)

Page 13: Baking Wins

B A K ING TOOLS

ARE SLOW AND FRAGILE

umount: /sysroot/proc: device is busy.

Page 14: Baking Wins

THEORYRESOLUTIO

NPRACTICE

Baking proved to be

demanding, slow, messy

Page 15: Baking Wins

THEORYRESOLUTIO

NPRACTICE

We use Docker to make baking better

Page 16: Baking Wins

D O C K E R R E D U C E S

T H E O R Y T O

P R A C T I C E

• single dependency

• isolated containers

• improved dev / ops interface

• fast

Page 17: Baking Wins

SWIPELY’S ESSENTIAL

INGREDIENTS

docker-api: programmatic docker control

dockly: declarative package definition

aerosol: functional deployment orchestration

Page 18: Baking Wins

swipely/docker-api

Docker::Image.allGet all images

Create an image Docker::Image.create(

'repo' => ‘ubuntu',

'tag' => ‘latest'

)

Add file to existing

image

image.insert_local(

'localPath' => ‘/some/file',

'outputPath' => ‘/other/path'

)

Ruby wrapper for Docker Remote API

Page 19: Baking Wins

swipely/dockly

deb :my_package do

package_name 'my_app'

docker do

name 'my_image'

import 's3://.../base-image.tar.gz'

git_archive '/app'

build <<-EOF

run cd /app && ./configure && make

EOF

end

foreman do

name 'my_app'

log_dir '/data/logs'

user 'appuser'

end

end

Declarative DSL for packaging

Page 20: Baking Wins

Orchestrates instance-based-deploys

swipely/aerosol

deploy :production_myapp do

ssh :production_myapp

auto_scaling :production_myapp

stop_command 'sudo stop myapp'

live_check '/version'

app_port 14000

post_deploy_command 'bundle exec rake honeybadger:deploy TO=production'

end

auto_scaling :production_myapp do

availability_zones ['us-east-1a', 'us-east-1b']

min_size 2

max_size 2

launch_configuration :production_myapp

tag 'Name' => 'prod-myapp'

end

Page 21: Baking Wins

D O C K E R R U N I S F A S T

container

Page 22: Baking Wins

docker do

name :my_app

import 's3://.../base-image.tar.gz'

git_archive '/app'

build_cache do

s3_bucket "my-build-cache-bucket"

s3_object_prefix "make/"

hash_command "md5deep /app/src”

build_command "cd /app && ./configure && make”

output_dir "/app/build"

use_latest true

end

end

D O C K L Y I S F A S T

Granular build caching

Page 23: Baking Wins

A E R O S O L I S

F A S T

v1 v2

Page 24: Baking Wins

THEORYRESOLUTIO

NPRACTICE

Docker makes baking

clean, simple, fast

Page 25: Baking Wins

github.com/swipely

careers.swipely.com

@swipelyeng

T H A N K Y O U


Top Related