You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Karthik <ka...@xius.org> on 2005/12/28 11:04:27 UTC

MULTI DEPLOYMENT


Hi form,
I am a begineer in here.

I have a single application and currently 3 systems,
and need too use ANT to deploy the application on all the 3 systems.

The systems may increase in next quater...

  So have to develop the build.xml file in such a way for flexibility....

 I have gone thru the documentation on using the tasks ,cant figure out how
to achieve this feature

 some body please help me



with regards
karthik





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: MULTI DEPLOYMENT

Posted by Karthik <ka...@xius.org>.
Hi Form

   To be more specific about the Argument.

   >>It depends on the nature of your deployment problem.

   The nature of the hindrance is applying patches/rollback version's of
bulk is time consuming.

   So have to automise  the task of applying patches/rollback version's.

   and can be achieved  as follows.

   1)The application patches is for 'WAR' post deployment only.

   2)Need to develop a task using ANT for multi Server (more then one)
deployment scenireo.




Please somebody Help me.

with regards
Karthik


-----Original Message-----
From: Steve Loughran [mailto:stevel@apache.org]
Sent: Thursday, December 29, 2005 5:34 AM
To: Ant Users List
Subject: Re: MULTI DEPLOYMENT


Karthik wrote:

>
> Hi form,
> I am a begineer in here.
>
> I have a single application and currently 3 systems,
> and need too use ANT to deploy the application on all the 3 systems.
>
> The systems may increase in next quater...
>
>   So have to develop the build.xml file in such a way for flexibility....
>
>  I have gone thru the documentation on using the tasks ,cant figure out
how
> to achieve this feature
>

It depends on the nature of your deployment problem. If its just 'how do
I copy files to three different systems", then use property file and
<property file="secure/${server}.properties" /> to pull in a different
set of properties for each target system.

If you have a more complex problem like "how do bring up my app on
jboss+mysql on host A, tomcat and derby on host B, with clean install of
everything if needed", then the project I work on by day, SmartFrog, is
more suited to your needs: http://smartfrog.org/ . You can initiate a
deployment from Ant.

-Steve


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.8/215 - Release Date: 12/27/2005



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.8/215 - Release Date: 12/27/2005



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: MULTI DEPLOYMENT

Posted by Karthik <ka...@xius.org>.
Hi Form

   To be more specific about the Argument.

   >>It depends on the nature of your deployment problem.

   The nature of the hindrance is applying patches/rollback version's of
bulk is time consuming.

   So have to automise  the task of applying patches/rollback version's.

   and can be achieved  as follows.

   1)The application patches is for 'WAR' post deployment only.

   2)Need to develop a task using ANT for multi Server (more then one)
deployment scenireo.




Please somebody Help me.

with regards
Karthik


-----Original Message-----
From: Steve Loughran [mailto:stevel@apache.org]
Sent: Thursday, December 29, 2005 5:34 AM
To: Ant Users List
Subject: Re: MULTI DEPLOYMENT


Karthik wrote:

>
> Hi form,
> I am a begineer in here.
>
> I have a single application and currently 3 systems,
> and need too use ANT to deploy the application on all the 3 systems.
>
> The systems may increase in next quater...
>
>   So have to develop the build.xml file in such a way for flexibility....
>
>  I have gone thru the documentation on using the tasks ,cant figure out
how
> to achieve this feature
>

It depends on the nature of your deployment problem. If its just 'how do
I copy files to three different systems", then use property file and
<property file="secure/${server}.properties" /> to pull in a different
set of properties for each target system.

If you have a more complex problem like "how do bring up my app on
jboss+mysql on host A, tomcat and derby on host B, with clean install of
everything if needed", then the project I work on by day, SmartFrog, is
more suited to your needs: http://smartfrog.org/ . You can initiate a
deployment from Ant.

-Steve


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.8/215 - Release Date: 12/27/2005



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: MULTI DEPLOYMENT

Posted by Steve Loughran <st...@apache.org>.
Karthik wrote:

> 
> Hi form,
> I am a begineer in here.
> 
> I have a single application and currently 3 systems,
> and need too use ANT to deploy the application on all the 3 systems.
> 
> The systems may increase in next quater...
> 
>   So have to develop the build.xml file in such a way for flexibility....
> 
>  I have gone thru the documentation on using the tasks ,cant figure out how
> to achieve this feature
> 

It depends on the nature of your deployment problem. If its just 'how do 
I copy files to three different systems", then use property file and 
<property file="secure/${server}.properties" /> to pull in a different 
set of properties for each target system.

