The key points about proxies are:-
So, and in summary, begin by creating a short term proxy. Then, unless you are doing short tests that will end before it expires, make sure you have a long term proxy up and running before you submit jobs and if necessary refresh until they all complete.
voms-proxy-init -voms minos.vo.gridpp.ac.ukThis contacts the VOMS server and retrieves an Attributes Certificate that is inserted into proxy certificates. If no -voms option is supplied it will create an old style GRID certificate without any VOMS extensions, which won't be any use, so don't forget it.
-valid 24:0- do NOT use -hour 24 which extends the basic GRID certificate but not the VOMS extension that it carries as, after the 12 hour limit is passed, you still have a certificate but it won't be recognised by any VOMS aware service!
VOMS Server for minos.vo.gridpp.ac.uk not known!then the UI is not properly configured for MINOS.
In this case create the file:-
~/.glite/vomsescontaining:-
"minos.vo.gridpp.ac.uk" "voms.gridpp.ac.uk" "15016" "/C=UK/O=eScience/OU=Manchester/L=HEP/CN=voms.gridpp.ac.uk/Email=ops@tier2.hep.manchester.ac.uk" "minos.vo.gridpp.ac.uk"and type:-
voms-proxy-init -voms minos.vo.gridpp.ac.uk --confile ~/.glite/vomses
voms-proxy-info -allThe -all option includes the VO extension information.
voms-proxy-destroy
myproxy-init -d -n
where
-d Use the subject of the certificate as the default username.
-n Don't prompt for a credential passphrase, so that the WMS can perform the renewals automatically.
also
-s <proxy-sever hostname>
Currently at Oxford on pplxint1 must first do:
setenv MYPROXY_SERVER lcgrbp01.gridpp.rl.ac.uk
By default, the long-term proxy lasts for one week and the proxy
certificates created from it last 12 hours. These lifetimes can be
changed using the -c and the -t option, respectively.
If the hostname of the Proxy Server is wrong (environment
MYPROXY_SERVER or -s option), or the service is unavailable, the
output will end e.g.:-
Your proxy is valid until: Wed Sep 17 12:10:22 2003 Unable to connect to adc0014.cern.ch:7512or will fail entirely with
Unspecified myproxy-server. Please set the MYPROXY_SERVER environment variableOur server is
lcgrbp01.gridpp.rl.ac.ukTo get information about a long-term proxy:-
myproxy-info -dTo destroy a long-term proxy before it expires:-
myproxy-destroy -dThis information comes from @ LCG-2 User Guide/4.4 Proxy Certificates
By default voms-proxy-init will use the standard VOMS server defined for the experiment at the UI . You can select an alternative using the --voms option, for example
voms-proxy-init --voms minos.vo.gridpp.ac.ukHere the "minos.vo.gridpp.ac.uk" is just an alias that is used to look up the server details in a configuration file. This file can specified in several alternative ways:-
voms-proxy-init --voms minos.vo.gridpp.ac.uk --confile ~/.glite/vomses
setenv VOMS_USERCONF ~/.glite
/opt/glite/etc/vomses ~/.glite
--voms vo-alias[:vo-command]The default command is :all, and it gets all group membership information. However it is also possible to send other commands and in particular to select a role.
For example:-
voms-proxy-init --voms minos.vo.gridpp.ac.uk:/Role=lcgadminwill select the lcgadmin role.
Before proceeding, make sure you have prepared a short term GRID proxy
Executable = "/bin/echo";
Arguments = "Hello World";
StdOutput = "hw.out";
StdError = "hw.err";
OutputSandbox = {"hw.out", "hw.err"};
VirtualOrganisation = "minos.vo.gridpp.ac.uk";
For each job you need a "JDL file" (JDL is the Job Description
Language) and in this case that's all you need.As you might expect this just echoes the string "Hello World" to stdout. The stdout and stderr streams are redirected to files called hw.out and hw.err, and at the end of the job those files will be returned in the "output sandbox", a list of files which can be retrieved once the job is finished.
glite-wms-job-list-match -a hello.jdlThe -a is the option to request auto delegation; each time you use it you are delegating your proxy for a one shot use by the WMProxy.
If all is O.K., you should see something like this:-
Connecting to the service https://lcgwms01.gridpp.rl.ac.uk:7443/glite_wms_wmproxy_server
==========================================================================
COMPUTING ELEMENT IDs LIST
The following CE(s) matching your job requirements have been found:
*CEId*
...
- lcgce02.gridpp.rl.ac.uk:2119/jobmanager-lcgpbs-gridS
- t2ce03.physics.ox.ac.uk:2119/jobmanager-lcgpbs-minos
- t2ce03.physics.ox.ac.uk:2119/jobmanager-lcgpbs-short
- t2ce02.physics.ox.ac.uk:2119/jobmanager-lcgpbs-minos
- t2ce02.physics.ox.ac.uk:2119/jobmanager-lcgpbs-short
==========================================================================
glite-wms-job-submit -a -o /tmp/hello.jid hello.jdlhere hello.jid is a temporary file containing the job ID - if you submit further jobs using the same file the IDs will be appended.
glite-wms-job-status -i /tmp/hello.jidIn particular look for the Current Status: and Status Reason: lines e.g.:-
Current Status: Scheduled Status Reason: Job successfully submitted to GlobusNote that you don't need -a this time; you are only requesting services of the WMProxy, not of the wider GRID.
glite-wms-job-output -i /tmp/hello.jidThe output is stored in a directory which is configured locally, often in /tmp, or you can supply your own with the --dir option. In any case the above command will print the location. For eample I see:-
JOB GET OUTPUT OUTCOME
Output sandbox files for the job:
https://lcgwms01.gridpp.rl.ac.uk:9000/fFNhqhtvZ0Tv9tZ25sTQJg
have been successfully retrieved and stored in the directory:
/tmp/glite/glite-ui/west_fFNhqhtvZ0Tv9tZ25sTQJg
You can then examine the files to check that the output is correct.
#!/bin/bash cat $1Finally, create a new JDL file hello2.jdl:
Executable = "hello2.sh";
Arguments = "hello2.txt";
InputSandbox = {"hello2.sh", "hello2.txt"};
StdOutput = "hw.out";
StdError = "hw.err";
OutputSandbox = {"hw.out", "hw.err"};
VirtualOrganisation = "minos.vo.gridpp.ac.uk";
and submit it as described above. If all goes well this should send
the files hello2.txt and .sh with the job, set hello2.sh to be
executable, and run the command "hello2.sh hello2.txt" which will
again print the string "Hello World" to stdout.One thing to note is that permissions on the sandbox files are not preserved. A file named in the Executable field in the JDL will have the x bit set, but any other files will have it cleared.
You should also be aware that sandboxes are for small files, up to a few kb - resource brokers will generally limit the maximum size. Larger files should be accessed via the data management system.
The examples above have jobs which take a very short time to run. However, for real jobs you need to take into account that batch queues have time limits. This can be managed by adding a Requirement to the JDL, which specifies constraints on the site and queue used to run the job. This can be quite complex and you should consult the User Guide for full details. However, as a simple example you can specify a minimum CPU time of an hour with a JDL line like:
Requirements = other.GlueCEPolicyMaxCPUTime > 60;Note that the time limits are in minutes, although the Estimated/WorstResponseTime values are in seconds.
This section has been drawn from @ Submitting Jobs to the Grid and @ Submission and monitoring of jobs via WMProxy using the command line interface
globus-job-run lcgce02.gridpp.rl.ac.uk /bin/pwd and globus-job-run lcgce02.gridpp.rl.ac.uk /usr/bin/whoamiThis command is extremely useful for checking things like the environment and setup up of a CE.
For more information, type
globus-job-run -help
If you look at the options available to voms-proxy-init you will find:-
-pwstdin Allows passphrase from stdinwhich could encourage you to do something like:-
voms-proxy-ini -pwstdin < <my-GRID-certificate-password-file>
Instead the answer is to lodge a long term proxy with the myproxy server and retrieve a short term one from there. Note that this is a separate proxy to the one you may have set up to keep GRID jobs running. In that case the command is:-
myproxy-init -d -nwhich creates a proxy with the GRID certificate's username and without a password. In this case the command is
myproxy-init -a -l <user-name>
where
-a Allow proxies to be retrieved with just pass phrase
-l <user-name> the user name to be assigned (default: $LOGNAME)
Remember: to run myproxy-init you must have a short term proxy. If
you run this it will first ask for your GRID certificate password but
it will then ask for, and reconfirm, a password that will give you
access to short term proxies created from this proxy.
With that preparation we can now turn to the cron job that has not got a short term proxy. It can use the command myproxy-get-delegation to get a GRID certificate, without a VOMS extension. The problem is that it needs the password you assigned to the proxy. This time, the solution is to store the password in a file and then the command is:-
myproxy-get-delegation -l <user-name> --stdin_pass < <my-myproxy-password-file>Note that this is a far lower risk. If this file is stolen and read they can only obtain short-term proxies and if the theft is discovered your proxy can be deleted from the myproxy, and your VOMS membership can be suspended. That's not to say that the password file should not be highly protected and it's worth changing frequently (have a script that creates a new password file each time you store a new certificate in the server?).
Having run myproxy-get-delegation you have a certificate but without a VOMS extension and you can add this with:-
voms-proxy-init -voms minos.vo.gridpp.ac.uk --confile ~/.glite/vomses -noregenThis adds a VOMS extension to the certificate. When you run that command you will probably see the warning:-
Warning: your certificate and proxy will expire ... which is within the requested lifetime of the proxybecause the certificate will be a little older than the VOMS addition. It's harmless or if it annoys you could make the VOMS extension shorter using
-valid 11:0voms-proxy-init option to trim them both.
If you want to try this out then, having run myproxy-init to lodge your proxy type:-
voms-proxy-destroyto delete it and then, having run myproxy-get-delegation and voms-proxy-init see that it is there with:-
voms-proxy-info -allRemember long term proxies only last a week so you still have to renew it from time to time so that your cron job won't be starved of a source of proxies.
For further information see @ GridPP: Using MyProxy
$MOG_SCRIPTS/setup/grid_proxy_maintainer.py setthen, in any GRID cron script that needs a proxy add the line e.g.:-
$MOG_SCRIPTS/setup/grid_proxy_maintainer.py get --voms minos.vo.gridpp.ac.ukFor more detail just type:-
$MOG_SCRIPTS/setup/grid_proxy_maintainer.py