Interactions with the Datalake

From ESCAPE_WIKI
Jump to: navigation, search

Using the Rucio client Docker image with Singularity

  • Create the Singularity container:
$ singularity build --sandbox rucio-client docker://projectescape/rucio-client:py3

or (Y. Grange):

$ singularity build --fakeroot rucio-py3.simg docker://projectescape/rucio-client:py3
  • The directory /opt/rucio/etc needs to be bound to a local directory in order to be read-write. The (robot) certificates should be copied (permission 400) in this directory:
$ mkdir ~/.rucio
$ cp ~/x/y/z/publicCert.pem ~/.rucio/client.crt
$ cp ~/x/y/z/privateKey.pem ~/.rucio/client.key
  • The Rucio account needs to be specified
$ export RUCIO_ACCOUNT=pchanial
  • Run the Rucio client image:
$ singularity run --bind ${HOME}/.rucio/:/opt/rucio/etc rucio-client
  • Create the Rucio configuration file:
Singularity> /etc/profile.d/rucio_init.sh
  • Obtain the proxy certificate to read/write in the data centers:
Singularity> voms-proxy-init --voms escape --cert /opt/rucio/etc/client.crt --key /opt/rucio/etc/client.key
  • Test
Singularity> python3
Python 3.6.8 (default, Apr  2 2020, 13:34:55) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pprint import pprint
>>> from rucio.client import Client
>>> client = Client(account='pchanial')
>>> pprint(client.whoami())
{'account': 'pchanial',
 'account_type': 'SERVICE',
 'created_at': '2020-10-13T09:59:50',
 'deleted_at': None,
 'email': 'pierre.chanial@ego-gw.it',
 'status': 'ACTIVE',
 'suspended_at': None,
 'updated_at': '2020-10-13T09:59:50'}