<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>IWSG</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>MiCADO - Towards a Microservice-based Cloud Application-level Dynamic Orchestrator</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Hannu Visti</string-name>
          <email>H.Visti@westminster.ac.uk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Tamas Kiss</string-name>
          <email>T.Kiss@westminster.ac.uk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Gabor Terstyanszky</string-name>
          <email>G.Z.Terstyanszky@westminster.ac.uk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Gregoire Gesmier</string-name>
          <email>G.Gesmier@westminster.ac.uk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Stephen Winter</string-name>
          <email>S.C.Winter@westminster.ac.uk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Centre for Parallel Computing, University of Westminster</institution>
          ,
          <addr-line>London, UK (H.Visti, T.Kiss, G.Z.Terstyanszky,G.Gesmier</addr-line>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2016</year>
      </pub-date>
      <volume>8</volume>
      <fpage>8</fpage>
      <lpage>10</lpage>
      <abstract>
        <p>-In order to satisfy end-user requirements, many scientific and commercial applications require access to dynamically adjustable infrastructure resources. Cloud computing has the potential to provide these dynamic capabilities. However, utilising these capabilities from application code is not trivial and requires application developers to understand low-level technical details of clouds. This paper investigates how a generic framework can be developed that supports the dynamic orchestration of cloud applications both at deployment and at run-time. The advantages and challenges of designing such framework based on microservices is analysed, and a generic framework, called MiCADO - (Microservices-based Cloud Application-level Dynamic Orchestrator) is proposed. A first prototype implementation of MiCADO to support data intensive commercial web applications is also presented.</p>
      </abstract>
      <kwd-group>
        <kwd>Cloud applications</kwd>
        <kwd>application-level orchestration</kwd>
        <kwd>microservices-based architectures</kwd>
        <kwd>container technologies</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>I. INTRODUCTION</title>
      <p>Many scientific and commercial applications require access to
computation, data or network resources based on dynamically
changing requirements. Applications running on distributed
computing infrastructures, such as grids or clouds, typically fall
into this category. End-users can access these applications via
desktop or web-based high-level user interfaces, such as science
gateways. When executing applications or accessing services via
high-level user environments, users and providers both require
these applications or services to dynamically adjust to
fluctuations in demand and serve end-users at required quality of
service and speed, and also at optimized cost. The challenge of
developing such dynamically adaptable applications without
requiring application developers to deal with low level details of
the underlying distributed computing infrastructure is the topic
of this paper.</p>
      <p>
        One of well-documented benefits of cloud computing [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] is its
ability to supply a variable amount of resources (computational
power, storage, network capacity), which can scale dynamically
up and down, forming the supply side of figure 1. On the
demand side, we can see applications that are likely to be
formed of one or more services. Services can be either in-house
developed or provided by external suppliers or open-source
communities. Services could also be shared between
applications.
      </p>
      <p>Services consume baseline resources that can be defined as
resources consumed by the component in idle state. Variable
resources are consumed when the component performs its
duties. This can include heavy computation or storage based on
application use, which can vary significantly based on the nature
of the application.</p>
      <p>Application 1</p>
      <p>Application 2</p>
      <p>Fig. 1: Resource demand and supply of cloud applications
Overall resource demand is the sum of baseline and variable
components, and the presence of a variable component makes
the overall resource demand variable as well. IaaS
(Infrastructure as a Service) clouds are elastic and have the
ability to supply a variable amount of resources. However,
applications need to be specifically programmed in order to
utilise this elasticity and dynamically vary the amount of
resources provided. Customising dynamic provision for each
application individually for a specific cloud environment is
costly to do. Our ultimate aim is to implement a generic service
or layer that provides this functionality for any application
automatically, and in a cloud resource agnostic way.
As shown in Figure 1, cloud service providers are indifferent to
the resource needs of applications since they have no means of
predicting application capacity demand behaviour. In practice,
the operator of an application requests cloud resources based on
static predictive estimates (typically, worst-case estimates), but
after being commissioned, these resources remain static without
operator intervention. If demand exceeds supply at a given point
of time, applications do not function within their required
parameters. If supply exceeds demand, resources are wasted,
which generally has a cost impact.
This work investigates possibilities of replacing manually
adjusted supply of cloud services with an automatically adjusted
supply, as also illustrated in Figure 1. The aim is to create a
framework, where automatically adjusted cloud service supply
can be arranged, based on application component demands.
Such framework would allow cloud application developers to
build cost and performance optimization mechanisms into their
application code through a high-level API.</p>
      <p>The suggested solution is based on microservices and their
dynamic orchestration in a cloud computing environment. The
rest of this paper defines a generic microservices-based
architecture for application-level cloud orchestration, called
MiCADO (Microservices-based Cloud Application level
Dynamic Orchestrator), and describes its first prototype
implementation utilizing container-based open source cloud
technologies.</p>
    </sec>
    <sec id="sec-2">
      <title>II. RELATED WORK</title>
      <p>
        The problem of application-level orchestration has been
recognized and a number of solutions have been designed and
implemented. Marpaung et al. [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] discuss Altocumulus,
AppScale, Cloudify and mOSAIC. Altocumulus focuses on
deploying web applications to variety of public clouds, which
limits its usability in private or hybrid clouds. It does not
provide monitoring or dynamic changes to services. AppScale is
an open-source product that supports execution of Google
Application Engine applications and therefore restricted to this
particular technology. mOSAIC provides a set of APIs to
application developers to tackle cloud deployment issues. The
limitation of mOSAIC is the implementation of these APIs; the
application developer needs to integrate these to application
components.
      </p>
      <p>
        Cloudify [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] combines a TOSCA editor with deployment and
orchestrator. It provides access to multiple clouds and a
complete framework to describe microservices and execute them
either in Docker containers or on cloud metal. Cloudify also
provides dynamic service upscaling and downscaling based on
microservice dependent parameters, for example number of
transactions, number of threads, etc. Cloudify does not provide a
container portability framework, nor do its metrics span
dockerised microservices and the cloud metal executing them.
Pham, Tchana et al. discuss the problem of distributed
applications [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. They focus on application orchestration that can
span several different clouds. They recognize the need to deliver
microservice-specific parameters, for example port numbers and
IP addresses, to other microservices, and provide a description
language framework to do this. However, this solution does not
support service discovery tools and dynamic relocation of
microservices.
      </p>
      <p>
        Amazon CloudFormation [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] provides to system administration
developers an easier way for the collection, creation and
management of related AWS resources through templates. These
templates describe the AWS resources and associated
dependencies. After the deployment of AWS resources,
CloudFormation ensures the start of services in the correct order.
OpenTosca [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] provides an open source ecosystem for the
OASIS Topology and Orchestration Specification for Cloud
      </p>
      <p>Applications developed by Stuttgart University. OpenTosca is
divided into three parts: a TOSCA runtime environment
(OpenTosca container), a graphical modelling TOSCA tool
(Winery) and a self-service portal for the application available in
the container (Vinothek).</p>
      <p>Although effective in particular narrow circumstances, none of
these systems provide a fully-automated, cloud-agnostic solution
for all, or even a wide range of applications and for wide variety
of clouds.</p>
      <p>III. OPPORTUNITIES AND CHALLENGES OF MICROSERVICE-BASED</p>
      <p>ARCHITECTURE DESIGN IN CLOUDS
In order to support application-level orchestration and dynamic
resource provision in clouds, a microservices-based architecture
is proposed. This section highlights the motivations behind this
approach and collects challenges that the architecture design
needs to overcome.</p>
      <p>
        Software design based around microservices, in contrast to a
traditional monolithic architecture, is a relatively new concept,
and the literature does not yet have an agreed definition for
microservices. According to Newman “Microservices are small,
autonomous services that work together”. His definition includes
further characteristics, chiefly “focused on doing one thing well”
and being “autonomous” [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. Balalaie et al write “Microservices
is [sic] a new architectural style [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] that aims to realize software
systems as a package of small services, each deployable on a
different platform, and running in its own process while
communicating through lightweight mechanisms like RESTFull
APIs.”
Both Newman and Balalaie et al. see microservices mainly as an
agile development concept. A small, focused team can develop
one component of an application independently and deploy new
versions without changes to other components. In this paper, we
focus on deployment of microservices-based architecture, where
connectivity between microservices becomes challenging.
Cloud computing is a natural platform for microservices.
Microservices achieve decoupling of independent components
from a monolithic application. Clouds enable execution and
resource allocation of these independent components based on
their specific needs. One microservice might require a lot of
storage while another could be CPU-intensive. Cloud execution
offers the possibility to optimise resource allocation, and thus
resource cost, dynamically. The alternative would be to allocate
a monolithic infrastructure, the size of which would be large
enough for a worst-case requirements scenario. However, for
most of the time, the worst-case scenario does not prevail and
allocated resources of the monolithic infrastructure are wasted.
As discussed earlier, microservices provide APIs to enable
communication with them, and rely on APIs of other
microservices to access other services, on which they are
depending. A typical API connection is a TCP (Transmission
Control Protocol) socket. To set up a TCP connection, the
connecting computer needs two parameters: the IP address of the
server host and a port number of the particular service on that
host. Many port numbers are defined either officially in RFCs
(Request For Comments), or by convention, and even in case of
a completely new service, the port number would remain static
within the particular architecture. The problem arises from
dynamic IP address allocation strategy employed by the cloud.
To form an API connection, the client application needs to know
the dynamically assigned IP address of the server host.
In a microservices-based architecture commissioned on cloud,
the IP address information may change during the life-cycle of
the application. In a microservices-based model, microservices
can and will be developed independently. Moreover, cloud
computing provides dynamic allocation of hardware resources.
From performance and financial optimisation, it would be
occasionally necessary to allocate more capacity by migrating a
microservice to a more powerful platform, or to consolidate less
regularly used microservices to a single platform and shutting
down some cloud capacity. By doing this, the IP address of the
server host would change.
      </p>
      <p>An additional challenge arises if multiple microservices
providing the exact same service are deployed on the same host.
If the service API is provided in an established port, only one of
the microservices could occupy this, and the others would need
to be remapped. This would normally require changes to a
configuration file. For example, if a single cloud instance hosted
three MySQL implementations, only one of them could use the
default port 3306. Running the other two would require
configuration file changes, including additional changes to
configuration files and service start-up scripts to assign a
different location to data and configuration files.</p>
      <p>One workaround would be to ensure that only one microservice
of a kind could run on each cloud instance. This would remove
the need to reconfigure port numbers and file locations, but it
might waste resources if new cloud instances would be needed
just for this purpose. Moreover, this would require building an
additional coordination layer to keep track of running cloud
instances and currently running microservices, to be used to
allocate new microservices to cloud instances where such
microservices do not currently run. It would also be entirely
possible for two different services to occupy the same network
port. While not common, there is no mechanism or policy that
would prevent this, especially if microservices came from
different sources and their development were independent. Thus,
the aforementioned mapping would need to consider network
services as well as file system locations to ensure there is no
overlap between two microservices designed to share the same
cloud instance. In Section V we will show such steps are
unnecessary.</p>
      <p>Obtaining benefits from the dynamic nature of cloud requires an
understanding of current and/or predicted resource usage, and
the possibility to scale infrastructure up or down on demand. A
mechanism is needed to analyse usage, allocate microservices to
cloud instances best suited to serve them, and allow optimisation
based on given parameters, such as performance or cost.
Microservices can set different requirements to physical cloud
instances and resources based on the nature of the service. For
example, an authentication service would require little CPU
power or storage, an HTTP application server would require
considerable CPU power but little storage, and a database server
could require both powerful computation and storage
capabilities.</p>
      <p>Setting up a static microservices based architecture on cloud
would be possible manually, by designing the correct launch
order of services, and configuring manually IP addresses of the
already started services to those depending on them. If more
capacity were needed or any changes to the infrastructure were
initiated by changes in cloud services provisioning, an operator
would need to reconfigure microservices API information
manually. This could in many cases lead to suboptimal service
performance or waste, as from cost and workload management
viewpoint it might be easier to react to changed requirements
only when absolutely necessary. Automated monitoring and
control could thus enhance benefits enabled by the use of cloud
and microservices.</p>
      <p>The above detailed challenges can be summarized as follows:
C1. Discovery of IP addresses and port numbers of running
microservices.</p>
      <p>C2. Ability to run several microservices of the same kind on a
single cloud instance.</p>
      <p>C3. Allocation of microservices to cloud instances based on
available resources.</p>
      <p>C4. Restriction mechanism to ensure microservices can only be
allocated to cloud instances that have the functionality and
capabilities of serving them.</p>
      <p>C5. Ability to dynamically scale up and down. If cloud
infrastructure usage exceeds given parameters, the condition
must be detected and more cloud resources need to be
allocated.</p>
      <p>This work proposes an architecture that helps mitigate the
aforementioned challenges. The approach is also agnostic to
chosen applications, cloud providers, and microservices needed
to provide applications.</p>
    </sec>
    <sec id="sec-3">
      <title>IV. MICADO – THE PROPOSED SOLUTION</title>
      <p>
        The proposed solution places microservices in lightweight
virtualisation containers in worker nodes. These containers can
be hosted on any of the different worker nodes, and one node
can run one or more containers. An orchestration and
coordination mechanism is required to enable service discovery
and performance management. The overall MiCADO
(Microservices-based Cloud Application level Dynamic
Orchestrator) architecture is illustrated in Figure 2. The solution
takes the following overall approaches to challenges identified
in section III:
C1. To address dynamic discovery of IP addresses and ports,
use a service discovery framework. Several such
frameworks exist, for example Consul [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], Zookeeper [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]
and Etcd [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ].
      </p>
      <p>
        C2. To enable deployment of several microservices of the same
kind on the same instance, use kernel namespace based
lightweight virtualisation solution to run microservices in
containers. These solutions (for example Docker [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] built
on Linux containers) provide separation of application files
and allow port mapping functionality to masquerade
standard microservice API ports to dynamically allocated
ones.
      </p>
      <p>C3. To support the allocation of microservices to cloud
instances based on available resources, form a cluster of
worker nodes that is aware of the capacity and status of each
node, and is able to make service allocation decisions based
on a documented logic.</p>
      <p>C4. The chosen clustering mechanism must be aware of the
hardware configuration of cloud instances, and allow
constraints to be set to limit automatic allocation decisions
(C3) to those nodes that have the requisite physical
capabilities, for example a public IP address, to serve a
particular microservice.</p>
      <p>C5. To support automatic scaling up and down, the cluster needs
to have an alert mechanism, to help cluster management
detect nodes and services that exceed thresholds or nodes
that appear to be underutilised. Decision-making logic
needs to be programmed based on this information or
obtained within a software component. The logic needs to
have interfaces to clouds to start and shut down instances,
and to container start-up and shutdown mechanisms.
MiCADO
Based on the above described generic approaches to handle the
five identified challenges, the following layered architecture is
proposed for the application level orchestration of cloud
applications. The layers in the box entitled MiCADO represent
the actual orchestration architecture. Layers below MiCADO
provide access to cloud resources, while the top layer represents
actual applications to be optimized. The layers in Figure 2 are
described from bottom to top.
1) Cloud infrastructure layer. This layer contains cloud
instances, which in turn run containers that execute actual
microservices. One instance can run one or more containers.
2) Cloud interface layer. This is a set of APIs that provides
means to launch and shut down cloud instances. There can
be one or more cloud interfaces to support multiple clouds.
Either native interfaces of targeted clouds can be applied
(e.g. EC2) or generic cloud access layers that provide access
to multiple heterogeneous clouds.
3) Microservices orchestration layer. This is divided into
four sub-layers.
a) Cloud interface API. This layer is needed to abstract
cloud access from the layers above. Cloud access APIs
can be complex interfaces, as they typically cater for a
large number of services provided by the cloud
provider. On the other hand, the microservices
execution and coordination logic layers (see 3b and 3c)
only need to shut down and start instances. Abstracting
this to a cloud interface API simplifies the
implementation of the aforementioned layers, and
equally, if new Cloud access APIs are implemented,
only this layer needs to change.
b) Microservices coordination logic layer. With large
infrastructures, and to reap the benefits from
cloudbased execution, it becomes necessary to understand
how the current execution environment is performing.</p>
      <p>Information needs to be gathered and processed. If
