forwarding to the list as I sent it from the wrong login for that mailing list
-------- Original Message -------- Subject: Re: [Smartfrog-users] Running applications using Ant tasks Date: Wed, 22 Sep 2010 16:28:49 +0100 From: Steve Loughran On 20/09/10 15:59, [email protected] wrote: > Hi Steve, > > Thank you very much for your informative reply. I am following your suggestion and studying testharness to see how I can use it for what I am trying to do. > > > As for the ant tasks, my problem with<sf-run> is that although the description suggests that the task waits for the application to terminate, in reality it only waits for deployment/start, and then shuts down the daemon. Therefore, if the application lifecycle extends beyond sfStart (as in the 'counter' example, for instance), then<sf-run> terminates it prematurely. I'll have to look at that because it shouldn't happen, I know I've run things as parts of builds (e.g. deploy something to create properties files), but it may just be I've been running targets by hand and not noticing the race condition > > <sf-functionaltest> offers more flexibility, in that you can insert sleep or some kind of waitFor, in order to ensure that the application runs to completion before teardown. However, except for some special cases (such as the webapps that you mentioned), there doesn't seem to be a straightforward way to do that. If you just put<sf-deploy> between the<test> tags, the result will be as in<sf-run>: the task may end before the application terminates on its own. <sf-deploy> should just deploy, but <sf-run> is meant to be blocking. You can also run an SF daemon > > Before I received your reply, I worked around this problem by writing a custom Ant task that loops<sf-ping> until it throws, indicating that the application has terminated. Placing this task in the<test> block after<sf-deploy> delays teardown until application termination. This is a rather cumbersome solution though. funnily enough, I have some code which does something similar only worse, as its trying to connect to a remote VM whose hostname may not resolve at first, then, even once you can SSH in to it, it may not yet have finished running the scripts to install the RPMs, let alone brought up SmartFrog. There are loops waiting for DNS, SSH, `which sfPing` working and then finally the sfPing operation to go live before I try to deploy stuff over SSH. Ugly, but functional. http://smartfrog.svn.sourceforge.net/viewvc/smartfrog/trunk/core/components/cloudfarmer/src/org/smartfrog/services/cloudfarmer/server/deployment/NodeDeploymentOverSSH.java?revision=8407&view=markup > > By the way, you might be interested to know that currently the sf-tasks jar is not added to distribution packages. I had to build SmartFrog from source in order to get it. Sorry, I've added a bugrep on that, and I'll make sure it's in the next izpack and RPM distributions, the plan I have in mind is 1 sf-tasks to go into the core distribution. 2 sf-testharness to go into the junit bundle as it depends on junit Keep an eye on http://jira.smartfrog.org/jira/browse/SFOS-1533 Also, http://smartfrog.sourceforge.net/repository/ contains a maven2 layout of the various JARs; this is effectively how we release internally except there we push them into SCM-managed bits of the filesystem so people can build and test offline. > > > Finally, I have a different but related question. I would like to use a SmartFrog script to run several OS executable programs, one after another. I could use ExecuteProgram as the base component for each program, but how would I chain them? Sequence does something like this, except that it does not wait for sub-components to terminate and launches the next component as soon as the current component returns from sfStart. I am thinking of either extending (or more likely, rewriting) ExecuteProgram (RunShellImpl), or extending/rewriting Sequence or Compound. Perhaps there is a better way to do this? > As you noted, Sequence does this; some other components handle failures in the chain too. -Steve ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ Smartfrog-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/smartfrog-users
