baking wins

Post on 19-Aug-2014

2.363 Views

Category:

Engineering

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

Do you take the time to bake your deployments from scratch to ensure they work reliably, or do you fry them at the risk of something breaking? Using Swipely's open source Docker projects, you can now enjoy the best of both worlds by baking reliable Docker containers in less time than it takes to launch new instances.

TRANSCRIPT

B A K I N G W I N S

@brightfulton

The bake vs. fry debate is over

and baking wins

THEORYRESOLUTIO

NPRACTICE

THEORYRESOLUTIO

NPRACTICE

Baking makes deployment better

GOALS

reliability

scalability

availability

GOALS

reliability

scalability

availability

HURDLES

mutable state

startup latency

dependencies

GOALS

reliability

scalability

availability

HURDLES

mutable state

startup latency

dependencies

SOLUTION

baking

The bake vs. fry debate is over

and baking wins

*

* for some the debate was over long ago

The bake vs. fry debate is over

and baking wins

*

* for some the debate was over long ago

THEORYRESOLUTIO

NPRACTICE

Baking improves deployment

reliability, scalability, availability

THEORYRESOLUTIO

NPRACTICE

But, baking isn’t very fun

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)

B A K ING TOOLS

ARE SLOW AND FRAGILE

umount: /sysroot/proc: device is busy.

THEORYRESOLUTIO

NPRACTICE

Baking proved to be

demanding, slow, messy

THEORYRESOLUTIO

NPRACTICE

We use Docker to make baking better

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

SWIPELY’S ESSENTIAL

INGREDIENTS

docker-api: programmatic docker control

dockly: declarative package definition

aerosol: functional deployment orchestration

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

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

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

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

container

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

A E R O S O L I S

F A S T

v1 v2

THEORYRESOLUTIO

NPRACTICE

Docker makes baking

clean, simple, fast

github.com/swipely

careers.swipely.com

@swipelyeng

T H A N K Y O U

top related