Más contenido relacionado La actualidad más candente (20) Similar a Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten Ziegeler (20) Dockerizing apps for the Deployment Platform of the Month with OSGi - David Bosschaert & Carsten Ziegeler1. © 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Dockerizing for the Deployment Platform of the Month - with
OSGiCarsten Ziegeler & David Bosschaert | Adobe
2. © 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
3. © 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Carsten Ziegeler
RnD Adobe Research Switzerland
Member of the Apache Software Foundation
VP of Apache Felix and Sling
OSGi Expert Groups and Board member
3
4. © 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Create...
4
5. © 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
6. © 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
7. © 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
8. © 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
OSGi Goodies
Modularity
Requirements and Capabilities
Explicitly declare and isolate dependencies
8
9. © 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Run...
9
10. © 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Yay dockerize your app!
10
docker container 1
App
client
docker container 2
App
docker container 3
App
?
11. © 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
12. © 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 12
13. © 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
14. © 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Manage...
14
15. © 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Solutions
15
Docker Swarm
Amazon ECS
16. © 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:8080
kubectl 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":tru
e}]’
aws ecs create-service --service-name myslingsvc --task-definition myslingfam --desired-count 3
16
yaml
json
17. © 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
18. © 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Or how about a common API
ContainerFactory 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
19. © 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Demo!
19
20. © 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
21. © 2015 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Discussion
21