~ubuntu-branches/ubuntu/vivid/cctools/vivid

« back to all changes in this revision

Viewing changes to parrot/doc/parrot.html

  • Committer: Bazaar Package Importer
  • Author(s): Michael Hanke
  • Date: 2011-05-07 09:05:00 UTC
  • Revision ID: james.westby@ubuntu.com-20110507090500-lqpmdtwndor6e7os
Tags: upstream-3.3.2
ImportĀ upstreamĀ versionĀ 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
 
 
3
<head>
 
4
<title>Parrot User's Manual</title>
 
5
</head>
 
6
 
 
7
<h1>Parrot User's Manual</h1>
 
8
<b>March 2011</b>
 
9
<p>
 
10
 
 
11
Parrot is Copyright (C) 2003-2004 Douglas Thain and
 
12
Copyright (C) 2005- The University of Notre Dame.
 
13
All rights reserved.
 
14
This software is distributed under the GNU General Public License.
 
15
See the file COPYING for details.
 
16
<p>
 
17
The Glite module of Parrot is Copyright (c) Members of the EGEE Collaboration. 2004.
 
18
See http://eu-egee.org/partners/ for details on the copyright holders.
 
19
For license conditions see the license file or http://eu-egee.org/license.html
 
20
<p>
 
21
<b>Please use the following citation to refer to Parrot:</b><br>
 
22
<dir>
 
23
<li> Douglas Thain and Miron Livny, <a href=http://www.cse.nd.edu/~dthain/papers/parrot-scpe.pdf>Parrot: An Application Environment for Data-Intensive Computing</a>, Scalable Computing: Practice and Experience, Volume 6, Number 3, Pages 9--18, 2005.
 
24
</dir>
 
25
 
 
26
<h2>Overview</h2>
 
27
 
 
28
Parrot is a tool for attaching old programs to new storage systems.  Parrot makes a remote storage system appear as a file system to a legacy application.  Parrot does not require any special privileges, any recompiling, or any change whatsoever to existing programs.  It can be used by normal users doing normal tasks.  For example, an anonymous FTP service is made available to <code>vi</code> like so:
 
29
<dir>
 
30
<pre>
 
31
% parrot_run vi /anonftp/ftp.cs.wisc.edu/RoadMap
 
32
</pre>
 
33
</dir>
 
34
<p>
 
35
Parrot is useful to <i>users</i> of distributed systems, because it frees them from rewriting code to work with new systems and relying on remote administrators to trust and install new software.
 
36
Parrot is also useful to <i>developers</i> of distributed systems, because it allows rapid deployment of new code to real applications and real users that do not have the time, inclination, or permissions to build a kernel-level filesystem.
 
37
<p>
 
38
Parrot currently supports a variety of remote I/O systems, all detailed below.
 
39
We welcome contributions of new remote I/O drivers from others.
 
40
However, if you are working on a protocol driver
 
41
please drop us a note so that we can make sure work
 
42
is not duplicated.
 
43
<p>
 
44
Almost any application - whether static or dynmically linked,
 
45
standard or commercial, command-line or GUI - should work with
 
46
Parrot.  There are a few exceptions.  Because Parrot relies on
 
47
the Linux <code>ptrace</code> interface
 
48
any program that relies on the ptrace interface cannot run under Parrot.
 
49
This means Parrot cannot run a debugger, nor can it run itself recursively.
 
50
In addition, Parrot cannot run setuid programs, as the operating system
 
51
system considers this a security risk.
 
52
<p>
 
53
Parrot also provide a new experimental features called <i>identity boxing</i>.
 
54
This feature allows you to securely run a visiting application within
 
55
a protection domain without become root or creating a new account.
 
56
Read below for more information on identity boxing.
 
57
<p>
 
58
Parrot currently runs on the Linux operating system with either
 
59
Intel compatible (i386) or AMD compatible (x86_64) processors.
 
60
It relies on some fairly low level details in order to implement
 
61
system call trapping.  Ports to other platforms and processors
 
62
Linux may be possible in the future.
 
63
<p>
 
64
Like any software, Parrot is bound to have some bugs.
 
65
Please check the <a href=http://www.cse.nd.edu/~ccl/software/parrot/known-bugs.html>known bugs</a> page for the latest scoop.
 
66
 
 
67
<h2>Installation</h2>
 
68
 
 
69
Parrot is distributed as part of the
 
70
<a href=http://www.cse.nd.edu/~ccl/software>Cooperative Computing Tools</a>.
 
71
To install, please read the <a href=install.html>cctools installation instructions</a>.
 
72
 
 
73
<h2>Examples</h2>
 
