Beruflich Dokumente
Kultur Dokumente
Chapter 3
Programming Interfaces
for Realtime and Cloud-
Based Computing
Gregory Katsaros
National Technical University of Athens, Greece
Tommaso Cucinotta
Scuola Superiore SantAnna, Italy
ABSTRACT
Research in the fields of Grid Computing, Service Oriented Architectures (SOA) as well as virtualization
technologies has driven the emergence of Cloud service models such as Software-as-a-Service (SaaS),
Platform-as-a-Service (PaaS), and Infrastructure-as-a-Service (IaaS).
The appearance of different business roles according to this classification, potentially with differing
interests, introduces new challenges with regard to the tools and mechanisms put in place in order to
enable the efficient provisioning of services. Security, Quality of Service (QoS) assurance, and real-time
capabilities are just a few issues that the providers are trying to tackle and integrate within the new
products and services that they offer. In this chapter, we make an overview of the approaches that aim to
APIs for real-time computing. In the first part of this chapter, several Real-Time Application Interfaces
will be presented and compared. After that, we will document the state-of-the-art regarding the Cloud
APIs available and analyze the architecture and the technologies that they support.
DOI: 10.4018/978-1-60960-827-9.ch003
Copyright 2012, IGI Global. Copying or distributing in print or electronic forms without written permission of IGI Global is prohibited.
Programming Interfaces for Realtime and Cloud-Based Computing
42
Programming Interfaces for Realtime and Cloud-Based Computing
(IaaS). Moreover, the emergence of different Amazon and Vmware provide commercial
business roles according to this classification, solutions for IaaS layer (EC2 and vCloud). The
potentially with differing interests, introduces new first one offers packages for accessing and utiliz-
challenges with regard to the tools and mechanisms ing Amazons servers while with the vCloud you
put in place in order to enable the efficient provi- can build your own Cloud infrastructure. OCCI
sioning of services. Security, Quality of Service is a specification that is being developed for IaaS
(QoS) and efficiency are just a few issues that the providing supported by the Open Grid Forum
providers are trying to tackle and integrate within (OGF) community while Sun Cloud is the solution
the new products and services that they offer. In that Sun Microsystems published in the same
general, the SaaS provider offers an application context. From the other hand, there are APIs that
as a service over a distributed environment to the are trying to cover the intermediate layer of the
end users. The PaaS provider offers a develop- platform (PaaS) such as Microsoft Azure and
ment platform and environment consisting of Google App Engine. The first offers components
services and storage units hosted on the cloud, and tools for developing and deploying applica-
while the IaaS provider offers resources on de- tions within Microsofts data centers. It is com-
mand depending on each deployed instance. The mercial product that allows you to deploy Windows
PaaS offerings include services for binding all the applications on Microsofts data centers. Googles
involved parties, in addition to the end user of the App Engine on the contrary, provides an API for
infrastructure. This includes adapting the applica- developing and executing Cloud-based applica-
tion in order to be executed on a service oriented tions for free, with specific utilization boundaries
and distributed infrastructure, describing it in a and limits. Extension of those quotas can be
machine understandable way and enabling it in achieved by joining the billing mode of that ser-
order to be executed on virtualized environments. vice. Finally, there are several cross platform
To this end, several Application Programming Cloud APIs like jClouds, libCloud, deltacloud
Interfaces have been published serving different and others, that allow you to develop applications
layer of the Cloud architecture. In the following using various programming languages (e.g. Java,
table (Table 1) we try to map the important ones Python) and deploy them onto proprietary as well
regarding their characteristics. as open Cloud infrastructures.
43
Programming Interfaces for Realtime and Cloud-Based Computing
In what follows we make an overview of the signals, message passing and process scheduling),
approaches that aim to APIs for real-time comput- Advanced Realtime (grouping together clock
ing. In the first part of this chapter, several Real- selection, process CPU-time clocks, monotonic
Time Application Interfaces will be presented clock, timeouts and typed memory objects), Re-
and compared. After that, we will document the altime Threads (grouping together thread priority
state-of-the-art regarding the Cloud APIs available inheritance and protection, and thread scheduling),
and analyze the architecture and the technologies Advanced Realtime Threads (grouping together
that they support. thread CPU-time clocks, thread sporadic server,
spin locks and barriers).
By means of the just listed features, the standard
PROGRAMMING INTERFACES allows for a precise timing of real-time processes
FOR REAL-TIME COMPUTING and threads on a system, and for a certain control
over the scheduler configuration for individual
Approaches, Implementations processes and threads. This last aspect is criti-
and Comparisons cal: a real-time application should not compete
for the access to the shared physical resources,
POSIX first of all the CPU, with all the other non real-
time processes on the system. In fact, POSIX
POSIX stands for Portable Operating System defines a multi-queue priority-based regulated
Interface and is the collective name of a family access to the CPU, where a set of system calls
of standards, also referred as IEEE 1003 or ISO/ can be used in order to set the scheduling policy
IEC 9945, jointly developed by the IEEE Portable of each process to SCHED_FIFO, SCHED_RR
Application Standards Committee (PASC) and or SCHED_OTHER:
the Austin Common Standards Revision Group
(CSRG) of The Open Group. int sched_setscheduler(pid_t pid, int poli-
In 1998, the first real-time profile, IEEE Std cy, const struct sched_param *param)
1003.13-1998, was published enabling POSIX to int sched_getscheduler(pid_t pid)
address real-time applications, even for embedded int sched_rr_get_interval(pid_t pid, struct
systems and small footprint devices. It must be timespec * tp)
said that support for most of these functionalities int sched_get_priority_max(int policy)
is not mandatory in a POSIX-conforming imple- int sched_get_priority_min(int policy)
mentation and the 1003.1-2001 standard defines
the X/Open System Interface (XSI) extensions that The SCHED_FIFO and SCHED_RR policies
groups together several of these optional features allow the programmer to specify the real-time
in the so-called XSI Option Groups. A compliant priority at which a process will be scheduled
XSI implementation has to support at least the (by setting the priority field of the sched_param
following options: file synchronization, memory structure). The available priorities range for a
mapped files, memory protection, threads, thread given policy may be retrieved by using the sched_
synchronization, thread stack address attribute and get_priority_min() and sched_get_priority_max()
size, and may also support a bunch of other option system calls. In case multiple processes are as-
groups among whom: Realtime (grouping together signed the same priority, SCHED_FIFO simply
asynchronous, synchronized and prioritized I/O, schedules them in FIFO order, whilst SCHED_RR
shared memory objects, process and range based applies a Round-Robin policy with a fixed time-
memory locking, semaphores, timers, realtime
44
Programming Interfaces for Realtime and Cloud-Based Computing
slice (whose duration may be retrieved using the Priority analysis for checking schedulability of
sched_rr_get_interval() system call). the real-time processes on the system. Also, if
All other non real-time processes in the system an application tries to consume more CPU than
have the default SCHED_OTHER policy, meaning the maximum value theoretically foreseen in the
that they are scheduled in the background of the analysis, i.e., the reservation budget, it is down-
real-time processes, allowing real-time processes graded to the low real-time priority. Therefore, it
to exhibit a far better responsiveness than non is possible to keep under control the maximum
real-time ones. interference that a higher priority real-time process
In the context of cloud-computing and virtual- may have on lower priority ones.
ized infrastructures, the POSIX API for real-time Unfortunately, being optional, the SCHED_
computing is relevant in those contexts in which SPORADIC scheduling class is not widely imple-
a host Operating System (OS) is exploited as mented on POSIX compliant OSes. On Linux, an
hypervisor for hosting multiple Virtual Machines implementation of SCHED_SPORADIC has been
(VM), along with the guest OSes running inside. developed in the context of the IRMOS European
In fact, in this scenario, each VM is seen by the Project by Faggioli et al. and made available as a
host OS as a process, thus its scheduling policy and kernel patch (Faggioli).
real-time scheduling priority may be manipulated When using Fixed-priority scheduling, the op-
by leveraging the POSIX API. For example, this timum assignment of priorities is the well-known
kind of scenario is realized by the Kernel Virtual Rate-Monotonic, which needs knowledge of the
Machine (KVM) hypervisor on the Linux OS. entire set of real-time tasks running on the system,
With the mentioned POSIX priority-based in order to set each one priority. Interfaces that are
scheduling policies, the actual guarantees a real- more suitable to open, dynamic real-time systems
time process receives depend basically on what are based on EDF scheduling and they allow
other real-time processes run into the system at a each application to request to the OS scheduling
higher real-time priority. The SCHED_FIFO and guarantees in terms of a minimum budget to be
SCHED_RR POSIX scheduling classes have the granted every application period. This model is
heavy drawback that a higher priority process can also capable of theoretically saturating a single-
indefinitely delay the execution of all other lower processor system with real-time tasks, conversely
priority ones, and there is no run-time mechanism to what happens with Fixed-priority scheduling.
that ensures temporal encapsulation among real- For example, such an API has been developed for
time processes. Linux in the context of various academic projects,
Such problem is mitigated by the SCHED_ such as the ones summarized in what follows.
SPORADIC optional POSIX real-time scheduling (Mark Stanovich et al., 2009) (Dario Faggioli et
class. In this model, the developer may reserve the al., 2010) (Faggioli).
CPU for a real-time task by specifying a budget, a
period, a real-time priority and a low priority. The The AQuoSA API
kernel runs the process at the specified real-time
priority for an overall time duration not exceeding The AQuoSA framework (Luigi Palopoli et al.,
the budget in each time window as wide as the 2008), (OCERA Open Components for Embed-
period. When the budget is exhausted, the process ded Real-time Applications), (OCERA Project
is downgraded to the low priority. The advantage Deliverable D1.1 - RTOS), (S.Oikawa et al.,
of such a scheme is that, with proper refinements 1999), enhances a standard GNU/Linux system
(Mark Stanovich et al., 2009), (Dario Faggioli et with scheduling strategies based on the Resource
al., 2010) it is possible to rely on classical Fixed- Reservation techniques (Tommaso Cucinotta,
45
Programming Interfaces for Realtime and Cloud-Based Computing
attach and detach of threads to the created the Core Module provides applications
server: with fundamental real-time scheduling
qos_rv qres_attach_thread (qres_ services;
sid_t server_id, pid_t pid, tid_t tid) the Shared Objects Module allows for re-
qos_rv qres_detach_thread (qres_ alizing atomic operations where the access
sid_t sid, pid_t pid, tid_t tid) to the shared resources is governed accord-
ing to well-designed real-time protocols;
where the thread to be attached is identified the Hierarchical Scheduling Module pro-
by its POSIX process identifier (pid) and the vides applications with hierarchical sched-
Linux-specific thread identifier (tid), which can uling capabilities, allowing for example
be obtained via the Linux gettid() system call; to nest Fixed-Priority scheduling inside
Resource-Reservation scheduling, etc.
dynamic setting and retrieval of schedul- the Distribution Module provides ser-
ing parameters for a server: vices for distributed real-time applications,
qos_rv qres_get_params (qres_sid_t such as the capability to negotiate the al-
sid, qres_params_t *p_params) location of resources atomically on a set of
qos_rv qres_set_params (qres_sid_t distributed physical nodes;
sid, qres_params_t * p_params)
46
Programming Interfaces for Realtime and Cloud-Based Computing
the Feedback Control Module provides binding and unbinding of threads to a ne-
applications with adaptive reservation gotiated contract:
strategies, where the resource allocation int frsh_thread_bind (const frsh_
can be varied dynamically following the vres_id_t vres, const frsh_thread_id_t
actual instantaneous application workload; thread)
the Energy Management Module allows int frsh_thread_unbind (const frsh_
applications to specify their resource re- thread_id_t thread)
quirements in presence of dynamic voltage querying the run-time status of the
scaling capabilities of the CPU. scheduler:
int frsh_vres_get_remaining_bud-
In what follows, we focus on FRSH Core get ( const frsh_vres_id_t vres,
Module. The reader may refer to for a complete frsh_rel_time_t*budget)
description of the FRSH API.
The most important functions of the FRSH this function is useful for realizing anytime
Core Module are the following: computing real-time algorithms, where some
optional computations in the algorithm may be
preparation of the scheduling parame- performed or suppressed depending on the avail-
ters, referred to as contracts, to be negoti- ability of residual budget granted by the OS till
ated with the OS: the deadline.
int frsh_contract_init (frsh_contract_t
*contract) The IRMOS Real-Time Schedulers
int frsh_contract_set_basic_params
(frsh_contract_t*contract, const frsh_ In the context of the IRMOS European Project, a
rel_time_t *budget_min, const frsh_ new multi-processor real-time scheduler for Linux
rel_time_t*period_max, ...) has been developed, with hierarchical scheduling
int frsh_contract_set_timing_reqs capabilities.
(frsh_contract_t*contract, const In this case, the real-time computing capabili-
boold_equals_t, const frsh_rel_ ties of the kernel are not exposed to applications
time_t*deadline, ...) through an API, but rather the Linux cgroup virtual
negotiation of the contract with the OS: file-system is exploited.
int frsh_contract_negotiate Therefore, the main operations related to real-
(const frsh_contract_t*contract, time scheduling may be achieved as follows:
frsh_vres_id_t*vres)
int frsh_contract_cancel (const frsh_ first of all, the cgroup special file-system
vres_id_t vres) (and specifically the CPU controller) needs
int frsh_contract_renegotiate_sync to be mounted somewhere on the system,
(const frsh_contract_t*new_contract, e.g., for mounting it in /cg/ the following
const frsh_vres_id_t vres) shell command can be used:
mount -t cgroup -o cpu cgroup /cg
where, after negotiation, the granted reser- for creating a new reservation, a group
vation is referred to by means of a frsh_vres_t must be created by creating a folder in /
identifier, and its parameters may be also changed cg/, e.g.:
via the renegotiation function, if needed; mkdir /cg/myresv1
47
Programming Interfaces for Realtime and Cloud-Based Computing
for setting the scheduling parameters, grams through an adaptation layer written in C
i.e., a given budget (a.k.a., runtime) and implementing the AQuoSA API already detailed
period, the corresponding quantities (in above, and to Python scripts via an adaptation
microseconds) need to be written into spe- layer written in Python realising a similar API.
cial entries available in the group folder,
e.g., for creating a reservation of 10ms ev- RTLinuxFree and RTAI
ery 100ms:
echo 100000 > /cg/myresv1/cpu. RTLinux and RTAI (Setz) are projects
rt_period_us mainly aimed to support real-time in the
echo 10000 > /cg/myresv1/cpu. context of industrial control, and they do
rt_runtime_us not generally target complex, distributed
echo 100000 > /cg/myresv1/cpu. multimedia applications on Linux, nor
rt_task_period_us general cloud-computing applications run-
echo 10000 > /cg/myresv1/cpu. ning in virtualized infrastructures. In fact,
rt_task_runtime_us in these projects a real-time task is gen-
erally written as a kernel module for the
where the cpu.rt_*_us entries decide the pa- Linux kernel, which may use a proper API
rameters for the entire group, comprising possible in order to set its own real-time schedul-
subgroups that one might want to create, whilst ing class and related parameters. Such an
the cpu.rt_task_*_us entries decide the parameters approach is perfectly viable for relatively
dedicated to the tasks attached at this very level simple control applications that need to
of the hierarchy periodically read information from a sen-
sor, apply some control logic then drive an
for attaching a task to a group, its Linux actuator, but it is not easy at all to realize
TID (similar to the POSIX PID) needs to complex real-time distributed applications
be written into the tasks special entry avail- in form of kernel modules.
able in the group, e.g., if the TID of the
task were interested into is 1421: RTSJ
echo 1421 > /cg/myresv1/tasks
for detaching a task from a group, its To address the problems that Java has when used in
Linux TID needs to be written into the real-time systems, the Real-Time Specification for
tasks special entry at the root cgroup level, Java has been developed. Among other features,
e.g.: RTSJ basically exposes at the Java programming
echo 1421 > /cg/tasks level the POSIX real-time scheduling capabilities
finally, in order to allow tasks to actu- of the underlying OS. Also, in order to face with
ally exploit real-time scheduling, they the well-known problem of the Garbage Collec-
need to be scheduled according to the tor that can interfere with Java applications in
needed POSIX real-time scheduling class unpredictable ways, RTSJ defines immortal and
(SCHED_RR or SCHED_FIFO), and a re- scoped memory areas to supplement the standard
al-time priority needs to be assigned, e.g.: Java heap. These areas allow applications to use
chrt -r -p 20 1421 memory without being required to block if the
garbage collector needs to free memory in the
For the convenience of the programmer, the heap. Objects allocated in the immortal memory
above operations are made available to C pro- area are accessible to all threads and are never
48
Programming Interfaces for Realtime and Cloud-Based Computing
collected. Because it is never collected, immortal of local storage systems and is one of the major
memory is a limited resource that must be used services of the whole AWS collection. Similar
carefully. Scoped memory areas can be created with EC2, Amazon provides an S3 API for stor-
and destroyed under programmer control, through ing and retrieving data from their Data Centers.
specific API available to the programmer. In addition, Amazon is committed to provide
99.99% durability and availability of the stored
data as described in the Amazon S3 Service Level
PROGRAMMING INTERFACES Agreement.
IN CLOUD COMPUTING For better understanding of EC2 service we
will explain the terminology that Amazon uses for
Amazon EC2 API the specification of the related API. An instance
is a virtual server that runs over the physical host
Amazon is considered to be the leader Cloud within Amazons Data Centers. The templates
Provider in the current market. The Cloud solu- from which the instances are been created are
tion offered by Amazon is called Amazon Web called Amazon Machine Images (AMIs) and
Services (AWS) and was initially launched in include options of operating system or other
2002. In principle AWS is a collection of Web properties than you can select in order to define
services that together are forming the Amazons the individual instance that you want to utilize.
Cloud platform. The company offers a variety of To access your instances you can use Amazons
Cloud related products such as Elastic Compute Elastic IP Addresses that are actually static IP ad-
Cloud (Amazon EC2), Simple Storage Service dresses designed for dynamic Cloud computing.
(S3), Simple Queue Service (SQS), CloudFront, That IP address is associated with your account
Simple DB and more. It is not in the context of this in Amazon and you can reconfigure to point to a
chapter to elaborate on the services and products different instance. Elastic Block Storage (EBS)
offered by Amazon so we will only mention the is the persistent storage of each EC2 instance that
basic characteristics of the two basic services: keeps the state of the instance. In addition, you can
EC2 and S3, before elaborating on the Amazon create a snapshot of the state that will be stored
EC2 API (Amazon EC2 API). within the S3 service for long term durability. Like
EC2 is a Web service that allows you to de- presented in Figure 1, the basic flow when using
ploy and manage server instances with a variety the EC2 starts by finding an existing public AMI
of operating systems in Amazons Data Centers. and customizing to our needs or building one from
It offers specific API and utilities to control the scratch. The next step is to create the instance for
computing resources and manage the networks the AMI using the provided EC2 API. The result
access permission and therefore launch a custom of this bundling process is an AMI ID that you can
application environment. Apart from the complete use in order to launch as many instances of the
control that you have on the instances, scalability AMI as you want. Finally, through the available
is another key feature of EC2 service. As the name tools of the API you can administer and use the
of the service implies (Elastic), the computing instances as you want with any servers.
capacity of each resource can be adjusted manu- Amazon EC2 API provides access to EC2 Web
ally or automatically by the application through service either using the SOAP API or the Query
the provided API. API. When using the SOAP Web Services mes-
Amazon S3 service offers an on-line storage saging protocol, the interfaces are defined by a
space that can be accessible by any individual or Web Service Description Language (WSDL) xml
application on the Web. It appears as an alternative document. While the SOAP requests and re-
49
Programming Interfaces for Realtime and Cloud-Based Computing
sponses in Amazon EC2 follow current standards, enables application developers to create clients
any programming language supporting those of vCloud services using a RESTful application
standards (e.g. Java, C++, C#, Python, Perl and development style. vCloud API clients and serv-
Ruby) could be used within Amazons Cloud. The ers communicate over HTTP, exchanging XML
Query API interface is a REST-based interface representations of vCloud entities.
that supports GET and POST method to perform The vCloud defines several resources and
any request. The Query interface is seems to be entities illustrated in Figure 2. All kind of objects
preferred by the Amazons developers and is (resources and other entities) are being described
provided for almost all AWS. Moreover, many through XML. In addition, the vCloud API elabo-
browsers do not support the full range of HTTP rates and defines in detail with links the context of
methods, while all Web browsers can handle GET a resource, list other relevant resources, and define
and POST requests. how they relate to the current resource. These
links are the primary way that a server delivers
VMware vCloud Computing Interface information to a client about how to access and
operate a resource.
VMware as a leading company in the field of Organization: A vCloud can include more
virtualization released in 2009 the vCloud API than one organization each one of them is a ad-
(VMware vCloud), an OVF 1.0 standards-based ministrative superset of users, groups and re-
Programming Interface for providing and consum- sources.
ing virtual resources from the cloud. The vCloud vDC: A vCloud virtual datacenter (vDC) is a
API was a result of a combined effort from VM- mechanism for allocating computing resources
ware and its partners in order to deliver an easy such as networks, storage, CPU, and memory.
to use Cloud Interface, extensible and based on Within a vDC the resources are fully virtualized
various established open standards such as XML, and either are reserved on demand or pre-defined
HTTP, OVF etc. In more details, the vCloud API through the SLA. There are Provider vDCs, con-
can be distinguished in two parts: the Administra- taining the available resources of a vCloud Service
tive API which is used for creating, managing and Provider and Organization vDCs (Org. vDCs) that
monitoring resources, users and roles within a provide an environment where the virtual systems
vCloud and the Users API which provides brows- can be stored, deployed and operated.
ing and discovering resources operations as well Catalogs: Catalogs contain references to the
as creating, modifying and deploying operating organizations virtual datacenters and media im-
virtual appliances. The VMware vCloud API ages. A catalog can be visible only to its creators
50
Programming Interfaces for Realtime and Cloud-Based Computing
or could be published and become visible to other the catalog, while the Media Images are stored
members of the organization as well. in their native representation (ISO, floppy) and
Network: Network represents the allocated the Virtual Systems are stored as template based
network capacity of a vDC provider within the on the OVF 1.0 standard format. Those templates
organization. can then be retrieved from the catalog and be
User & Groups: An organization can contain instantiated to become vApps. A vApp resource
several Users or Groups that are being created from can contain even more than one Virtual Machine
the Organization Administrator or imported from (VM) including the operational parameters
the Directory Service (LDAP). Roles and specific such as: connection links between the VMs, the
rights are being assigned from the Administrator hierarchy of powering on and off the VMs, the
for setting the users permissions. End-user license agreements for each VM, the
TasksList: The tasks that are being created by deployment terms and conditions that constrain
the execution of long-running operations are kept the vDC resources consumption, access control
within the TaskList of the Organization. and user permissions etc.
Virtual Systems and Media Images: A vDC The vCloud API supports multiple operations
can include several Virtual Systems and Media for enabling the two-way transfer of Media Im-
Images. References of those can be listed within ages and OVF packages between the client and
51
Programming Interfaces for Realtime and Cloud-Based Computing
the cloud. Those upload and download operations 2. The server returns an unresolved (status=0)
are implemented by POST and GET requests vAppTemplate document that includes an
respectively. In this context, the vApp Lifecycle upload URL for the OVF package.
includes three major steps: 3. The client uses an HTTP PUT request to
upload the OVF package descriptor (the
Uploading the OVF package .ovf file) to the upload URL.
Instantiating the vApp template 4. The server reads the descriptor and con-
Deploying the vApp structs a complete vAppTemplate document
(one that includes an upload URL for each
In order to create a vApp template an OVF file listed in the References section of the
package must be uploaded to the cloud through descriptor). While the server is constructing
a vCloud API client. The steps that must be ful- this document, the client makes periodic
filled are: requests for it and examines the response for
additional upload URLs. When the response
1. The client POSTs an initial request that speci- contains any upload URls beyond the one
fies a name for the template, a transfer format returned in Step 2, template is complete
for the data, and an optional description.
52
Programming Interfaces for Realtime and Cloud-Based Computing
5. The client uses HTTP PUT requests to upload SDK that is available for both languages (Java and
each of the files. Python) there is also an Eclipse plugin provided
6. If the OVF package includes a manifest for development. Moreover, the data handling
file, the entire upload is validated against at Googles Cloud-enabled platform is provided
the contents of the manifest file. with the Datastore API. In the case of Java de-
velopment, the Datastore API stores and performs
The Instantiation process is a prerequisite to queries over data objects, known as entities. Each
deployment and is based on the uploaded vApp entity has a unique identifier (key) and one or
Template. The template includes specific details more properties, as values of specific data types.
of the vApp such as virtual disks that the cApp The Datastore supports Java Data Objects (JDO)
requires, CPU, memory and network connections 2.3 and Java Persistent API (JPA) 1.0 standard
that must be allocated by the vDC etc. A client interfaces. When building Python applications the
can trigger the instantiation either using the de- Datastore in implemented through an SQL-like
fault parameters of a vDC or he can override the language called QGL. It does not support Join
vDC parameters with his own set. Instantiation statements while it is inefficient when queries
parameters allow you to specify certain properties span over multiple machines. In this context, GQL
of a vApp, including: details of its vApp network, is not a relational database in the common SQL
lease settings for the vApp, startup and shutdown sense but such a modeling can be accomplished
parameters for the vApp. Instantiation parameters through specific mechanism provided by the API
also include a way to indicate that any terms and (e.g. ReferenceProperty()).
conditions (such as license agreements) contained When it comes to build an application, Google
in the vApp have been accepted. App Engine API provides a development envi-
For the deployment and powering on a vApp ronment either for Java (Eclipse plugin) or for
a POST request is again being used. The client Python. This environment simulates Google
makes the request to the respective action/deploys App Engine (including local Datastore, Google
URL and all VMs that are included within the accounts etc.) and gives you the ability to deploy
vApp are being deployed. Similar requests for the (upload) the application directly to Google App
operation of undeploy, power-off, reset, suspend Engine. As a result, the whole process includes
and other are supported by the API. the following steps:
53
Programming Interfaces for Realtime and Cloud-Based Computing
54
Programming Interfaces for Realtime and Cloud-Based Computing
55
Programming Interfaces for Realtime and Cloud-Based Computing
for provisioning compute, storage and network interfaces for Cloud Computing. Jclouds is a
resources. Java-enabled open source framework for devel-
SUNs Cloud API is a RESTful programming oping applications, supporting many cloud-aware
interface, with every entity be represented as cloud features. Using the framework you can develop
resources (compute, storage, networking compo- applications for various Cloud Providers such as
nents etc). The usage of the API is realized via Amazon, VMWare, Azure and others. Deltacloud
HTTP protocol through the common GET, POST, is an open source RESTful API, provided by Red
PUT and DELETE requests. The API operates in Hat and is compatible with EC2, Rackspace,
the context of various resource types: GoGRID and other Cloud Providers. Deltacloud
offers drivers for every supporting Cloud as a
Cloud: A top-level construct which groups translation layer between the client and the pro-
all the Virtual Data Centers to which an viders native API. In the same context, libcloud is
API user has access. Python client library that allows your application
Virtual Data Center (VDC): An iso- to interact with various providers. It is distributed
lated container which is populated with under the Apache Software License and serves
Clusters, Private Virtual Networks, Public through specific drivers provided by the API the
Addresses, Storage Volumes, Volume most common Clouds in the market.
Snapshots.
Cluster: An administrative grouping of
Virtual Machines, useful for access con- CONCLUSION
trol, copying or cloning, geographic isola-
tion, and scripting automation. Through this chapter we documented the basic Ap-
Virtual Machine (VM): A server. plication Programming Interfaces for integrating
Private Virtual Network (VNet): A subnet, Real-Time capabilities to Linux kernels. Several
not connected to the Internet, which may approaches were presented and compared in the
be used to connect Virtual Machines within context of executing soft as well as hard real-time
a VDC. applications. From the other hand, the emergence
Public Address: A connection to the of Cloud computing brought a revolution and a
Internet. new perception on application development and
Storage Volume: A storage resource which execution. All major Service Providers of the
may be accessed via WebDAV and other global marketplace, sooner or later got involved
storage protocols. into Cloud-enabled technologies and related
Volume Snapshot: A snapshot of the state products. In the previous section, we presented
of a Storage Volume. various solutions and APIs covering all three
layers of Cloud service model (SaaS, PaaS and
More information about the API specification IaaS). After investigating all most of the APIs
can be found at the Kenai project wiki, where available, either commercial and open source, we
documentation as well as the actual source code concluded that while the last three years there is a
and binaries are provided. vast explosion of Cloud solutions published, still
many aspects should be further explored. One
Cross Platform Cloud APIs important drawback detected was that the Cloud
technology available lacks in standardization. The
Apart from the Cloud Provider specific APIs there field of Cloud Computing is quite immature and
are several platform independent programming still under development. Every Service Provider
56
Programming Interfaces for Realtime and Cloud-Based Computing
publishes its own API to serve their Data Centers Faggioli, D. (n.d.). POSIX SCHED_SPORADIC
and there only a few open source Cloud APIs. As implementation for tasks and groups. Retrieved
a result, this affects interoperability in a very im- from http://lwn.net/Articles/293547/
portant way and the SaaS APIs (jCloud, libcloud
Faggioli, D., et al. (2010). Sporadic server revis-
etc) have to implement specific libraries and
ited. Proceedings of 25th ACM Symposium On
plugins for every individual Cloud (IaaS). When
Applied Computing. Sierre, Switzerland.
it comes to real-time capabilities in Cloud not
much can be found in literature. The technology FRESCOR Framework for Real-time Embedded
is relatively young and the Cloud-enabled APIs Systems. (n.d.). European project no. FP6/2005/
are focusing into the virtualization of resources, IST/5-034026. Retrieved from http://www.frescor.
the deployment of applications and the control org
of the virtual environment. From the other hand,
Gonzlez Harbour, M., et al. (2008). FRESCOR
the integration of real-time capabilities into the
deliverable D-AC2v2 Architecture and contract
Linux kernel is an active topic for more than a
model for integrated resources II.
decade with several really promising results. In
total, Cloud Computing, regardless the current Google App Engine. (n.d.). Retrieved from http://
deficiencies will remain the buzzword the follow- code.google.com/appengine/
ing years and its capabilities will evolve to meet
IBM jrtj. (n.d.). Retrieved from http://www.ibm.
the requirements of the contemporary interactive
com/ developerworks/java/library/ j-rtj1/index.
and distributed applications.
html?S_ TACT=105AGX02& S_CMP=EDU
Java, A. P. I. (n.d.). Retrieved from http://code.
REFERENCES google.com/ appengine/docs/java/ overview.html
Amazon EC2 API. (n.d.). Retrieved from Javolution. (n.d.). Retrieved from http://javolu-
http://docs.amazonwebservices.com /AW- tion.org
SEC2/2009-11-30/ APIReference/ jClouds. (n.d.). Retrieved from http://code.google.
Amazon EC2. (n.d.). Retrieved from http://aws. com/p/jclouds/
amazon.com/ec2/ KENAI Project. (n.d.). Retrieved from http://
Cucinotta, T. (2008). Access control for adaptive kenai.com
reservations on multi-user systems. 14th IEEE KVM. (n.d.). Retrieved from http://www.linux-
Real-Time and Embedded Technology and Appli- kvm.org
cations Symposium. St. Louis, MO, United States.
libCloud. (n.d.). Retrieved from http://ci.apache.
Deltacloud. (n.d.). Retrieved from http://www. org/ projects/libcloud
deltacloud.org/
Litchfield, J. (2007). The foundations of Solaris
DMTF.(n.d.). DSP0243 open virtualization format realtime. Retrieved from http://blogs.sun.com/
specification 1.1.0. thejel/ entry/the_foundations _of_solaris_realtime
Enea, O. S. E. O. S. (n.d.). Retrieved from http:// Marte, O. S. (n.d.). Retrieved from http://marte.
www.enea.com/Templates/ Product____27035. unican.es
aspx
57
Programming Interfaces for Realtime and Cloud-Based Computing
Menage, P. (n.d.). CGROUPS. Retrieved from Python, A. P. I. (n.d.). Retrieved from http://code.
http://www.mjmwired.net/ kernel/Documenta- google.com/ appengine/docs/python/ overview.
tion/ cgroups.txt html
OCCI. (n.d.). Retrieved from http://www.occi- Rajkumar, R., et al. (1998). Resource kernels:
wg.org A resource-centric approach to real-time and
multimedia systems. SPIE/ACM Conference on
OCCI specification. (n.d.). Retrieved from http://
Multimedia Computing and Networking.
forge.ogf.org/sf/docman /do/listDocuments/
projects.occiwg /docman.root.drafts. occi_speci- Reservoir Project. (n.d.). Retrieved from http://
fication www.reservoir-fp7.eu
OCERA Open Components for Embedded Real- Rtsj. (n.d.). Retrieved from http://www.rtsj.org/
time Applications. (2001). (European Project No. specjavadoc /book_index.html
IST-2001-35102). Retrieved from http://www.
Setz, J. (2007). Inter-process communication in
ocera.org
RTAI and RTLinux. Saarland University.
OCERA Project deliverable D1.1 - RTOS. (n.d.).
Stanovich, M., et al. (2009). Defects of the POSIX
Retrieved from http://www.ocera.org/download
sporadic server and how to correct them.
/documents/ documentation/wp1.html
Sun Microsystems. (n.d.). SUN Cloud. Retrieved
OGF. (n.d.). Cloud storage for cloud computing.
from http://developers.sun.com/cloud/
Retrieved from http://ogf.org/Resources/ docu-
ments/CloudStorage ForCloudComputing.pdf Timesys. (n.d.). Retrieved from http://www.time-
sys.com/java
Oikawa, S., et al. (1999). Portable RK: A portable
resource kernel for guaranteed and enforced tim- vCloud API Programming Guide. (n.d.). Retrieved
ing behavior. Fifth IEEE Real-Time Technology from http://communities.vmware.com /servlet/
and Applications Symposium. Vancouver. JiveServlet/previewBody/ 12463-102-1-13007/
vCloud_API_Guide.pdf
Opennebula. (n.d.). Retrieved from http://www.
opennebula.org/ VMware vCloud. (n.d.). Retrieved from http://
www.vmware.com/ products/vcloud/
Palopoli, L. (2008). AQuoSA - Adaptive qual-
ity of service architecture. Software, Practice & Windows Azure. (n.d.). Retrieved from http://www.
Experience, 39(1). microsoft.com/ windowsazure/windowsazure/
Partikle. (n.d.). Retrieved from http://www.e-rtl.
org/partikle
58