jOCCI – General-Purpose OCCI Client Library in Java

Transcription

jOCCI – General-Purpose OCCI Client Library in Java
jOCCI – General-Purpose OCCI Client
Library in Java
Michal Kimle, Boris Parák, Zdeněk Šustr
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
1
www.egi.eu
Agenda
Cloud Standards
OCCI – Introduction, principles, underlying ideas
jOCCI
Motivation
Overview
rOCCI & jOCCI side by side
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
2
www.egi.eu
Standardization in IaaS Clouds
Standards for Infrastructure as a Service cloud delivery model
• Relatively late in coming
• CDMI (Cloud Data Management Interface, SNIA, 2010)
• Cloud storage
• OCCI (Open Cloud Computing Interface, OGF, 2011)
• VM Management
• CIMI (Cloud Infrastructure Management Interface, DMTF, 2012)
• VM Management
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
3
www.egi.eu
Standardization in IaaS Clouds
Standards for Infrastructure as a Service cloud delivery model
• Relatively late in coming
• CDMI (Cloud Data Management Interface, SNIA, 2010)
• Cloud storage
• OCCI (Open Cloud Computing Interface, OGF, 2011)
• VM Management
• CIMI (Cloud Infrastructure Management Interface, DMTF, 2012)
• VM Management
Compare with Amazon WS – y. 2006
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
3
www.egi.eu
OCCI
• Standard of choice for the EGI Federated
Cloud
⇐ CIMI not yet released at design time
⇒ no discussion of OCCI vs. CIMI here
+ CDMI for object storage
• Text-based protocol and API focusing on cloud interoperability
• Primarily for IaaS, extensible to other areas
• Currently v. 1.1, published in three parts:
• Core
• Infrastructure
• HTTP Rendering
• v. 1.2 to be released for public comment on 23 March 2015
• See insider info in the “Future” Section
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
4
www.egi.eu
OCCI Core Class Structure
Category
+ Scheme :URI
+ Term :string
+ Title :stirng[0..1]
+ Attributes :Set<string>
Mixin
Action
­ entity_type: Entity
actions
actions
related
related
category
Kind
Entity
kind
+ id :URI
+ title :String[0..1]
Resource
mixins
target
Link
+ summary :String[0..1]
links
20 March 2015
EGI
+ source
ISGC ’15, Taipei, Taiwan
5
www.egi.eu
OCCI Core + Infrastructure Classes
Category
+ Scheme :URI
+ Term :string
+ Title :stirng[0..1]
+ Attributes :Set<string>
Mixin
Action
­ entity_type: Entity
actions
actions
related
related
category
Kind
Entity
kind
+ id :URI
+ title :String[0..1]
Network
Resource
+ occi.network.vlan :Integer[0..1]
+ occi.network.label :Token[0..1]
+ occi.network.state :Enum
+ summary :String[0..1]
mixins
target
links
Link
+ source
Compute
Storage
NetworkInterface
+ occi.compute.architecture :Enum[0..1]
+ occi.compute.cores :Integer [0..1]
+ occi.compute.hostname :String[0..1]
+ occi.compute.speed :Float [0..1]
+ occi.compute.memory :Float [0..1]
+ occi.compute.state :Enum
+ occi.storage.size :int + occi.storage.state :Enum + occi.networkinterface.interface :String
+ occi.networkinterface.mac :String
+ occi.networkinterface.state :Enum
StorageLink
+ occi.storagelink.deviceid :String
+ occi.storagelink.mountpoint :String[0..1]
+ occi.storagelink.state :Enum
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
6
www.egi.eu
OCCI HTTP Rendering I
Example: Rendering a simple compute resource, i.e.,
describing a virtual machine in OCCI:
Category : compute ; scheme = " http :// schemas . ogf . org / occi /
infr astructu re # " ; class = " kind "
X - OCCI - Attribute : occi . core . id = " ee13808d -7708 -4341 - a4ba -0
e42e4818218 "
X - OCCI - Attribute : occi . core . title = " exampleVM "
X - OCCI - Attribute : occi . compute . cores =1
X - OCCI - Attribute : occi . compute . memory =1.7
X - OCCI - Attribute : occi . compute . architecture = " x86 "
X - OCCI - Attribute : occi . compute . speed =1
X - OCCI - Attribute : occi . compute . state = " active "
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
7
www.egi.eu
OCCI HTTP Rendering II
Certain limitations in text rendering
• Inability to describe multiple resources in a single message
• will be eventually overcome by JSON rendering specs
• or XML
• Difficult parsing
• Size limitations when transported in HTTP headers
(text/occi)
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
8
www.egi.eu
OCCI Implementation
Client must be able to . . .
receive, parse and
understand model
render request, validate
against model and send
receive response:
Server must be able to . . .
render model:
• local capabilities
• mixins
• resource categories
parse request and act on it
return response
• location
• rendered object
• HTTP return code
Table: Simplified schema of a single-request workflow
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
9
www.egi.eu
jOCCI
+
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
10
www.egi.eu
jOCCI – What Led Here
Mid-2014
• Numerous infrastructures already using OCCI in their
workflows . . .
• often even extending OCCI with custom specifications . . .
• but very limited choice of general-purpose clients
• command-line client: rOCCI-cli
• lets you wrap around CLI calls
• client libraries: rOCCI-core + rOCCI-api
• Ruby – native =⇒ OK
• JRuby – not so good, but demand for Java support apparent
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
11
www.egi.eu
jOCCI – What Led Here
Mid-2014
• Numerous infrastructures already using OCCI in their
workflows . . .
• often even extending OCCI with custom specifications . . .
• but very limited choice of general-purpose clients
• command-line client: rOCCI-cli
• lets you wrap around CLI calls
• client libraries: rOCCI-core + rOCCI-api
• Ruby – native =⇒ OK
• JRuby – not so good, but demand for Java support apparent
• September 2014: EGI FedCloud funds development of an
independent OCCI client library in Java: jOCCI.
• Taken up by CESNET – developers of the existing rOCCI
framework
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
11
www.egi.eu
jOCCI – Release
jOCCI v. 0.1.0 released on 3 March 2015
• 1st release comes in two parts
• jOCCI-core
• representation of OCCI Class structure
• https://github.com/EGI-FCTF/jOCCI-core
• jOCCI-api
• transport routines
• https://github.com/EGI-FCTF/jOCCI-api
• Libraries available from maven central
• More in following slides
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
12
www.egi.eu
jOCCI-core
• Java-based implementation of OCCI:
• classes defined by OCCI Core and Infrastructure specifications,
and methods for manipulating them
• methods for rendering plain-text or HTTP header
representations of OCCI class instances
• methods for basic parsing of such renderings
• methods for validation of OCCI requests with respect to known
models on client-side
. . . in other words . . .
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
13
www.egi.eu
jOCCI-core
Category
+ Scheme :URI
+ Term :string
+ Title :stirng[0..1]
+ Attributes :Set<string>
• Java-based implementation of OCCI:
category
related
­ entity_type: Entity
actions
actions
+ id :URI
+ title :String[0..1]
kind
related
Kind
Mixin
Action
• classes defined
by OCCI Core
and Infrastructure
specifications,
and methods for manipulating them
Entity
• methods for rendering plain-text
or HTTP header
representations of OCCI class instances
• methods for
basic parsingResource
of such renderingsLink
Network
• methods for validation of OCCI requests with respect to known
models on client-side
Storage
Compute
NetworkInterface
. . . in other words . . .
mixins
target
+ occi.network.vlan :Integer[0..1]
+ occi.network.label :Token[0..1]
+ occi.network.state :Enum
+ summary :String[0..1]
links
+ occi.compute.architecture :Enum[0..1]
+ occi.compute.cores :Integer [0..1]
+ occi.compute.hostname :String[0..1]
+ occi.compute.speed :Float [0..1]
+ occi.compute.memory :Float [0..1]
+ occi.compute.state :Enum
+ occi.storage.size :int + occi.storage.state :Enum + source
+ occi.networkinterface.interface :String
+ occi.networkinterface.mac :String
+ occi.networkinterface.state :Enum
StorageLink
+ occi.storagelink.deviceid :String
+ occi.storagelink.mountpoint :String[0..1]
+ occi.storagelink.state :Enum
Remember this?
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
13
www.egi.eu
jOCCI-core
• Java-based implementation of OCCI:
• classes defined by OCCI Core and Infrastructure specifications,
and methods for manipulating them
• methods for rendering plain-text or HTTP header
representations of OCCI class instances
• methods for basic parsing of such renderings
• methods for validation of OCCI requests with respect to known
models on client-side
. . . in other words . . . OCCI translated to Java
• Think in OCCI
• work with OCCI concepts hands-on in Java
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
13
www.egi.eu
jOCCI-api
• Transport functions for rendered OCCI queries
• HTTP
• Authentication
• Basic
• X.509 & VOMS
• Keystone tokens
• Client (HTTPClient) class implementing basic resource
management methods
•
•
•
•
•
list
describe
create
delete
trigger
• EntityBuilder class to construct OCCI class instances
. . . while immediately verifying the new instance against model
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
14
www.egi.eu
jOCCI Usage Example
• Creating a Client instance:
Client client = new HTTPClient ( URI . create ( " https :// remote .
server . net " ) , new B a s i c A u t h e n t i c a t i o n ( " username " , "
password " ) , MediaType . TEXT_OCCI , true ) ;
• Creating a compute resource (having skipped discovery for brevity):
Model model = client . getModel ();
EntityBuilder entityBuilder = new EntityBuilder ( model );
Resource resource = entityBuilder . getResource ( " compute " );
resource . addMixin ( model . findMixin ( " debian7 " , " os_tpl " ));
resource . addMixin ( model . findMixin ( " small " , " resource_tpl " ));
resource . addAttribute ( Compute . MEMORY_ATTRIBUTE_NAME , " 2048 " );
URI location = client . create ( resource );
• Works with any cloud platform implementing OCCI!
• rOCCI (OpenNebula, AWS, MS Azurein progress ), openstack,
synnefo, . . .
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
15
www.egi.eu
jOCCI Alongside rOCCI
Where does jOCCI fit into the world?
(Admittedly from the point of view of an EGI person)
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
16
www.egi.eu
OCCI – the Cloudscape Today
Clients
Custom client app.
Native Ruby
Java
Native
application
jOCCI-api
rOCCI-api
http
occi
jOCCI-core
rOCCI-core
Application or
script using
command-line
executables
# Shell script
rOCCI-cli
rOCCI-api
rOCCI-api
Server
Apache
http
occi
Phusion Passenger
rOCCI-core
Custom client app.
Native Ruby
application
Server
mod_ssl http
occi
rOCCI-server
Independent
OCCI-compliant
server
Backends
rOCCI-core
Independent
OCCI-compliant
client
20 March 2015
EGI
http
occi
OpenNebula
MS Azure
ISGC ’15, Taipei, Taiwan
17
www.egi.eu
OCCI – the Cloudscape Today
Clients
NEW!
Custom client app.
Native Ruby
Java
Native
application
jOCCI-api
rOCCI-api
http
occi
jOCCI-core
rOCCI-core
Application or
script using
command-line
executables
# Shell script
rOCCI-cli
rOCCI-api
rOCCI-api
Server
Apache
http
occi
Phusion Passenger
rOCCI-core
Custom client app.
Native Ruby
application
Server
mod_ssl http
occi
rOCCI-server
Independent
OCCI-compliant
server
Backends
rOCCI-core
Independent
OCCI-compliant
client
20 March 2015
EGI
http
occi
OpenNebula
MS Azure
ISGC ’15, Taipei, Taiwan
17
www.egi.eu
OCCI – the Cloudscape Today
Clients
Custom client app.
Native Ruby
Java
Native
application
jOCCI-api
rOCCI-api
http
occi
jOCCI-core
rOCCI-core
Application or
script using
command-line
executables
# Shell script
rOCCI-cli
rOCCI-api
rOCCI-api
Server
Apache
http
occi
Phusion Passenger
rOCCI-core
Custom client app.
Native Ruby
application
Server
mod_ssl http
occi
rOCCI-server
Independent
OCCI-compliant
server
Backends
rOCCI-core
Independent
OCCI-compliant
client
20 March 2015
EGI
http
occi
OpenNebula
MS Azure
ISGC ’15, Taipei, Taiwan
17
www.egi.eu
jOCCI as an Independent Product
Multiple advantages of separation from rOCCI:
• multiple implementation attempts are crucial to the
development of open standards
• getting a new take on an old problem
• not building on old bugs and design mistakes
• getting an opportunity to test real-world interoperability
across different implementations
• one solution testing the other
• a chance to apply language-specific design patterns,
optimizations and use native project maintenance &
distribution mechanisms
• no need for emulation, cross-compilation or embedded
runtime environments for other languages
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
18
www.egi.eu
The Future I
?
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
19
www.egi.eu
The Future I
1.2
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
19
www.egi.eu
The Future I
No, seriously:
• OCCI 1.2 is the greatest development currently expected
•
•
•
•
•
•
Proper Attribute definition in the standard
New resource state (error)
JSON rendering – now preferred
Pagination syntax & semantics defined by the standard
New extensions for billing, SLAs and monitoring
Separation of rendering and protocol specs
• Missing from 1.2, i.e., plans beyond:
• XML rendering
. . . but JSON is a 100-% capable alternative
• Filtering mechanism redesign
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
19
www.egi.eu
The Future II
Aside of OCCI 1.2:
• Interoperability tests
• Cloud Plugfests
• EGI FedCloud testsuites
• Continued development of rOCCI backends
• MS Azure – in progress, pole in the spokes
• AWS – already out but you may have missed it
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
20
www.egi.eu
— T HAT
IS ALL
—
Questions?
20 March 2015
EGI
ISGC ’15, Taipei, Taiwan
21
www.egi.eu

Similar documents

rOCCI

rOCCI are not a suitable solution.

More information

PoS(ISGC2015)015

PoS(ISGC2015)015 The model is an overview of the server’s capabilities. It lists available OS templates (images) and Resource templates (pre-defined virtual machine sizes), actions supported by the underlying cloud...

More information