Slide 1

Slide 1 text

Introduction to Apache jclouds The java multi-cloud toolkit Ignasi Barrera Apache jclouds PMC [email protected]

Slide 2

Slide 2 text

Agenda •  What is Apache jclouds? •  What does it do? •  Code examples •  Roadmap: what’s next?

Slide 3

Slide 3 text

What is Apache jclouds? An open source multi-cloud toolkit for the Java platform

Slide 4

Slide 4 text

Why does multi-cloud matter? •  High availability •  Privacy •  Cost •  Performance •  Support One size does not fit all Avoid lock-in

Slide 5

Slide 5 text

What does it do? Helps existing tools connect to cloud services •  Consistent integration pattern •  Pluggable components •  Addresses service quirks in a clean way •  Error/retry handling •  Pagination •  (Re)Authentication

Slide 6

Slide 6 text

How? APIs A P I Endpoint Credentials … APIs are generic and represent common service offerings: EC2, Nova...

Slide 7

Slide 7 text

How? Providers P R O V I D E R A P I LOCATION + DEFAULTS Configuration Providers represent concrete cloud services: API + location + defaults AWS, GCE, Rackspace…

Slide 8

Slide 8 text

How? Pluggable strategies P R O V I D E R A P I LOCATION + DEFAULTS Configuration Pluggable strategies Error/retry policies Pagination Drivers

Slide 9

Slide 9 text

How? Portable abstractions A P I P R O V I D E R S E R V I C E S M O D E L Compute Blob Store Load Balancer

Slide 10

Slide 10 text

Connection to a Provider ComputeServiceContext ctx = ContextBuilder.newBuilder(”hpcloud-compute") .credentials("identity", "credential") .buildView(ComputeServiceContext.class);

Slide 11

Slide 11 text

Connection to an API ComputeServiceContext ctx = ContextBuilder.newBuilder(”hpcloud-compute") .credentials("identity", "credential") .buildView(ComputeServiceContext.class); ComputeServiceContext ctx = ContextBuilder.newBuilder(”openstack-nova") .credentials("identity", "credential") .endpoint(“http://keystone.endpoint:5000/v2.0/”) .buildView(ComputeServiceContext.class);

Slide 12

Slide 12 text

Getting the services ComputeServiceContext ctx = ContextBuilder.newBuilder(”hpcloud-compute") .credentials("identity", "credential") .buildView(ComputeServiceContext.class); ComputeServiceContext ctx = ContextBuilder.newBuilder(”openstack-nova") .credentials("identity", "credential") .endpoint(“http://keystone.endpoint:5000/v2.0/”) .buildView(ComputeServiceContext.class); ComputeService compute = ctx.getComputeService(); NovaApi nova = ctx.unwrapApi(NovaApi. class);

Slide 13

Slide 13 text

Compute example ComputeService compute = ctx.getComputeService(); Template template = compute.templateBuilder() .osFamily(OsFamily.UBUNTU) .minRam(2048) .options(inboundPorts(22, 80)) .build(); compute.createNodesInGroup("jclouds", 1, template);

Slide 14

Slide 14 text

Configure a node compute.runScriptOnNode(“node-id”, script, options) compute.runScriptOnNodesMatching(filter, script, options) compute.submitScriptOnNode(“node-id”, script, options)

Slide 15

Slide 15 text

Access the node SshClient ssh = ctx.utils().sshForNode().apply(“node-id”);

Slide 16

Slide 16 text

Access the node SshClient ssh = ctx.utils().sshForNode().apply(“node-id”); ssh.get(path); ssh.put(path, content); ExecResponse result = ssh.exec(script); ExecChannel channel = ssh.execChannel(script);

Slide 17

Slide 17 text

Open source ecosystem •  Apache Stratos •  Apache Brooklyn (incubating) •  Jenkins •  Chef •  jclouds CLI

Slide 18

Slide 18 text

What’s next? •  Dropping support for Java 6 •  OpenStack Neutron and Swift refactor •  Docker •  DigitalOcean API v2 •  More docs!

Slide 19

Slide 19 text

Thank you! http://jclouds.apache.org