74
 
 
75
To use Parrot, you simply use the <code>parrot</code> command followed by any other Unix program.  For example, to run a Parrot-enabled <code>vi</code>, execute this command:
 
76
<dir>
 
77
<pre>
 
78
% parrot_run vi /anonftp/ftp.cs.wisc.edu/RoadMap
 
79
</pre>
 
80
</dir>
 
81
Of course, it can be clumsy to put <code>parrot</code> before every command you run, so try starting a shell with Parrot already loaded:
 
82
<dir>
 
83
<pre>
 
84
% parrot_run tcsh
 
85
</pre>
 
86
</dir>
 
87
Now, you should be able to run any standard command using Parrot filenames.  Here are some examples to get you thinking:
 
88
<dir>
 
89
<pre>
 
90
% cp /http/www.cse.nd.edu/~dthain/papers/parrot-agm2003.pdf .
 
91
% grep Yahoo /http/www.yahoo.com
 
92
% set autolist
 
93
% cat /anonftp/ftp.cs.wisc.edu/<b>[Press TAB here]</b>
 
94
</pre>
 
95
</dir>
 
96
<p>
 
97
 
 
98
<center>
 
99
<table width=75% border=2>
 
100
<tr bgcolor=#ffffaa>
 
101
<td>
 
102
Hint: You may find it useful to have some visual indication
 
103
of when Parrot is active, so we recommend that you modify
 
104
your shell startup scripts to change the prompt when Parrot is enabled.
 
105
If you use <tt>tcsh</tt>, you might add something like this to your <tt>.cshrc</tt>:
 
106
<pre>
 
107
        if ( $?PARROT_ENABLED ) then
 
108
                set prompt = " (Parrot) %n@%m%~%# "
 
109
        else
 
110
                set prompt = " %n@%m%~%# "
 
111
        endif
 
112
</pre>
 
113
</table>
 
114
</center>
 
115
<p>
 
116
 
 
117
We have limited the examples so far to HTTP and anonymous FTP, as they are
 
118
the only services we know that absolutely everyone is familiar with.
 
119
There are a number of other more powerful and secure remote services
 
120
that you may be less familiar with.  Parrot supports them in the same form:
 
121
The filename begins with the service type, then the host name,
 
122
then the file name.  Here are all the currently supported services:
 
123
 
 
124
<hr>
 
125
<table>
 
126
<tr><td><b>example path</b><td><b>remote service</b><td><b>more info</b>
 
127
<tr><td>/http/www.somewhere.com/index.html<td>Hypertext Transfer Protocol<td>included
 
128
<tr><td>/grow/www.somewhere.com/index.html<td>GROW - Global Read-Only Web Filesystem <td>included
 
129
<tr><td>/ftp/ftp.cs.wisc.edu/RoadMap<td>File Transfer Protocol<td>included
 
130
<tr><td>/anonftp/ftp.cs.wisc.edu/RoadMap<td>Anonymous File Transfer Protocol<td>included
 
131
<tr><td>/chirp/target.cs.wisc.edu/path<td>Chirp Storage System<td>included + <a href=chirp.html>more info</a> 
 
132
<br>
 
133
<tr><td>/gsiftp/ftp.globus.org/path<td>Globus Security + File Transfer Protocol<td><a href=http://www.globus.org/gridftp>more info</a>
 
134
<tr><td>/nest/nest.cs.wisc.edu/path<td>Network Storage Technology<td><a href=http://www.cs.wisc.edu/condor/nest>more info</a>
 
135
<tr><td>/rfio/host.cern.ch/path<td>Castor Remote File I/O<td><a href=http://castor.web.cern.ch/castor/Welcome.html>more info</a>
 
136
<tr><td>/dcap/dcap.cs.wisc.edu/pnfs/cs.wisc.edu/path<td>DCache Access Protocol<td><a href=http://dcache.desy.de>more info</a>
 
137
<tr><td>/lfn/logical/path<td>Logical File Name - Grid File Access Library<td><a href=http://grid-deployment.web.cern.ch/grid-deployment/gis/GFAL/GFALindex.html>more info</a>
 
138
<tr><td>/srm/server/path<td>Site File Name - Grid File Access Library<td><a href=http://grid-deployment.web.cern.ch/grid-deployment/gis/GFAL/GFALindex.html>more info</a>
 
139
<tr><td>/guid/abc123<td>Globally Unique File Name - Grid File Access Library<td><a href=http://grid-deployment.web.cern.ch/grid-deployment/gis/GFAL/GFALindex.html>more info</a>
 
