0% found this document useful (0 votes)
11 views66 pages

Lecturer 9

The document provides an overview of cloud computing, including its services (IaaS, PaaS, SaaS), virtualization technologies, and orchestration tools like Kubernetes and Docker. It discusses the advantages and disadvantages of microservices and containerization, as well as the Twelve-Factor App methodology for building scalable applications. Additionally, it covers web services and their components, emphasizing the relationship between cloud computing and service-oriented architecture.

Uploaded by

chamikalak2001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views66 pages

Lecturer 9

The document provides an overview of cloud computing, including its services (IaaS, PaaS, SaaS), virtualization technologies, and orchestration tools like Kubernetes and Docker. It discusses the advantages and disadvantages of microservices and containerization, as well as the Twelve-Factor App methodology for building scalable applications. Additionally, it covers web services and their components, emphasizing the relationship between cloud computing and service-oriented architecture.

Uploaded by

chamikalak2001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

What is cloud Computing:

computing services such as servers, storage, databases,


networking, software, analytics, and more over the Internet
(“the cloud”).
- Microsoft Azure
Technology Innovations

Clustering
A cluster is a group of independent IT resources that are interconnected and work as a single system.

Grid Computing
A computing grid (or "computational grid") provides a platform in which computing resources are organized
into one or more logical pools.Its loosely coupled and distributed.

Virtualization
Virtualization represents a technology platform used for the creation of virtual instances of IT resources.
Cloud computing service models

● Infrastructure As A Service. (IAAS)


● Platform As A Service. (PAAS)
● Software As A Service. (SAAS)
SaaS examples and common use cases.

Google Apps

Salesforce

Workday
Replaces traditional on-device
Concur software

Citrix GoToMeeting

Cisco WebEx
PaaS examples and common use cases.
Windows Azure

Google App Engine


Increases developer productivity and
Heroku utilization rates while also decreasing
an application’s time-to-market
Cloud Foundry

Apprenda

AWS Elastic Beanstalk


IaaS examples and common use cases.

Amazon Web Services


(AWS)
Extends current data center
Cisco Metapod
infrastructure for temporary workloads
Microsoft Azure (e.g. increased Christmas holiday site
traffic)
Google Compute Engine
(GCE)

Joyent
Cost

Speed

Global Scale
Why cloud
Productivity
computing?
Performance

Reliability
Scaling
Represents the ability of the IT resource to handle increased or decreased usage demands.

● Horizontal Scaling - scaling out and scaling in

● Vertical Scaling - scaling up and scaling down

On Demand scaling
● Security Vulnerabilities
● Control
Is cloud that ● Limited Portability Between
Cloud Providers
much ● Multiregional Regulatory
awesome? and Legal Issues
Create your own cloud.
Seriously !!!
OpenStack
Build and manage private and public clouds (Link)

Compute
Networking
Storage
Identity
Image service

Isn't OpenStack just a virtualization management platform?


No
Virtualization
What is ?
Virtualization is the process of running a virtual instance
(server, desktop, operating system, file, storage) of a
computer system in a layer abstracted from the actual
hardware.
VM?

Are self-contained units that administrators can easily move from one
physical computer to another, greatly simplifying the process of deploying
network applications and services.

Hypervisor?

Is responsible for abstracting the computer’s physical hardware and


creating multiple virtualized hardware environment.
Virtualization architectures
● Type 1 (Hardware-based virtualization)

In here the hypervisor is an abstraction layer that interacts directly with the computer’s
physical hardware. Also no host OS shares processor time with the hypervisor.

Eg- VMware vSphere / ESXi, Hyper-V, Xen / Citrix XenServer ,KVM


● Type 2 (Operating system base virtualization)

In this arrangement hypervisor runs on top of a host OS. By using this one, you create a
virtual hardware environment for each VM. The host OS then shares access to the computer’s
processor with the hypervisor, with each taking the clock cycles it needs and passing control of the
processor back to the other.

Eg - VMware Workstation/Fusion/Player, Oracle VM VirtualBox, Microsoft Virtual PC


Containerization

containerization is an OS-level virtualization method for deploying and


running distributed applications without launching an entire virtual machine
for each application. Instead, multiple isolated systems, called containers,
are run on a single control host and access a single kernel.
Advantages of containerization

● Standardization

● Flexibility

● Costs

● Velocity

● Security and safety


Disadvantages of containerization

● Site constraints

● Capital intensiveness

● Stacking

● Theft and losses

● Repositioning
Containerization vs Virtualization
Containerization Virtualization

Represent Operating System Represent hardware-level


virtualization virtualization

Native performance Limited performance

