Continuous Automated
Deployment with

Thursday, October 31, 13
Who are we
Jago de Vreede
Senior Developer at Luminis Technologies

Marcel Offermans
Director at Luminis Technologies
Memb...
Agenda
• Traditional Continuous Integration
• From EAR to bundles
• Versioning and baselining
• ACE basics
• Build env. se...
Traditional Continuous
Integration
(enterprise) apps before OSGi

Source
repository

Thursday, October 31, 13
Traditional Continuous
Integration
(enterprise) apps before OSGi

Source
repository

Thursday, October 31, 13

CI
Traditional Continuous
Integration
(enterprise) apps before OSGi

Source
repository

Thursday, October 31, 13

CI

Package...
Traditional Continuous
Integration
(enterprise) apps before OSGi

Source
repository

Thursday, October 31, 13

CI

Package...
Traditional Continuous
Integration
(enterprise) apps before OSGi
Maven plugins,
scp, and many
others

Source
repository

T...
Monolithic to Modular
Single, big, monolithic
application

Versioned whenever
“something” changes

Modules versioned
indep...
What to version?
Bundles

So we know their contents has changed
rted Packages
Expo

So we know the interface contract has ...
Semantic Versioning
tells us what has changed

1.0.0.abc
major.minor.micro(.qualifier)
Major: Backward incompatible change...
Baselining
Compares build with latest release
Checks if version numbers should be
bumped
Uses byte code analysis
pse with ...
Eclipse with Bndtools
demo

Thursday, October 31, 13
Apache ACE
• Software distribution framework
• Manages the installation and upgrade
of bundles, configuration, etc. to
hete...
Organizing artifacts
• group artifacts into features and

distributions to make them manageable

• Analogy: IKEA catalog
L...
ACE basics
Ar#fact
Feature

Target

Ar#fact
Target
Ar#fact

Feature

Distribu#on
Target

Ar#fact

Feature
Target
Distribu#...
Initial configuration of
Apache ACE
demo

Thursday, October 31, 13
Build env. with ACE
Source
repository

Thursday, October 31, 13

CI
Build env. with ACE
Source
repository

Thursday, October 31, 13

CI

Bundles
Build env. with ACE
Source
repository

CI

Bundles

OBR

Releases

Snapshots

Thursday, October 31, 13
Build env. with ACE
Source
repository

CI

Bundles

OBR

Releases

Snapshots

Thursday, October 31, 13

ACE
Build env. with ACE
Source
repository

CI

Bundles

OBR

Releases

Snapshots

Thursday, October 31, 13

ACE

Target
Build env. with ACE

Releases

Bundles from
build
Thursday, October 31, 13

Snapshots
Versioning bundles
from a build
Assume only bundle A changed since the release
Workspace

Snapshot Repository

Release Rep...
Versioning bundles
from a build
Assume only bundle A changed since the release
Workspace

Snapshot Repository

Release Rep...
Versioning bundles
from a build
Assume only bundle A changed since the release
Workspace

Snapshot Repository

1.0.1.SNAPS...
Versioning bundles
from a build
Assume only bundle A changed since the release
Workspace

Snapshot Repository

1.0.1.SNAPS...
Versioning bundles
from a build
Assume only bundle A changed since the release
Workspace

Snapshot Repository

Release Rep...
Versioning bundles
from a build
Assume only bundle A changed since the release
Workspace

Snapshot Repository

Release Rep...
Versioning bundles
from a build
Assume only bundle A changed since the release
Workspace

Snapshot Repository

1.0.1.20131...
Versioning bundles
from a build
Assume only bundle A changed since the release
Workspace

Snapshot Repository

1.0.1.20131...
Versioning bundles
from a build
Assume only bundle A changed since the release
Workspace

Snapshot Repository

Release Rep...
Versioning bundles
from a build
Assume only bundle A changed since the release
Workspace

Release Repository

A 1.0.1

A 1...
Versioning bundles
from a build
Assume only bundle A changed since the release
Workspace

Snapshot Repository