bottlenecks are detected or the currently running
infrastructure appears underutilised, it may be
necessary to either launch or shut down cloud
instances, and possibly move microservices from one
physical worker node to another.
c) Microservices discovery and execution layer. This layer
manages the execution of microservices and keeps
track of services running. Execution management
combines both start-up and shut-down of
microservices. Service management gathers
information about currently running services.
Information gathered includes service name, IP address
and port where the service is reachable, and optional
service tags to help in service coordination.
d) Coordination interface API. This layer provides access
to orchestration control and decouples the orchestration
layer from the application infrastructure definition. This
set of APIs enables application developers to utilise the
dynamic orchestration capabilities of the underlying
layer and support the convenient development of
dynamically and automatically scalable cloud-based
applications.
4) Application infrastructure definition layer. This forms
the basis for creating a functional application infrastructure.
At this level, software components and their requirements
as well as their interconnectivity are defined. This layer
does not contain any application-specific data. For example,
to provide HTTP based services, this layer can define that to
provide this functionality, a MySQL database, Apache
HTTP server and Nginx proxy server are needed, and that
Nginx needs connection to Apache, which in turn needs
connection to MySQL. As the infrastructure is agnostic to
the actual application using it, this definition can be shared
with any application that requires such an environment.
5) Application layer. This layer contains actual application
code and data to make an incarnation of a defined
application infrastructure (4) function in such a way that the
desired functionality is achieved. For example, this layer
could populate a database with initial data, and configure an
HTTP server with both look and feel and application logic.</p>
    </sec>
    <sec id="sec-4">
      <title>V. MICADO REFERENCE IMPLEMENTATION</title>
      <p>
        A prototype of the proposed MiCADO architecture has been