If you have a more complex problem like "how do bring up my app on 
jboss+mysql on host A, tomcat and derby on host B, with clean install of 
everything if needed", then the project I work on by day, SmartFrog, is 
more suited to your needs: http://smartfrog.org/ . You can initiate a 
deployment from Ant.

-Steve


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: MULTI DEPLOYMENT

Posted by glenn opdycke-hansen <gl...@gmail.com>.
I see the changes in the following.  It appears that the change is
integrated.  I have tried this change and it worked for me.

Log of
/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java
Revision 278545  - (view) (download) (as text)     - [select for diffs]
  Modified  Wed Aug 31 19:39:14 2005 UTC (4 months, 1 week ago) by
mbenson


On 1/12/06, Steve Loughran <st...@apache.org> wrote:
> glenn opdycke-hansen wrote:
> > Steve,
> > I have been looking at using Ant for application deployment to multiple
servers.
> > I see there is a known problem with ant 1.6.5 where a sshexec request
> > will close stdout.  This can be patched, but this problem is pretty
> > serious since multiple sshexec requests would be needed.
>
> Do you know if it has been fixed in ant1.7? If not, now is the time to
> get a patch in.
>

Re: MULTI DEPLOYMENT

Posted by Steve Loughran <st...@apache.org>.
glenn opdycke-hansen wrote:
> Steve,
> I have been looking at using Ant for application deployment to multiple servers.
> I see there is a known problem with ant 1.6.5 where a sshexec request
> will close stdout.  This can be patched, but this problem is pretty
> serious since multiple sshexec requests would be needed.

Do you know if it has been fixed in ant1.7? If not, now is the time to 
get a patch in.

> I have been looking at the documentation for SmartFrog.  Can you point
> out a doc that describes the issues of deployment?

I would have a look at the overview presentation we gave at OSCon:
http://www.hpl.hp.com/research/smartfrog/presentations/Taming_deployment_with_SmartFrog.pdf

> This would include distribution of build files, execution of
> deployment scripts, configuration, and logging/notification?

Probably the best paper on how to use ant for large scale deployment is 
the "Advanced deployment" chapter in Java Development with Ant, in which 
we covered how to use property files to control uploading of build files 
to different targets, then remotely executing them. I probably used 
ftp+telnet though, not scp/ssh.

Smartfrog is not a scripting tool; you are really trying to describe the 
static system state; which things should be running in a correctly 
functioning system. It just so happens that to deploy some thing you 
need to run scripts or do other actions in a sequence, so there are some 
workflow components you deploy to run stuff in a sequence, handle 
failures etc. A lot of the examples (and real stuff)  has tended to drop 
down to unix shell scripts to do stuff like install apache, mysql, etc. 
One of the things I did after joining the project was try and add more 
platform independence, with constructs like Ant's file type, and a 
better java runner, for java execution (that is a bit unfair, as 
smartfrog has always been really good at deploying stuff in new 
processes, but I needed separate process execution to escape from the 
security restrictions of signed-code-only).

Logging and notification. hmmm. Logging is done, though logging in a 
distributed system is part of the ongoing problem of "how do you monitor 
distributed systems properly". It helps to have all the clocks in sync, 
otherwise it becomes hard to determine the 'absolute' order of things 
happening. Realistically, there is no absolute order of events in a 
distributed system, we are all radio astronomers looking at distant 
events in the past, trying to work out why a server disapperaed for no 
apparent reason.

-steve


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: MULTI DEPLOYMENT

Posted by glenn opdycke-hansen <gl...@gmail.com>.
Steve,
I have been looking at using Ant for application deployment to multiple servers.
I see there is a known problem with ant 1.6.5 where a sshexec request
will close stdout.  This can be patched, but this problem is pretty
serious since multiple sshexec requests would be needed.
I have been looking at the documentation for SmartFrog.  Can you point
out a doc that describes the issues of deployment?
This would include distribution of build files, execution of
deployment scripts, configuration, and logging/notification?

Thanks much!
--glenn

