Frank Wilson wrote:
> I am learning to use SmartFrog. I would like to deploy an executable jar
> called 
> "helloworldhttp.jar" to a remote host called "falcon" and run it. I get the
> following
> error on deployment with ant:

Hi Frank.




> 
> deploy:
> [sf:deploy] SmartFrog 3.16.006 (2009-01-26 07:36:35 GMT)
> [sf:deploy] (C) Copyright 1998-2009 Hewlett-Packard Development Company, LP
> [sf:deploy] 2010/04/08 16:24:03:031 BST [WARN ][main] SFCORE_LOG - SmartFrog
> security is NOT active
> [sf:deploy] 2010/04/08 16:24:03:031 BST [WARN ][main] SFCORE_LOG - Possible
> problem with classpath: 
> [sf:deploy]   2 occurrences for sfServices
> [sf:deploy]     C:\Documents and
> Settings\frank\.m2\repository\org\smartfrog\sfServices\3.16.006\sfServices-3
> .16.006.jar
> [sf:deploy]     C:\Documents and
> Settings\frank\.m2\repository\org\smartfrog\sfServices\3.16.006\sfServices-3
> .16.006.jar
> [sf:deploy]  - FAILED when trying DEPLOY of 'helloworldhttp',
> [deploy/targets/falcon.sf],  host:localhost
> [sf:deploy]     Result:
> [sf:deploy]       * Exception: 'SmartFrogLifecycleException:: [sfStart] HOST
> jensen.sidonis.internal:rootProcess:helloworldhttp:upload
> [sf:deploy]         cause: SmartFrogResolutionException:: Unresolved
> Reference: LAZY PARENT:PARENT:action:passwordProvider
> [sf:deploy]            source: HOST
> jensen.sidonis.internal:rootProcess:helloworldhttp
> [sf:deploy]            path(182) 
> [sf:deploy]            Reference not found
> [sf:deploy]         SmartFrog 3.16.006 (2009-01-26 07:36:35 GMT)
> [sf:deploy]         data: Failed object class:
> org.smartfrog.services.ssh.ScpBulkUploadImpl
> [sf:deploy]         primSFCompleteName: HOST
> jensen.sidonis.internal:rootProcess:helloworldhttp
> [sf:deploy]         primContext: included
> [sf:deploy]         reference: HOST
> jensen.sidonis.internal:rootProcess:helloworldhttp
> [sf:deploy]         primContext: included'
> 
> I think this is probably to do with the way I have specified the
> passwordProvider in the
> "upload" section of "MySystem". Please could somebody tell me where I went
> wrong? I don't really
> understand what to put in the passwordProvider line. I put something similar
> to what can be
> found in the SSHComponents document.
> 

The PasswordProvider stuff exists to avoid having passwords in .sf 
files, because once you stick them into SCM and other places it can 
become too much of a security risk. That said, one of the password 
providers lets you do exactly that.
The Jetty SSL listener, and telnet, SSH and FTP clients all use the 
password provider to get their passwords.
There is also a password checker which can validate passwords against 
rules (minimum length) etc, and check that your password provider is working


The password providers are all currently defined in 
/org/smartfrog/services/passwords/components.sf

The FilePassword loads an entire file:

file extends FilePassword {
        passwordFile "/secure/password.1";
}

The inline password does take an inline password

inline extends InlinePassword  {
     password "not that secure";
}

The PropertyPassword uses a JVM property in the JVM running SmartFrog 
itself, not the JVM that is running client side.

propertyDriven extends PropertyPassword {
   property "secret.jvm.property";
}

That means the passwords aren't checked in, but if a ps -ef lists all 
the parameters to a process, your properties can be seen.

Looking at how I get some of my passwords out, I do a trick which is to 
push them from ant to the .sf files,

   passwordProvider extends InlinePassword {
     password OPTIONAL("") PROPERTY test.vm.root.password;
   }


That tells the .sf file parser to look for the JVM property 
test.vm.root.password and, if is not there, just insert an empty string 
instead. The problem now becomes: how to get that ant property into a 
parser property, which the Ant task can do. I define a new

   <presetdef name="deploy" >
       <sf-deploy classpathref="tests.run.classpath"
           logStackTraces="true"
           host="${deploy.host}"
           timeout="${deploy.timeout}"
           >
         <syspropertyset>
           <propertyref prefix="test."/>
           <propertyref prefix="run."/>
         </syspropertyset>
       </sf-deploy>
     </presetdef>

This defines a new task template which can be used to deploy onto target 
machines -the default is the local host. If my build.properties is set 
up to look like:

deploy.host=host3
test.cell.root.password=no-this-is-not-the-real-password

Then the deployment will be to a remote machine, host3, with the 
password set on my local machine, passed over to host3 in the graph of 
SmartFrog attributes.

> Here are my input files.
> 

Try this variation for your MySystem component. It says that the 
password provider gets deployed at the same time as the upload and run 
sequence, and that the run operation should happen after the upload

#include "/org/smartfrog/sfcore/workflow/combinators/components.sf"

MySystem extends Compound {


        PasswordProvider extends InlinePassword {
                password "password";
        }
                
        UploadAndRun extends Sequence {

          upload extends ScpBulkUpload {
                remoteDir helloworldhttpPath;
                dir "target/";
                passwordProvider LAZY PARENT:PARENT:PasswordProvider;
                pattern "helloworldhttp.jar";
                host "falcon";
                username "root";
                sfShouldTerminate true;
          }

          falconHelloworld extends helloworldhttp {
                sfProcessHost "falcon";
                jardir helloworldhttpPath;
          }
        }
        
}


-Steve

-- 
-----------------------
Hewlett-Packard Limited
Registered Office: Cain Road, Bracknell, Berks RG12 1HN
Registered No: 690597 England

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Smartfrog-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/smartfrog-users

Reply via email to