140
<tr><td>/gfal/protocol://host//path<td>Grid File Access Library<td><a href=http://grid-deployment.web.cern.ch/grid-deployment/gis/GFAL/GFALindex.html>more info</a>
 
141
<tr><td>/irods/host:port/zone/home/user/path<td>iRODS<td><a href=http://irods.sdsc.edu>more info</a>
 
142
<tr><td>/hdfs/namenode:port/path<td>Hadoop Distributed File System (HDFS)<td><a href=http://hadoop.apache.org/common/docs/current/hdfs_user_guide.html>more info</a>
 
143
<tr><td>/xrootd/host:port/path<td>XRootD/Scalla Distributed Storage System (xrootd)<td><a href=http://project-arda-dev.web.cern.ch/project-arda-dev/xrootd/site/index.html>more info</a>
 
144
</table>
 
145
<hr>
 
146
 
 
147
You will notice quite quickly that not all remote I/O systems
 
148
provide all of the functionality common to an ordinary file system.
 
149
For example, HTTP is incapable of listing files.
 
150
If you attempt to perform a directory listing on an HTTP
 
151
server, Parrot will attempt to keep <code>ls</code> happy
 
152
by producing a bogus directory entry:
 
153
<pre>
 
154
    % parrot_run ls -la /http/www.yahoo.com/
 
155
    -r--r--r--    1 thain    thain           0 Jul 16 11:50 /http/www.yahoo.com
 
156
</pre>
 
157
 
 
158
A less-drastic example is found in FTP.  If you attempt
 
159
to perform a directory listing of an FTP server, Parrot
 
160
fills in the available information -- the file names and
 
161
their sizes -- but again inserts bogus information to fill the rest out:
 
162
<pre>
 
163
    % parrot_run ls -la /anonftp/ftp.cs.wisc.edu
 
164
    total 0
 
165
    -rwxrwxrwx    1 thain    thain        2629 Jul 16 11:53 RoadMap
 
166
    -rwxrwxrwx    1 thain    thain     1622222 Jul 16 11:53 ls-lR
 
167
    -rwxrwxrwx    1 thain    thain      367507 Jul 16 11:53 ls-lR.Z
 
168
    -rwxrwxrwx    1 thain    thain      212125 Jul 16 11:53 ls-lR.gz
 
169
</pre>
 
170
 
 
171
If you would like to get a better idea of the underlying behavior
 
172
of Parrot, try running it with the <code>-d remote</code> option,
 
173
which will display all of the remote I/O operations that it performs
 
174
on a program's behalf:
 
175
 
 
176
<pre>
 
177
    % parrot_run -d remote ls -la /anonftp/ftp.cs.wisc.edu
 
178
    ...
 
179
    ftp.cs.wisc.edu <-- TYPE I
 
180
    ftp.cs.wisc.edu --> 200 Type set to I.
 
181
    ftp.cs.wisc.edu <-- PASV
 
182
    ftp.cs.wisc.edu --> 227 Entering Passive Mode (128,105,2,28,194,103)
 
183
    ftp.cs.wisc.edu <-- NLST /
 
184
    ftp.cs.wisc.edu --> 150 Opening BINARY mode data connection for file list.
 
185
    ...
 
186
</pre>
 
187
 
 
188
If your program is upset by the unusual semantics of such
 
189
storage systems, then consider using the Chirp protocol and
 
190
server:
 
191
 
 
192
<h2>The Chirp Protocol and Server</h2>
 
193
 
 
194
Although Parrot works with many different protocols,
 
195
is it limited by the capabilities provided by each underlying system.
 
196
(For example, HTTP does not have reliable directory listings.)
 
197
Thus, we have developed a custom protocol, <b>Chirp</b>,
 
198
which provides secure remote file access with all of the capabilities
 
199
needed for running arbitrary Unix programs.
 
200
<b>Chirp</b> is included with the distribution of Parrot,
 
201
and requires no extra steps to install.
 
202
<p>
 
203
To start a Chirp server, simply do the following:
 
204
<pre>
 
205
    % chirp_server -d all
 
206
</pre>
 
207
The <b>-d all</b> option turns on debugging, which helps you to understand
 
208
how it works initially.  You may remove this option once everything
 
209
is working.
 
210
<p>
 
211
Suppose the Chirp server is running on <tt>bird.cs.wisc.edu</tt>.
 
212
Using Parrot, you may access all of the Unix features of
 
213
that host from elsewhere:
 
214
<pre>
 
215
    % parrot_run tcsh
 
216
    % cd /chirp/bird.cs.wisc.edu
 
217
    % ls -la
 
218
    % ...
 
