Skip to content

Simple SweStore integration via arc client

samuell edited this page Jun 20, 2012 · 5 revisions
  • SweStore could be integrated by using the "Universal mass storage" driver for iRODS, which basically can wrap any commands used to talk to the storage. The file is located in:
 [irods-install-dir]/server/bin/cmd/univMSSDriver.sh





  • The first thing to do with this file, is to move the line "#!/bin/sh" to the first line. Otherwise you'll get errors.
  • Second, modify the file to look like so:
# function for the synchronization of file $1 on local disk resource to file $2 in the MSS
syncToArch () {
    # <your command or script to copy from cache to MSS> $1 $2
    # e.g: /usr/local/bin/rfcp $1 rfioServerFoo:$2
    ngcp $1 srm://your-srm-path$2
    return
}

# function for staging a file $1 from the MSS to file $2 on disk
stageToCache () {
    # <your command to stage from MSS to cache> $1 $2    
    # e.g: /usr/local/bin/rfcp rfioServerFoo:$1 $2
    ngcp srm://your-srm-path$1 $2
    return
}

# function to create a new directory $1 in the MSS logical name space
mkdir () {
    # <your command to make a directory in the MSS> $1
    # e.g.: /usr/local/bin/rfmkdir -p rfioServerFoo:$1
    echo "Faking mkdir"
    return
}

# function to modify ACLs $2 (octal) in the MSS logical name space for a given directory $1
chmod () {
    # <your command to modify ACL> $1 $2
    # e.g: /usr/local/bin/rfchmod $2 rfioServerFoo:$1
    return
}

# function to remove a file $1 from the MSS
rm () {
    # <your command to remove a file from the MSS> $1
    # e.g: /usr/local/bin/rfrm rfioServerFoo:$1
    echo "Faking rm"
    return
}

# function to do a stat on a file $1 stored in the MSS
stat () {
    # <your command to retrieve stats on the file> $1
    # e.g: output=`/usr/local/bin/rfstat rfioServerFoo:$1`
    echo "Faking stat"
    error=$?
  • Then you need to add two "resources" in iRODS, and add them to the same group.
  • Fire up iadmin, and then go:
iadmin>mkgroup sweStoreGrp
iadmin>help mkresc
... to see the options you have to specify. You'll need to do:
iadmin>mkresc sweStoreCache 'unix file system' cache localhost /path/where/you/want/files/to/reside
iadmin>mkresc sweStore 'MSS universal driver' compound localhost /irodstest
iadmin>atrg sweStoreGrp sweStore
iadmin>atrg sweStoreGrp sweStoreCache
  • Exit iadmin
  • Now you should be able to do:
ls > testfile
iput -R sweStore testfile
... and you can verify that the file really got uploaded, with:
ngls srm://your-srm-path/irodstest/home/rods
  • Another way to put the file, is to first put it in the cache, and then replicate to SweStore:
iput -R sweStoreCache testfile
irepl -G sweStoreGrp

Some additional yum packages that can be useful:

  • A decent java: `yum install java-1.6.0-openjdk` (For some things to work, such as the dCache SRM client)