Lin:
Can you please try to submit a job with staging using the default
c-client globusrun-ws? I assume that something is wrong with your
client.
To verify this try a submission using the default client globusrun-ws:
Save the following to the file job.xml (replace host and port
with real values and also replace the staging files in case they don't
fit your needs)
<job>
<executable>/bin/date</executable>
<stdout>${GLOBUS_USER_HOME}/stdout</stdout>
<stderr>${GLOBUS_USER_HOME}/stderr</stderr>
<fileStageIn>
<transfer>
<sourceUrl>gsiftp://host:port/bin/echo</sourceUrl>
<destinationUrl>gsiftp://host:port/tmp/TESTFILE</destinationUrl>
</transfer>
</fileStageIn>
</job>
and submit the job to your GT4 container (replace host and port with
real values) by
globusrun-ws \
-submit \
-F https://host:port/wsrf/services/ManagedJobFactoryService \
-Ft Fork \
-S \
-f job.xml
and check if things work fine.
Martin
> Martin,
> I used one java program to submit the job on one node(g3.grid.cn). The
> program will transfer some necessary files to remote node(g4.grid.cn),
> and the "worker" node will render one SVG file into JEPG file, then
> the result JEPG file will be sent back to the client node.
> the GRAM Job related program section is:
>
> // do the work in a separate thread
> public void run()
> {
> System.out.println("WorkerDispatch.run(): dispatching work via
> WSGramRunner to node " + nodeHostname + " for box " + boxNum );
> System.out.println("WorkerDispatch.run(): creating JobDescription stuff"
> );
> JobDescriptionType jobDescription = new JobDescriptionType();
> List arguments = new ArrayList();
> arguments.add( uriSourceService );
> arguments.add( String.valueOf(boxNum) );
> jobDescription.setArgument( (String[]) arguments.toArray(new String[0]));
> //jobDescription.setCount( new PositiveInteger("1") );
> jobDescription.setDirectory( "/tmp" );
> // Environment
> NameValuePairType environment[] = new NameValuePairType[3];
> NameValuePairType javaHome = new NameValuePairType();
> javaHome.setName( "JAVA_HOME" );
> javaHome.setValue( "/usr/lib/jdk" );
> environment[0] = javaHome;
> NameValuePairType libPath = new NameValuePairType();
> libPath.setName( "LIBPATH" );
> libPath.setValue( "/usr/local/globus-4.0.5/lib:/usr/lib:/lib" );
> environment[1] = libPath;
> NameValuePairType ldLibPath = new NameValuePairType();
> ldLibPath.setName( "LD_LIBRARY_PATH" );
> ldLibPath.setValue( "/usr/local/globus-4.0.5/lib" );
> environment[2] = ldLibPath;
> jobDescription.setEnvironment( environment );
> String sourcePath = "gsiftp://" + stagingFromHostField.getText() +
> stagingFromPathField.getText() + "/";
> String destinationPath = "gsiftp://" + nodeHostname + "/tmp/";
>
> EndpointReferenceType credentialEndpoint=null;
> try{
> ExtendedGSSManager manager =
> (ExtendedGSSManager)ExtendedGSSManager.getInstance();
> GSSCredential cred =
> manager.createCredential(GSSCredential.INITIATE_AND_ACCEPT);
> GlobusCredential userGlobusCred =
> ((GlobusGSSCredentialImpl)cred).getGlobusCredential();
> HostAuthorization iA = new HostAuthorization();
> ClientSecurityDescriptor secDesc = new ClientSecurityDescriptor();
> secDesc.setGSITransport(Constants.ENCRYPTION);
> secDesc.setAuthz(iA);
> if(cred != null){
> secDesc.setGSSCredential(cred);
> }
> EndpointReferenceType delegFactoryEndpoint =
> DelegationServiceEndpoint.getInstance().getDelegationServiceEndpoint();
> int lifetime = 120000;
> X509Certificate certToSign =
> DelegationUtil.getCertificateChainRP(delegFactoryEndpoint,secDesc)[0];
> String delegationUri="https://" + nodeHostname +
> ":8443/wsrf/services/DelegationFactoryService";
> credentialEndpoint =
> DelegationUtil.delegate(delegationUri,userGlobusCred,certToSign,lifetime,false,secDesc);
> }
> catch(Exception e)
> {
> e.printStackTrace();
> }
> if ( stageFiles )
> {
> // set up the 18 files that have to be copied to the remote system
> // [0] = the batch file that sets up the environment and runs RenderWorker
> // [1] = the jar containing the RenderWorker class alone
> // [2] = the jar containing the generated stubs so the RenderWorker
> can call the RenderSourceService
> // [3]..[16] = the required Apache XML Batik jar files
> // [17] = the SVG file to be rendered
> TransferType transfers[] = new TransferType[18];
> transfers[0] = new TransferType();
> transfers[0].setSourceUrl( sourcePath + "runrenderworker" );
> transfers[0].setDestinationUrl( destinationPath + "runrenderworker" );
> //...omitted
> transfers[16] = new TransferType();
> transfers[16].setSourceUrl( sourcePath + "batik-xml.jar" );
> transfers[16].setDestinationUrl( destinationPath + "batik-xml.jar" );
>
> // NEEDSWORK: the client is pushing the SVG file to the worker now -
> should it pull from the service?
> String svgSourcePath = "gsiftp://" + svgFromHostField.getText() +
> svgFromPathField.getText();
> System.out.println("WorkerDispatch.run(): source for svg file is: '" +
> svgSourcePath + "'");
> String svgPath = svgFromPathField.getText();
> String svgDestinationPath = destinationPath + svgPath.substring(
> svgPath.lastIndexOf('/')+1 );
> System.out.println("WorkerDispatch.run(): destination for svg file is:
> '" + svgDestinationPath + "'");
> transfers[17] = new TransferType();
> transfers[17].setSourceUrl( svgSourcePath );
> transfers[17].setDestinationUrl( svgDestinationPath );
>
> TransferRequestType transferRequestType = new TransferRequestType();
> transferRequestType.setTransfer( transfers );
> //transferRequestType.setTransferCredentialEndpoint(credentialEndpoint);
> jobDescription.setFileStageIn( transferRequestType );
> TransferRequestType StageIn = jobDescription.getFileStageIn();
> StageIn.setTransferCredentialEndpoint(credentialEndpoint);
> }
> else
> {
> // user has chosen that files do not need to be staged to the remote
> system
> jobDescription.setFileStageIn( null );
> }
> TransferType transfersBack[] = new TransferType[1];
> transfersBack[0] = new TransferType();
> // match the filename that the source service is going to tell the
> worker to create
> String jpegName = jpegStub + "-" + boxX + "-" + boxY + ".jpg";
> String jpegSource = destinationPath + jpegName;
> System.out.println("WorkerDispatch.run(): node's rendered source JPEG
> path should be " + jpegSource );
> // build where we want GRAM to stage the result back on this machine
> String jpegPath = resultPathField.getText() + "/" + jpegName;
> String jpegDestination = "gsiftp://" + resultHostField.getText() +
> jpegPath;
> System.out.println("WorkerDispatch.run(): local path of JPEG filename
> should be " + jpegDestination );
> transfersBack[0].setSourceUrl( jpegSource );
> transfersBack[0].setDestinationUrl( jpegDestination );
> TransferRequestType transferRequestTypeBack = new TransferRequestType();
> transferRequestTypeBack.setTransfer( transfersBack );
> jobDescription.setFileStageOut( transferRequestTypeBack );
> TransferRequestType StageOut = jobDescription.getFileStageOut();
> StageOut.setTransferCredentialEndpoint(credentialEndpoint);
> jobDescription.setHoldState( null );
> jobDescription.setHostCount( new PositiveInteger("1") );
> jobDescription.setJobCredentialEndpoint(credentialEndpoint);
> jobDescription.setJobType( JobTypeEnumeration.single );
> jobDescription.setStagingCredentialEndpoint(credentialEndpoint);
> jobDescription.setStdout( "/tmp/stdout" );
> jobDescription.setStderr( "/tmp/stderr" ) ;
> // submit the job - this blocks (safe as we're in a thread) until the
> job either succeeds or fails
> System.out.println("WorkerDispatch.run(): about to submit the job: " +
> jobDescription );
> // create GramJob instance
> GramJob gramJob = new GramJob(jobDescription);
> // obtain factory endpoint to prepare for GRAM job
> EndpointReferenceType factoryEndpoint = null;
> try
> {
> factoryEndpoint =
> ManagedJobFactoryClientHelper.getFactoryEndpoint("https://" +
> nodeHostname + ":8443/wsrf/services/ManagedJobFactoryService",
> ManagedJobFactoryConstants.FACTORY_TYPE.FORK);
> }
> catch(Exception e)
> {
> System.err.println("WorkerDispatch.run(): failure getting factory
> endpoint for GRAM job: ");
> e.printStackTrace();
> return;
> }
>
> // submit the job to GRAM
> try
> {
> gramJob.submit(factoryEndpoint, false);
> }
> catch (Exception e)
> {
> System.err.println("WorkerDispatch.run(): failure submitting GRAM job: ");
> e.printStackTrace();
> return;
> }
> // now that the job has been submitted, wait for status changes
> // notifications will be caught in the stateChanged() method
> //...
>
> I put the complete container logfile of g4 node in the mail attachment.
>
>
>
> Regards,
> ------------
> Lin Wan
>