Mais conteúdo relacionado Semelhante a Developing Distributed Internet of Things Applications Made Easy with Concierge - Jan Rellermeyer, Jochen Hiller, Tim Verbelen (20) Developing Distributed Internet of Things Applications Made Easy with Concierge - Jan Rellermeyer, Jochen Hiller, Tim Verbelen1. © 2015 IBM Corporation
EclipseCon Europe
3rd November 2015
Developing Distributed Internet
of Things Applications Made
Easy with Concierge
Jan S. Rellermeyer, IBM Research
Tim Verbelen, iMinds - Ghent University
Jochen Hiller, Deutsche Telekom AG
2. © 2015 IBM Corporation
Important Disclaimers
THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY.
WHILST EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION
CONTAINED IN THIS PRESENTATION, IT IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED.
ALL PERFORMANCE DATA INCLUDED IN THIS PRESENTATION HAVE BEEN GATHERED IN A CONTROLLED
ENVIRONMENT. YOUR OWN TEST RESULTS MAY VARY BASED ON HARDWARE, SOFTWARE OR INFRASTRUCTURE
DIFFERENCES.
ALL DATA INCLUDED IN THIS PRESENTATION ARE MEANT TO BE USED ONLY AS A GUIDE.
IN ADDITION, THE INFORMATION CONTAINED IN THIS PRESENTATION IS BASED ON IBM’S CURRENT PRODUCT
PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM, WITHOUT NOTICE.
IBM AND ITS AFFILIATED COMPANIES SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE
OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION.
NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO, OR SHALL HAVE THE EFFECT OF:
- CREATING ANY WARRANT OR REPRESENTATION FROM IBM, ITS AFFILIATED COMPANIES OR ITS OR THEIR
SUPPLIERS AND/OR LICENSORS
2
3. © 2015 IBM Corporation3
Introduction to the speakers: Jan S. Rellermeyer
9 years experience in doing systems research
Recent work focus:
– Embedded Systems
– Analytics on Modern Hardware
– Programming Languages and Runtimes
– Next Generation Data Centers
My contact information:
– rellermeyer@us.ibm.com
– Linked in rellermeyer
– Twitter @rellermeyer
– Slideshare.net rellermeyer
4. © 2015 IBM Corporation4
Introduction to the speakers: Tim Verbelen
Over 5 years experience doing research on mobile cloud computing
Invited Researcher of the OSGi Alliance
Recent work focus:
– Middleware for mobile cloud computing
– Concierge
– Internet of Things
My contact information:
– tim.verbelen@intec.ugent.be
– Linked in tim-verbelen
5. © 2015 IBM Corporation5
Introduction to the speakers: Jochen Hiller
10 years experience using Java/OSGi based systems
Recent work focus:
– Product Owner for commercial SmartHome platform
(based on OSGi)
– Concierge
– Identity Management/Security
My contact information:
– jo.hiller@gmail.com
– Linked in jochenhiller
– Twitter @jochenhiller
6. © 2015 IBM Corporation
Internet of Things
We’ve been here before ...
Mainframe Era
PC Era
Web Era
Mobile
Cloud
IoT
or not?
6
7. © 2015 IBM Corporation
IoT is Distributed
7
Cloud
SoftwareStack
Embedded Device
Mobile Gateway
Image: http://www.quirky.com
Image: http://www.nest.com
Image: http://www.thalmic.com
8. © 2015 IBM Corporation
Embedded and IoT: Why OSGi?
Java can run almost everywhere
From embedded device to the cloud
Dynamic linking, adaptable
Updating and maintaining long-running Java software
really better than “reboot”?
Complexity of large application
the mystical classpath
8
9. © 2015 IBM Corporation
OSGi Bundles and Services
• Modular Software Management
• Can be managed individually
• Understand versioning
• The implementation of modularity
is the Bundle
• Dynamism
• Well-defined life-cycle
• Lose coupling
• IoT can be easily implemented as a network of Services
Module A
Module B
Module C
9
10. © 2015 IBM Corporation
Concierge
Question: What is the (minimum) overhead of OSGi?
The “old” Concierge:
OSGi R3 core implementation developed during Jan’s PhD at ETH Zurich
optimized for mobile and embedded devices, has a footprint of only 86kB
People found the source code readable and understandable: 7 Java classes + 7
inner classes.
[J.S. Rellermeyer and G. Alonso: Concierge – A Service Platform for Resource-Constrained Devices. In: EuroSys 2007].
Image: http://www.linksys.com
10
11. © 2015 IBM Corporation
Eclipse Concierge
Goals:
Full OSGi core R5 compatibility
Keep a small footprint to work well on
embedded devices
Remain “readable”
Remain backwards-compatible
Java 5
Java 1.4?
Being a sandbox for innovation around OSGi
11
Image: http://raspberrypi.org
12. © 2015 IBM Corporation
Challenges
12
R3 R4 R5
28 classes
4.0
48 classes
4.2
73 classes
4.3
99 classes
4.1
30 classes
2005 2007 2009 2011 2012
13. © 2015 IBM Corporation
Eclipse Concierge
Goals:
Full OSGi core R5 compatibility
Goal achieved
Keep a small footprint to work well on
embedded devices
250kiB without debug symbols
330kiB with debug symbols
Remain “readable”
Currently 9 classes
Remain backwards-compatible
Java 5
13
How does it perform?
14. © 2015 IBM Corporation
Experiments
Beaglebone Rev A5
• AM335x 720MHz ARM Cortex-A8
• 256 MiB DDR2 RAM
• 4 GiB microSD card
• Angstrom Linux
• Java SE Embedded 1.7.0_21-b11 and
• Java SE Embedded build 1.8.0_06-b23 compact1
Raspberry Pi B
• ARM1176JZF-S 700 MHz ARM 11
• 512 MiB SDRAM (shared with GPU)
• 8 GiB SDHD card
• Raspbian Linux
• Java SE build 1.8.0-b132
14
Image: http://beaglebone.org
15. © 2015 IBM Corporation
OSGi Frameworks
Eclipse Equinox
• version 3.10.101.v20150820-1432
• 1.3 MiB
• (R6 framework)
Apache Felix
• version 5.4.0
• 675 kiB
Knopflerfish
• version 7.2.0
• 609kiB / 320kiB compact
Concierge
• version 5.0.0
• 245kiB
15
16. © 2015 IBM Corporation
Startup Time
VM = startup time of the JVM
Concierge is consistently the fastest
framework in terms of startup
time
16
0
2
4
6
8
10
12
14
16
18
20
Beaglebone ejre7 Beaglebone ejre8 Raspberry Pi
time(s)
VM
Concierge
Equinox
Felix
Knopflerfish
17. © 2015 IBM Corporation
Service Registry
Stress test
Register 10000 services
• Each one has a random value for the same key
• Range: byte => collisions
Perform 1000 lookups (getServiceReferences) for a random value
• Range: byte
Unregister the 10000 services
17
Registry
18. © 2015 IBM Corporation
Service Registry – Service Registration
Concierge is consistently the
fastest framework
Java 8 helps performance
18
0
2000
4000
6000
8000
10000
12000
14000
16000
Beaglebone ejre7 Beaglebone ejre8 Raspberry Pi
time (ms)
Concierge
Equinox
Felix
Knopflerfish
19. © 2015 IBM Corporation
Service Registry – Service Lookup
19
0
100000
200000
300000
400000
500000
600000
700000
Beaglebone ejre7 Beaglebone ejre8 Raspberry Pi
time (ms)
Concierge
Equinox
Felix
Knopflerfish
0
10000
20000
30000
40000
50000
60000
70000
80000
90000
100000
Beaglebone ejre7Beaglebone ejre8 Raspberry Pi
time (ms)
Concierge
Equinox
Felix
Knopflerfish
20. © 2015 IBM Corporation
Service Registry – Service Unregistration
20
0
500
1000
1500
2000
2500
3000
3500
4000
4500
Beaglebone ejre7 Beaglebone ejre8 Raspberry Pi
time (ms)
Concierge
Equinox
Felix
Knopflerfish
21. © 2015 IBM Corporation
Resolver
21
Generate 1000 “random bundles”
• Can either import or export up to 5 packages
• Choice of 50 packages in total
• For exports: generate a random package version from [1.0.0-21.0.0)
• For import: generate a random import range from the interval.
Install all 1000 bundles
Resolve the bundles
Benchmark turned out to be rather volatile…
22. © 2015 IBM Corporation
Resolver - Install
Performance is good
Operation tends to be I/O-bound
22
0
10000
20000
30000
40000
50000
60000
70000
80000
90000
Beaglebone ejre7 Beaglebone ejre8 Raspberry Pi
time(ms)
Concierge
Equinox
Felix
Knopflerfish
23. © 2015 IBM Corporation
Resolver - Resolve
Equinox is optimized for
resolving a large number of
bundles
First run (shown here) very
slow, subsequent runs
benefit from caching (faster
than any other framework)
Concierge is on par with Felix.
Could not get Knopflerfish to
resolve
23
0
20000
40000
60000
80000
100000
120000
140000
160000
180000
Beaglebone ejre7 Beaglebone ejre8 Raspberry Pi
time(ms)
Concierge
Equinox
Felix
Knopflerfish
24. © 2015 IBM Corporation
Usability
What does Usability mean for an OSGi framework?
Don’t be annoying…
Stay close to the (core) standard
Every OSGi framework has some extra functionality
Concierge has a built-in log service
Discrepancies between compile time and run time behavior is what makes OSGi
challenging
Log service in the framework => correlate application behavior with framework events
24
25. © 2015 IBM Corporation
XargsFileLauncher
$ java -jar framework/org.eclipse.concierge-5.0.0.*.jar samples/demo.xargs
# demo.xargs
-Dorg.osgi.framework.system.packages.extra+=javax.xml.parsers
# -Drepo=http://www.us.apache.org/dist/felix
-Drepo=localRepo
# load bundles, use wildcard notation for local files, not for URLs
-istart bundles/org.eclipse.concierge.shell-5.0.0.*.jar
-istart bundles/org.eclipse.concierge.service.startlevel-5.0.0.*.jar
-istart bundles/org.eclipse.concierge.service.packageadmin-5.0.0.*.jar
-istart ${repo}/org.apache.felix.httplite.complete-0.1.4.jar
-istart ${repo}/org.apache.felix.webconsole-4.2.14-all.jar
• Concierge supports Knopflerfish styled xargs file for startup
• Enhanced property (variable replacement) and install notation (wildcard support)
• Supports start level in scripts (-level <n>)
25
26. © 2015 IBM Corporation
How to Embed Concierge
Map<String, String> launchArgs = new HashMap<String, String>();
Framework framework = new Factory().newFramework(launchArgs);
framework.init();
framework.start();
BundleContext bundleContext = framework.getBundleContext();
Bundle shellBundle = bundleContext.installBundle(
"org.eclipse.concierge.shell-5.0.0.20151029184259.jar");
shellBundle.start();
bundleContext.installBundle("mybundle_1.0.0.jar");
// ...
// wait until framework will be terminated
framework.waitForStop(0);
26
27. © 2015 IBM Corporation
Remote Management
RESTful interface
• Exposing the framework and its internal state as resources
• Bundles
• Services
• Easy management of OSGi deployments through REST
• Command line tools
• Web interfaces
• Application-level
• REST service implementation will appear in Concierge 5.1
27
28. © 2015 IBM Corporation
Gateway
DYAMAND
Dynamic, Adaptive Management
of Networks and Devices
→ Exposes each “thing” as
OSGi service
A framework for distributed OSGi
→ Access “thing” services in the Cloud
http://aiolos.intec.ugent.be
http://dyamand.intec.ugent.be
Demo: AIOLOS
28
29. © 2015 IBM Corporation
What’s next?
Several work streams
• R6 compatibility
• More auxiliary bundles
• EventAdmin
• Remote services?
• Remote management based on REST interface
• More cool demos!
• Working with students from UNICAMP, Brazil as part of the Facebook Open Academy
program
• Help other projects with transitioning to Concierge
30. © 2015 IBM Corporation
Eclipse Concierge
Concierge is an OSGi framework optimized
for embedded devices and the
Internet of Things
It’s simplicity and usability can help with
developing complex, distributed IoT
applications with ease.
It’s fast, it’s pleasant, you should try it, too.
30
http://eclipse.org/concierge
http://git.eclipse.org/c/concierge/org.eclipse.concierge.git
Project
Homepage
Clone it
from here
31. © 2015 IBM Corporation31
Copyright and Trademarks
© IBM Corporation 2015. All Rights Reserved.
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International
Business Machines Corp., and registered in many jurisdictions worldwide.
Other product and service names might be trademarks of IBM or other companies.
A current list of IBM trademarks is available on the Web – see the IBM “Copyright and
trademark information” page at URL: www.ibm.com/legal/copytrade.shtml