219
</pre>
 
220
In general, Parrot gives better performance and usability
 
221
with Chirp than with other protocols.
 
222
You can read extensively about the Chirp server and protocol
 
223
<a href=chirp.html>in the Chirp manual</a>.
 
224
<p>
 
225
In addition, Parrot provides several custom command line tools
 
226
(<tt>parrot_getacl</tt>, <tt>parrot_setacl</tt>, <tt>parrot_lsalloc</tt>,
 
227
and <tt>parrot_mkalloc</tt>) that can be used to manage the
 
228
access control and space allocation features of Chirp from the Unix command line.
 
229
 
 
230
<h2>Name Resolution</h2>
 
231
 
 
232
In addition to accessing remote storage, Parrot allows you
 
233
to create a custom namespace for any program.  All file name
 
234
activity passes through the Parrot <b>name resolver</b>, which
 
235
can transform any given filename according to a series of rules
 
236
that you specify.
 
237
<p>
 
238
The simplest name resolver is the <b>mountlist</b>, given
 
239
by the <b>-m mountfile</b> option.  This file corresponds closely
 
240
to <tt>/etc/ftsab</tt> in Unix.  A mountlist is simply a file with two
 
241
columns.  The first column gives a logical directory or file name,
 
242
while the second gives the physical path that it must be connected
 
243
to.
 
244
<p>
 
245
For example, if a database is stored at an FTP server under the
 
246
path <tt>/anonftp/ftp.cs.wisc.edu/db</tt>, it may be spliced into the
 
247
filesystem under <tt>/dbase</tt> with a mount list like this:
 
248
<pre>
 
249
     /dbase       /anonftp/ftp.cs.wisc.edu/db
 
250
</pre>
 
251
Instruct Parrot to use the mountlist as follows:
 
252
<pre>
 
253
    % parrot_run -m mountfile tcsh
 
254
    % cd /dbase
 
255
    % ls -la
 
256
</pre>
 
257
A single mount entry may be given on the command line
 
258
with the <b>-M</b> option as follows:
 
259
<pre>
 
260
    % parrot_run -M /dbase=/anonftp/ftp.cs.wisc.edu/db tcsh
 
261
</pre>
 
262
A more sophisticated way to perform name binding is with
 
263
an <i>external resolver</i>.  This is a program executed
 
264
whenever Parrot needs to locate a file or directory.
 
265
The program accepts a logical file name and then returns
 
266
the physical location where it can be found.
 
267
<p>
 
268
Suppose that you have a database service that locates
 
269
the nearest copy of a file for you.  If you run the
 
270
command <tt>locate_file</tt>, it will print out the nearest
 
271
copy of a file.  For example:
 
272
<pre>
 
273
    % locate_file /1523.data
 
274
    /chirp/server.nd.edu/mix/1523.data
 
275
</pre>
 
276
 
 
277
To connect the program <tt>locate_file</tt> to Parrot,
 
278
simply give a mount string that specifies the program
 
279
as a resolver:
 
280
<pre>
 
281
    % parrot_run -M /dbase=resolver:/path/to/locate_file tcsh
 
282
</pre>
 
283
 
 
284
Now, if you attempt to access files under /dbase,
 
285
Parrot will execute <tt>locate_file</tt> and access
 
286
the data stored there:
 
287
<pre>
 
288
    % cat /dbase/1523.data
 
289
    (see contents of /chirp/server.nd.edu/mix/1523.data)
 
290
</pre>
 
291
 
 
292
<h2>More Efficient Copies with <tt>parrot_cp</tt></h2>
 
293
 
 
294
If you are using Parrot to copy lots of files across the network,
 
295
you may see better performance using the <tt>parrot_cp</tt> tool.
 
296
This program looks like an ordinary <tt>cp</tt>, but it makes
 
297
use of an optimized Parrot system call that streams entire files
 
298
over the network, instead of copying them block by block.
 
299
<p>
 
300
To use <tt>parrot_cp</tt>, simply use your shell to alias calls
 
301
to <tt>cp</tt> with calls to <tt>parrot_cp</tt>:
 
302
<p>
 
303
<pre>
 
304
% parrot_run tcsh
 
305
% alias cp parrot_cp
 
306
% cp /tmp/mydata /chirp/server.nd.edu/joe/data
 
307
% cp -rR /chirp/server.nd.edu/joe /tmp/joe
 
308
 </pre>
 
309
<p>
 
310
If run outside of Parrot, <tt>parrot_cp</tt> will operate as
 
311
an ordinary <tt>cp</tt> without any performance gain or loss.
 
312
 
 
313
<h2>Notes on Protocols</h2>
 
314
 
 
315
<h3>HTTP Proxy Servers</h3>
 
316
 
 
317
Both HTTP and GROW can take advantage of standard HTTP proxy servers.
 
318
To route requests through a single proxy server, set the HTTP_PROXY
 
319
environment variable to the server name and port:
 
320
<pre>
 
321
    % setenv HTTP_PROXY "http://proxy.nd.edu:8080"
 
322
</pre>
 
323
Multiple proxy servers can be given, separated by a semicolon.
 
324
This will cause Parrot to try each proxy in order until one succeeds.
 
325
If <tt>DIRECT</tt> is given as the last name in the list, then
 
326
Parrot will fall back on a direct connection to the target web server.
 
327
For example:
 
328
<pre>
 
329
    % setenv HTTP_PROXY "http://proxy.nd.edu:8080;http://proxy.wisc.edu:1000;DIRECT"
 
330
</pre>
 
331
 
 
332
 
 
333
<h3>GROW - Global Read Only Web Filesystem</h3>
 
334
 
 
335
Although the strict HTTP protocol does not allow for correct
 
336
structured directory listings, it is possible to emulate
 
337
directory listings with a little help from the underlying filesystem.
 
338
We call this technique GROW, a global filesystem based on the Web.
 
339
GROW requires the exporter of data to run a script (<tt>make_growfs</tt>)
 
340
that generates a complete directory listing of the data that you wish to
 
341
export.  This directory listing is then used to produce reliable metadata.
 
342
Of course, if the data changes, the script must be run again,
 
343
so GROW is only useful for data that changes infrequently.
 
344
<p>
 
345
To set up an GROW filesystem, you must run <tt>make_growfs</tt>
 
346
on the web server machine with the name of the local storage directory
 
347
as the argument.  For example, suppose that the web server
 
348
<tt>my.server.com</tt> stores pages for the URL
 
349
<tt>http://my.server.com/~fred</tt> in the local directory <tt>/home/fred/www</tt>.
 
350
In this case, you should run the following command:
 
351
<p>
 
352
<pre>
 
353
    % make_growfs /home/fred/www
 
354
</pre>
 
355
Now, others may perceive the web server as a file server under the /grow
 
356
hierarchy.  For example:
 
357
<pre>
 
358
    % parrot_run tcsh
 
359
    % cd /grow/my.server.com/~fred
 
360
    % ls -la
 
361
</pre>
 
362
 
 
363
In addition to providing precise directory metadata, GROW offers
 
364
two additional advantages over plain HTTP:
 
365
<dir>
 
366
<li><b>Aggressive Caching.</b>  GROW caches files in an on-disk
 
367
cache, but unlike plain HTTP, does not need to issue up-to-date
 
368
checks against the server.   Using the cached directory metadata,
 
369
it can tell if a file is up-to-date without any network communication.
 
370
The directory is only checked for changes at the beginning of program
 
371
execution, so changes become visible only to newly executed programs.
 
372
<li><b>SHA-1 Integrity.</b>
 
373
<tt>make_growfs</tt> generates SHA-1 checksums on the directory
 
374
and each file so that the integrity of the system can be verified at
 
375
runtime.
 
376
If a checksum fails, GROW will attempt to reload the file or directory
 
377
listing in order to repair the error, trying until the master timeout
 
378
(set by the -T option) expires.  This will also occur if the underlying
 
379
files have been modified and <tt>make_growfs</tt> has not yet been re-run.
 
380
If necessary, checksums can be disabled by giving the <tt>-k</tt> option
 
381
to either Parrot or <tt>make_growfs</tt>.
 
382
</dir>
 
383
 
 
384
<h3>Hadoop Distributed File System (HDFS)</h3>
 
385
 
 
386
HDFS is the primary distributed filesystem used in the <a
 
387
    href="http://hadoop.apache.org">Hadoop</a> project.  Parrot supports read
 
388
and write access to HDFS systems using the <tt>parrot_run_hdfs</tt> wrapper.  This
 
389
script checks that the appropriate environmental variables are defined and
 
390
calls <tt>parrot</tt>.
 
391
<p>
 
392
In particular, you must ensure that you define the following environmental
 
393
variables:
 
394
 
 
395
<pre>
 
396
JAVA_HOME     Location of your Java installation.
 
397
HADOOP_HOME   Location of your Hadoop installation.
 
398
</pre>
 
399
 
 
400
Based on these environmental variables, <tt>parrot_run_hdfs</tt> will attempt to
 