Release Rep...
Versioning bundles
from a build
Assume only bundle A changed since the release
Workspace

A 1.0.1

B 1.0.0

C 1.0.0

Thurs...
What do we need?
CI
Script that places bundles in the OBR
ACE
Server with snapshot and release
OBR
Target
Management agent...
GoGo shell
• “Standard” OSGi shell (RFC-147)
• Powerful and extensible
• Available from Apache Felix
• ACE provides comman...
Script
Setup

echo “Define repositories”
sourceindex = (repo:index ../release)
sourcerepo = (repo:repo R5 $sourceindex)
ta...
echo "For each bundle"
each $deployed {
echo "Get metadata from bundle"
identity = $it getIdentity
version = $it getVersio...
Demo
• With the Amdatu Showcase (extended)
• https://bitbucket.org/amdatu/showcase

demo

Thursday, October 31, 13
ovisioning Server
Pr
ce.apache.org/
http://a

Eclipse OSGi plugin
http://bndtools.org/

Thursday, October 31, 13

Cloud OS...
Thursday, October 31, 13
kU
an
D

Maha

Merci

lo

Danke
Grazie

Takk

Obrigado

racias
G

Thursday, October 31, 13

Thank
you
Upcoming SlideShare
Loading in...5
×

Continuous Automated Deployment with Apache Ace - Jago de Vreede, Marcel Offermans

1,316

Published on

OSGi Community Event 2013 (http://www.osgi.org/CommunityEvent2013/Schedule)

ABSTRACT

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

No Downloads
Views
Total Views
1,316
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
32
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Continuous Automated Deployment with Apache Ace - Jago de Vreede, Marcel Offermans

  1. 1. Continuous Automated Deployment with Thursday, October 31, 13
  2. 2. Who are we Jago de Vreede Senior Developer at Luminis Technologies Marcel Offermans Director at Luminis Technologies Member at the Apache Software Foundation @m4rr5 Thursday, October 31, 13
  3. 3. Agenda • Traditional Continuous Integration • From EAR to bundles • Versioning and baselining • ACE basics • Build env. setup with ACE • Demo Thursday, October 31, 13
  4. 4. Traditional Continuous Integration (enterprise) apps before OSGi Source repository Thursday, October 31, 13
  5. 5. Traditional Continuous Integration (enterprise) apps before OSGi Source repository Thursday, October 31, 13 CI
  6. 6. Traditional Continuous Integration (enterprise) apps before OSGi Source repository Thursday, October 31, 13 CI Package (EAR/WAR)
  7. 7. Traditional Continuous Integration (enterprise) apps before OSGi Source repository Thursday, October 31, 13 CI Package (EAR/WAR) Target
  8. 8. Traditional Continuous Integration (enterprise) apps before OSGi Maven plugins, scp, and many others Source repository Thursday, October 31, 13 CI Package (EAR/WAR) ? Target
  9. 9. Monolithic to Modular Single, big, monolithic application Versioned whenever “something” changes Modules versioned independently On every change the whole application has to be redeployed Thursday, October 31, 13 Many, small modules that can be combined to form applications Only modules that changed need to be redeployed
  10. 10. What to version? Bundles So we know their contents has changed rted Packages Expo So we know the interface contract has changed our focus here is on bundle versions, because they tell us what to update Thursday, October 31, 13
  11. 11. Semantic Versioning tells us what has changed 1.0.0.abc major.minor.micro(.qualifier) Major: Backward incompatible change Minor: Backward compatible change Micro: Implementation change Qualifier: Label, e.g. build number Thursday, October 31, 13
  12. 12. Baselining Compares build with latest release Checks if version numbers should be bumped Uses byte code analysis pse with Bndtools Ecli -­‐baseline:  * -­‐removeheaders:  Bnd-­‐LastModified,Tool,Created-­‐By Thursday, October 31, 13
  13. 13. Eclipse with Bndtools demo Thursday, October 31, 13
  14. 14. Apache ACE • Software distribution framework • Manages the installation and upgrade of bundles, configuration, etc. to heterogenous targets Thursday, October 31, 13
  15. 15. Organizing artifacts • group artifacts into features and distributions to make them manageable • Analogy: IKEA catalog License'Repository Store&Repository Ar-fact Thursday, October 31, 13 Feature Distribu-on Distribu1on Target
  16. 16. ACE basics Ar#fact Feature Target Ar#fact Target Ar#fact Feature Distribu#on Target Ar#fact Feature Target Distribu#on Ar#fact Feature Ar#fact Thursday, October 31, 13 Target
  17. 17. Initial configuration of Apache ACE demo Thursday, October 31, 13
  18. 18. Build env. with ACE Source repository Thursday, October 31, 13 CI
  19. 19. Build env. with ACE Source repository Thursday, October 31, 13 CI Bundles
  20. 20. Build env. with ACE Source repository CI Bundles OBR Releases Snapshots Thursday, October 31, 13
  21. 21. Build env. with ACE Source repository CI Bundles OBR Releases Snapshots Thursday, October 31, 13 ACE
  22. 22. Build env. with ACE Source repository CI Bundles OBR Releases Snapshots Thursday, October 31, 13 ACE Target
  23. 23. Build env. with ACE Releases Bundles from build Thursday, October 31, 13 Snapshots
  24. 24. Versioning bundles from a build Assume only bundle A changed since the release Workspace Snapshot Repository Release Repository A 1.0.1.SNAPSHOT A 1.0.1.SNAPSHOT A 1.0.0 B 1.0.1.SNAPSHOT B 1.0.1.SNAPSHOT B 1.0.0 C 1.0.1.SNAPSHOT C 1.0.1.SNAPSHOT C 1.0.0 Thursday, October 31, 13
  25. 25. Versioning bundles from a build Assume only bundle A changed since the release Workspace Snapshot Repository Release Repository A 1.0.1.SNAPSHOT A 1.0.1.SNAPSHOT A 1.0.0 B 1.0.1.SNAPSHOT B 1.0.1.SNAPSHOT B 1.0.0 C 1.0.1.SNAPSHOT C 1.0.1.SNAPSHOT C 1.0.0 Thursday, October 31, 13 1.0.1.SNAPSHOT > 1.0.1
  26. 26. Versioning bundles from a build Assume only bundle A changed since the release Workspace Snapshot Repository 1.0.1.SNAPSHOT > 1.0.1 A 1.0.1.SNAPSHOT even though they have the same version, not all snapshots are equal B 1.0.1.SNAPSHOT B 1.0.1.SNAPSHOT A 1.0.1.SNAPSHOT C 1.0.1.SNAPSHOT Thursday, October 31, 13 C 1.0.1.SNAPSHOT Release Repository A 1.0.0 B 1.0.0 C 1.0.0
  27. 27. Versioning bundles from a build Assume only bundle A changed since the release Workspace Snapshot Repository 1.0.1.SNAPSHOT > 1.0.1 A 1.0.1.SNAPSHOT even though they have the same version, not all snapshots are equal B 1.0.1.SNAPSHOT B 1.0.1.SNAPSHOT A 1.0.1.SNAPSHOT even if nothing changed, C 1.0.1.SNAPSHOT C 1.0.1.SNAPSHOT you still end up with a new snapshot bundle Thursday, October 31, 13 Release Repository A 1.0.0 B 1.0.0 C 1.0.0
  28. 28. Versioning bundles from a build Assume only bundle A changed since the release Workspace Snapshot Repository Release Repository A 1.0.1.20131023 A 1.0.1.20131024 A 1.0.0 B 1.0.1.20131023 B 1.0.1.20131024 B 1.0.0 C 1.0.1.20131023 C 1.0.1.20131024 C 1.0.0 Thursday, October 31, 13
  29. 29. Versioning bundles from a build Assume only bundle A changed since the release Workspace Snapshot Repository Release Repository A 1.0.1.20131023 A 1.0.1.20131024 A 1.0.0 B 1.0.1.20131023 B 1.0.1.20131024 B 1.0.0 C 1.0.1.20131023 C 1.0.1.20131024 C 1.0.0 Thursday, October 31, 13 1.0.1.20131022 > 1.0.1
  30. 30. Versioning bundles from a build Assume only bundle A changed since the release Workspace Snapshot Repository 1.0.1.20131022 > 1.0.1 A 1.0.1.20131024 even though they have a different version, they might still be equal B 1.0.1.20131023 B 1.0.1.20131024 A 1.0.1.20131023 C 1.0.1.20131023 Thursday, October 31, 13 C 1.0.1.20131024 Release Repository A 1.0.0 B 1.0.0 C 1.0.0
  31. 31. Versioning bundles from a build Assume only bundle A changed since the release Workspace Snapshot Repository 1.0.1.20131022 > 1.0.1 A 1.0.1.20131024 even though they have a different version, they might still be equal B 1.0.1.20131023 B 1.0.1.20131024 A 1.0.1.20131023 even if nothing changed, C 1.0.1.20131023 C 1.0.1.20131024 you still end up with a new bundle Thursday, October 31, 13 Release Repository A 1.0.0 B 1.0.0 C 1.0.0
  32. 32. Versioning bundles from a build Assume only bundle A changed since the release Workspace Snapshot Repository Release Repository A 1.0.1 A 1.0.0.CDS001 A 1.0.0 B 1.0.0 B 1.0.0 B 1.0.0 C 1.0.0 C 1.0.0 C 1.0.0 Thursday, October 31, 13
  33. 33. Versioning bundles from a build Assume only bundle A changed since the release Workspace Release Repository A 1.0.1 A 1.0.0.CDS001 A 1.0.0 B 1.0.0 B 1.0.0 B 1.0.0 C 1.0.0 Thursday, October 31, 13 Snapshot Repository C 1.0.0 C 1.0.0 1.0.0.CDS001 < 1.0.1
  34. 34. Versioning bundles from a build Assume only bundle A changed since the release Workspace Snapshot Repository Release Repository A 1.0.0.CDS001 A 1.0.0 B 1.0.0 B 1.0.0 B 1.0.0 C 1.0.0 C 1.0.0 C 1.0.0 A 1.0.1 Thursday, October 31, 13 1.0.0.CDS001 < 1.0.1 the bundle gets a new qualifier if it has changed
  35. 35. Versioning bundles from a build Assume only bundle A changed since the release Workspace A 1.0.1 B 1.0.0 C 1.0.0 Thursday, October 31, 13 Snapshot Repository Release Repository A 1.0.0.CDS001 A 1.0.0 B 1.0.0 B 1.0.0 1.0.0.CDS001 < 1.0.1 the bundle gets a new qualifier if it has changed if nothing changed, nothing C 1.0.0 new is deployed C 1.0.0
  36. 36. 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 Thursday, October 31, 13
  37. 37. 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 Thursday, October 31, 13
  38. 38. Script Setup 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") Define repositories echo "Deploying bundles" deployed = repo:cd $releaserepo $sourcerepo $targetrepo Deploy bundles 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?" Thursday, October 31, 13 Create workspace For each bundle done next bundle Get metadata from bundle yes Bundle exists?
  39. 39. 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 Thursday, October 31, 13 For each bundle done next bundle Get metadata from bundle yes Bundle exists? no Create artifact for bundle Commit workspace Quit
  40. 40. Demo • With the Amdatu Showcase (extended) • https://bitbucket.org/amdatu/showcase demo Thursday, October 31, 13
  41. 41. ovisioning Server Pr ce.apache.org/ http://a Eclipse OSGi plugin http://bndtools.org/ Thursday, October 31, 13 Cloud OSGi services http://www.amdatu.org/ That’s us http://luminis.eu/
  42. 42. Thursday, October 31, 13
  43. 43. kU an D Maha Merci lo Danke Grazie Takk Obrigado racias G Thursday, October 31, 13 Thank you
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×