Globus Toolkit 3.9.2 Development Documentation: GRAM

Testing the WS GRAM Service

Once you've set up your GRAM service (see Configuring the WS GRAM Service), you should be able to run the following jobs successfully:

Submitting the Touch job

1

Save the following as touch.xml:

<?xml version="1.0" encoding="UTF-8"?>
 <gram:job xmlns:gram="http://www.globus.org/namespaces/2004/06/job"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.globus.org/namespaces/2004/06/job
 <put path to GLOBUS_LOCATION here>/share/schema/gram/job_description.xsd">
 <gram:executable>/bin/touch</gram:executable>
 <gram:arguments>touched_it</gram:arguments>
 </gram:job>
2

Run the following command from the directory where you saved the file:

% managed-job-globusrun -factory <host>:<port> -file touch.xml

Submitting the Hello job

1

Save the following as hello.xml:

<?xml version="1.0" encoding="UTF-8"?>
 <gram:job xmlns:gram="http://www.globus.org/namespaces/2004/06/job"
 		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   	xsi:schemaLocation="http://www.globus.org/namespaces/2004/06/job
 <put path to GLOBUS_LOCATION here>/share/schema/gram/job_description.xsd">
 <gram:executable>/bin/echo</gram:executable>
 <gram:arguments>Hello, World!</gram:arguments> 
 </gram:job>
2

Run the following command from the directory where you saved the file:

% managed-job-globusrun -factory <host>:<port> -file hello.xml -o

Note: The option -o allows for stdout to be sent to the managed-job-globusrun client.

Submitting the stage_etc_group job

1

Save the following as stage_etc_group.xml:

<?xml version="1.0" encoding="UTF-8"?>
 <gram:job xmlns:gram="http://www.globus.org/namespaces/2004/06/job"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   
   xsi:schemaLocation="http://www.globus.org/namespaces/2004/06/job
 <put path to GLOBUS_LOCATION here>/share/schema/gram/job_description.xsd">
 <gram:executable>/bin/true</gram:executable>
 <gram:fileStageOut>
 <gram:sourceFile>/etc/group</gram:sourceFile>
 <gram:destinationFile>file:///** replace with destination path **/staged_etc_group</gram:destinationFile>
 </gram:fileStageOut>
 </gram:job>
2

Run the following command from the directory where you saved the file:

% managed-job-globusrun -factory <host>:<port> -file stage_etc_group.xml

Submitting the stdout_to_file job

1

Save the following as stage_etc_group.xml:

<?xml version="1.0" encoding="UTF-8"?>
 <gram:job xmlns:gram="http://www.globus.org/namespaces/2004/06/job"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   
   xsi:schemaLocation="http://www.globus.org/namespaces/2004/06/job
 <put path to GLOBUS_LOCATION here>/share/schema/gram/job_description.xsd">
 <gram:executable>/bin/echo</gram:executable>
 <gram:arguments>hi there</gram:arguments>
 <gram:stdout>** replace with destination path **/stdout.hi</gram:stdout>
 <gram:stderr>** replace with destination path **/stderr.hi</gram:stderr> 
 </gram:job>
2

Run the following command from the directory where you saved the file:

% managed-job-globusrun -factory <host>:<port> -file stdout_to_file.xml

Submitting simple command-line jobs

Without the need for a job description file, you can submit a job that consists simply of a command line by doing:

managed-job-globurun '<job command line>'

For instance:

Submitting the '/bin/true' job

% managed-job-globurun '/bin/true'

This will not output anything except from the state of the job.

Submitting the '/bin/echo Hello World!' job

% managed-job-globurun -o '/bin/echo Hello World!'

The -o option will redirect the output of the job (i.e. the string "Hello World!") to the standard output of managed-job-globusrun, which will otherwise be quiet.