Mais conteúdo relacionado Semelhante a ContainerDays Boston 2015: "Continuous Delivery with Containers" (Nick Gauthier) (20) Mais de DynamicInfraDays (16) ContainerDays Boston 2015: "Continuous Delivery with Containers" (Nick Gauthier)3. 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
8. Core CD System Attributes
1. Speed
2. Parity
3. Reliability
4. Flexibility
9. Speed: The CD Cycle
1. Check out code
2. Run tests
3. Build deployment artifact
4. Ship deployment artifact
5. Start deployment artifact
28. 1. Run tests (hopefully? same env?)
2. Build images (slow, cpu + net)
3. Push images (slow, race?)
4. Trigger host pull (race?)
LOCAL
30. HOSTED SOLUTION
1. Build CI Container
2. Run tests in CI Container
3. Build Production Container
4. Push Production Container
5. Trigger host pull
31. HOSTED SOLUTION
1. Build CI Container (caching? multiple?)
2. Run tests in CI Container (prod parity?)
3. Build Production Container (build artifacts? mult?)
4. Push Production Container
5. Trigger host pull
71. CODESNIPPET
# Classic
ADD .
RUN make deps / bundle / ...
CMD [“run my tests”]
# Layered
ADD Godeps + Makefile / Gemfile + .lock / …
RUN make deps / bundle / …
ADD .
CMD [“run my tests”]
83. CODESNIPPET
# Commands during CI
make prod-binary
docker build -f Dockerfile.production .
# Dockerfile.production
FROM debian:latest
RUN apt-get update &&
apt-get install some-dyn-lib
ADD prod-binary /
CMD [“/prod-binary”]
84. Static Container
1. Minimal Packages
2. No language packages
3. Only works for compiled languages
(but also gains for vm languages)
87. CODESNIPPET
# Commands during CI
make prod-binary
docker build -f Dockerfile.production .
# Dockerfile.production
FROM scratch
ADD prod-binary /
CMD [“/prod-binary”]
89. Scratch Containers
1. Only works for statically compiled binaries
2. Worst CI + Prod parity
3. Near Instant push+pull+boot+deploy
91. Minimal Guest
1. Bare O.S.
2. Minimal toolchain
3. Minimal Packaging + DIY
4. Small containers for the dynamic crowd
93. CODESNIPPET
# 16mb mysql container
FROM gliderlabs/alpine:3.1
RUN apk --update add mysql-client
ENTRYPOINT ["mysql"]
103. CODESNIPPET
docker run -d --name u1-postgres postgres
sleep magicnumber # :(
docker run --name u1-app --link u1-postgres:postgres
app make test
docker kill u1-postgres
112. Deployment Styles
1. Push code + build on host
(e.g. Deis, EB, …)
2. Build + push image + trigger host pull
(e.g. EB, ECS, GAE, …)
3. Build + crossbuild for host + push
(e.g. Heroku docker release)
113. Build on Host
1. Removes burden from CI
2. Must be single-Dockerfile app
3. Must be deployable in isolation
4. Can’t leverage local cache
114. Build + Push + Trigger Pull
1. Use local cache
2. CI must do production builds
3. Push + Pull adds time
4. Can push many and launch many
117. Use the same registry
1. Put registry near CI
2. Push CI layers to registry a la Hack #2
3. Minimal layers pushed with small changes
4. Put registry near host
5. Minimal pull onto host with small changes
120. CI + CD + Hosting
keep them close
121. CI + CD + Hosting
keep them close
(a.k.a. Amazon all the things)