Difference between revisions of "Accessing Swestore with the ARC client"

From SNIC Documentation
Jump to: navigation, search
Line 6: Line 6:
 
[[Swestore|< SweStore]]
 
[[Swestore|< SweStore]]
  
(PAGE UNDER DEVELOPMENT)
+
This guide describes how to use the [http://www.nordugrid.org Nordugrid] ''ARC'' client for storing and retrieving files from SweStore National Storage. The ARC client is usually used for sending grid jobs to grid clusters, but it also contains commands for data management. A complete user guide for the ARC client can be found in http://www.nordugrid.org/documents/arc-ui.pdf.
  
= The ARC client =
+
= Requirements =
 +
To access SweStore national storage using the ARC client you need to get a [[Grid_certificates#Requesting_a_certificate|grid certificate]] and become a member of the [[Grid_certificates#Requesting_membership_in_the_SweGrid_VO|SweGrid virtual organisation]]. If you want access to your own private storage area you need to have a SweStore [[Apply_for_storage_on_SweStore|storage project]]. You also need to have the ARC client installed in order
 +
All SNIC systems have the ARC client installed. If yours doesn't, please contact support at your centre so they can fix this error as soon as possible. To install the ARC client on your own computer, please follow instructions [[ARC_client_installation|here]], or see the official Nordugrid [http://www.nordugrid.org/documents/arc-client-install.html ARC installation] page for more information.
  
This guide describes how to use the [http://www.nordugrid.org Nordugrid]
+
= Quickstart =
''ARC'' client for storing and retrieving files from SweStore National
+
Basic commands are:
Storage. The ARC client is usually used for sending grid jobs to grid
+
: <code>arcproxy</code> - unlock your certificate so you can use it.
clusters, but it also contain commands for data management.
+
: <code>arcls</code> - for listing files. Works similarly to <code>ls</code>. Example <code><nowiki>arcls srm://srm.swegrid.se/snic/YOUR_PROJECT_NAME</nowiki></code>
 
+
: <code>arccp</code> - for copying files. Works similarly to <code>cp</code>. Example <code><nowiki>arccp myfile.txt srm://srm.swegrid.se/snic/YOUR_PROJECT_NAME/create_dirs_if_necessary/myfile.txt</nowiki></code>
If your system doesn't have the ARC client installed you can look at
+
: <code>arcrm</code> - for deleting files. Works similarly to <code>rm</code>. Example <code><nowiki>arcrm srm://srm.swegrid.se/snic/YOUR_PROJECT_NAME/whoops.txt</nowiki></code>
the [[ARC_client_installation|ARC client installation]] page in this
+
Note that the paths on storage are the same as in the web browser, only that the urls start with is srm://srm... rather than <nowiki>http://webdav...</nowiki>. Use <code>man</code> and <code>--help</code> to get more info on each command. Examples: <code>man arcrm</code> or <code>arcls --help</code>
wiki or the official Nordugrid
 
[http://www.nordugrid.org/documents/arc-client-install.html ARC
 
installation] page for more information. Please note that the windows
 
and MacOS clients are a bit unstable.
 
 
 
A complete user guide for the ARC client can be found in
 
http://www.nordugrid.org/documents/arc-ui.pdf.
 
 
 
ARC can handle many different file transfer protocols, such as:
 
''http, https, httpg, ftp, gsiftp, lfc, rls, srm''. But only the srm
 
protocol is currently is supported when accessing SweStore using the
 
ARC client.
 
 
 
== ARC 0.8 versus 1.0 ==
 
 
 
In late spring 2011 Nordugrid release the 1.0 version of ARC
 
(sometimes called 11.05). One of the new features of 1.0 compared to
 
the previous 0.8 release was a new command set. Basically most of the
 
ng* commands was replaced with the new arc* commands. Some
 
functionality moved between commands (ngstat became arcinfo and
 
arcstat) and some new commands was introduced (arcproxy as an
 
replacement for grid-proxy-init, which wasn't an arc command at all
 
but a part of the Globus Toolkit). There are still legacy compatibility
 
binaries in place for the old ng* commands, but I strongly suggest
 
that you use arc* when available.
 
 
 
If you on the same local account switch between ng* and arc* commands you may get warnings:
 
 
 
Bad format detected in file /home/jens/.arc/srms.conf, in line srm.swegrid.se 8443 2.2
 
Unwrapped data does not fit into buffer
 
Connection to server failed: Connection refused
 
Connection to server failed: Connection refused
 
or
 
WARNING: Bad or old format detected in file /home/jens/.arc/srms.conf, in line srm.swegrid.se 8443 gsi 2.2
 
WARNING: Bad or old format detected in file /home/jens/.arc/srms.conf, in line srm.swegrid.se 8443 gsi 2.2
 
 
 
There is a file, srm.conf, that gets automatically updated when
 
accessing a resource. ngls and arcls does not agree on the content of
 
that file. There are bug reports about it. That warning is just
 
confusing and shouldn't be displayed. Another attempt using the same
 
command will probably not display those errors again.
 
 
 
== arcproxy 1.0.1 ==
 
 
 
There us a bug in dCache which makes proxy certificates from arcproxy
 
1.0.1 unusable. The error you get is:
 
 
 
ERROR: Failed listing files
 
 
 
All other version of arcproxy should be fine. If you encounter this
 
version av arcproxy, please use grid-proxy-init if available. The
 
generated proxy certificates should be equivalent.
 
 
 
= Preparations =
 
 
 
In addition to the installed ARC client you need the proper access rights and a valid grid proxy certificate. Please check the [[Grid certificates]] page for more information.
 
  
 
= Copying files =  
 
= Copying files =  
Line 83: Line 29:
 
normal '''cp''' command as shown in the following example:
 
normal '''cp''' command as shown in the following example:
  
  $ arccp archive.tar.gz srm://srm.swegrid.se/ops/
+
  $ arccp archive.tar.gz srm://srm.swegrid.se/snic/YOUR_PROJECT_NAME/
  
 
Please note the trailing / which marks the destination as a directory.
 
Please note the trailing / which marks the destination as a directory.
Line 96: Line 42:
 
recursive copy.
 
recursive copy.
  
  $ arccp --recursive=3 foobar/ srm://srm.swegrid.se/ops/foobar/
+
  $ arccp --recursive=3 foobar/ srm://srm.swegrid.se/snic/YOUR_PROJECT_NAME/
  
 
= Listing files =  
 
= Listing files =  
Line 105: Line 51:
 
following example:
 
following example:
  
  $ arcls srm://srm.swegrid.se/ops/
+
  $ arcls srm://srm.swegrid.se/snic/bils/db/uniprot/2012_05
motd.1
 
bla
 
generated
 
ops
 
motd.f343
 
  
 
Additional information can be listed by adding the '''--long''' option:
 
Additional information can be listed by adding the '''--long''' option:
  
  $ arcls --long srm://srm.swegrid.se/ops
+
  $ arcls --long srm://srm.swegrid.se/snic/bils/db/uniprot/2012_05
 
  <Name> <Type> <Size> <Creation> <Validity> <CheckSum> <Latency>
 
  <Name> <Type> <Size> <Creation> <Validity> <CheckSum> <Latency>
  motd.1 file 354 2008-06-05 12:28:23 (n/a) adler32:582d7718 NEARLINE
+
  reldate.txt file 151 2012-05-23 03:00:19 (n/a) adler32:f3f52f1d ONLINE
  bla dir 512 2008-08-22 12:23:49 (n/a) (n/a) NEARLINE
+
  speclist.txt file 1715169 2012-05-23 03:00:17 (n/a) adler32:91e59dae ONLINE
  foobar dir 512 2008-11-17 15:07:39 (n/a) (n/a) NEARLINE
+
uniprot_sprot.dat.gz file 462895141 2012-05-23 02:57:18 (n/a) adler32:0f131bb2 ONLINE
  ops dir 512 2010-01-21 11:26:00 (n/a) (n/a) NEARLINE
+
  uniprot_sprot.fasta.gz file 79935897 2012-05-23 03:00:20 (n/a) adler32:89844c57 ONLINE
  motd.f343 file 436 2010-01-08 14:35:40 (n/a) adler32:0fed94f2 ONLINE
+
  uniprot_trembl.dat.gz file 9162678278 2012-05-23 02:52:01 (n/a) adler32:b2d7cfd5 ONLINE
 +
  uniprot_trembl.fasta.gz file 4456514443 2012-05-23 02:57:34 (n/a) adler32:2b73b2a1 ONLINE
  
 
Metadatainformation on a specific file can be listed by specifying the '''-m''' or '''--metadata''' option. In the following example the metadata information of the '''motd.1''' file is shown:
 
Metadatainformation on a specific file can be listed by specifying the '''-m''' or '''--metadata''' option. In the following example the metadata information of the '''motd.1''' file is shown:
  
 
  $ arcls --metadata srm://srm.swegrid.se/ops/motd.1
 
  $ arcls --metadata srm://srm.swegrid.se/ops/motd.1
  /ops/motd.1
+
  /snic/bils/db/uniprot/2012_05/reldate.txt
 
  accessperm:rw-r--r--
 
  accessperm:rw-r--r--
  checksum:adler32:582d7718
+
  checksum:adler32:f3f52f1d
  ctime:2008-06-05 12:28:23
+
  ctime:2012-05-23 03:00:19
 
  filestoragetype:PERMANENT
 
  filestoragetype:PERMANENT
  group:25001
+
  group:25051
  latency:NEARLINE
+
  latency:ONLINE
 
  lifetimeassigned:PT1S
 
  lifetimeassigned:PT1S
 
  lifetimeleft:PT1S
 
  lifetimeleft:PT1S
  mtime:2011-03-24 12:57:42
+
  mtime:2012-05-23 03:00:19
  owner:25001
+
  owner:25064
  path:/ops/motd.1
+
  path:/snic/bils/db/uniprot/2012_05/reldate.txt
  size:354
+
  size:151
 
  spacetokens:
 
  spacetokens:
 
  type:file
 
  type:file
Line 148: Line 90:
  
 
  $ touch dummyfile
 
  $ touch dummyfile
  $ arccp dummyfile srm://srm.swegrid.se/ops/newdir/
+
  $ arccp dummyfile srm://srm.swegrid.se/snic/YOUR_PROJECT_NAME/newdir/
  $ arcls srm://srm.swegrid.se/ops/newdir/
+
  $ arcls srm://srm.swegrid.se/snic/YOUR_PROJECT_NAME/newdir/
 
  dummyfile
 
  dummyfile
  
Line 156: Line 98:
 
= Removing files or directories =
 
= Removing files or directories =
  
  $ arcrm srm://srm.swegrid.se/ops/newdir/dummyfile
+
  $ arcrm srm://srm.swegrid.se/snic/YOUR_PROJECT_NAME/newdir/dummyfile
  $ arcrm srm://srm.swegrid.se/ops/newdir/
+
  $ arcrm srm://srm.swegrid.se/snic/YOUR_PROJECT_NAME/newdir/
  
 
To remove directories they have to be empty.
 
To remove directories they have to be empty.
 +
 +
= Known problems =
 +
 +
== ARC 0.8 versus 1.0 ==
 +
 +
In late spring 2011 Nordugrid release the 1.0 version of ARC
 +
(sometimes called 11.05). One of the new features of 1.0 compared to
 +
the previous 0.8 release was a new command set. Basically most of the
 +
ng* commands was replaced with the new arc* commands. Some
 +
functionality moved between commands (ngstat became arcinfo and
 +
arcstat) and some new commands was introduced (arcproxy as an
 +
replacement for grid-proxy-init, which wasn't an arc command at all
 +
but a part of the Globus Toolkit). There are still legacy compatibility
 +
binaries in place for the old ng* commands, but I strongly suggest
 +
that you use arc* when available.
 +
 +
If you on the same local account switch between ng* and arc* commands you may get warnings:
 +
 +
Bad format detected in file /home/jens/.arc/srms.conf, in line srm.swegrid.se 8443 2.2
 +
Unwrapped data does not fit into buffer
 +
Connection to server failed: Connection refused
 +
Connection to server failed: Connection refused
 +
or
 +
WARNING: Bad or old format detected in file /home/jens/.arc/srms.conf, in line srm.swegrid.se 8443 gsi 2.2
 +
WARNING: Bad or old format detected in file /home/jens/.arc/srms.conf, in line srm.swegrid.se 8443 gsi 2.2
 +
 +
There is a file, srm.conf, that gets automatically updated when
 +
accessing a resource. ngls and arcls does not agree on the content of
 +
that file. There are bug reports about it. That warning is just
 +
confusing and shouldn't be displayed. Another attempt using the same
 +
command will probably not display those errors again.
 +
 +
== arcproxy 1.0.1 ==
 +
 +
There us a bug in dCache which makes proxy certificates from arcproxy
 +
1.0.1 unusable. The error you get is:
 +
 +
ERROR: Failed listing files
 +
 +
All other version of arcproxy should be fine. If you encounter this
 +
version av arcproxy, please use grid-proxy-init if available. The
 +
generated proxy certificates should be equivalent.

Revision as of 09:24, 25 May 2012

< Getting started with SweGrid
< SweStore

This guide describes how to use the Nordugrid ARC client for storing and retrieving files from SweStore National Storage. The ARC client is usually used for sending grid jobs to grid clusters, but it also contains commands for data management. A complete user guide for the ARC client can be found in http://www.nordugrid.org/documents/arc-ui.pdf.

Requirements

To access SweStore national storage using the ARC client you need to get a grid certificate and become a member of the SweGrid virtual organisation. If you want access to your own private storage area you need to have a SweStore storage project. You also need to have the ARC client installed in order All SNIC systems have the ARC client installed. If yours doesn't, please contact support at your centre so they can fix this error as soon as possible. To install the ARC client on your own computer, please follow instructions here, or see the official Nordugrid ARC installation page for more information.

Quickstart

Basic commands are:

arcproxy - unlock your certificate so you can use it.
arcls - for listing files. Works similarly to ls. Example arcls srm://srm.swegrid.se/snic/YOUR_PROJECT_NAME
arccp - for copying files. Works similarly to cp. Example arccp myfile.txt srm://srm.swegrid.se/snic/YOUR_PROJECT_NAME/create_dirs_if_necessary/myfile.txt
arcrm - for deleting files. Works similarly to rm. Example arcrm srm://srm.swegrid.se/snic/YOUR_PROJECT_NAME/whoops.txt

Note that the paths on storage are the same as in the web browser, only that the urls start with is srm://srm... rather than http://webdav.... Use man and --help to get more info on each command. Examples: man arcrm or arcls --help

Copying files

Copying files to and from resources is accomplished using the arccp command.

Copying single files

Copying single files is accomplished in the same way as using the normal cp command as shown in the following example:

$ arccp archive.tar.gz srm://srm.swegrid.se/snic/YOUR_PROJECT_NAME/

Please note the trailing / which marks the destination as a directory. Without a / the destination will be a file, which may or may not be what you wanted. All required directories are created when needed so the destination may be a nonexisting directory.

Recursive copying

Recursive copying is accomplished using the --recursive option to arccp. The argument to the option determines the depth of the recursive copy.

$ arccp --recursive=3 foobar/ srm://srm.swegrid.se/snic/YOUR_PROJECT_NAME/

Listing files

Listing files on a resources is done using the arcls command. In the simplest form the command just takes a URL as input and displays names and directories without any extra information as shown in the following example:

$ arcls srm://srm.swegrid.se/snic/bils/db/uniprot/2012_05

Additional information can be listed by adding the --long option:

$ arcls --long srm://srm.swegrid.se/snic/bils/db/uniprot/2012_05
<Name> <Type> <Size> <Creation> <Validity> <CheckSum> <Latency>
reldate.txt file 151 2012-05-23 03:00:19 (n/a) adler32:f3f52f1d ONLINE
speclist.txt file 1715169 2012-05-23 03:00:17 (n/a) adler32:91e59dae ONLINE
uniprot_sprot.dat.gz file 462895141 2012-05-23 02:57:18 (n/a) adler32:0f131bb2 ONLINE
uniprot_sprot.fasta.gz file 79935897 2012-05-23 03:00:20 (n/a) adler32:89844c57 ONLINE
uniprot_trembl.dat.gz file 9162678278 2012-05-23 02:52:01 (n/a) adler32:b2d7cfd5 ONLINE
uniprot_trembl.fasta.gz file 4456514443 2012-05-23 02:57:34 (n/a) adler32:2b73b2a1 ONLINE

Metadatainformation on a specific file can be listed by specifying the -m or --metadata option. In the following example the metadata information of the motd.1 file is shown:

$ arcls --metadata srm://srm.swegrid.se/ops/motd.1
/snic/bils/db/uniprot/2012_05/reldate.txt
accessperm:rw-r--r--
checksum:adler32:f3f52f1d
ctime:2012-05-23 03:00:19
filestoragetype:PERMANENT
group:25051
latency:ONLINE
lifetimeassigned:PT1S
lifetimeleft:PT1S
mtime:2012-05-23 03:00:19
owner:25064
path:/snic/bils/db/uniprot/2012_05/reldate.txt
size:151
spacetokens:
type:file

Creating directories

There is no command line tool for creating directories. This command will probably be added in an upcoming release. In the meantime the following procedure can be used:

$ touch dummyfile
$ arccp dummyfile srm://srm.swegrid.se/snic/YOUR_PROJECT_NAME/newdir/
$ arcls srm://srm.swegrid.se/snic/YOUR_PROJECT_NAME/newdir/
dummyfile

The dummmyfile can be removed using the arcrm command described in the following section.

Removing files or directories

$ arcrm srm://srm.swegrid.se/snic/YOUR_PROJECT_NAME/newdir/dummyfile
$ arcrm srm://srm.swegrid.se/snic/YOUR_PROJECT_NAME/newdir/

To remove directories they have to be empty.

Known problems

ARC 0.8 versus 1.0

In late spring 2011 Nordugrid release the 1.0 version of ARC (sometimes called 11.05). One of the new features of 1.0 compared to the previous 0.8 release was a new command set. Basically most of the ng* commands was replaced with the new arc* commands. Some functionality moved between commands (ngstat became arcinfo and arcstat) and some new commands was introduced (arcproxy as an replacement for grid-proxy-init, which wasn't an arc command at all but a part of the Globus Toolkit). There are still legacy compatibility binaries in place for the old ng* commands, but I strongly suggest that you use arc* when available.

If you on the same local account switch between ng* and arc* commands you may get warnings:

Bad format detected in file /home/jens/.arc/srms.conf, in line srm.swegrid.se 8443 2.2
Unwrapped data does not fit into buffer
Connection to server failed: Connection refused
Connection to server failed: Connection refused

or

WARNING: Bad or old format detected in file /home/jens/.arc/srms.conf, in line srm.swegrid.se 8443 gsi 2.2
WARNING: Bad or old format detected in file /home/jens/.arc/srms.conf, in line srm.swegrid.se 8443 gsi 2.2

There is a file, srm.conf, that gets automatically updated when accessing a resource. ngls and arcls does not agree on the content of that file. There are bug reports about it. That warning is just confusing and shouldn't be displayed. Another attempt using the same command will probably not display those errors again.

arcproxy 1.0.1

There us a bug in dCache which makes proxy certificates from arcproxy 1.0.1 unusable. The error you get is:

ERROR: Failed listing files

All other version of arcproxy should be fine. If you encounter this version av arcproxy, please use grid-proxy-init if available. The generated proxy certificates should be equivalent.