This document describes how user with grid certificate can access the files stored in the AGLT2 dCache system!

All files in dCache need to be copied to a local file system for user analysis, with either the gfal-copy or xrdcp commands.

Prerequisite

Initiate user certificate and VOMS

All files stored in dCache needs to be accessed with user grid certificate with its ATLAS VOMS attribute.

Command to initiate user certificate with ATLAS VOMS attribute:

-bash-4.2$ voms-proxy-init --voms atlas
Enter GRID pass phrase:Your identity: /DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=wwu/CN=673124/CN=Wenjing Wu
Creating temporary proxy ............................ Done
Contacting  lcg-voms2.cern.ch:15001 [/DC=ch/DC=cern/OU=computers/CN=lcg-voms2.cern.ch] "atlas" 
DoneCreating proxy ................... Done
Your proxy is valid until Tue Feb 19 23:54:41 2019

Setup Environment

export GFALDOOR=gsiftp://dcdum0$(echo $RANDOM %3 + 1|bc).aglt2.org:2811
export XRCPDOOR=root://xrootd.aglt2.org:1094
export SRMDOOR="srm://head01.aglt2.org:8443/srm/managerv2?SFN="

Different Tools to access files

gfal

One can use the gfal tools to list/stat/read/write/delete files in dCache
-bash-4.2$ gfal-ls -l $GFALDOOR/pnfs/aglt2.org/atlaslocalgroupdisk/SAM/testfile-srm-GET-ATLASLOCALGROUPDISK.txt
-rw-rw-rw-   1 55670 789090        20 Jun 10  2015 gsiftp://dcdum03.aglt2.org:2811/pnfs/aglt2.org/atlaslocalgroupdisk/SAM/testfile-srm-GET-ATLASLOCALGROUPDISK.txt



-bash-4.2$ gfal-ls -l $GFALDOOR/pnfs/aglt2.org/atlaslocalgroupdisk/SAM/



-rw-rw-rw-   1 55670 751564        20 Apr 29  2016 etf-testfile-GET-ATLASLOCALGROUPDISK.txt



-rw-rw-rw-   1 55670 789090        20 Jun 11  2015 testfile17-https-GET-ATLASLOCALGROUPDISK.txt



-rw-rw-rw-   1 55670 751564        20 Nov  9  2014 testfile-DEL-ATLASLOCALGROUPDISK-1415555298-b8e66448c198.txt

-bash-4.2$ gfal-stat $GFALDOOR/pnfs/aglt2.org/atlaslocalgroupdisk/SAM/testfile-srm-GET-ATLASLOCALGROUPDISK.txt
File: 'gsiftp://dcdum03.aglt2.org:2811/pnfs/aglt2.org/atlaslocalgroupdisk/SAM/testfile-srm-GET-ATLASLOCALGROUPDISK.txt'
Size: 20   regular file
Access: (0666/-rw-rw-rw-)   Uid: 789090   Gid: 55670
Access: 1969-12-31 19:00:00.000000
Modify: 2015-06-10 08:02:15.000000
Change: 1969-12-31 19:00:00.000000

-bash-4.2$ gfal-copy $GFALDOOR/pnfs/aglt2.org/atlaslocalgroupdisk/SAM/testfile-srm-GET-ATLASLOCALGROUPDISK.txt /tmp/myfile1
Copying gsiftp://dcdum03.aglt2.org:2811/pnfs/aglt2.org/atlaslocalgroupdisk/SAM/testfile-srm-GET-ATLASLOCALGROUPDISK.txt   [DONE]  after 0s
-bash-4.2$ gfal-copy /etc/hosts $GFALDOOR/pnfs/aglt2.org/atlaslocalgroupdisk/SAM/mytest-20190218.txt
Copying file:///etc/hosts   [DONE]  after 0s


-bash-4.2$ gfal-rm $GFALDOOR/pnfs/aglt2.org/atlaslocalgroupdisk/SAM/mytest-20190218.txt

gsiftp://dcdum03.aglt2.org:2811/pnfs/aglt2.org/atlaslocalgroupdisk/SAM/mytest-20190218.txt   DELETED

For all the above commands, one can also replace the $GFALDOOR with $SRMDOOR
-bash-4.2$ gfal-ls $SRMDOOR/pnfs/aglt2.org/atlaslocalgroupdisk/SAM/testfile-srm-GET-ATLASLOCALGROUPDISK.txt