Lightweight Heavyweight

Real-time provisioning and Slow provisioning


scalability

Process level isolation and hence Fully isolated and hence more
less secure secure
Docker and
Docker compose
What is Docker
● Docker is a tool designed to make it easier to create, deploy, and run
applications by using containers. Containers allow a developer to
package up an application with all of the parts it needs, such as
libraries and other dependencies, and ship it all out as one package.
● Docker is open source.
● Using Docker containers, everything required to make a piece of
software run is packaged into isolated containers. Unlike VMs,
containers do not bundle a full operating system - only libraries and
settings required to make the software work are needed.
Who is Docker for? Architecture of Docker container

For developers

Can focus on writing code without


worrying about the system that it will
ultimately be running on.

For operations staff

Docker gives flexibility and potentially


reduces the number of systems needed
because of its small footprint and lower
overhead
Docker Commands
Command Description

docker images List images

docker ps List containers

docker rm Remove one or more containers

docker rmi Remove one or more images

docker kill Kill one or more running containers

docker build Build an image from a Dockerfile

docker attach Attach local standard input, output, and error streams to a running container
Dockerfile
● text document that contains all the commands a user could call on the command line to
assemble an image
● Dockerfile will define what goes on in the environment inside your container.
● The advantage of a Dockerfile over just storing the binary image is that the automatic
builds will ensure you have the latest version available.

Docker Image
● An image is an inert, immutable, file that's essentially a snapshot of a container.
Images are created with the build command, and they'll produce a container when
started with run.
Dockerfile ●


The first part is the FROM command, which tells
us what image to based this off.

The WORKDIR instruction sets the working


directory for any RUN, CMD,ENTRYPOINT,
COPY and ADD instructions that follow it in the
# Use an official Python runtime as a parent image Dockerfile.
FROM python: 2.7-slim
# Set the working directory to /app ● The ADD instruction copies new files, directories
WORKDIR /app or remote file URLs from <src> and adds them to
# Copy the current directory contents into the container at the filesystem of the image at the path <dest>.
/app (Ex: ADD <src>... <dest>)
ADD . /app
# Install any needed packages specified in requirements.txt ● The RUN instruction will execute any commands
RUN pip install -r requirements.txt in a new layer on top of the current image and
# Make port 80 available to the world outside this container commit the results.
EXPOSE 80
# Define environment variable ● The EXPOSE instruction informs Docker that the
ENV NAME World container listens on the specified network ports at
# Run app.py when the container launches runtime.
CMD ["python" , "app.py" ]
● The ENV instruction sets the environment variable
<key> to the value <value>.

● The main purpose of a CMD is to provide defaults


for an executing container.
Docker compose
● Compose is a tool for defining and running multi-container Docker applications. With
Compose, we use a Compose file to configure your application’s services.
● In a distributed application, different pieces of the app are called “services.”
● A service only runs one image
● Service codifies the way that image runs—what ports it should use, how many replicas of
the container should run so the service has the capacity it needs, and so on
● Docker-compose.yml file help to define services
● A docker-compose.yml file is a YAML file that defines how Docker containers should
behave in production.
Orchestration Tools
Why Orchestration?

As cloud environment become more complex and


organization seek greater benefits from their computing
resources, the need for orchestration across the entire
environment become even more important.
What is Orchestration?
Cloud orchestration describe that the arrangement and
coordination of automated tasks, ultimately resulting in a
consolidated process or workflow.

Advantages
● Efficiency
● Control
● Scalability
Orchestration Tools Examples
● Docker swamp
○ https://docs.docker.com/docker-for-windows/install/
● Apache Mesos
○ http://mesos.apache.org/downloads/
● Openshift -> when it come to local use Minishift
○ https://github.com/minishift/minishift/releases
● Kubernetes -> when it come to local use Minikube
○ https://github.com/kubernetes/minikube/releases
Kubernetes
Kubernetes is the best tool for managing containerized
application available today, Minikube is the local version
of Kubernetes.
Minikube supports Kubernetes features such as,
● DNS
● NodePorts
● ConfigMaps and Secrets
● Dashboard
● Container Runtime
● Enabling CNI (Container Network Interface)
● Ingress
Kubernetes
Kubernetes has its own vocabulary which, once you get used to it, gives you some sense of how things
are organized. These terms include:

