7. Container
•A lightweight, stand-alone, executable package of a piece of
software that includes everything needed to run it: code,
runtime, system tools, system libraries, settings.
•Containers share the host operating system rather than the
hardware directly
•Way more lightweight than a VM
•Docker is the most popular implementation
10. Microservices
• An architecture pattern decomposing vertically a
monolith system into loosely coupled subsystems
(microservices). Nothing more. The pattern doesn't
dictate how it should be done technically.
• Just to highlight it: Microservices and Containers are not
the same and totally independent. You can use Docker
with a monolith app, and you can have several micro-
services without using Docker at all.
11. Architecture patterns. Evolution
•Monolith
– distributed horizontally on
Prem/Cloud/Hybrid
– containerized horizontally
•Microservices
– distributed vertically and horizontally on
Prem/Cloud/Hybrid
– containerized vertically and horizontally
12. Players (some of them)
Cloud Native Computing Foundation
Player Cloud Container oriented service Serverless Project
Oracle Oracle Cloud • Oracle Container Cloud Service
• Oracle Container Native Application
Development Platform
Fn
Amazon AWS • Elastic Container Service (ECS)
• Elastic Container Service for
Kubernetes (EKS)
AWS Lambda
Microsoft AZURE • Azure Container Service (AKS) Azure Functions
Google Google Cloud • Google Kubernetes Engine (GKE) Google Cloud Functions
13. Open Source Platforms
and Projects
• Docker
– Container manager
– Docker Hub
– Docker Cloud
• Kubernetes
16. Docker Hub
•Cloud based registry
– Public (free)
– Private
•Centralized resource for container images
– Repositories
– Automated Builds (based on Dockerfile)
•Docker CLI provides access to Docker Hub
– docker search, pull, login, push
17. Docker Cloud
•Built on top of Docker Hub
•Builds, Tests and Deploys Images
•Manages Infrastructure
– Serves as a facade
– Backed up by AWS, Azure, Digital Ocean, SoftLayer,
Packet
•Operated with docker-cloud CLI
– API (Rest, Go, Python)
19. Kubernetes
• Open Source platform (Google born)
• Orchestration engine for Ops
• A level of abstraction hiding the complexity of a
hybrid environment (prem/cloud)
• Configuration properties
• Load balancing
• Scalability
• Security
• Visibility
20. Kubernetes Architecture
• Cluster. Set of physical or VMs. Masters and workers.
• Node. Worker. Minion. A physical or virtual machine. Docker is installed on it.
• Kubelet. Internal service running on each worker node and managed by a master
node. Makes sure that everything works according to configuration files.
22. Kubernetes Architecture
• Pod. Logical set of containers. A smallest deployable and scalable unit
• Replica set. Defines how many instances of a pod should be alive
23. Kubernetes Architecture
• Service. Logical set of pods with a stable ip/access rules and name. Has a
lightweight internal load balancer.
• Internal, External
30. Serverless
• A unit of work consumes resources only when it is used
– Function is a unit of work
• stateless
• serves one goal
• arguments (input) and result (output)
• Orchestration of independent pieces of work (functions as a
service FaaS)
– Carrying state of the entire flow (program)
– Error handling
– Transaction management
31. Serverless
• Code centric paradigm. Hyde Infrastructure.
– Focus on coding resolving business problems and forget about
infrastructure
– Everything is working on some “computing resources”
• Scalability
– Developers don't do anything for scaling. Scaling is handled
automatically.
• Billing
– Don't pay for idle time
– Pay for milliseconds
• Utilization
– Many small pieces running for short time on same VM
32. Serverless
“There is no such thing as serverless computing.
However, there is such a thing as dedicated serverless computing.”
Lucas Jellema. Oracle ACE Director. AMIS. CTO
33. Serverless Platforms
• AWS Lambda
• Azure Functions
• OpenWhisk
– Open Source / Apache
• Fn
– Open Source / Oracle
– container native
• OpenFaaS
– Open Source / Alex Ellis
– container native
34. Function
(modern / Container-as-a-Function view)
•Static self-running piece-of-work wrapped into a
container with everything it needs for its work
– code + platform
– stateless
– single purposed
– arguments (input) and result (output)
35. AWS Lambda
(old generation)
• One of the first Function projects on the market
– The idea is:
– You have your code written with one of supported languages
(limited list, binaries are preconfigured by AWS)
– Your code exposes some standardized API
– You upload your code (in a zip file) to AWS Lambda
– Basing on event (e.g. request on URL) AWS Lambda allocates
resources for your code, invokes a function and releases the
resource at the end
– The flow is orchestrated with AWS Step Functions
– Visual Flow designer
36. Fn
• Fn Platform (Fn Server and CLI)
– Based on Docker
– Functions are packaged into Docker images
– A custom Docker image can be used as a function
– A container lives as long as the function is being executed
• Fn FDK
– Libraries, annotations for standard input/output handling, configurations, ...
– Polyglot. Supports a long list of languages (Java, Node.js, Python, Ruby, Go, ...)
– Interaction with functions is based on Rest over HTTP or CLI
• Fn Flow
– Orchestration of function graph: state, transactions, exception handling
– Based on Java SE 8 API CompletionStage
– It's awesome! Like a good old Lisp.
– UI Dashboard visualizing flow executions
37. Fn
• Fn components are Docker containers
• Requires only Docker engine
• Can run on Kubernetes cluster
38. Function Flow Example
•Build
– Build Oracle Jet application
– Build a Docker Image (Nginx + Jet
application)
– Push image to Docker Hub
•Deploy
– Accept image name and cluster name as
parameters
– Deploy image to K8s cluster
41. Pipeline Function Flow
public class PipelineFunction {
public void pipeline(String cluster) {
Flow fl = Flows.currentFlow();
FlowFuture<HttpResponse> pipeline =
fl.invokeFunction("./build", HttpMethod.POST, Headers.emptyHeaders(), input.getBytes())
.thenApply(HttpResponse::getBodyAsBytes)
.thenCompose((image) ->
fl.invokeFunction("./deploy", HttpMethod.POST, Headers.emptyHeaders(),
(cluster + " " + new String(image)).getBytes()))
.exceptionally((err) -> { throw new RuntimeException("Pipeline error:" + err); });
}
}
fn deploy -app ojetpipeline
curl http://localhost:8080/r/ojetpipeline/pipeline -d "google-cloud-k8s-dev"
42. Containers and Database
• Does not make sense for enterprise systems in terms of DevOps
– Data and PL/SQL code should be separated
• Containers are good for upper layers of the system (middleware,
UI)
– Configuration properties are handled by the orchestration
engine (Kubernetes, Docker swarms, etc.)
• Database may work in containers for benefits such as scalability,
maintenance, abstraction from infrastructure, etc.
• Works perfectly for sample applications and test automation
43. Containers and SOA
• Containers/Kubernetes/Functions easily resolve
– Small loosely coupled services
– Handling of invocation traffic
– Process work flow
• Focus on implementing services and don't think about
composing them