implemented via a combination of open-source tools and
inhouse developed extensions, as is illustrated in Figure 3.
Although it would be possible to develop a platform to
implement MiCADO functionality from scratch, reusing and
utilizing existing open-source components has significantly
speeded up the implementation process. As a restriction, this
first MiCADO prototype does not include Cloud interface and
Coordination interface APIs. The Coordination interface API is
replaced by a simple command line, and the Cloud interface API
is represented by direct calls towards the cloud access layer (in
this case the CloudBroker Platform [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]). Moreover,
instead of a generic approach towards infrastructure definition, a
concrete architecture has been realized implementing a real-life
case-study. Applying these limitations, a proof-of-concept
implementation has been completed to justify the validity of the
proposed approach when handling the five challenges detailed in
section III. For infrastructure management and orchestration the
[
        <xref ref-type="bibr" rid="ref21">21</xref>
        ]. An installation of the platform that is operated by the
CloudSME European Project [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ] was utilized in our
experiments. Using the CloudBroker Platform, even this very
first MiCADO implementation is capable of interfacing with a
large variety of clouds without further cloud interface plug-in
development.
      </p>
      <p>For cloud instances, an Ubuntu 14.04 image was prepared with
Docker, Consul, Swarm and Registrator installed. The
CloudBroker platform provides a mechanism for preparing such
images to be later launched in participating clouds. In addition to
pre-installed applications, the cloud image needs a start-up script
to initialise and launch the above mentioned tools. Consul and
Docker create, upon initial start, random identifiers to
distinguish between nodes in the same cluster. When a cloud
instance launches the first time, it needs to remove these
identifiers to force initialisation.</p>
      <p>Customer 1 app</p>
      <p>Customer 2 app</p>
      <p>Customer 3 app