On 1/4/06, Steve Loughran <st...@apache.org> wrote:
...
> If it is more complex you have just entered the world of systems
> management. This is no longer a build-time step, it is something that
> operations want to get involved in too. SmartFrog (http://smartfrog.org)
> is one option. Others are
>
> -the premium big-system management tools like the Microsoft Datacenter
> thing,
> -linux  rpms (that is, package everything as rpms and use your server's
> RPM tools to install stuff).
> -cfengine (unix/linux only)
> -bcfg
> -lcfg (lcfg.org)
>
> Large-Scale CM is still a research topic. 3 machines is solved. 500+
> nodes is considered leading edge.
> http://config.sage.org/faq.html
> http://homepages.informatics.ed.ac.uk/group/lssconf/
>
> Before you try any of this, find out who will be in charge of keeping
> the machine operational and talk to them. Find out what they
> like/dislike, and work with them to come up with a solution that
> everyone is happy with.
>
>
> -Steve
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: MULTI DEPLOYMENT

Posted by Steve Loughran <st...@apache.org>.
James Fuller wrote:
> Karthik wrote:
> 
>> Hi For
>>
>>
>>   But every targets have to be run 
>>   seperately for every deployment / roll back process for 1..n servers.
>>  
>>
> 
> Hello Karthik,
> 
> I think one of the problems people encounter often when designing a
> build/deploy system is trying to write the entire
> script in one step.
> 
> All the problem(s) as you are defining, are regularly solved by Ant in
> many different ways, so I would suggest;
> 
> * start off by writing one script for one machine, think about 1....n
> machines after you have fully defined deployment on a single machine.
> 
> * define standard targets (read this
> http://ant.apache.org/ant_in_anger.html)

Also: by the same author,

Making Web Services that work:
http://www.hpl.hp.com/techreports/2002/HPL-2002-274.html

The advanced deployment chapter of "Java Development with Ant"

> 
> * parameterise your Ant script by using Ant properties, this way when u
> do get around to deploying to other machines all you have to do is
> supply different Ant properties instead of have a variation on Ant script
> 
> * another way to parameterise your Ant script is to have a run wrapper
> (batch shell script) that runs Ant correctly for the platform (sets up
> env vars...etc)
> 
> * investigate CruiseControl, LuntBuild, or perhaps AnthillPro which will
> run your scripts at regular intervals and adds a bit of a management
> layer on top of Ant; this makes your Ant scripts simpler as well

I would do this before anything else.

> 
> * note, Ant is really good at 'building' software, in sophisticated
> deployments, for example where one is tracking incremental requirements
> are being satisified in each build, or where the build and deployment
> itself is a 'delta' type build that is just deploying certain components
> or patches you may need to investigate something like smartfrog (HP),
> depends
> 

Yes, deployment is really a form of system management, to be precise the 
area known as "Configuration Management" (CM) not to be confused with 
SCM, Software Configuration Management, which tends to be about source 
control)

Ant is a build tool, to go from source code to tested binaries, with 
publishing operations. Its workflow is built around a simple model of 
everything working or the build halting. There is no built in notion of 
rollback, retries, nightly restarts and other aspects of a deployment 
workflow.

Deploying to production systems is a different operation. It may be 
simple (copy the .war  to where jboss or tomcat expects it), or it may 
be very complex (install jboss and mysql, set up the db and point the 
deployed web app at it).

If your deployment is simple copy-style, then you can get away with 
ant's <copy> task, though I'd turn dependency checking off so you can 
force in older versions on demand. This is very easy to parameterise (a 
destination per machine), and you can use things like scp to do remote 
deployment.

If it is more complex you have just entered the world of systems 
management. This is no longer a build-time step, it is something that 
operations want to get involved in too. SmartFrog (http://smartfrog.org) 
is one option. Others are

-the premium big-system management tools like the Microsoft Datacenter 
thing,
-linux  rpms (that is, package everything as rpms and use your server's 
RPM tools to install stuff).
-cfengine (unix/linux only)
-bcfg
-lcfg (lcfg.org)

Large-Scale CM is still a research topic. 3 machines is solved. 500+ 
nodes is considered leading edge.
http://config.sage.org/faq.html
http://homepages.informatics.ed.ac.uk/group/lssconf/

Before you try any of this, find out who will be in charge of keeping 
the machine operational and talk to them. Find out what they 
like/dislike, and work with them to come up with a solution that 
everyone is happy with.


-Steve

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: MULTI DEPLOYMENT

Posted by James Fuller <ji...@ruminate.co.uk>.
Karthik wrote:

>Hi For
>
>
>   But every targets have to be run 
>   seperately for every deployment / roll back process for 1..n servers.
>  
>

Hello Karthik,

I think one of the problems people encounter often when designing a
build/deploy system is trying to write the entire
script in one step.

All the problem(s) as you are defining, are regularly solved by Ant in
many different ways, so I would suggest;

* start off by writing one script for one machine, think about 1....n
machines after you have fully defined deployment on a single machine.

* define standard targets (read this
http://ant.apache.org/ant_in_anger.html)

* parameterise your Ant script by using Ant properties, this way when u
do get around to deploying to other machines all you have to do is
supply different Ant properties instead of have a variation on Ant script

* another way to parameterise your Ant script is to have a run wrapper
(batch shell script) that runs Ant correctly for the platform (sets up
env vars...etc)

* investigate CruiseControl, LuntBuild, or perhaps AnthillPro which will
run your scripts at regular intervals and adds a bit of a management
layer on top of Ant; this makes your Ant scripts simpler as well

* note, Ant is really good at 'building' software, in sophisticated
deployments, for example where one is tracking incremental requirements
are being satisified in each build, or where the build and deployment
itself is a 'delta' type build that is just deploying certain components
or patches you may need to investigate something like smartfrog (HP),
depends

start off simple and add complexity in incremental steps.

gl Jim Fuller


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: MULTI DEPLOYMENT

Posted by Karthik <ka...@xius.org>.
Hi For


   But every targets have to be run 
   seperately for every deployment / roll back process for 1..n servers.



with regars
KARTHIK
-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org]
Sent: Monday, January 02, 2006 10:53 AM
To: user@ant.apache.org
Subject: Re: MULTI DEPLOYMENT


On Mon, 2 Jan 2006, Karthik <ka...@xius.org> wrote:

>   Can this be done in another way

Sure.

>   1)Create destination targets fixed for 1..n servers in the
>     build.xml.

works

>   2)fire the Ant tasks in loop for deployment.

