Continuous Delivery with Containers Nick Gauthier @ngauthier Developer @codeship
What is Continuous Delivery?
Continuous Delivery (CD) is a software engineering approach in which teams keep producing valuable software in short cycles and ensure that the software can be reliably released at any time. Chen, Lianping (2015). "Continuous Delivery: Huge Benefits, but Challenges Too". IEEE Software 32
“valuable software” I think we can all agree here!
“short cycles” ship early, ship often!
“reliably released at any time” don’t break the build!
What are our needs?
Core CD System Attributes 1. 2. 3. 4.
Speed Parity Reliability Flexibility
Speed: The CD Cycle
1. 2. 3. 4. 5.
Check out code Run tests Build deployment artifact Ship deployment artifact Start deployment artifact
Official + Community Images don’t reinvent the wheel unless you want to
Hosting Choices low lock-in, many new options including OSS diy
Docker CD What are our options?
#1 Local
LOCAL
1. 2. 3. 4.
Run tests Build images Push images Trigger host pull
LOCAL
1. 2. 3. 4.
Run tests (hopefully? same env?) Build images (slow, cpu + net) Push images (slow, race?) Trigger host pull (race?)
#2 Hosted Solution
HOSTED SOLUTION
1. 2. 3. 4. 5.
Build CI Container Run tests in CI Container Build Production Container Push Production Container Trigger host pull
HOSTED SOLUTION
1. 2. 3. 4. 5.
Build CI Container (caching? multiple?) Run tests in CI Container (prod parity?) Build Production Container (build artifacts? mult?) Push Production Container Trigger host pull
Removes burden from CI Must be single-Dockerfile app Must be deployable in isolation Can’t leverage local cache
Build + Push + Trigger Pull
1. 2. 3. 4.
Use local cache CI must do production builds Push + Pull adds time Can push many and launch many
Build + Crossbuild
1. ???
Hack #4: use the same registry
Use the same registry
1. 2. 3. 4. 5.
Put registry near CI Push CI layers to registry a la Hack #2 Minimal layers pushed with small changes Put registry near host Minimal pull onto host with small changes
Keep common bases hot
Try to use similar bases
CI + CD + Hosting keep them close
CI + CD + Hosting keep them close (a.k.a. Amazon all the things)
What’s next?
Better parallel tooling
Better development environments (non virtualized drivers)
Better machine provisioning (docker machine as a library)
Codeship Docker pages.codeship.com/docker (or come say hi!)
Thanks!
Questions?
Continuous Delivery with Containers - ContainerDays NYC.pdf ...
Continuous Delivery with Containers - ContainerDays NYC.pdf. Continuous Delivery with Containers - ContainerDays NYC.pdf. Open. Extract. Open with.