jclouds high level overview by adrian cole
TRANSCRIPT
![Page 1: jclouds High Level Overview by Adrian Cole](https://reader033.vdocument.in/reader033/viewer/2022051515/554bc700b4c9053a298b5711/html5/thumbnails/1.jpg)
Overview
@jclouds
![Page 2: jclouds High Level Overview by Adrian Cole](https://reader033.vdocument.in/reader033/viewer/2022051515/554bc700b4c9053a298b5711/html5/thumbnails/2.jpg)
Agenda
•What is jclouds?
•What does it do?
• Relationship to other projects
•Code examples
• Extras
![Page 3: jclouds High Level Overview by Adrian Cole](https://reader033.vdocument.in/reader033/viewer/2022051515/554bc700b4c9053a298b5711/html5/thumbnails/3.jpg)
What is jclouds?• Apache licensed Java multi-cloud SDK
• b 3/2009; ~525k loc; 110 contributors
• connects tools portably regardless of, yet also availing backend
• Over 40 cloud providers supported
• next release is 1.6 (March)
![Page 4: jclouds High Level Overview by Adrian Cole](https://reader033.vdocument.in/reader033/viewer/2022051515/554bc700b4c9053a298b5711/html5/thumbnails/4.jpg)
What does it do?• Helps projects become cloud projects,
and developers become cloud developers.
• through consistency in
• Tools vs Services
• Services vs Model
• API approach
![Page 5: jclouds High Level Overview by Adrian Cole](https://reader033.vdocument.in/reader033/viewer/2022051515/554bc700b4c9053a298b5711/html5/thumbnails/5.jpg)
Tools vs Services• jclouds helps existing tools connect to
cloud services
• a consistent integration pattern and configuration
• adjustable library dependencies
• sample patterns, integrations, and abstractions
![Page 6: jclouds High Level Overview by Adrian Cole](https://reader033.vdocument.in/reader033/viewer/2022051515/554bc700b4c9053a298b5711/html5/thumbnails/6.jpg)
Services vs Model• jclouds simplifies modeling of cloud
services
• Standards focus with pragmatic extensions. (JSR-330, 311)
• Clean means of addressing service quirks
• pluggable strategies for error/retry
![Page 7: jclouds High Level Overview by Adrian Cole](https://reader033.vdocument.in/reader033/viewer/2022051515/554bc700b4c9053a298b5711/html5/thumbnails/7.jpg)
API Approach• Backend before abstraction
• proprietary features, multiple abstractions
• Async/Sync api mirroring
• scalably deal with 400ms-3m response time
• Guava
• Universal Testing Approach
• unit, “expect”, and live tests
![Page 8: jclouds High Level Overview by Adrian Cole](https://reader033.vdocument.in/reader033/viewer/2022051515/554bc700b4c9053a298b5711/html5/thumbnails/8.jpg)
Who’s integrating?
you?
![Page 9: jclouds High Level Overview by Adrian Cole](https://reader033.vdocument.in/reader033/viewer/2022051515/554bc700b4c9053a298b5711/html5/thumbnails/9.jpg)
Alternatives• Roll-your-own
• Jersey, RESTEasy
• EC2-based cloud apis
• typica, jets3t
• Dasein Cloud API
• Proprietary Service Provider SDKs
![Page 10: jclouds High Level Overview by Adrian Cole](https://reader033.vdocument.in/reader033/viewer/2022051515/554bc700b4c9053a298b5711/html5/thumbnails/10.jpg)
BlobStore LoadBalancer
Compute DNS, Block Storage, Network, Identity
Portable APIs
Embeddable
Provider-Specific Hooks
40 built-in providers & 20 apis and dialects!
![Page 11: jclouds High Level Overview by Adrian Cole](https://reader033.vdocument.in/reader033/viewer/2022051515/554bc700b4c9053a298b5711/html5/thumbnails/11.jpg)
// initcontext = ContextBuilder.newBuilder(“cloudfiles-us”) .credentials(apikey, secret) .buildView(BlobStoreContext.class);
blobStore = context.getBlobStore();
// create containerblobStore.createContainerInLocation(null, “adriansmovies”);
// add blobblob = blobStore.blobBuilder("sushi.avi").payload(file).build();blobStore.putBlob(“adriansmovies”, blob);
java overview github jclouds/jclouds
![Page 12: jclouds High Level Overview by Adrian Cole](https://reader033.vdocument.in/reader033/viewer/2022051515/554bc700b4c9053a298b5711/html5/thumbnails/12.jpg)
@jclouds
java overview github jclouds/jclouds// initcontext = ContextBuilder.newBuilder(“openstack-nova”) .endpoint(“https://keystone:5000/v2.0”) .credentials(tenantUser, password) .modules(singleton(new SshjSshClientModule())) .buildView(ComputeServiceContext.class);
compute = context.getComputeService();
// create a couple nodes and open a couple portsnodes = compute.createNodesInGroup(“hbase-master”, 1, runScript(install). inboundPorts(60000, 60010));
// gather my ip addressesfor (NodeMetadata node : nodes) { node.getPublicAddresses(); node.getPrivateAddresses();}
12
![Page 13: jclouds High Level Overview by Adrian Cole](https://reader033.vdocument.in/reader033/viewer/2022051515/554bc700b4c9053a298b5711/html5/thumbnails/13.jpg)
jclouds locationsLocation helps normalize placement across resource types All top-level resources have a locationLocation metadata is extensible
listAssignableLocations
IE
US
SG
![Page 14: jclouds High Level Overview by Adrian Cole](https://reader033.vdocument.in/reader033/viewer/2022051515/554bc700b4c9053a298b5711/html5/thumbnails/14.jpg)
jclouds modularityAPIs are software focused Providers are offering focusedAPI + location + defaults = Provider
jclouds-blobstore
s3
aws-s3
walrus
eucaluptus-partnercloud-s3
googlestorage
scality-ring
scaleup-storage
![Page 15: jclouds High Level Overview by Adrian Cole](https://reader033.vdocument.in/reader033/viewer/2022051515/554bc700b4c9053a298b5711/html5/thumbnails/15.jpg)
@jclouds
New Toys
• Fluent Pagina,on (1.5)• Small distribu,on (1.6)
![Page 16: jclouds High Level Overview by Adrian Cole](https://reader033.vdocument.in/reader033/viewer/2022051515/554bc700b4c9053a298b5711/html5/thumbnails/16.jpg)
Fluent Pagination
• Many apis == pagination differences
• Desire ease, but also ability to “opt-out” of lazy continuations
• Can we make it easier to filter/transform resources?
![Page 17: jclouds High Level Overview by Adrian Cole](https://reader033.vdocument.in/reader033/viewer/2022051515/554bc700b4c9053a298b5711/html5/thumbnails/17.jpg)
FluentIterablelazy advance through all your metrics:FluentIterable<Metric> allMetrics = cloudwatch.getMetricApi().list().concat();
advance only until we find the load balancer we want:Optional<LoadBalancer> firstInterestingLoadBalancer = elb .getLoadBalancerApi().list() .concat() .firstMatch(isInterestingLB());
get only the first page of google instancesIterableWithMarker<Instance> firstPage = gce.getInstanceApiForProject("myproject").listFirstPage();
![Page 18: jclouds High Level Overview by Adrian Cole](https://reader033.vdocument.in/reader033/viewer/2022051515/554bc700b4c9053a298b5711/html5/thumbnails/18.jpg)
Small Distribution
• Before 1.6 we had more deps
• We now have much less deps
• You can now make a <5MB cloud app!
![Page 20: jclouds High Level Overview by Adrian Cole](https://reader033.vdocument.in/reader033/viewer/2022051515/554bc700b4c9053a298b5711/html5/thumbnails/20.jpg)
@jclouds
java overview github jclouds/jclouds
// create a couple nodes and open a couple portsnodes = compute.createNodesInGroup(“web-prod”, 2, runScript(installApache). inboundPorts(22, 8080));
// load balance the nodes mapping port 80 -> 8080lb = lbapi.createLoadBalancerInLocation(null, “web-prod”, “HTTP”, 80, 8080, nodes);
// gather my lb addressesfor (String lbAddress : lb.getAddresses()) { }
20
![Page 21: jclouds High Level Overview by Adrian Cole](https://reader033.vdocument.in/reader033/viewer/2022051515/554bc700b4c9053a298b5711/html5/thumbnails/21.jpg)
chef integration github jclouds/jclouds-chef
if (any(cookbookVersions, containsRecipe("apache2"))) runList = new RunListBuilder().addRecipe("apache2").build();
chef.updateRunListForGroup(runList, “web-prod”);
boot = chef.createClientAndBootstrapScriptForGroup(“web-prod”);
nodes = compute.createNodesInGroup(“web-prod”, 1, runScript(boot));
![Page 22: jclouds High Level Overview by Adrian Cole](https://reader033.vdocument.in/reader033/viewer/2022051515/554bc700b4c9053a298b5711/html5/thumbnails/22.jpg)
CLI github jclouds/jclouds-cli
![Page 23: jclouds High Level Overview by Adrian Cole](https://reader033.vdocument.in/reader033/viewer/2022051515/554bc700b4c9053a298b5711/html5/thumbnails/23.jpg)
BYON github jclouds/jclouds