Continuous Automated
Deployment with
Who are we
Director at Luminis Technologies
Member at the Apache Software Foundation
@m4rr5
Marcel Offermans
Jan Willem Ja...
Agenda
•Traditional Continuous Integration
•From EAR to bundles
•Versioning and baselining
•ACE basics
•Build env. setup w...
Typical CI workflow
(D)VCS CI EAR/WAR Target
?
Maven,!
scp, ftp, nfs,
smb, …
without OSGi and ACE
Monolithic to Modular
•Single, big, monolithic
application

•Versioned whenever
“something” changes
•On every change the
w...
What to version?
So we know their contents has changed
So we know the interface contract has changed
our focus here is on ...
Semantic Versioning
• Major: Backward incompatible change!
• Minor: Backward compatible change!
• Micro: Implementation ch...
Baselining
•Compares build with latest release
•Checks if version numbers should be bumped
•Uses byte code analysis
-­‐bas...
Baselining
•Bnd annotations
•@ProviderType

A  type  that  is  provided  by  the  
implementor  of  the  contract.  
•@Con...
Eclipse with Bndtools
demo
Apache ACE
•Software distribution framework
•Manage installation/upgrade of targets
•bundles
•configurations
•etc
ACE basics
target
target
target
network
provisioning.
server
component.
repository
client
management.
agent
management.
ag...
ACE basics
Store&Repository
Ar-fact Distribu-onFeature
License'Repository
Distribu1on Target
•group artifacts into feature...
Organising artifacts
Ar#fact Distribu#onFeature
Ar#fact
Ar#fact
Ar#fact
Ar#fact
Ar#fact
Feature
Feature
Feature
Distribu#o...
Apache ACE
demo
CI workflow
(D)VCS CI Bundles Target
Snapshots
Releases
OBR ACE
with OSGi & ACE
Build env. with ACE
Snapshots
Releases
Bundles from
build
A 1.0.1.SNAPSHOT
Workspace
B 1.0.1.SNAPSHOT
C 1.0.1.SNAPSHOT
Snapshot Repository
A 1.0.0
B 1.0.0
C 1.0.0
Release Repositor...
A 1.0.1.20131023
Workspace
B 1.0.1.20131023
C 1.0.1.20131023
A 1.0.1.20131024
B 1.0.1.20131024
C 1.0.1.20131024
Snapshot R...
Versioning bundles
from a build
Assume only bundle A changed since the release
A 1.0.1
Workspace
B 1.0.0
C 1.0.0
A 1.0.0.C...
What do we need?
CI!
Script that places bundles in the OBR
ACE

