definition (wikipedia) what is deployment ? “software deployment is all of the activities that...

26
THE DEPLOY TOOL

Upload: andra-lester

Post on 18-Jan-2016

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

THE DEPLOY TOOL

Page 2: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

Definition (Wikipedia) What is deployment ?

“Software deployment is all of the activities that make a software system available for use.”

1. Install Software

2. Customize local configuration file(s)passwords, remote endpoints, …

executable(s) + libraries

Page 3: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

Situation 2010 Java

Restart installs softwareLog file stored locally Passwords had to be hardcoded or stored separately

in funny locations

C/C++Restarted installs softwareCopy to diskAuxiliary files accessed via network

No Standard Location !

No Standard Location !

Page 4: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

Analysis Deployment information is de facto not

standardizedDefault installation directoryDirectory structureProcess name…

No flexible way to install a product No influence on file/directory structureNo post-install changes (e.g. tailoring of config files)No configurable backup policy

Deployment Standardization Document

Page 5: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

Suggestion Define deployment configuration in file

CommonBuild’s product.xml is a good place○ Developers already know this○ Some deployment information is already there

No need for an additional system

Creation of an installation procedureUses product.xml to deploy applicationProjects should have certain deployment flexibility

Page 6: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

A Closer Look What to we need ?

File and directory structureInstallation locationBackup policyProcess nameMore ?

NomenclatureProduct is the name of the software as from repo

○ E.g. LSA serverApplication is the concrete instance

○ LHC LSA Server

Page 7: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

Deployment.xml (product.xml)...

<application name=“jmsagent”>

<deployment installLocation="/opt/diamon/agent-jms/" > <directory name="conf" mask="550" >   <file name="jmsconfig.xml" mask=“755" />   <file name="log/log4j.properties" /> <file name="log/log4j.properties“ source=“/nfs/fgr/”/> <file name="log/log4j.properties“ source=“svn://...”/>  </directory>   <directory name="log" mask="750" /> <backupPolicy keepBackups="2"/> <replaceString> <file name="bin/start.sh" var="VAR_1" value="my value" /> </replaceString> </deployment></application>...

Page 8: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

The Deploy Tool

Page 9: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

The Deploy Tool What is it for ?

Simplifying deployment process & reduce your workloadAllows developers to take influence on the installation

○ Takes information from deployment configEnforces deployment standardsReduces upgrade time by automation

deploy

MAVEN

CmbBuild

Page 10: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

The Deploy Tool and Maven Maven assembly creates a tarball

Assembly.xml required

Deploy Copies tarball to local diskCreates backupExtracts tarball to target install dirCopies aux filesPreserves directories/files from previous installationSends deployment notification (mail + STOMP)

Page 11: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

TAR.GZ

Default installation Java (Maven)

deployquery product info

/opt/…

NEXUS/Artifactory

Deployment Config

Page 12: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

Default installation C++

deploy

/opt/…

Executable + Aux

Repository

Deployment Config

Page 13: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

Features Deploy Tool

Notification

Preserve Files

Automatic Backups

Create Directories

Add additional Files

Set Access Rights

Create Install Log

Startscript Creation

Simulation Mode

Checkout from SVN

Safety checks

Page 14: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

Summary Unified way to install software Allows to simply customize installation Main tool in CO for Java & (many) C++ services Simplifies integration test Reduces workload for developers Standardises deployment Easy to extend Supports Maven (Artifactory & Nexus) Supports CommonBuild

Page 15: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install
Page 16: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

copera@cs-ccr-dev4:/)deploy -p diamon-notifier -a diamon-notifier -t /tmp/del[ INFO ] cmnbuild Found only one Application : diamon-notifier[ INFO ] cmnbuild Creating dependency file list..[ INFO ] install -------------------------------------------------------[ INFO ] install[ INFO ] install Installation of application 'diamon-notifier' for product 'diamon-notifier'[ INFO ] install[ INFO ] install Application : diamon-notifier[ INFO ] install Product : diamon-notifier[ INFO ] install Version : 1.9.4-002 (PRO)[ INFO ] install Release Date : Thursday, March 5, 2009 09:26:44[ INFO ] install Source : /user/pcrops/dist/accsoft/diamon/diamon-notifier/PRO[ INFO ] install Started on : Fri, 26 Apr 2013 10:48:30[ INFO ] install Target directory is : /tmp/del[ INFO ] install Triggered by : ('felixehm', 'copera')[ INFO ] install Host : cs-ccr-dev4.cern.ch[ INFO ] install Force installaton is : False[ INFO ] install Automatic rollback : False[ INFO ] install Keeping backups : 1[ INFO ] install SimulationMode : False[ INFO ] install[ INFO ] install Starting PreInstallation for diamon-notifier in /tmp/del[ INFO ] install Creating backup for /tmp/del (max 1 are kept)[ INFO ] install Creating /tmp/del[ INFO ] install Preinstallation finished[ INFO ] install Postinstallation starts[ INFO ] install Postinstallation finished[ INFO ] install Sending notifications to []

Page 17: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

product.xml<products>  <product name="diamon-agent-jms" version="1.0.2" directory=“/nfsrepo/ccsoft/diamon/diamon-agent/jms"> <desc>Diamon central JMS agent</desc>      <application name="jmsagent"> ...     </application>

  </product></product>

Page 18: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

product.xml<products>  <product name="diamon-agent-jms" version="1.0.2" directory=“/nsfrepo/ccsoft/diamon/diamon-agent/jms"> <desc>Diamon central JMS agent</desc>      <application name="jmsagent"> ...     </application>

  </product></product>