srm://head01.aglt2.org:8443/srm/managerv2?SFN=/pnfs/aglt2.org/atlaslocalgroupdisk/SAM/testfile-srm-GET-ATLASLOCALGROUPDISK.txt

-bash-4.2$ gfal-stat $SRMDOOR/pnfs/aglt2.org/atlaslocalgroupdisk/SAM/testfile-srm-GET-ATLASLOCALGROUPDISK.txt
File: 'srm://head01.aglt2.org:8443/srm/managerv2?SFN=/pnfs/aglt2.org/atlaslocalgroupdisk/SAM/testfile-srm-GET-ATLASLOCALGROUPDISK.txt'
Size: 20   regular file
Access: (0666/-rw-rw-rw-)   Uid: 47   Gid: 48
Access: 1969-12-31 19:00:00.000000
Modify: 2015-06-10 08:02:15.000000
Change: 2015-06-10 08:02:15.000000

-bash-4.2$ gfal-copy $SRMDOOR/pnfs/aglt2.org/atlaslocalgroupdisk/SAM/testfile-srm-GET-ATLASLOCALGROUPDISK.txt /tmp/myfile2
Copying srm://head01.aglt2.org:8443/srm/managerv2?SFN=/pnfs/aglt2.org/atlaslocalgroupdisk/SAM/testfile-srm-GET-ATLASLOCALGROUPDISK.txt   [DONE]  after 0s


-bash-4.2$ gfal-copy /etc/hosts $SRMDOOR/pnfs/aglt2.org/atlaslocalgroupdisk/SAM/mytest-20190218.txt

Copying file:///etc/hosts   [DONE]  after 0s

-bash-4.2$ gfal-rm $SRMDOOR/pnfs/aglt2.org/atlaslocalgroupdisk/SAM/mytest-20190218.txt

srm://head01.aglt2.org:8443/srm/managerv2?SFN=/pnfs/aglt2.org/atlaslocalgroupdisk/SAM/mytest-20190218.txt   DELETED

xrootd

One can use xrdcp to copy a file from the dCache to a local file system, but not the other way around, because xrootd is read only server.
-bash-4.2$ xrdcp $XRCPDOOR/pnfs/aglt2.org/atlaslocalgroupdisk/SAM/testfile-srm-GET-ATLASLOCALGROUPDISK.txt /tmp/myfile4

[20B/20B][100%][==================================================][20B/s]



-bash-4.2$ xrdcp /etc/hosts /pnfs/aglt2.org/atlaslocalgroupdisk/SAM/mytest-20190219.txt

[0B/0B][100%][==================================================][0B/s]
Run: [ERROR] Server responded with an error: [3005] Read-only file system


Access dCache files from your jobs(running on the work node)

Generate a user proxy, and store it in your NFS home direcotry which the work node can access

replace /atlas/data19/wuwj/myproxy with your own file path!

-bash-4.2$ voms-proxy-init --voms atlas -out /atlas/data19/wuwj/myproxy --valid 96:00
Enter GRID pass phrase:
Your identity: /DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=wwu/CN=673124/CN=Wenjing Wu
Creating temporary proxy ..................................................................................................... Done
Contacting  voms2.cern.ch:15001 [/DC=ch/DC=cern/OU=computers/CN=voms2.cern.ch] "atlas" Done
Creating proxy ............................ Done

Your proxy is valid until Mon May 27 14:38:19 2019

-bash-4.2$ ll /atlas/data19/wuwj/myproxy 
-rw------- 1 wuwj umatlas 9.3K May 23 14:34 /atlas/data19/wuwj/myproxy

Add the following commands in your job script to access the files

export GFALDOOR=gsiftp://dcdum0$(echo $RANDOM %3 + 1|bc).aglt2.org:2811
export XRCPDOOR=root://xrootd.aglt2.org:1094
export SRMDOOR="srm://head01.aglt2.org:8443/srm/managerv2?SFN="
export X509_USER_PROXY=/atlas/data19/wuwj/myproxy

You can use any of the above tools (gfal or xrootd) to access the files from your job script.

This topic: AGLT2 > WebHome > AccessDcacheFiles
Topic revision: 23 May 2019, WenjingWu
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback