Tutorial TOC

Introduction

These notes were designed for Windows NT/2000/XP. Windows ME/98 is not supported. Commands starting with ">" can be executed from any directory. You will need WinZip or some other tool that can handle .tar.gz compressed files.

Chapter 1 Exercises

Files modified: none.

Install GT3 core

Get gt3-cvs-core.tar.gz from the instructors

c:\>mkdir tutorial
[Unpack gt3-cvs-core.tar.gz into c:\tutorial\gt3-cvs-core]
c:\tutorial\gt3-cvs-core>set GLOBUS_LOCATION=c:\tutorial\gt3-cvs-core
GLOBUS_LOCATION is the variable that lets various scripts know where the install is located.
c:\tutorial\gt3-cvs-core>set GT3_LOCATION=c:\tutorial\gt3-cvs-core
This variable is just for convenience. It will be used throughout this document.
c:\tutorial\gt3-cvs-core>ant setup
This creates the operating system dependent scripts inside of bin\

Test GT3 core

c:\tutorial\gt3-cvs-core> bin\globus-start-container
This starts the GT3 container (if you see "The input line is too long." error message on the console see the note about it in the appendix) Control will not return to the prompt. Press Ctrl-C to stop. If port 8080 is in use, this will fail. Specify an alternate port with -p.

Please stay in %GLOBUS_LOCATION% for this command. We will be using relative paths in some of our deployment parameters, and we will assume that you were in %GLOBUS_LOCATION% when you started your container.

Build Fileshare

Get fileshare-tutorial.tar.gz from the instructors

>cd /d c:\tutorial
[Unpack fileshare-tutorial.tar.gz into c:\tutorial\fileshare-tutorial]
c:\tutorial>cd fileshare-tutorial
c:\tutorial\fileshare-tutorial>set TUTORIAL_LOCATION=c:\tutorial\fileshare-tutorial
c:\tutorial\fileshare-tutorial>ant deployGar -Dogsa.root=%GT3_LOCATION%
This builds the fileshare service and installs it into your GT3 install

Test Fileshare

>cd /d %GT3_LOCATION%
c:\tutorial\gt3-cvs-core>start bin\globus-start-container
Start the container again. You need to start one after having deployed the service. This is why we stopped the container earlier. Be in %GT3_LOCATION%, not %GT3_LOCATION%\bin See that FileShareService is now listed. The container will be started in a separate window
c:\tutorial\gt3-cvs-core>setenv.bat
This is *not* a production step. We are only doing this because our code is in "samples" If you see "The input line is too long." error message on the console see the note about it in the appendix)
c:\tutorial\gt3-cvs-core>mkdir client
c:\tutorial\gt3-cvs-core>cd client
c:\tutorial\gt3-cvs-core\client>set CLIENT_LOCATION=c:\tutorial\gt3-cvs-core\client
This is to make sure you're not in %GT3_LOCATION% when you retrieve files.
c:\tutorial\gt3-cvs-core\client>java org.globus.ogsa.impl.samples.fileshare.client.GetFile FILENAME

FILENAME may be any file in %GLOBUS_LOCATION%, like LICENSE. Do not specify a full or relative path to the file, just the word "LICENSE". After running the command, you should get that file in "c:\tutorial\gt3-cvs-core\client" directory.

[If you had to use an alternate port, you may specify a port after the filename, for example:
java org.globus.ogsa.impl.samples.fileshare.client.GetFile FILENAME PORT]

Chapter 2 Exercises

Files modified:

Undeploy Fileshare

>cd /d %GT3_LOCATION%
[Stop the container if it is running ((ctrl-c) or close the window)]
c:\tutorial\gt3-cvs-core>ant undeploy -Dgar.id=fileshare
This makes sure that the old version of your install will not conflict with the version you're about to add. Do this every time before running deployGar

Note: If you get an error saying that lib\fileshare.jar could not be deleted, run "del lib\fileshare.jar", then run ant undeploy -Dgar.id=fileshare again. It is important if you get this error to run undeploy again after manually deleting the file.

Rebuild Fileshare Client

>cd /d %TUTORIAL_LOCATION%
c:\tutorial\fileshare-tutorial>ant cleanAll -Dogsa.root=%GT3_LOCATION%
Removes old code. This is a good habit to get into, as the ant targets will not recompile code if the stubs already exist.
[Make your edits]
c:\tutorial\fileshare-tutorial>ant deployGar -Dogsa.root=%GT3_LOCATION%
Builds new code and deploys it.

Restart the container

>cd /d %GT3_LOCATION%
c:\tutorial\gt3-cvs-core>start bin\globus-start-container
This starts the container in a separate window

Test new GSH functionality

Retrieve a file from yourself, using the GSH published by your container.

>cd /d %CLIENT_LOCATION%
c:\tutorial\gt3-cvs-core\client>java org.globus.ogsa.impl.samples.fileshare.client.GetFile FILENAME YOUR_GSH

Get a GSH from a neighbor. Retrieve a file from them using their GSH.

c:\tutorial\gt3-cvs-core\client>java org.globus.ogsa.impl.samples.fileshare.client.GetFile FILENAME NEIGHBORS_GSH

Chapter 3 Exercises

Files modified:

Undeploy Fileshare

>cd /d %GT3_LOCATION%
c:\tutorial\gt3-cvs-core>ant undeploy -Dgar.id=fileshare
If undeploy fails please see the following note for help.

Make your changes.

>cd /d %TUTORIAL_LOCATION%
c:\tutorial\fileshare-tutorial>ant cleanAll -Dogsa.root=%GT3_LOCATION%
[Edit files in %TUTORIAL_LOCATION% listed above]
c:\tutorial\fileshare-tutorial>ant deployGar -Dogsa.root=%GT3_LOCATION%

Restart Container

>cd /d %GT3_LOCATION%
[Stop the container if it is running ((ctrl-c) or close the window)]
c:\tutorial\gt3-cvs-core>start bin\globus-start-container
This starts the container in a separate window.

Query servicedata

>cd /d %GT3_LOCATION%
c:\tutorial\gt3-cvs-core>bin\ogsi-find-service-data-by-name "http://ogsa.globus.org/samples/2003/09/fileshare":NumberOfFileGets FILESHARE_GSH
First argument is namespace-qualified SDE, second arg is GSH. Should see a return value like:
Service Data Values: <ns2:serviceDataValues xmlns:ns2="http://www.gridforum.org/namespaces/2003/03/serviceData"> <ns3:NumberOfFileGets gt:originator="http://140.221.57.104:8080/ogsa/services/samples/fileshare/FileShareService" ogsi:availableUntil="2003-10-08T17:44:12.247Z" ogsi:goodFrom="2003-10-07T17:44:11.246Z" ogsi:goodUntil="2003-10-08T17:44:11.247Z" xmlns:gt="http://ogsa.globus.org/" xmlns:ns3="http://ogsa.globus.org/samples/2003/09/fileshare" xmlns:ogsi="http://www.gridforum.org/namespaces/2003/03/OGSI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:int">0</ns3:NumberOfFileGets></ns2:serviceDataValues>

You should recognized the originator and attrs from your populateAttrs() function. The actual value here is "0". Also try querying for the filelist. Both should be initialized at startup by the postCreate call.

>cd /d %CLIENT_LOCATION%

Try running GetFile a number of times. Query the servicedata again. It should update appropriately.

Try running the query against your neighbor's GSH. Get a file from them, then query the SDE again to see that it updated.

Extra exercise idea: Create new SDEs of your own

Chapter 4 Exercises

Files modified:

Clean up, modify code, redeploy

>cd /d %GT3_LOCATION%
[Stop the container if it is running ((ctrl-c) or close the window)]
c:\tutorial\gt3-cvs-core>ant undeploy -Dgar.id=fileshare

>cd /d %TUTORIAL_LOCATION%
c:\tutorial\fileshare-tutorial>ant cleanAll -Dogsa.root=%GT3_LOCATION%
[Modify files]
c:\tutorial\fileshare-tutorial>ant deployGar -Dogsa.root=%GT3_LOCATION%

c:\tutorial\fileshare-tutorial>cd /d %GT3_LOCATION%
c:\tutorial\gt3-cvs-core>start bin\globus-start-container
This starts the container in a separate window.

Query the Index

Verify that your service appears in the index:

>cd /d %GT3_LOCATION%
c:\tutorial\gt3-cvs-core>bin\ogsi-find-service-data-by-name entry INDEX_GSH

The instructors will provide the GSH of the Index to register to.

Your IP address should appear in the (very long) results in an entry named "ogsi:handle" under a ogsi:memberServiceLocator entry:

<ogsi:memberServiceLocator xsi:type="ogsi:LocatorType">
<ogsi:handle xsi:type="ogsi:HandleType">http://140.221.57.104:8080/ ogsa/services/samples/fileshare/FileShareService</ogsi:handle>

Note that depending when your service gets registered, there may be many other entries already. It may be easier to save the output to a file, then search for your IP.

Chapter 5 Exercises

Files modified: none.

Query to find the lifetime of your subscription:

>cd /d %GT3_LOCATION%
c:\tutorial\gt3-cvs-core>bin\ogsi-find-service-data-by-name entry INDEX_GSH
In the large amount of output, you should see lines like:
availableUntil: 2003-10-07T22:32:27.761Z
Check again after that time has passed:
c:\tutorial\gt3-cvs-core>bin\ogsi-find-service-data-by-name entry INDEX_GSH
The dates should be current again:
availableUntil: 2003-10-07T22:33:47.784Z

Chapter 6 Exercises

Files modified: New files used:

Add a file and restart (no undeploy/redeploy required)

>cd /d %GT3_LOCATION%
[Stop the container if it is running ((ctrl-c) or close the window)]
[Create a file named after yourself (mine is Bacon) in "c:\tutorial\gt3-cvs-core"
c:\tutorial\gt3-cvs-core>start bin\globus-start-container

Ensure that you appear in the instructor's Index server.

>cd /d %CLIENT_LOCATION%
c:\tutorial\gt3-cvs-core\client>java org.globus.ogsa.impl.samples.fileshare.client.GetFileIndex FILENAME INDEX_GSH

Expected output:

The 'Bacon' is published by:
1. http://140.221.57.104:8080/ogsa/services/samples/fileshare/FileShareService

Trying to get file from: http://140.221.57.104:8080/ogsa/services/samples/fileshare/FileShareService
File received.

Be aware! While a Windows machine will not necessarily be case-sensitive about the filename, Unix machines will be. Make sure that you have the capitalization of your filename correct when you request it.

Now try retrieving a file from your neighbor by searching the Index for their name. After you retrieve the file, run the query again. You should see multiple sources for the file now.

Extra exercise idea: Construct more complicated XPath queries

Chapter 7 Exercises

Files modified: New files used:

Clean up, modify code, redeploy

>cd /d %GT3_LOCATION%
[Stop the container if it is running ((ctrl-c) or close the window)]
c:\tutorial\gt3-cvs-core>ant undeploy -Dgar.id=fileshare

>cd /d %TUTORIAL_LOCATION%
c:\tutorial\fileshare-tutorial>ant cleanAll -Dogsa.root=%GT3_LOCATION%
[Modify files]
c:\tutorial\fileshare-tutorial>ant deployGar -Dogsa.root=%GT3_LOCATION%

>cd /d %GT3_LOCATION%
c:\tutorial\gt3-cvs-core>start bin\globus-start-container

Try different operations

>cd /d %GT3_LOCATION%
c:\tutorial\gt3-cvs-core>bin\ogsi-find-service-data-by-name http://ogsa.globus.org/samples/2003/09/fileshare:FileList FILESHARE_GSH
You should see the normal output, because the findServiceData call has been left without security. Query your fileshare service directly, not the Index being run by the instructors.
>cd /d %CLIENT_LOCATION%
c:\tutorial\gt3-cvs-core\client>java org.globus.ogsa.impl.samples.fileshare.client.GetFile FILENAME FILESHARE_GSH

Output should look like:

[...]
Error: Defective credential detected [Root error message: Proxy file (/tmp/x509up_u500) not found.]

On the server side, you should see something like:

org.globus.ogsa.impl.security.SecurityManager [getSystemSubject:70] ERROR: Failed to get system subject org.globus.gsi.GlobusCredentialException: Proxy file (/tmp/x509up_u500) not found.
This is because you have not initialized your proxy to interact with secure operations.

Create a proxy

>cd /d %CLIENT_LOCATION%
c:\tutorial\gt3-cvs-core\client>java org.globus.tools.ProxyInit -cert %TUTORIAL_LOCATION%\certificates\usercert.pem -key %TUTORIAL_LOCATION%\certificates\userkey.pem

Expected output:

Your identity: O=Grid,OU=Tutorial,OU=User,CN=user50
Creating proxy, please wait...
Your proxy is valid until Wed Oct 08 04:32:30 CDT 2003
You may see a warning to check filesystem permissions. This is an expected Windows warning.
>cd /d %CLIENT_LOCATION%
c:\tutorial\gt3-cvs-core\client>java org.globus.ogsa.impl.samples.fileshare.client.GetFile FILENAME FILESHARE_GSH

Extra exercise idea: Try adding gridmap authorization to the GetFile operation

Chapter 8 Transience

Files modified: New files used:

Clean up, modify code, redeploy

>cd /d %GT3_LOCATION%
[Stop the container if it is running ((ctrl-c) or close the window)]
c:\tutorial\gt3-cvs-core>ant undeploy -Dgar.id=fileshare

>cd /d %TUTORIAL_LOCATION%
c:\tutorial\fileshare-tutorial>ant cleanAll -Dogsa.root=%GT3_LOCATION%
[Modify files]
c:\tutorial\fileshare-tutorial>ant deployGar -Dogsa.root=%GT3_LOCATION%

>cd /d %GT3_LOCATION%
c:\tutorial\gt3-cvs-core>start bin\globus-start-container

Use the Factory

>cd /d %CLIENT_LOCATION%
c:\tutorial\gt3-cvs-core\client>java org.globus.ogsa.impl.samples.fileshare.client.CreateFileShare DIRNAME_TO_SHARE
First argument is name of directory to share.

Expected output:

If you have a proxy, it will succeed with:

File Share Handle: http://140.221.57.104:8080/ogsa/services/samples/fileshare/FileShareFactoryService/hash-14141119-1065564907262
Termination Time: infinity

If it fails with "Error: org.gridforum.ogsi.NoSuchServiceFaultType: samples/fileshare/FileShareFactoryService", verify that you renamed the FileShareService to the FileShareFactoryService in the .wsdd.

Now get a file from the newly-created service:

c:\tutorial\gt3-cvs-core\client>java org.globus.ogsa.impl.samples.fileshare.client.GetFile FILENAME NEW_GSH
Received file 'filename' of size 7

Verify that the created service is also registering into the index:

c:\tutorial\gt3-cvs-core\client>java org.globus.ogsa.impl.samples.fileshare.client.GetFileIndex FILENAME INDEX_GSH

Appendix

If you see "The input line is too long." error message on the console when executing various scripts, you might need to create a virtual drive for the directory where the gt3 core is installed. To create a virtual drive do:
>subst p: c:\tutorial\gt3-cvs-core 
Then reset the GLOBUS_LOCATION to that virtual drive:
>set GLOBUS_LOCATION=p:
DO NOT create a virtual drive unless you see "The input line is too long." We have seen problems with the latest version of ant and the use of subst.