Location of source file

Location of source can be .tar.gz or directory

Page 19: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

Introducing Deployment Info<products>  <product name="diamon-agent-jms" version="1.0.2” directory="accsoft/diamon/diamon-agent/jms">

<application name=“jmsagent”> <deployment installLocation="/opt/diamon/agent-jms/" > <directory name="conf" mask="550" >          <file name="jmsconfig.xml" mask=“755" />          <file name="log/log4j.properties" /> <file name="log/log4j.properties“ source=“/user/nfs/fgr/” /> <file name="log/log4j.properties“ source=“svn://...”/>       </directory>       <directory name="log" mask="750" />     </deployment> </application>       </product></product>

File are copied from source directory

Page 20: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

Introducing Deployment Info<products>  <product name="diamon-agent-jms" version="1.0.2” directory="accsoft/diamon/diamon-agent/jms"> <desc>Diamon central JMS agent</desc>

<application name=“jmsagent”> <deployment installLocation="/opt/diamon/agent-jms/" > <directory name="conf" mask="550" >          <file name="jmsconfig.xml" mask=“755" />          <file name="log/log4j.properties" /> <file name="log/log4j.properties“ source=“/user/nfs/fgr/” /> <file name="log/log4j.properties“ source=“svn://...”/>       </directory>       <directory name="log" mask="750" />     </deployment> </application>       </product></product>

File are copied from arbitrary directory

Page 21: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

Introducing Deployment Info<products>  <product name="diamon-agent-jms" version="1.0.2” directory="accsoft/diamon/diamon-agent/jms"> <desc>Diamon central JMS agent</desc>

<application name=“jmsagent”> <deployment installLocation="/opt/diamon/agent-jms/" > <directory name="conf" mask="550" >          <file name="jmsconfig.xml" mask=“755" />          <file name="log/log4j.properties" /> <file name="log/log4j.properties“ source=“/user/nfs/fgr/” /> <file name="log/log4j.properties“ source=“svn://...”/>       </directory>       <directory name="log" mask="750" />     </deployment> </application>       </product></product>

File from SVN

Page 22: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

Backup Policy<products>  <product name="diamon-agent-jms" version="1.0.2” directory="accsoft/diamon/diamon-agent/jms"> <desc>Diamon central JMS agent</desc>

<application name=“jmsagent”> <deployment installLocation="/opt/diamon/agent-jms/" > <directory name="conf" mask="550" >          <file name="jmsconfig.xml" mask=“755" />          <file name="log/log4j.properties" /> <file name="log/log4j.properties“ source=“/user/nfs/fgr/” /> <file name="log/log4j.properties“ source=“svn://...”/>       </directory>       <directory name="log" mask="750" /> <backupPolicy keepBackups="2"/>     </deployment>

      </product></product>

.

..agent-jms/agent-jms.1/agent-jms.2/

Page 23: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

Replace Strings in Files <products>  <product name="diamon-agent-jms" version="1.0.2” directory="accsoft/diamon/diamon-agent/jms"> <desc>Diamon central JMS agent</desc>

<application name=“jmsagent”> <deployment installLocation="/opt/diamon/agent-jms/" > <directory name="conf" mask="550" >          <file name="jmsconfig.xml" mask=“755" />          <file name="log/log4j.properties" /> <file name="log/log4j.properties“ source=“/user/nfs/fgr/” /> <file name="log/log4j.properties“ source=“svn://...”/>       </directory>       <directory name="log" mask="750" /> <backupPolicy keepBackups="2"/> <replaceString>        <file name="bin/start.sh" var="VAR_1" value="my value" />    </replaceString>     </deployment>    </product></product>

Page 24: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

Tailoring Installation<products>  <product name="diamon-agent-jms“ ... > ... <deployment installLocation="/opt/diamon/agent-jms/" > <directory name="conf" mask="550" >          <file name="jmsconfig.xml" mask="400" />          <file name="log/log4j.properties" mask="400" />       </directory>       <directory name="log" mask="750" /> <backupPolicy keepBackups="2"/> <replaceString>        <file name="bin/start.sh" var="VAR_1" value="my value" />    </replaceString>     </deployment>

     <application name="jmsagent"> ...     </application>

  </product></product>

Page 25: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

Application Inheritance <products>  <product name="diamon-agent-jms"> ... <application name=“general”> <deployment installLocation="/opt/diamon/agent-jms/" > ...     </deployment> <application>

     <application name="jmsagent" > <!–global deployment info applies here -->      </application> <application name="jmsagent-dev" >      <deployment installLocation="/opt/diamon/agent-jms-dev/" > <!– additional to global deployment info -->        <directory name="conf">          <file name="log/log4j-dev.properties" />        </directory>       </deployment>     </application>  </product></product>

Page 26: Definition (Wikipedia)  What is deployment ? “Software deployment is all of the activities that make a software system available for use.” 1. Install

Generation of a Startscript<products>  <product name="diamon-agent-jms"> ... <deployment installLocation="/opt/diamon/agent-jms/" > ...     </deployment>

     <application name="jmsagent" processName="jmsagent-prod" >       <main-class name="cern.diamon.agent.jms.JmsCentralAgent"/>       <property name="cmw.mom.brokerlist” value="diamjms1:2506"/>       <property name="log4j.configuration"

value="$INSTALL_DIR/etc/log4j.properties"/>       <property name="agent.jms.configFile"

value="$INSTALL_DIR/etc/jmsconfig.xml" />     </application>

  </product></product>