401
find the appropriate paths for <tt>libjvm.so</tt> and <tt>libhdfs.so</tt>.
 
402
These paths are stored in the environmental variables <tt>LIBJVM_PATH</tt> and
 
403
<tt>LIBHDFS_PATH</tt>, which are used by the HDFS Parrot module to load the
 
404
necessary shared libraries at run-time.  To avoid the startup overhead of
 
405
searching for these libraries, you may set the paths manually in your
 
406
environment before calling <tt>parrot_run_hdfs</tt>, or you may edit the script
 
407
directly.
 
408
 
 
409
<p>
 
410
 
 
411
Note that while Parrot supports read access to HDFS, it only provides
 
412
write-once support on HDFS.  This is because the current implementations of
 
413
HDFS do not provide reliable append operations.  Likewise, files can only be
 
414
opened in either read (<tt>O_RDONLY</tt>) or write mode (<tt>O_WRONLY</tt>),
 
415
and not both (<tt>O_RDWR</tt>).
 
416
 
 
417
<h3>EGEE Data Access: GFAL, LFN, GUID, SRM, RFIO, DCAP, and LFC</h3>
 
418
 
 
419
The EGEE project is a European-wide grid computing project.
 
420
The EGEE software stack, GLite, can be downloaded <a href=http://glite.web.cern.ch/glite/packages/R3.0/R20060502/default.asp>here</a>.  (Warning: it's big.)
 
421
Parrot can be connected to several different but related components of EGEE.
 
422
<p>
 
423
The simplest way to use Parrot with EGEE is through the Grid File Access Library (GFAL).  This library is attached to Parrot under the paths <tt>/lfn</tt>, <tt>/guid</tt>, <tt>/srm</tt>, <tt>/rfio</tt>, <tt>/dcap</tt>, and <tt>/gfal</tt>.  This manual does not document all of the details of GFAL itself, you should read <a href=http://wiki.nesc.ac.uk/read/egee-na3-etf?action=browse&diff=1&id=InductionNotesGFAL>that manual</a> for more information.
 
424
<p>
 
425
For example, suppose that you have an RFIO server running on <tt>server.somewhere.edu</tt>.  To access this server, try the following:
 
426
<pre>
 
427
    % parrot_run tcsh
 
428
    % cd /rfio/server.somewhere.edu/
 
429
    % ls -la
 
430
</pre>
 
431
 
 
432
Or, to access a file by logical name or by GUID, note that you can either use
 
433
a pathname-like syntax, or specify a URL with colons.  Both ways are acceptable:
 
434
<pre>
 
435
    % parrot_run tcsh
 
436
 
 
437
    % cat /lfn/baud/testgfal15 
 
438
    % cat lfn:baud/testgfal15 
 
439
 
 
440
    % cat /guid/2cd59291-7ae7-4778-af6d-b1f423719441
 
441
    % cat guid:2cd59291-7ae7-4778-af6d-b1f423719441
 
442
</pre>
 
443
 
 
444
In these cases, Parrot pre-processes the paths so that they are formatted correctly
 
445
for use by the GFAL.  However, you can also compose paths directly for you by GFAL,
 
446
by accessing files underneath <tt>/gfal</tt>.  This syntax can be useful if you
 
447
are attempting to harness some new GFAL capability that Parrot is not aware of.
 
448
For example:
 
449
 
 
450
<pre>
 
451
    % parrot_run tcsh
 
452
    % cd /gfal/rfio://server.somewhere.edu//
 
453
    % ls -la
 
454
</pre>
 
455
 
 
456
As noted above, GFAL requires some setup to work properly.
 
457
If you are having difficulties, make sure that you have
 
458
set all of the GFAL environment variables appropriately:
 
459
 
 
460
<pre>
 
461
    LCG_GFAL_INFOSYS
 
462
    LCG_CATALOG_TYPE
 
463
    LFC_HOST
 
464
    LCG_RFIO_TYPE
 
465
    LCG_GFAL_VO
 
466
</pre>
 
467
 
 
468
And, if using RFIO, make sure that the appropriate
 
469
dynamic library <tt>libshift.so</tt> is in your
 
470
library search path:
 
471
 
 
472
<pre>
 
473
    export LD_LIBRARY_PATH=/opt/lhc/lib
 
474
</pre>
 
475
 
 
476
Use of the GFAL involves many complex interacting pieces
 
477
of software.  It is recommended that you run Parrot with the <tt>-d remote</tt>
 
478
flag in order to debug problems using GFAL.
 
479
 
 
480
<h3>EGEE Data Catalog: LFC</h3>
 
481
 
 
482
In addition to using GFAL, Parrot can access an LHC file catalog (LFC) directly
 
