Vms, Serverless, or Containers

6c18ceafef161be26ae441469b29c475?s=47 Terrence Ryan
December 14, 2017

Vms, Serverless, or Containers

An exploration of how and why to choose between these technologies

6c18ceafef161be26ae441469b29c475?s=128

Terrence Ryan

December 14, 2017
Tweet

Transcript

  1. ‹#› @tpryan Terry Ryan Developer Advocate VM, Serverless, or Containers

    ¯\_(ツ)_/¯
  2. ‹#› @tpryan Who are you?

  3. ‹#› @tpryan Disclaimer

  4. ‹#› @tpryan Disclaimer

  5. ‹#› @tpryan Finances Developers System Admins

  6. ‹#› @tpryan 01 Introduction What’s the problem?

  7. ‹#› @tpryan Computing options are confusing.

  8. ‹#› @tpryan There is money on the table.

  9. ‹#› @tpryan Where there is money there is FUD.

  10. ‹#› @tpryan Virtual Machines OS OS Containers Serverless OS

  11. ‹#› @tpryan 02 Virtual Machines Everyone’s first step OS OS

  12. ‹#› @tpryan Hypervisor Virtual Machines OS OS OS

  13. ‹#› @tpryan Virtual Machines - Pros • Eliminate direct hardware

    costs Finances Developers • No significant changes System Admins • Eliminates toil associated with hardware. • Allows continued use of system configuration and optimization skills.
  14. ‹#› @tpryan Virtual Machines - Cons • Can lead to

    billing surprises Finances Developers • Might be environment differences that cause bugs. System Admins • Loss of control • Problems can occur in the space that they used to control but now don’t.
  15. ‹#› @tpryan Iceberg

  16. ‹#› @tpryan Radio Show

  17. ‹#› @tpryan VM Mitigation • Move risk from cloud provider

    to cloud customer Discounts Unstable VM • Dramatically reduced cost • Resource isn’t guaranteed Custom VMs • Constrain resources to your processing need
  18. ‹#› @tpryan Demo: 100,000,000 Digits of Pi

  19. ‹#› @tpryan 03 Serverless That can’t be right

  20. ‹#› @tpryan • Marketing term (but a very relevant one)

    Serverless
  21. ‹#› @tpryan • Pay per use • Code is the

    deliverable • APIs provide interaction • Hardware is abstracted Serverless
  22. ‹#› @tpryan Serverless Computing • REST APIs • Microservices •

    Mobile Backends • Entire web applications Application Event • File writes • Queue messages • API calls Storage • Database • Data Warehouse • File storage
  23. ‹#› @tpryan Serverless - Pros • Pay only for exact

    use Finances Developers • Easier to create microservices • Easier to isolate services from other service System Admins • Eliminates most systems toil
  24. ‹#› @tpryan Serverless - Cons • Bursts can surprise you

    • Sustained usage will tend to be more expensive then you might expect Finances Developers • Most serverless systems require a proprietary interface • Existing apps require work to migrate • Constraints in what kinds of other operation you can do • Constraints in runtimes. System Admins • Eliminates most systems toil • (Might be threatening if all of it gets replaced.)
  25. ‹#› @tpryan Demo: 0 to 100,000 strikes

  26. ‹#› @tpryan 04 Containers Docker, Docker, Docker OS

  27. ‹#› @tpryan Matrix from Hell Dev 1 Laptop Dev 2

    Laptop QA Stage Production OS ? ? ? ? ? Frontend ? ? ? ? ? Services ? ? ? ? ? Database ? ? ? ? ? Logs ? ? ? ? ?
  28. ‹#› @tpryan Matrix from Hell Dev 1 Laptop Dev 2

    Laptop QA Stage Production OS OS X Windows Debian Debian Debian Frontend nginx (homebrew) nginx (download) nginx (apt-get) nginx (apt-get) nginx (apt-get) Services php (homebrew) php (download) php (apt-get) php (apt-get) php (apt-get) Database mysql (download) mysql (download) mysql (apt-get) mysql (apt-get) mysql (apt-get) Logs /usr/local/etc/nginx/logs/ C:\nginx-1.9.5\logs /var/log/nginx/ /var/log/nginx/ /var/log/nginx/
  29. ‹#› @tpryan It worked fine in dev It worked fine

    in dev Ops Problem now Ops Problem now
  30. ‹#› @tpryan Back your shit up Back your shit up

    Your laptop’s going to prod Your laptop’s going to prod
  31. ‹#› @tpryan Hypervisor Virtual Machines OS OS OS

  32. ‹#› @tpryan Container Host Containers OS

  33. ‹#› @tpryan Dockerfile FROM php:5.6-apache RUN apt-get update && apt-get

    -y install \ curl \ php5-mysqlnd \ php-pear \ zlib1g-dev RUN docker-php-ext-install mysqli COPY php.ini /usr/local/etc/php/ COPY startup.sh /usr/local/bin/ RUN chmod 755 /usr/local/bin/startup.sh ADD default /var/www/html CMD ["/usr/local/bin/startup.sh"]
  34. ‹#› @tpryan Matrix from Hell Dev 1 Laptop Dev 2

    Laptop QA Stage Production OS Frontend Services Database Logs
  35. ‹#› @tpryan # FRONTEND AND SERVICES FROM nginx-php-fpm COPY nginx.conf

    /etc/nginx/nginx.conf ADD www /var/www/
  36. ‹#› @tpryan # BACKEND FROM ubuntu:12.04 ADD ./mysql-setup.sh /tmp/mysql-setup.sh RUN

    /bin/sh /tmp/mysql-setup.sh EXPOSE 3306 CMD ["/usr/sbin/mysqld"]
  37. ‹#› @tpryan

  38. ‹#› @tpryan # FRONTEND AND SERVICES FROM nginx-php-fpm COPY nginx.conf

    /etc/nginx/nginx.conf ADD www /var/www/ # JUST SERVICES FROM nginx-php-fpm COPY nginx.conf /etc/nginx/nginx.conf ADD www /var/www/
  39. ‹#› @tpryan # FRONTEND AND SERVICES FROM nginx-php-fpm COPY nginx.conf

    /etc/nginx/nginx.conf ADD www /var/www/ # FRONTEND FROM nginx COPY nginx.conf /etc/nginx/nginx.conf ADD www /var/www/
  40. ‹#› @tpryan

  41. ‹#› @tpryan # BACKEND FROM ubuntu:12.04 ADD ./mysql-setup.sh /tmp/mysql-setup.sh RUN

    /bin/sh /tmp/mysql-setup.sh EXPOSE 3306 CMD ["/usr/sbin/mysqld"] # BACKEND FROM ubuntu:12.04 ADD ./mysql-setup.sh /tmp/mysql-setup.sh RUN /bin/sh /tmp/mysql-setup.sh EXPOSE 3306 VOLUME ["/etc/mysql", "/var/lib/mysql"] CMD ["/usr/sbin/mysqld"]
  42. ‹#› @tpryan

  43. ‹#› @tpryan

  44. ‹#› @tpryan

  45. ‹#› @tpryan

  46. ‹#› @tpryan

  47. ‹#› @tpryan That’s a lot to manage.

  48. ‹#› @tpryan 4 3 1

  49. ‹#› @tpryan

  50. ‹#› @tpryan

  51. ‹#› @tpryan

  52. ‹#› @tpryan

  53. ‹#› @tpryan Containers - Pros • Allows for better resource

    usage Finances Developers • Easier to create microservices • Easier to isolate services from other service • Less constraints then serverless System Admins • Separates the code from the system almost entirely • Strongly encourages developer to write easily logged, monitored and dignosed applications
  54. ‹#› @tpryan Containers - Cons • Still requires a sunk

    minimum cost Finances Developers • Microservices are great, until they aren’t and then they hurt. • Complexity System Admins • Containers tend to create additional layer of management • Complexity, complexity, complexity
  55. ‹#› @tpryan Container Mitigation • Bring a container, provider will

    host • GAE Flex • AWS has a thing • Azure has a thing • Other services Managed Container Hosting Managed Kubernetes • Provider runs Kubernetes for you, takes away a lot of complexity • Kubernetes Engine • AWS’s thing • Azure thing
  56. ‹#› @tpryan Demo: Launch all the things

  57. ‹#› @tpryan 05 Conclusions Bring it home

  58. ‹#› @tpryan Workload • Consistent load • Lift and Shift

    • Licensed executables • Custom Hardware • GPUs • TPUs Virtual Machines Containers • Middle step • Variable load • Microservices • Diminishing Legacy Apps Serverless • Greenfield • Microservices • Unknown load
  59. ‹#› @tpryan Staffing • Serverless • Containers Developer Heavy Systems

    Heavy • VMs • Containers Some other • VMs
  60. ‹#› @tpryan Personally, I love Serverless, but use Containers

  61. ‹#› @tpryan Lock in • Every Cloud Provider • VMware

    • Virtual Box Virtual Machines Container • Every Cloud Provider • Docker • Kubernetes Serverless • Cloud Proprietary • No winners yet
  62. ‹#› @tpryan Containers, wherever you run them are a safe

    bet
  63. ‹#› @tpryan Ultimately I think Serverless will win out.

  64. ‹#› @tpryan Thank You terrenceryan.com @tpryan This preso: http://bit.ly/tpryan-ab2017 Joind.in:

    https://joind.in/talk/ 73e71