loops are not really supported in Ant - and not liked by most Ant
developers either.

Personally I'd write a deploy-all target that depends on the targets
of step one and add the new target name to the depends list if you add
a new system.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.10/218 - Release Date: 1/2/2006



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: MULTI DEPLOYMENT

Posted by Stefan Bodewig <bo...@apache.org>.
On Mon, 2 Jan 2006, Karthik <ka...@xius.org> wrote:

>   Can this be done in another way

Sure.

>   1)Create destination targets fixed for 1..n servers in the
>     build.xml.

works

>   2)fire the Ant tasks in loop for deployment.

loops are not really supported in Ant - and not liked by most Ant
developers either.

Personally I'd write a deploy-all target that depends on the targets
of step one and add the new target name to the depends list if you add
a new system.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: MULTI DEPLOYMENT

Posted by Karthik <ka...@xius.org>.
Hi

  Thx for the early Response.

  Can this be done in another way


  1)Create destination targets fixed for 1..n servers in the build.xml.
  2)fire the Ant tasks in loop for deployment.
  

 Am i doing the correct or wrong  design ?
  
Please some body do the need full.


with regards
Karthik

-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org]
Sent: Monday, January 02, 2006 10:29 AM
To: user@ant.apache.org
Subject: Re: MULTI DEPLOYMENT


On Mon, 2 Jan 2006, Karthik <ka...@xius.org> wrote:

> Please excuse me,I am raising the Form again and agian ,need help in
> here.

It is very difficult to help you since nobody can guess what "deploy"
means in your context.

> I have a single application and currently 3 systems of different
> OS's[ LINUX / UNIX / WINWOSW ], and need too use ANT [Only Once ] in
> to deploy the application on all the 3 systems.
> 
> The systems may increase in next quater...

If you can figure out how to deploy to each of the existing systems
(can't help as I don't know what it means in your case, see above),
write a single build file for each of them.  Say unix.xml, windows.xml
and linux.xml with deploy targets that perform the steps needed.  In
your build.xml use the subant task to invoke them.  As you add new
target machines, you add a new build file.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.10/218 - Release Date: 1/2/2006



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: MULTI DEPLOYMENT

Posted by Stefan Bodewig <bo...@apache.org>.
On Mon, 2 Jan 2006, Karthik <ka...@xius.org> wrote:

> Please excuse me,I am raising the Form again and agian ,need help in
> here.

It is very difficult to help you since nobody can guess what "deploy"
means in your context.

> I have a single application and currently 3 systems of different
> OS's[ LINUX / UNIX / WINWOSW ], and need too use ANT [Only Once ] in
> to deploy the application on all the 3 systems.
> 
> The systems may increase in next quater...

If you can figure out how to deploy to each of the existing systems
(can't help as I don't know what it means in your case, see above),
write a single build file for each of them.  Say unix.xml, windows.xml
and linux.xml with deploy targets that perform the steps needed.  In
your build.xml use the subant task to invoke them.  As you add new
target machines, you add a new build file.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: MULTI DEPLOYMENT

Posted by Karthik <ka...@xius.org>.
Hi form,

Please excuse me,I am raising the Form again and agian ,need help in here.

I have a single application and currently 3 systems of different OS's[ LINUX
/ UNIX / WINWOSW ],

and need too use ANT [Only Once ] in to deploy the application on all the 3
systems.

The systems may increase in next quater...

  So have to develop the build.xml file in such a way for flexibility with
deployment for multiple servers....

 I have gone thru the documentation on using the tasks ,cant figure out how
to achieve this feature

 some body please help me



with regards
karthik





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org