class: topic # Cloud for Microservices .footnote[[Kamil Chmielewski](https://github.com/kamilchm)] --- # About Me * 10+ years of professional experience * developer, architect, team leader, product owner * C/C++, Python, Java, Groovy for production * Go, Erlang, [Nim](http://nim-lang.org/), Rust for fun * pragmatic programmer, continuous delivery practitioner * I like programming, but hate writing code --- # Microservices * easy to understand and modify * small teams * system resilence * easy to scale * polyglot programming * easy to throw away -- .important[continuous delivery being mandatory] --- # Countinuous Delivery .footnote[[CD Maturity Model](http://www.infoq.com/articles/Continuous-Delivery-Maturity-Model)] * over 40 teams -- * 1 or 2 week sprints -- * over 128 services -- * 3 environments: dev => test => prod -- .important[~ 100 deployments each day] ??? * how to do it? cloud? * how to make it enough agile? --- # Cloud .footnote[[Benefits of Cloud Computing](http://aws.amazon.com/what-is-cloud-computing/)] * resources available to your developers from weeks to just minutes -- * dramatic increase in agility for the organization -- * cost and time it takes to experiment and develop is significantly lower -- * and scale up and down as required -- * with only a few minutes notice --- class: big-code ```python if cloud == "IaaS": developer.commit_feature(repo) # CI/CD kicks in package = ci.build(repo) cd.publish(package) # deploy to cloud! :) cd.deploy(package, iaas) } ``` --- class: big-code ```python def deploy(package, iaas): # we need some machines machines = iaas.machines() if len(machines) < 4: machines = iaas.create_machines(4) # prepare and run service for machine in machines: machine.provision() machine.put(package) machine.run_as_service(package) ``` --- class: big-code ```python def deploy(package, iaas): # we need some machines machines = iaas.machines() if len(machines) < 4: * machines = iaas.create_machines(4) # prepare and run service for machine in machines: * machine.provision() machine.put(package) * machine.run_as_service(package) ``` --- class: topic # IaaS + Infra Team -- ## + JIRA -- .watermark.fail[FAIL] ??? * doesn't scale * adding new instances require days or weeks! --- class: topic # IaaS + Dev Team --- # IaaS + Dev Team + add instances in hours -- - new tools for devs - cloud (GUI/API) - OS distribution - provisioning - managing processes - monitoring -- .important[add instances in hours!] --- class: topic # Immutable Servers ## Trash Your Servers and Burn Your Code .footnote[[Immutable Deployments](http://chadfowler.com/blog/2013/06/23/immutable-deployments/)] --- # Immutable Servers - building package in hours -- + add instances in minutes -- - new tools for devs -- + stable tools -- - large deployment packages --- # Who own this? .center[.img-80[![](FullOSDiagram.svg)]] ??? * do we need two OS'es in our stack? --- class: topic # Unikernels ## Rise of the Virtual Library Operating System .footnote[[Cloud Operating Systems](http://www.linux.com/news/enterprise/cloud-computing/751156-are-cloud-operating-systems-the-next-big-thing-)] --- # Unikernels * specialized OS kernels that are written in a high-level language * access *hardware* resources directly * without transitions to move data between user space and kernel space * virtual hardware devices - use hypervisor to drive the real physical hardware --- # Remove some layers :) .center[.img-80[![](CloudOSDiagram.svg)]] --- # Unikernels + build packages in minutes -- + small packages -- + start instances in miliseconds -- + using well known IaaS -- - language specific implementation - [OCaml](http://openmirage.org/), [Haskell](https://github.com/GaloisInc/HaLVM), [Erlang](http://erlangonxen.org/) -- - [JVM](http://osv.io/) ??? * small adoption --- # Remove Hypervisor .center[.img-80[![](ContainerOSDiagram.svg)]] --- class: topic # Containers ## VM without the overhead that comes with running a separate kernel .footnote[[Linux Containers](https://linuxcontainers.org/)] --- # Containers + build packages in minutes -- + small packages *([UnionFS](http://en.wikipedia.org/wiki/UnionFS)) -- + start instances in miliseconds -- - get rid off IaaS ??? * better adoption than unikernels --- class: topic # How we do it? ??? * immutable images for now -- ## Mesos - Datacanter Operating System .footnote[[Apache Mesos](http://mesos.apache.org/)] --- background-image: url(mesos-offer-example.jpg) .footnote[[Mesos Architecture](http://mesos.apache.org/documentation/latest/mesos-architecture/)] --- class: middle, center # [github.com/kamilchm](https://github.com/kamilchm/) # [.img-50[![](http://allegrotech.io/img/logo-allegro-tech.svg)]](https://github.com/allegro/)