483
under the path <tt>/lfc</tt>.  For example:
 
484
 
 
485
<pre>
 
486
    % parrot_run cat /lfc/my/logical/name
 
487
</pre>
 
488
 
 
489
In this case, Parrot itself performs the lookup against the LFC,
 
490
and uses its own access methods to retrieve the file directly.
 
491
This can be useful when Parrot supports a protocol (such as GSIFTP)
 
492
that is not directly supported by the GFAL library itself.
 
493
<p>
 
494
Use of the LFC involves many complex interacting pieces
 
495
of software.  It is recommended that you run Parrot with the <tt>-d remote</tt>
 
496
flag in order to debug problems using LFC.
 
497
 
 
498
<h2>Identity Boxing</h2>
 
499
 
 
500
Parot provides a unique feature known as <i>identity boxing</i>.
 
501
This feature allows you to run a (possibly) untrusted program
 
502
within a protection domain, as if it were run in a completely separate account.
 
503
Using an identity box, you do not need to become root or even
 
504
to manage account names: you can create any identity that you like on the fly.
 
505
<p>
 
506
For example, suppose that you wish to allow a friend to log into your
 
507
private workstation.  Instead of creating a new account, simply use a
 
508
script supplied with Parrot to create an identity box:
 
509
<p>
 
510
<pre>
 
511
% whoami
 
512
dthain
 
513
% parrot_identity_box MyFriend
 
514
% whoami
 
515
MyFriend
 
516
% touch ~dthain/private-data
 
517
touch: creating ~dthain/private-data': Permission denied
 
518
</pre>
 
519
<p>
 
520
Note that the shell running within the identity box cannot change or
 
521
modify any of the supervising user's data.  In fact, the contained
 
522
user can only access items that are world-readable or world-writable.
 
523
<p>
 
524
You can give the contained user access to other parts of the filesystem
 
525
by creating access control lists. (ACLs)  An ACL is a list of users
 
526
and the resources that they are allowed to access.  Each directory
 
527
has it's own ACL in the file <tt>.__acl</tt>.  This file does not
 
528
appear in a directory listing, but you can read and write it just the same.
 
529
<p>
 
530
For example, <tt>MyFriend</tt> above can see his initial ACL as follows:
 
531
<p>
 
532
<pre>
 
533
% cat .__acl
 
534
MyFriend rwlxa
 
535
</pre>
 
536
 
 
537
This means that <tt>MyFriend</tt> can read, write, list, execute, and
 
538
administer items in the current directory.  Now, suppose that <tt>MyFriend</tt>
 
539
wants to allow <tt>Freddy</tt> read access to the same directory.
 
540
Simply edit the ACL file to read:
 
541
<pre>
 
542
MyFriend rwlxa
 
543
Freddy   rl
 
544
</pre>
 
545
 
 
546
Identity boxing and ACLs are particularly useful when using distributed
 
547
storage.  You can read more about ACLs and identity boxing in the
 
548
<a href=chirp.html>Chirp</a> manual.
 
549
 
 
550
<h2>64-Bit Support</h2>
 
551
 
 
552
In all modes, Parrot supports applications that access large (>2GB) files
 
553
that require 64-bit seek pointers.   However, we have found that many tools
 
554
and filesystems do not manipulate such large files properly.  If possible,
 
555
we advise users to break up files into smaller pieces for processing.
 
556
<p>
 
557
Parrot supports 64 bit programs and processors in the following combinations:
 
558
<center>
 
559
<table border=1>
 
560
<tr> <td colspan=2 align=center> <b>Program Type</b>
 
561
<tr> <td> 32-bit <td> 64-bit <td> <b>CPU Type</b>
 
562
<tr> <td><font size=+1 color=green>YES</font> <td> <font size=+1 color=red>NO</font><td> Parrot for 32-bit X86 CPU    <br> Pentium, Xeon, Athlon, Sempron
 
563
<tr> <td><font size=+1 color=green>YES</font> <td> <font size=+1 color=green>YES</font> <td > Parrot for 64-bit X86_64 CPU <br> Opteron, Athlon64, Turion64, Sempron64
 
564
</table>
 
565
</center>
 
566
 
 
567
<h2>Options and Environment</h2>
 
568
 
 
569
Parrot has several command line options and corresponding environment variables.
 
570
<dir>
 
571
<table>
 
572
<tr><td><b>Option</b><td><b>Purpose</b><td><b>Environment Variable</b>
 
573
<tr><td><b>-a &lt;list&gt;</b><tr>Use these Chirp authentication methods.<tr>(PARROT_CHIRP_AUTH)
 
