AMGA (Metadata Catalogue) Tutorial

From EGEE-see WIki

Jump to: navigation, search

This Wiki page is a part of SEE-GRID Gridification Guide. It is contributed by Belgrade University Computer Centre.


Contents

Introduction

AMGA (Arda Metadata Catalogue Project) is a service that allows grid users to store various metadata used by applications. Currently only the standalone version of AMGA is available for SEE-GRID VOs (SEEGRID and AEGIS).

Access to the AMGA service is established by using the AMGA client. To check whether AMGA client is installed on your UI and which version it is:

$ rpm -qa | grep -i amga-cli
glite-amga-cli-1.3.0-1

If it is missing, contact your administrators and ask them to install AMGA client on your UI.

Configuring AMGA client

It is necessary to create a configuration file for AMGA client. In the current version of gLite it's not possible to query (via lcg-infosites) BDII for servers hosting AMGA service.

Setup the file $HOME/mdclient.config (or $HOME/.mdclient.config) with contents:

 
Host = grid16.rcub.bg.ac.yu
Port = 8822

# User settings
Login = seegrid:/seegrid/RS/App/VIVE/Role=NULL # eg. for VIVE application, here you specify VOMS group & role where you wish to be mapped into
PermissionMask = rwx
GroupMask = r-x
Home = /

# Security options
UseSSL = require # Values: require, try, no. If off,  all options below are ignored

AuthenticateWithCertificate = 1 # Use certificate to authenticate
UseGridProxy = 1
IgnoreCertificateNameMismatch = 1
# If server certificates are verified, CA certificates need to be loaded:
TrustedCertDir = /etc/grid-security/certificates

Basic Usage

To connect, first create proxy certificate:

$ voms-proxy-init --voms seegrid

Access to the AMGA service is provided via the CLI client (mdclient):

$ mdclient 
Connecting to grid16.rcub.bg.ac.yu:8822...
ARDA Metadata Server 1.3.0

Users are authenticated with their proxy certificate, but the authorization is done through the VOMS service group mappings by the AMGA service (users are automatically mapped to the appropriate AMGA roles according to the VOMS groups to which they belong). By default (by omitting the Login line in the mdclient.config file) users are mapped to the general seegrid & aegis roles. However, we encourage all interested grid application users to contact us and get their own application specific users activated. By configuring their clients properly, users can choose into which of the supported VOMS groups they will be mapped. For example, in order to access AMGA catalogue as "seegrid-vive" user (and obtain access rights to the specific parts of the catalogue related to the VIVE application), add a following line into the client config file (mdclient.config):

# User settings
Login = seegrid:/seegrid/RS/App/VIVE/Role=NULL
Query> whoami 
>> seegrid-vive

Of course, proper group mappings need to be present in the users certificate for this functionality to work.

Getting help:

Query> help
>> help [topic]
>> Displays help on a command or a topic.
>> Valid topics are: help metadata metadata-optional directory replication constraints entry group acl index schema sequence user view site replicas ticket capabilities commands

Metadata is stored in the directory/schema structures:

Query> dir
>> /guests
>> collection
>> /grid
>> collection

Query> cd /grid/
Query> ls
>> /grid/aegis
>> /grid/seegrid
Query> cd /grid/seegrid/

Create a test directory mytest:

Query> createdir mytest
Query> cd /grid/seegrid/mytest/ 
Query> pwd
>> /grid/seegrid/mytest/

Directory schema is described by attributes (database table/column analogy, note that a directory can contain subdirectories). Populating a directory schema with some example attributes:

Query> addattr /grid/seegrid/mytest/ ID int Name varchar(20) Country varchar(20)
Query> listattr /grid/seegrid/mytest/ 
>> ID
>> int
>> Name
>> varchar(20)
>> Country
>> varchar(20)

Actual metadata is represented by entries (database analogy - rows). Adding some entries into the example directory:

Query> addentry /grid/seegrid/mytest/Person1 ID 1 Name 'Joe Black' Country 'USA'
Query> addentry /grid/seegrid/mytest/Person2 ID 2 Name 'Mike' Country 'UK'
Query> addentry /grid/seegrid/mytest/Person3 ID 3 Name 'Christine' Country 'France'
Query> listentries /grid/seegrid/mytest/
>> /grid/seegrid/mytest/Person1
>> /grid/seegrid/mytest/Person2
>> /grid/seegrid/mytest/Person3
Query> ls
>> Person1
>> Person2
>> Person3

Basic queries (database analogy - SELECT query):

Query> selectattr .:ID .:Name 'ID > 1'
>> 2
>> Mike
>> 3
>> Christine

Removing entries:

Query> rm /grid/seegrid/mytest/Person2
Query> ls
>> Person1
>> Person3

Deleting a directory:

Query> rmdir /grid/seegrid/mytest/
Error: 11: Directory not empty

Managing access rights:

Query> acl_show /grid/seegrid/mytest/ 
>> seegrid rwx
Query> grp_member 
>> seegrid:users
Query> acl_add /grid/seegrid/mytest/ seegrid:users rx
Query> acl_show .
>> seegrid rwx
>> seegrid:users rx

References

Good tutorial for basic usage is available at: [1]

Reference documentation: [2] [3] Here you can also find information about various (c++, java, ...) APIs that allow you to access AMGA service.

Contact

Milan Potocnik [milan (d) potocnik (a) rcub (d) bg (d) ac (d) yu]

Personal tools