Pods: Pods are a group of one or more containers, their shared storage, and options about how to run
them. Each pod gets its own IP address.
Labels: Labels are key/value pairs that Kubernetes attaches to any objects, such as pods, Replication
Controllers, Endpoints, and so on.
Annotations: Annotations are key/value pairs used to store arbitrary non-queryable metadata.
Services: Services are an abstraction that defines a logical set of Pods and a policy by which to access
them over the network.
Replication Controller: Replication controllers ensure that a specific number of pod replicas are running at
any one time.
Secrets: Secrets hold sensitive information such as passwords, TLS certificates, OAuth tokens, and ssh
keys.
ConfigMap: ConfigMaps are mechanisms used to inject containers with configuration data while keeping
containers agnostic of Kubernetes.
Kubernetes Cont...
Openshift
Openshift is cloud development Platform As A Service in
RedHat. It is open source cloud based platform.
Minishift is single-node and local platform of Openshift for
your virtual machine.
Web Services
Cloud Computing and Web Services

Relationships among Web Services, Service Oriented Architecture and Cloud


Computing.
A Web Service,
● Is available over the internet or (Intranet) networks.
● Uses a standardized XML messaging system.
● Is not tied to any one operating system or programming language.
● Is self describing via a common XML grammar.
● Is discoverable via a simple find mechanism.

Components of Web Services

● SOAP (Simple Object Access Protocol)


● UDDI (Universal Description , Discovery and Integration)
● WSDL (Web Services Description Language)
Web Services Features

● Machine to machine interaction


● Loosely coupled
● Interoperability – Ability of the service to be invoked by any
potential client of the service
● Platform independence
● Web services are modular – Simple web services can be
aggregated to form more complex web services
● Web services are self describing – The client and server only
need to recognize the format and content of request and
response messages
Web Service Description Language
Major elements of WSDL
Sample WSDL Document
<definitions> element

● Root element of the WSDL document


● Contains all other elements define in the document
● Sets the name of the WSDL document and declares the namespaces used in the document

<types> element
● Contains schema definitions of the data types used in the messages that compose the
service
● WSDL uses XML schema syntax to define data types

<Port> element

● A port defines an individual endpoint by specifying a single address for a


binding
● Each port has a unique name and binding attribute
● A web service may be accesssible on many ports
● A port must not specify more than one address
<Message> element

● There is an input or request message, which is sent from the client to the service and there is
output or response message which is sent back the opposite way
● Each <Message> element contains one or more <part> elements

<Binding> element

● Binding mechanism is used to attach a specific protocol, data format or structure to an


abstract message, operation or endpoint
● Binding must specify exactly one protocol

<Service> element

● Defines the ports supported by the web service


● For each of the supported protocols there is one <port> element, service element is a
collection of ports
● Includes a documentation element to provide human - readable documentation
How Does a Web Service Work?
A web service enables communication among
various application by using open standards
such as HTML, XML, WSDL, and SOAP.

● XML to tag the data.


● SOAP to transfer a message.
● WSDL to describe the availability of service.
Service Oriented Architecture

A service-oriented architecture is essentially a collection of services. These services


