Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten...

22
© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Dockerizing for the Deployment Platform of the Month - with OSGi Carsten Ziegeler & David Bosschaert | Adobe

Transcript of Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten...

Page 1: Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten Ziegeler

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Dockerizing for the Deployment Platform of the Month - with OSGiCarsten Ziegeler & David Bosschaert | Adobe

Page 2: Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten Ziegeler

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

David Bosschaert Adobe R&D Ireland OSGi EEG co-chair Apache member and committer ISO JTC1 SC38 (Cloud Computing) Ireland committee member

2

Page 3: Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten Ziegeler

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 3

Carsten Ziegeler RnD Adobe Research Switzerland Member of the Apache Software Foundation VP of Apache Felix and Sling OSGi Expert Groups and Board member

Page 4: Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten Ziegeler

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Create...

4

Page 5: Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten Ziegeler

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Containers to the Rescue Rapid / Simplified application deployment Lightweight, reduced overhead Portability across machines Sharing

5

Page 6: Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten Ziegeler

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Application Canning

6

OSGi app == Java App Various solutions Apache Karaf

Distribution Apache Sling

Launchpad Provisioning Model

Page 7: Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten Ziegeler

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Common Setup

7

OSGi Framework Launcher

Initial Bundles / Configuration

Runtime Provisioning

<feature name="my-project" version="1.0.0"> <bundle>mvn:com.mycompany.myproject/myproject-dao</bundle> <bundle>mvn:com.mycompany.myproject/myproject-service</bundle> <config name="com.foo.bar"/> </feature>

[feature name=“my-project“] com.mycompany.myproject/myproject-dao/1.0.0 mvn:com.mycompany.myproject/myproject-service/1.0.0[configurations] com.foo.bar

Page 8: Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten Ziegeler

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

OSGi Goodies Modularity Requirements and Capabilities

Explicitly declare and isolate dependencies

8

Page 9: Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten Ziegeler

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Run...

9

Page 10: Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten Ziegeler

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Yay dockerize your app!

10

docker container 1

App

clientdocker container 2

App

docker container 3

App

?

Page 11: Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten Ziegeler

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

You need a load balancer

11

docker container 1

App

docker container 2

App

docker container 3

App

client LB

Page 12: Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten Ziegeler

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 12

Page 13: Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten Ziegeler

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Example deployment: Sling Containers!

13

docker container 1

Sling

docker container 2

Sling

docker container 3

Sling

client LB

Page 14: Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten Ziegeler

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Manage...

14

Page 15: Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten Ziegeler

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Solutions

15

Docker Swarm

Amazon ECS

Page 16: Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten Ziegeler

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Here’s how… Docker Swarm/Compose

docker-compose up –d docker-compose scale mysling 3

DC/OS Marathon curl -i -H 'Content-Type: application/json' -d @<mysling.json>

http://mymarathon:8080/v2/apps Kubernetes

kubectl run mysling-node --image=cziegeler/apacheslingdemo --port:8080kubectl expose deployment mysling.node --type="LoadBalancer"

Amazon ECS aws ecs register-task-definition --family myslingfam --container-definitions

‘[{"name":"mysling”,"image":"cziegeler/apacheslingdemo","cpu":1,"memory":512,"essential":true}]’

aws ecs create-service --service-name myslingsvc --task-definition myslingfam --desired-count 3 16

yaml

json

Page 17: Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten Ziegeler

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Everybody takes Docker containers ... but applications are defined using various proprietary APIs makes it very labour intensive to switch can we have a common API please?

17

Page 18: Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten Ziegeler

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Or how about a common APIContainerFactory cf = … from service registry …

LoadBalancerConfig lbCfg = LoadBalancerConfig.builder(). port(80). pingLocation("/slingshot.html").build();ContainerGroupConfig config = ContainerGroupConfig.builder("mysling", "cziegeler/apacheslingdemo"). cpu(1). memory(512). instances(3). loadBalancer(lbCfg). port(8080, true).build();

Service svc = cf.getService(config);18

Page 19: Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten Ziegeler

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Demo!

19

Page 20: Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten Ziegeler

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

OSGi RFP 179 – Compute Management Service Accepted OSGi RFP Independent API to manage compute nodes Can work with RFC 183

Cluster Information Specification (previously Cloud Ecosystems) Node discovery, metadata and provisioning

20

Page 21: Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten Ziegeler

© 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Discussion

21

Page 22: Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten Ziegeler