574
<tr><td><b>-b &lt;bytes&gt; </b><td>Set the recommended remote I/O block size.<td>PARROT_LOCAL_BLOCK_SIZE
 
575
<tr><td><b>-B &lt;bytes&gt; </b><td>Set the recommended local I/O block size.<td>PARROT_REMOTE_BLOCK_SIZE
 
576
<tr><td><b>-C &lt;MB&gt;</b><td>Set the size of the I/O channel.<td>PARROT_CHANNEL_SIZE
 
577
<tr><td><b>-d &lt;system&gt;</b><td>Enable debugging for this sub-system.<td>PARROT_DEBUG_FLAGS
 
578
<tr><td><b>-h</b><td>Show this screen.
 
579
<tr><td><b>-m &lt;file&gt; </b><td>Use this file as a mountlist.<td>PARROT_MOUNT_FILE
 
580
<tr><td><b>-M &lt;local&gt;=&lt;remote&gt;</b><td>Mount this remote file on this local directory.
 
581
<tr><td><b>-o &lt;file&gt;</b><td>Send debugging messages to this file.<td>PARROT_DEBUG_FILE
 
582
<tr><td><b>-p &lt;host:port&gt;</b><td>Use this proxy for HTTP requests.<td>HTTP_PROXY
 
583
<tr><td><b>-t &lt;dir&gt;</b><td>Where to store temporary files.<td>PARROT_TEMP_DIR
 
584
<tr><td><b>-v</b><td>Display version number.
 
585
</table>
 
586
</dir>
 
587
<p>
 
588
This list is probably out of date, so you should run <tt>parrot_run -h</tt> to see
 
589
the most up-to-date list.
 
590
<p>
 
591
The flexible debugging flags can be a great help in both debugging and understanding Parrot.
 
592
To turn on multiple debugging flags, you may either issue multiple -d options:
 
593
<pre>
 
594
    % parrot_run -d ftp -d chirp tcsh
 
595
</pre>
 
596
Or, you may give a space separated list in the corresponding environment variable:
 
597
<pre>
 
598
    % setenv PARROT_DEBUG_FLAGS "ftp chirp"
 
599
    % parrot_run tcsh
 
600
</pre>
 
601
Here is the meaning of each of the debug flags.
 
602
<p>
 
603
<dir>
 
604
<table>
 
605
<tr ><td><b>syscall</b><td>This shows all of the system calls attempted by each program, even those that Parrot does not trap or modify.  (To see arguments and return values, try -d libcall instead.)
 
606
<tr><td><b>libcall</b><td>This shows only the I/O calls that are actually trapped and implemented by Parrot.  The arguments and return codes are the logical values seen by the application, not the underlying operations.  (To see the underlying operations try -d remote or -d local instead.)
 
607
<tr><td><b>cache</b><td>This shows all of the shared segments that are loaded into the channel cache and shared by multiple programs.  For most programs, this means all the shared libraries.
 
608
<tr><td><b>process</b><td>This shows all process creations, deletions, signals, and process state changes.
 
609
<tr><td><b>resolve</b><td>This shows every invocation of the name resolver.  A plain file name indicates the name was not modified, while more detailed records show names that were changed or denied access.
 
610
<tr><td><b>local</b><td>This shows all local I/O calls from the perspective of Parrot.  Notice that the file descriptors and file names shown are internal to Parrot. (To see fds and names from the perspective of the job, try -d libcall.)
 
611
<tr><td><b>remote</b><td>This shows all non-local file activity.
 
612
<tr><td><b>http</b><td>This shows only HTTP operations.
 
613
<tr><td><b>ftp</b><td>This shows only FTP operations.
 
614
<tr><td><b>nest</b><td>This shows only NeST operations.
 
615
<tr><td><b>chirp</b><td>This shows only Chirp operations.
 
616
<tr><td><b>rfio</b><td>This shows only RFIO operations.
 
617
<tr><td><b>gfal</b><td>This shows only GFAL operations.
 
618
<tr><td><b>lfn</b><td>This shows only LFC LFN operations.
 
619
<tr><td><b>hdfs</b><td>This shows only HDFS operations.
 
620
<tr><td><b>poll</b><td>This shows all activity related to processes that block (explicitly or implicitly) waiting for I/O.
 
621
<tr><td><b>time</b><td>This adds the current time to every debug message.
 
622
<tr><td><b>pid</b><td>This adds the calling process id to every debug message.
 
623
<tr><td><b>all</b><td>This shows all possible debugging messages.
 
624
</table>
 
625
</dir>