communicate with each other. The communication can involve either simple data
passing or it could involve two or more services coordinating some activity. Some
means of connecting services to each other is needed.
Micro service architecture
and The twelve-factor apps
What are microservices
● Microservices - also known as
the microservice architecture.
● It is an architectural style that
structures an application as a
collection of loosely coupled
services, which implement
business capabilities.
● The microservice architecture
enables the continuous
delivery/deployment of large,
complex applications.
● It also enables an organization to
evolve its technology stack
What are microservices cont...
Advantages of microservices
● Microservice architecture gives developers the freedom to independently
develop and deploy services
● A microservice can be developed by a fairly small team
● Code for different services can be written in different languages.
● The developers can make use of the latest technologies
● Starts the web container more quickly, so the deployment is also faster
● When change is required in a certain part of the application, only the related
service can be modified and redeployed—no need to modify and redeploy
the entire application
● Better fault isolation: if one microservice fails, the other will continue to work
● Easy to scale and integrate with third-party services.
Disadvantages of microservices
● Due to distributed deployment, testing can become complicated and
tedious
● Increasing number of services can result in information barriers
● The architecture brings additional complexity as the developers have to
mitigate fault tolerance, network latency, and deal with a variety of
message formats as well as load balancing
● When number of services increases, integration and managing whole
products can become complicated
● Developers have to put additional effort into implementing the
mechanism of communication between the services
● Partitioning the application into microservices is very much an art
12 factor app
● Popular platform-as-a-service provider Heroku
maintains a manifesto of sorts called The
Twelve-Factor App.
● It outlines a methodology for developers to follow
when building modern web-based applications.
● The twelve-factor methodology can be applied to
apps written in any programming language, and
which use any combination of backing services
(database, queue, memory cache, etc).
12 factor app cont...
12 factor app - Config
● Anything that varies between deployments can be considered
configuration.
● Store all configuration in the environment, rather than committing it to
the repository.
● If we want to do any change, we just commit them to the config. Then
it will commit the change to all microservices in the application.
● Whenever a new node is added it will automatically get the latest
config file and commit the change.
● Example for configuration service which can be used in microservice
architecture are; spring config server, apache zookeeper, hashicorp
consul
12 factor app - Concurrency
● Scale out via the process model
● In a microservices architecture, we can horizontally scale each service
independently, to the extent supported by the underlying
infrastructure.
● As each process type is scaled independently, each logical process
would become its own Docker container as well.
● In most cases, scaling out simply means launching more instances of
the container.
12 factor app - Disposability
● Maximize robustness with fast startup and graceful shutdown
● Instances of a service need to be disposable so they can be started,
stopped, and redeployed quickly, and with no loss of data.
● Services deployed in Docker containers satisfy this requirement
automatically, as it’s an inherent feature of containers that they can be
stopped and started instantly.
12 factor app - Logs
● Treat logs as event streams
● Instead of including code in a microservice for routing or storing logs,
use one of the many good log‑management solutions on the market
● Example for centralized logging software is ELK (Elastic Logstack
Kibana).
12 factor app - Codebase
● A twelve-factor app is always tracked in a version control system,
such as Git, Mercurial, or Subversion. A copy of the revision tracking
database is known as a code repository, often shortened to code
repo or just repo.
● A codebase is any single repo (in a centralized revision control
system like Subversion), or any set of repos who share a root
commit (in a decentralized revision control system like Git). There is
always a one-to-one correlation between the codebase and the app.
● If there are multiple codebases, it’s not an app – it’s a distributed
system. Each component in a distributed system is an app, and
each can individually comply with twelve-factor.
● Multiple apps sharing the same code is a violation of twelve-factor.
The solution here is to factor shared code into libraries which can be
included through the dependency manager
12 factor app - Port binding
● The twelve-factor app is completely self-contained and does not
rely on runtime injection of a web server into the execution
environment to create a web-facing service.
● The web app exports HTTP as a service by binding to a port, and
listening to requests coming in on that port. this is about having your
application as standalone, instead of relying on a running instance of
an application server, where you deploy.
● Deploy to app container
● Standalone, but listens to specific ports
● Web server is part of app (node, netty)App exports HTTP as a service
12 factor app - Dev/prod parity
● Historically, there have been substantial gaps between development (a developer making live
edits to a local deploy of the app) and production (a running deploy of the app accessed by end
users). These gaps manifest in three areas:
● The time gap: A developer may work on code that takes days, weeks, or even months to go into
production.
● The personnel gap: Developers write code, ops engineers deploy it.
● The tools gap: Developers may be using a stack like Nginx, SQLite, and OS X, while the
production deploy uses Apache, MySQL, and Linux.
● The twelve-factor app is designed for continuous deployment by keeping the gap between
development and production small. Looking at the three gaps described above:
● Make the time gap small: a developer may write code and have it deployed hours or even just
minutes later.
● Make the personnel gap small: developers who wrote code are closely involved in deploying it
and watching its behavior in production.
● Make the tools gap small: keep development and production as similar as possible.
12 factor app - Dev/prod parity

● The process formation is the array of processes that are used to do the
app’s regular business (such as handling web requests) as it runs.
Separately, developers will often wish to do one-off administrative or
maintenance tasks for the app.
● One-off admin processes should be run in an identical environment as the
regular long-running processes of the app. They run against a release,
using the same codebase and config as any process run against that
release. Admin code must ship with application code to avoid
synchronization issues.
● Edit database entries manually
● Store migration scripts in repo
● Use framework’s tooling
12 factor app - Dependencies

Explicitly declare and isolate dependencies.


● Declare dependencies in a manifest
● Use isolation tools
● Specific versions are important
● Avoid shelling and unbounded system tools
12 factor app - Backing Systems
Treat backing services as attached resources

What is the backing service?


● Datastore
● SMTP
● Caching systems
● Amazon S3

Make no distinction between local and third party services


12 factor app - Build, Release, and Run

BUILD = CODE + DEPENDENCIES +ASSETS


RELEASE = BUILD + CONFIG
RUN = run process against RELEASE

● Strict separation between stages


● Cannot change code at run time
● Rollback = just use the last release instead
● Release has unique release ID
12 factor app - Processes

● Does the running of the release


● Is stateless
● Shares nothing with other processes
● Uses single transaction only caches
● Session db storage ...over sticky sessions
● Asset pre-compilation ...over runtime calculation

You might also like