Server with snapshot and release
OBR
Target!
Management ag...
GoGo shell
•“Standard” OSGi shell (RFC-147)
•Powerful and extensible
•Available from Apache Felix
•ACE provides commands t...
Script
echo “Define repositories”	
sourceindex = (repo:index ../release)	
sourcerepo = (repo:repo R5 $sourceindex)	
target...
!
echo "For each bundle"	
each $deployed {	
echo "Get metadata from bundle"	
identity = $it getIdentity	
version = $it get...
Example
•Amdatu showcase in local git repo
•post-­‐commit or post-­‐receive hook
•Jenkins
•post build step to deploy to AC...
Demo
• With the Amdatu Showcase (extended)
demo
Cloud OSGi services!
http://www.amdatu.org/
Eclipse OSGi plugin!
http://bndtools.org/ !
Provisioning Server!
http://ace.ap...
Takk
Grazie
Thank!
you
Obrigado
Mahalo
DankeDank U
Merci
Gracias
Upcoming SlideShare
Loading in …5
×

Continuous Automated Deployment with Apache ACE

1,268 views
1,194 views

Published on

Nowadays, it is quite common to have build infrastructure that, on every change in a repository, builds your software and runs all your tests. However this is where most development teams stop. This talk demonstrates how you can consistently deploy systems from development to testing, staging and production.
With Bndtools we semantically version bundles in the Eclipse IDE. The continuous build is setup to automatically deploy to a bundle repository and create snapshots of changed bundles compared to a baselined version that is available in a release repository. By hooking up these repositories to Apache ACE, such updates can instantly be deployed to systems in different configurations, allowing you to deploy new features to QA systems, beta users and finally roll them out to all other customers.
This presentation was given at ApacheCon NA 2014, Denver.

Published in: Software
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,268
On SlideShare
0
From Embeds
0
Number of Embeds
12
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Continuous Automated Deployment with Apache ACE

  1. 1. Continuous Automated Deployment with
  2. 2. Who are we Director at Luminis Technologies Member at the Apache Software Foundation @m4rr5 Marcel Offermans Jan Willem Janssen Software Architect at Luminis Technologies committer and PMC member of Apache ACE @j_w_janssen
  3. 3. Agenda •Traditional Continuous Integration •From EAR to bundles •Versioning and baselining •ACE basics •Build env. setup with ACE •Demo
  4. 4. Typical CI workflow (D)VCS CI EAR/WAR Target ? Maven,! scp, ftp, nfs, smb, … without OSGi and ACE
  5. 5. Monolithic to Modular •Single, big, monolithic application
 •Versioned whenever “something” changes •On every change the whole application has to be redeployed •Many, small modules that can be combined to form applications •Modules versioned independently •Only modules that changed need to be redeployed
  6. 6. What to version? So we know their contents has changed So we know the interface contract has changed our focus here is on bundle versions, because they tell us what to update Bundles Exported Packages
  7. 7. Semantic Versioning • Major: Backward incompatible change! • Minor: Backward compatible change! • Micro: Implementation change! • Qualifier: Label, e.g. build number major.minor.micro(.qualifier) 1.0.0.abc tells us what has changed
  8. 8. Baselining •Compares build with latest release •Checks if version numbers should be bumped •Uses byte code analysis -­‐baseline:  *   -­‐removeheaders:  Bnd-­‐LastModified,Tool,Created-­‐By Eclipse with Bndtools
  9. 9. Baselining •Bnd annotations •@ProviderType
 A  type  that  is  provided  by  the   implementor  of  the  contract.   •@ConsumerType
 A  type  that  is  typically  implemented  by   the  consumer  of  the  contract.
  10. 10. Eclipse with Bndtools demo
  11. 11. Apache ACE •Software distribution framework •Manage installation/upgrade of targets •bundles •configurations •etc
  12. 12. ACE basics target target target network provisioning. server component. repository client management. agent management. agent management. agent
  13. 13. ACE basics Store&Repository Ar-fact Distribu-onFeature License'Repository Distribu1on Target •group artifacts into features and distributions to make them manageable •IKEA catalogue
  14. 14. Organising artifacts Ar#fact Distribu#onFeature Ar#fact Ar#fact Ar#fact Ar#fact Ar#fact Feature Feature Feature Distribu#on Target Target Target Target Target
  15. 15. Apache ACE demo
  16. 16. CI workflow (D)VCS CI Bundles Target Snapshots Releases OBR ACE with OSGi & ACE
  17. 17. Build env. with ACE Snapshots Releases Bundles from build
  18. 18. A 1.0.1.SNAPSHOT Workspace B 1.0.1.SNAPSHOT C 1.0.1.SNAPSHOT Snapshot Repository A 1.0.0 B 1.0.0 C 1.0.0 Release Repository A 1.0.1.SNAPSHOT B 1.0.1.SNAPSHOT C 1.0.1.SNAPSHOT Versioning bundles from a build Assume only bundle A changed since the release 1.0.1.SNAPSHOT > 1.0.1 even though they have the same version, not all snapshots are equal even if nothing changed, you still end up with a new snapshot bundle
  19. 19. A 1.0.1.20131023 Workspace B 1.0.1.20131023 C 1.0.1.20131023 A 1.0.1.20131024 B 1.0.1.20131024 C 1.0.1.20131024 Snapshot Repository A 1.0.0 B 1.0.0 C 1.0.0 Release Repository Versioning bundles from a build Assume only bundle A changed since the release 1.0.1.20131022 > 1.0.1 even though they have a different version, they might still be equal even if nothing changed, you still end up with a new bundle
  20. 20. Versioning bundles from a build Assume only bundle A changed since the release A 1.0.1 Workspace B 1.0.0 C 1.0.0 A 1.0.0.CDS001 Snapshot Repository B 1.0.0 C 1.0.0 A 1.0.0 B 1.0.0 C 1.0.0 Release Repository 1.0.0.CDS001 < 1.0.1 the bundle gets a new qualifier if it has changed if nothing changed, nothing new is deployed
  21. 21. What do we need? CI! Script that places bundles in the OBR ACE
 Server with snapshot and release OBR Target! Management agent configured to the ACE instance
  22. 22. GoGo shell •“Standard” OSGi shell (RFC-147) •Powerful and extensible •Available from Apache Felix •ACE provides commands to interact with its client API and OBRs
  23. 23. Script echo “Define repositories” sourceindex = (repo:index ../release) sourcerepo = (repo:repo R5 $sourceindex) targetrepo = (repo:repo OBR "http://localhost:8084/obr/repository.xml") releaserepo = (repo:repo OBR "http://localhost:8083/obr/repository.xml") ! echo "Deploying bundles" deployed = repo:cd $releaserepo $sourcerepo $targetrepo ! echo "Create workspace" workspace = (ace:cw) ! echo "For each bundle" each $deployed { echo "Get metadata from bundle" identity = $it getIdentity version = $it getVersion name = "$identity - $version" url = $it getUrl mimetype = $it getMimetype echo "Bundle exists?" Setup Define repositories Deploy bundles Create workspace Get metadata from bundle Bundle For each bundle yes next bundle done
  24. 24. ! echo "For each bundle" each $deployed { echo "Get metadata from bundle" identity = $it getIdentity version = $it getVersion name = "$identity - $version" url = $it getUrl mimetype = $it getMimetype echo "Bundle exists?" if { (coll:first 
 ($workspace la "(&(Bundle-SymbolicName=$identity) (Bundle-Version=$version))")) } { echo "$name already exists" } { echo "Create artifact for bundle" $workspace ca [ artifactName="$name" url="$url" mimetype="$mimetype" Bundle-SymbolicName="$identity" Bundle-Version="$version" ] } } ! echo "Commit workspace" $workspace commit exit 0 Get metadata from bundle Create artifact for bundle Bundle exists? Commit workspace Quit For each bundle no yes next bundle done
  25. 25. Example •Amdatu showcase in local git repo •post-­‐commit or post-­‐receive hook •Jenkins •post build step to deploy to ACE •ACE •deploys artifacts to targets
  26. 26. Demo • With the Amdatu Showcase (extended) demo
  27. 27. Cloud OSGi services! http://www.amdatu.org/ Eclipse OSGi plugin! http://bndtools.org/ ! Provisioning Server! http://ace.apache.org/! That’s us! http://luminis.eu/ Demo code! bitbucket.org/amdatu/showcase/
  28. 28. Takk Grazie Thank! you Obrigado Mahalo DankeDank U Merci Gracias

×