Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Docker-Vancouver Meetup - March 18, 2014 - Contain(erize) the tests - Mark Eijsermans

378 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Docker-Vancouver Meetup - March 18, 2014 - Contain(erize) the tests - Mark Eijsermans

  1. 1. Contain(erize) The Tests @markeijsermans
  2. 2. Software Engineer Love DevOps Love Docker
  3. 3. When you're a hammer...
  4. 4. Our unit test problems monolithic code base complex setup few mocks hits databases slow
  5. 5. Jenkins Woes Jenkins was bottlenecking our server configurations Php 5.5.x roll-out took months
  6. 6. ...the nail
  7. 7. Parallelize the tests solved a problem low risk
  8. 8. Jenkins x Jenkins run tests on 10 (or more) slaves goal: Docker and git are the only dependencies
  9. 9. unittest.sh kickoff script private docker registry container for running test linked container for dbs
  10. 10. Results 25min down to 3min (could still be lower) ...but, not all is rosy
  11. 11. Findings
  12. 12. Configuration Management How to integrate Ansbile? sshd adds +40MB (seems wrong) installed Ansible in base image maybe provision with chroot? (but lose layering) Packer.io? isn't quite there yet CM integration with Docker rumored [soon to be fixed]
  13. 13. Why not just use Ansible directly on slaves? continuous integration is continually integrating itself! automatic refresh (pull) before running tests easy to scale more slaves slaves re-usable for other tasks - not polluted with dependencies part of the experiment!
  14. 14. The "PID 1" problem needs to watch sub-processes if they die and re-launch can't be SIGKILL'd some hacks needed to quiet upstart we used supervisord - works well init integration coming (systemd, SysV, etc.) [soon to be fixed]
  15. 15. libcontainer new in version 0.9 nsinit allows you to attach might be implemented as "docker exec" lxc namespacing still has lxc-attach
  16. 16. Registry is slow from the cloud push/pulling from local network to EC2 is painful +1GB containers! how about a local mirror? EDIT: added to the docker-registry a few weeks ago [fixed]
  17. 17. Trimming the fat installing packages dumps a TON of stuff on the system great way to find out what a package does dpkg --no-install-recommends filter out /usr/share/{man | doc | info} trash apt cache (+100MB) flatten: docker export -> import [solvable]
  18. 18. Container layering questions base -> Ansible -> runtime -> app -> unit test extras
  19. 19. Linking containers cumbersome. lots of verbose ENV VARS ambassador container (hacky)? service discovery - serf, etcd, etc? DB_PORT_3306_TCP=tcp://127.0.0.1 DB_PORT_3306_TCP_ADDR=127.0.0.1 DB_PORT_3306_TCP_PORT=3306 DB_PORT_3306_TCP_PROTO=tcp ... [unknown]
  20. 20. Unknown maintenance profile not all *nix tools ready for namespacing free & top are broken (shows full system memory allocation) logs (on aufs, inside the container - good/bad?) problem? copy container locally, inspect?
  21. 21. API first design *except a some commands like attach
  22. 22. Great for open-sourcing a project docker run ... done!
  23. 23. Thank You! @markeijsermans mark.eijsermans@hootsuite.com

×