Nginx, Node.js stack, MongoDB</p>
      <p>Another application infrastructure
g
n
i
itr
o
n
o
M</p>
      <p>Coordination interface API (Built in-house)
Microservices discovery and execution layer (built in-house)
Microservices coordination logic layer (Docker + Swarm)</p>
      <p>Cloud interface API (Built in-house)
following tools have been selected to implement the previously
described MiCADO layers.</p>
      <p>
        Microservices discovery layer was implemented based on
Consul [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. Consul is an open-source service discovery tool
that also includes health check and alerts functionality. An
additional component, Registrator [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] is used on worker nodes
to register information on running containers to Consul.
Consul agents can work either in a server or serf role [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ].
Servers keep track of events happening in the network and
notify other servers of changes, while serfs create a server
connection and maintain a list of backup servers. Consul servers
create network overhead by communicating between themselves
using Consensus protocol [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ]. In large environments, most
nodes should be configured as serfs to minimise this traffic. In
the proof of concept example, the master and all nodes are
configured as servers, to keep node configurations identical.
When a Consul agent starts, it needs to connect to an existing
network. This can be provided either by a specific Consul server
set in bootstrap mode, by connection to a node or set of nodes
already running Consul, or by connection to Atlas service [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ].
Atlas is a service that registers running Consul infrastructures
based on a secret token. When a Consul agent configured to use
Atlas starts, it registers itself with the service and queries for
other nodes already present. The service is provided via a REST
API, making it easy to use from firewalled networks. The first
node registering does not receive anything. When the second
node joins the infrastructure, it registers itself and receives in
response the details of the first node, allowing it to initialise
connection to it. When a server finds one Consul server, it
communicates with it and shares information about the entire
network. Thus, a Consul network does not need to be described
in nodes, only the bootstrap information needs to be present.
Registrator is started on all worker nodes. Registrator is a helper
process to Consul that registers all running Docker containers to
it. Registrator runs in a Docker container itself, and it can be
started either locally or via the Swarm launch mechanism. The
roles of Docker and Swarm will be explained in detail under the
Microservices coordination logic layer.
      </p>
      <p>
        Microservices coordination logic layer was implemented
based on Docker and Swarm [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ]. Swarm is a clustering
mechanism built on Docker that is aware of worker nodes and
their current workload, and is able to allocate new containers to
the node currently least used. Docker and Swarm allow the
capability of giving worker nodes “tags” to enable the use of
constraints. For example, giving a different tag to nodes with a
lot of disk space allows allocation of database containers to
these particular nodes, while worker nodes tagged for proxy use
will have a public IP address. To fulfil requirement C4, worker
nodes are tagged with their roles. The tags used in the current
application scenario are proxy, application and database (see
Application infrastructure definition layer later on). This tag is
set in the Docker start-up configuration file.
      </p>
      <p>Cloud Access API layer is represented by calls to the
Cloudbroker Platform. The Cloudbroker Platform is a
production level tool developed by a CloudBroker GmbH that
allows interfacing to various commercial IaaS clouds, for
example Amazon and CloudSigma, and also to private cloud
infrastructures based on Openstack, OpenNebula and Eucalyptus</p>
      <p>
        Fig. 3: MiCADO reference implementation
Application infrastructure definition layer currently
implements one particular topology based on a specific set of
use-cases provided by Outlandish LLP [
        <xref ref-type="bibr" rid="ref24">24</xref>
        ]. Outlandish is a
small employee-owned digital agency specialising in
middleware, usability, search and scalable data applications.
Outlandish develops and hosts various web applications for
multiple corporate clients. Usage estimates vary greatly between
applications and customers, and in some cases, usage activity
can be expected to vary greatly based on external triggers, such
as calendar, time of day, outside events and news. The company
wishes to serve its clients to agreed quality of service but also
tries to minimise its costs on the provision side. Therefore, a
cloud-based application deployment and hosting environment
that is capable of making such optimisation choices dynamically
at run-time is highly desired.
      </p>
      <p>A typical Outlandish application is formed of three components:
proxy servers with public IP address, application servers and
database servers, as illustrated in Figure 4. The concrete
implementation applies Nginx reverse proxy servers, Node.js
stacks for application servers, and MongoDB databases. This
set-up is generic for several Outlandish-developed and -hosted
applications and as a consequence, several application scenarios
and clients can be served based on this application pattern.
The currently implemented MiCADO prototype successfully
deploys the above described generic architecture for several
Outlandish applications into Docker containers, clusters these
containers based on Swarm, and provides the required service
discovery mechanism via Consul and Registrator. Outlandish
Public IP</p>
      <p>Private IP
application developers need only provide the application code
and the corresponding Docker configuration files. The optimised
deployment to available cloud instances is managed by
MiCADO. Therefore, the implemented solution successfully
addresses challenges C1-C3 (IP address and port number
discovery, running same kinds of microservices on a cloud
instance, and allocating microservices to cloud instances based
on available resources), and also by tagging the resources it
provides mechanisms to support C4 (allocate microservices to
specific instances that have the capabilities to serve these).
However, please note that this current prototype does not offer
run-time monitoring and automated optimisation capabilities
(C5) that is part of our future work.</p>
      <p>Internet
HTTP proxy1</p>
      <p>HTTP proxy 2</p>
      <p>HTTP proxy N
App server 1</p>
      <p>App server 2</p>
      <p>App server 3</p>
      <p>App server N
DB server 1</p>
      <p>Replication</p>
      <p>DB server 2
Fig. 4: Web-based application infrastructure example
implemented for the Outlandish use-cases
VI. DEPLOYING AND MANAGING APPLICATIONS WITH MICADO
Based on the above described first proof-of-concept reference
implementation of the MiCADO framework, a short overview
on how this implementation supports the deployment and
management of cloud applications is provided in this section.
Please note that the current implementation supports only
command-line access. However, the objective of our future
research is to develop a set of well-defined APIs that can be
conveniently embedded into desktop or web-based science
gateway solutions.</p>
      <p>
        Before an application developer can utilize MiCADO services,
certain infrastructure components need to be deployed and
setup by an administrator. A specific set of scripts has been
developed [
        <xref ref-type="bibr" rid="ref25">25</xref>
        ] that can be used to create and deploy the
necessary virtual machine images on the CloudBroker Platform.
MiCADO differentiates between two types of virtual machines:
manager and worker nodes. The manager node runs permanently
until the infrastructure is required and can be used to deploy or
terminate microservices running in containers, or cloud
instances. Worker nodes are hosting various Docker containers
running different microservices (e.g. applications, databases or
proxies, as illustrated in figure 4). Both manager and worker
node images include Docker, Consul and Swarm.
      </p>
      <p>In order to create a new MiCADO installation, the administrator
needs to launch a manager node instance through the
CloudBroker platform in the target cloud. Please note that as the
CB platform is used at the cloud access layer, the solution is
cloud-agnostic, and the manager node can be launched in any
targeted could in which an image has been created. Once the
manager node is launched, application developers can log-in to
this instance to manage their applications formed of multiple
microservices.</p>
      <p>
        Application developers first need to create a Docker image of
the specific microservice they want to deploy (for this process
no specific support is provided currently in MiCADO). This
Docker image is then uploaded to a private Docker registry
operated by the CloudSME project. In order to launch a new
Docker container with a required image, application developers
need to execute a Python script from [
        <xref ref-type="bibr" rid="ref25">25</xref>
        ] providing the name of
the image and the type of node (e.g. node with public IP address
for a Proxy server) as parameters. The container will be
launched to the least utilised node automatically by Swarm.
When a new container is launched, MiCADO checks whether
there is enough memory available on current cloud instances to
run the container. If there is not enough memory available, then
a new instance is launched automatically, and the launch of the
container will be held until the new cloud instance is up and
running on the infrastructure.
      </p>
      <p>The current MiCADO prototype also supports automated
downscaling of the infrastructure at run-time. There is a cron job
running continuously to determine if the infrastructure needs to
be downscaled. This cron job will first establish which instance
on the infrastructure is the least utilized. It will then list all the
running containers on the least utilized instance and get their
memory usage. The cron job will check if the memory usage on
the instance is less than the availability on the rest of the
infrastructure. If there is enough memory available on the other
running instances then it will check if each container can be
relocated on another instance. If the containers can be relocated
then these are launched on the other instances, the containers on
the least utilized instance are stopped and removed, and finally
the least utilized instance is stopped and removed from the
infrastructure. With this functionality MiCADO provides some
basic capabilities to optimize resource utilization and therefore
save unnecessary expenses for application providers.</p>
    </sec>
    <sec id="sec-5">
      <title>VII. CONCLUSIONS AND FUTURE WORK</title>
      <p>This paper collected and analysed challenges towards a
microservices-based implementation of a dynamic application
level cloud orchestrator called MiCADO. Moreover, it presented
a first proof-of-concept implementation of the architecture that
successfully addresses four out of the five identified challenges,
and also facilitates a future implementation to tackle the fifth
challenge. The MiCADO concept succeeds in decoupling
application level logic from cloud orchestration logic, while
preserving the elastic and dynamic nature of the cloud. The
experiment shows it is possible to narrow the gap between IaaS
and SaaS models.</p>
      <p>While the solution was tested on the infrastructure described
earlier, there is no fundamental reason why the principles could
not be applied to other operating systems, monitoring tools,
service discovery tools and cloud APIs. The most significant
limitations are in security, performance measurement and
downscaling. No work has been done on infrastructure level
security. Network overhead incurred by Consul and Swarm has
not been investigated, nor has the CPU overhead caused by
Docker. Consul has a built-in mechanism to reduce network
overhead by designating only a few nodes as servers and the rest
as serfs. Therefore, more work would be needed to define the
optimal configuration. Moreover, performance measurement has
been done on a most basic level, to prove a concept instead of
providing a ready solution.</p>
      <p>
        As this paper only analysed the MiCADO concept and presented
a proof of concept implementation, future work is rather
versatile. On the one hand it should evolve around measurement
and optimization logic of dynamic scalability. As this is the core
of the MiCADO platform, making this more versatile and
intelligent without sacrificing usability is a challenge. Another
aspect includes infrastructure definition reusability and sharing.
This could lead to a definition of application topology and
description templates that are applicable for a wide range of
application scenarios. For such purposes we are looking at
existing standardized description formats, such as TOSCA
(Topology and Orchestration Specification for Cloud
Applications) by OASIS [
        <xref ref-type="bibr" rid="ref23">23</xref>
        ]. Another angle for future work is
information security related to service up/downscaling and
portability, as this has not been touched at all.
      </p>
    </sec>
    <sec id="sec-6">
      <title>VIII. ACKNOWLEDGEMENTS</title>
      <p>This work was funded by the CloudSME Cloud-Based
Simulation platform for Manufacturing and Engineering Project
No. 608886 (FP7-2013-NMP-ICT-FOF). We also acknowledge
the contribution of Outlandish LLP whose staff provided us with
vital information regarding their requirements and valuable
feedback throughout the implementation.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Thomas</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          (
          <year>2009</year>
          ).
          <source>Cloud Computing - Benefits and Challenges! The Journal of Object Technology</source>
          ,
          <volume>8</volume>
          (
          <issue>3</issue>
          ),
          <fpage>37</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Marpaung</surname>
          </string-name>
          , Sain, &amp;
          <string-name>
            <surname>Hoon-Jae Lee</surname>
          </string-name>
          . (
          <year>2013</year>
          ).
          <article-title>Survey on middleware systems in cloud computing integration</article-title>
          .
          <source>Advanced Communication Technology (ICACT)</source>
          ,
          <source>2013 15th International Conference on Advanced Communications Technology</source>
          ,
          <fpage>709</fpage>
          -
          <lpage>712</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Anon</surname>
          </string-name>
          , (
          <year>2016</year>
          ). Cloudify [online] Available from: &lt;http://getcloudify.org
          <source>&gt; [Accessed</source>
          <volume>16</volume>
          /03/2016]
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Manh</given-names>
            <surname>Pham</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            ,
            <surname>Tchana</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Donsez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            ,
            <surname>Zurczak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            ,
            <surname>Gibello</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            , &amp;
            <surname>De Palma</surname>
          </string-name>
          ,
          <string-name>
            <surname>N.</surname>
          </string-name>
          (
          <year>2015</year>
          ).
          <article-title>An adaptable framework to deploy complex applications onto multi-cloud platforms</article-title>
          .
          <source>The Institute of Electrical and Electronics Engineers</source>
          , Inc. (IEEE) Conference Proceedings,
          <fpage>169</fpage>
          -
          <lpage>174</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Anon.</surname>
          </string-name>
          (
          <year>2016</year>
          ). AWS CloudFormation [online] Available from: &lt;https://aws.amazon.com/cloudformation/&gt; [Accessed 16/03/2016]
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Anon.</surname>
          </string-name>
          (
          <year>2015</year>
          ). OpenTosca [online] Available from: &lt;http://www.iaas.unistuttgart.de/OpenTOSCA/#ecosystem&gt; [Accessed 16/03/2016]
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>Binz</surname>
          </string-name>
          , Breiter, Leyman, &amp;
          <string-name>
            <surname>Spatzier</surname>
          </string-name>
          . (
          <year>2012</year>
          ).
          <source>Portable Cloud Services Using TOSCA. Internet Computing</source>
          , IEEE,
          <volume>16</volume>
          (
          <issue>3</issue>
          ),
          <fpage>80</fpage>
          -
          <lpage>85</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Newman</surname>
            ,
            <given-names>Sam.</given-names>
          </string-name>
          (
          <year>2015</year>
          ). Building
          <string-name>
            <surname>Microservices. O'Reilly.</surname>
          </string-name>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <surname>Balalaie</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Heydarnoori</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>Jamshidi</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          (
          <year>2015</year>
          ).
          <article-title>Migrating to CloudNative Architectures Using Microservices: An Experience Report</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>HashiCorp.</surname>
          </string-name>
          (
          <year>2016</year>
          ).
          <article-title>CONSUL by HashiCorp</article-title>
          [online] Available from: &lt;https://www.consul.
          <source>io&gt; [Accessed</source>
          <volume>16</volume>
          /03/2016]
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <surname>Apache</surname>
          </string-name>
          . (
          <year>2016</year>
          ). Apache Zookeeper [online] Available from: &lt;https://zookeeper.apache.
          <source>org&gt; [Accessed</source>
          <volume>16</volume>
          /03/2016]
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <surname>Coreos</surname>
          </string-name>
          . (
          <year>2016</year>
          ). Etcd [online] Available from: &lt;https://coreos.com/etcd/&gt; [Accessed 16/03/2016]
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>Anon</surname>
          </string-name>
          . (
          <year>2016</year>
          ). Docker [online] Available from &lt;https://www.docker.
          <source>com&gt; [Accessed</source>
          <volume>16</volume>
          /03/2016]
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <surname>Anon</surname>
          </string-name>
          . (
          <year>2016</year>
          ). CloudBroker Platform [online] Available from: &lt;http://cloudbroker.com/platform&gt; [Accessed 15/03/2016]
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <surname>Taylor</surname>
            <given-names>SJE</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kiss</surname>
            <given-names>T</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Terstyanszky</surname>
            <given-names>G</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kacsuk</surname>
            <given-names>P</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fantini</surname>
            <given-names>N.</given-names>
          </string-name>
          (
          <year>2014</year>
          ).
          <article-title>Cloud Computing for Simulation in Manufacturing and Engineering: Introducing the CloudSME Simulation Platform</article-title>
          .
          <source>Proceedings of the 2014 Annual Simulation Symposium, ANSS '14</source>
          ,
          <string-name>
            <surname>Society</surname>
          </string-name>
          for Computer Simulation International: San Diego, CA, USA,
          <year>2014</year>
          ;
          <volume>12</volume>
          :
          <fpage>1</fpage>
          -
          <lpage>12</lpage>
          :
          <fpage>8</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <surname>Anon</surname>
          </string-name>
          . (
          <year>2016</year>
          ). Registrator [online] Available from: &lt;http://gliderlabs.com/registrator/latest/&gt; [Accessed 16/03/2016]
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <surname>Anon</surname>
          </string-name>
          . (
          <year>2016</year>
          ). Consul Architecture [online] Available from: &lt;https://www.consul.io/docs/internals/architecture.
          <source>html&gt; [Accessed</source>
          <volume>16</volume>
          /03/2016]
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <surname>Anon</surname>
          </string-name>
          . (
          <year>2016</year>
          ). Consensus Protocol [online] Available from: &lt;https://www.consul.io/docs/internals/consensus.html
          <source>&gt; [Accessed</source>
          <volume>16</volume>
          /03/2016]
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <surname>Anon</surname>
          </string-name>
          . (
          <year>2016</year>
          ). Atlas Integration [online] Available from: &lt;https://www.consul.io/docs/guides/atlas.html
          <source>&gt; [Accessed</source>
          <volume>16</volume>
          /03/2016]
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <surname>Anon</surname>
          </string-name>
          . (
          <year>2016</year>
          ). Docker Swarm Overview [online] Available from: &lt;https://docs.docker.com/swarm/overview/&gt;
          <source>[Accessed</source>
          <volume>16</volume>
          /03/2016]
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          [21]
          <string-name>
            <surname>Baset</surname>
          </string-name>
          ,
          <string-name>
            <surname>Salman</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Carey</surname>
          </string-name>
          , Michael, &amp;
          <string-name>
            <surname>Hand</surname>
            ,
            <given-names>Steven.</given-names>
          </string-name>
          (
          <year>2012</year>
          ).
          <article-title>Open source cloud technologies</article-title>
          .
          <source>Cloud Computing Proceedings of the Third ACM Symposium</source>
          ,
          <volume>1</volume>
          -
          <fpage>2</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          [22]
          <string-name>
            <surname>Kiss</surname>
            ,
            <given-names>T</given-names>
          </string-name>
          , Dagdeviren,
          <string-name>
            <surname>H</surname>
          </string-name>
          , Taylor, JES, Anagnostou,
          <string-name>
            <given-names>A</given-names>
            ,
            <surname>Fantini</surname>
          </string-name>
          ,
          <string-name>
            <surname>N.</surname>
          </string-name>
          (
          <year>2015</year>
          ).
          <article-title>Business Models for Cloud Computing: Experiences from Developing Modeling &amp; Simulation as a Service Applications in Industry</article-title>
          ,
          <source>Proceedings of the 2015 Winter Simulation Conference, Pages 2656-2667</source>
          , ISBN:
          <fpage>978</fpage>
          -1-
          <fpage>4673</fpage>
          -9741-4, IEEE Press
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          [23]
          <string-name>
            <surname>Oasis</surname>
            <given-names>committee specification</given-names>
          </string-name>
          (
          <year>2013</year>
          ).
          <article-title>Topology and Specification for Cloud Applications version 1</article-title>
          .0 [online] Available from: &lt;http://docs.oasisopen.org/tosca/TOSCA/v1.0/os/TOSCA-v1.
          <article-title>0-os</article-title>
          .
          <source>html&gt; [Accessed</source>
          <volume>15</volume>
          /03/2016]
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          [24]
          <string-name>
            <surname>Anon</surname>
          </string-name>
          . (
          <year>2016</year>
          ). Outlandish [online] Available from &lt; http://outlandish.com/ &gt; [Accessed 19/03/2016]
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          [25]
          <string-name>
            <surname>Anon</surname>
          </string-name>
          . (
          <year>2016</year>
          ).
          <article-title>MiCADO setup scripts</article-title>
          [online] Available from &lt; https://github.com/gregGes/DSCR-infrastructure
          <source>&gt; [Accessed</source>
          <volume>08</volume>
          /05/2016]
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>