continuous automated deployment with apache ace · typical ci workflow (d)vcs ci ear/war? target...
TRANSCRIPT
![Page 1: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/1.jpg)
Continuous Automated Deployment with
![Page 2: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/2.jpg)
Who are we
Director at Luminis Technologies Member at the Apache Software Foundation
@m4rr5
Marcel Offermans
Jan Willem JanssenSoftware Architect at Luminis Technologies committer and PMC member of Apache ACE
@j_w_janssen
![Page 3: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/3.jpg)
Agenda• Traditional Continuous Integration
• From EAR to bundles
• Versioning and baselining
• ACE basics
• Build env. setup with ACE
• Demo
![Page 4: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/4.jpg)
Typical CI workflow
(D)VCS CI EAR/WAR Target?Maven,!
scp, ftp, nfs, smb, …
without OSGi and ACE
![Page 5: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/5.jpg)
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
![Page 6: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/6.jpg)
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
![Page 7: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/7.jpg)
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
![Page 8: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/8.jpg)
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
![Page 9: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/9.jpg)
Baselining• Bnd annotations
•@ProviderTypeA type that is provided by the implementor of the contract.
•@ConsumerTypeA type that is typically implemented by the consumer of the contract.
![Page 10: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/10.jpg)
Eclipse with Bndtools
demo
![Page 11: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/11.jpg)
Apache ACE• Software distribution framework
• Manage installation/upgrade of targets
• bundles
• configurations
• etc
![Page 12: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/12.jpg)
ACE basics
target
target
target
networkprovisioning.
server
component.repository
clientmanagement.
agent
management.agent
management.agent
![Page 13: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/13.jpg)
ACE basics
Store&Repository
Ar-fact Distribu-onFeature
License'Repository
Distribu1on Target
• group artifacts into features and distributions to make them manageable
• IKEA catalogue
![Page 14: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/14.jpg)
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
![Page 15: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/15.jpg)
Apache ACE
demo
![Page 16: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/16.jpg)
CI workflow
(D)VCS CI Bundles Target
Snapshots
Releases
OBR ACE
with OSGi & ACE
![Page 17: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/17.jpg)
Build env. with ACE
Snapshots
Releases
Bundles from build
![Page 18: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/18.jpg)
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
![Page 19: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/19.jpg)
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
![Page 20: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/20.jpg)
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 Repository1.0.0.CDS001 < 1.0.1
the bundle gets a new qualifier if it has changed
if nothing changed, nothing new is deployed
![Page 21: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/21.jpg)
What do we need?CI!Script that places bundles in the OBR
ACEServer with snapshot and release OBRTarget!Management agent configured to the ACE instance
![Page 22: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/22.jpg)
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
![Page 23: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/23.jpg)
Scriptecho “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?" if { (coll:first
Setup
Define repositories
Deploy bundles
Create workspace
Get metadata from bundle
Create artifact for bundle
Bundle exists?
Commit workspace
Quit
For each bundle
no
yes
next bundle
done
![Page 24: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/24.jpg)
!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 commitexit 0
Setup
Define repositories
Deploy bundles
Create workspace
Get metadata from bundle
Create artifact for bundle
Bundle exists?
Commit workspace
Quit
For each bundle
no
yes
next bundle
done
![Page 25: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/25.jpg)
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
![Page 26: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/26.jpg)
Demo• With the Amdatu Showcase (extended)
demo
![Page 27: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/27.jpg)
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/
![Page 28: Continuous Automated Deployment with Apache ACE · Typical CI workflow (D)VCS CI EAR/WAR? Target Maven,! scp, ftp, nfs, ... ACE basics Store&Repository Ar-fact Feature Distribu-on](https://reader035.vdocument.in/reader035/viewer/2022070711/5ec99686e42f933a7879eeb6/html5/thumbnails/28.jpg)
TakkGrazie
Thank!you
Obrigado
MahaloDankeDank U
Merci
Gracias