Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. <grid> <col lg="6" md="12" sm="12" xs="12"> <callout type="warning" title="New service" icon="true"> Please note, that this service is still relatively new. Do not hesitate to [[:start:training_and_outreach:ticket_system|contact us]] in order to discuss your data management plan or if anything on this page is unclear or even wrong. </callout> </col> </grid> ===== TL;DR ===== 1. **//kinit//** - obtain the Kerberos-Ticket with your University-Login 2. **//imkdir /zdv/project/<MOGON project>/path/to/archive/data//** - create the archive directory (collection) 3. **//iput -K <LARGE datafile> /zdv/project/<MOGON project>/path/to/archive/data//** - upload your data 4. **//iget /zdv/project/<MOGON project>/path/to/archive/data/<LARGE datafile>//** - download your archived data ====== Archiving with iRODS ====== **iRODS** stands for **i**ntegrated **R**ule-**O**riented **D**ata **S**ystem [[https://irods.org/|iRODS]] and is an Open Source Data Management software. It is a kind of a virtual file system, with its own lingo: * directories are called //collections//, they may contain further //subcollections// * files are (//data objects//). All commands from the iRODS command line tools start with an '//i//' and they are installed on the mogon login nodes. iRODS uses so called '//Resources//' to archive the //collections// and //data objects//. The //resources// are organized hierarchically. The root is a //replication resource//, where other //resources// are added as children. Currently there is a //compound resource// consisting itself of a cache (unix filesystem) and a universal mass storage system (here: TSM) as archive. The cache has a size of 8TB, once it is fills up, the oldest //data objects// will be deleted on the cache. If required, they will be fetched back from the archive. <code> replResc:replication ├── cephfsResc:unixfilesystem └── compResc:compound ├── netappResc:unixfilesystem └── tsmResc:univmss </code> On request it is still possible to apply for a [[:start:fs_dm:archiving:tsm|TSM account]], to store the data on tapes. ===== What belongs in an archive? ===== * (Raw) input data * Final publishable or already published data * zipped (git) repositories of the scripts/software used to process the data. Intermediate results and work in progress do **not** belong in an archive. If a directory, resp. //collection//, consists of many small files, those files should be [[:start:fs_dm:archiving:preparation|compressed]]. iRODS works best for files > 5GB. {{ :data_management:test-large-files.png?direct&400 | iRODS upload benchmark with one file of varying size.}} {{ :data_management:test-small-files.png?direct&400 | iRODS upload benchmark with multiple tiny files.}} ===== iRODS Account ===== There is no need to apply for an iRODS archiving account. Every user of MOGON I/II automatically gets access to iRODS. If your account is associated with a MOGON project you also get read/write access to the iRODS project collection (// /zdv/project/<PROJECT NAME> //). iRODS collections start with// /zdv //, wheras path in the MOGON-filesystem do not have this leading // /zdv // part in the path. <callout type="info" title="Data persistence" icon="true"> Subcollections in the home collection of individual user will be deleted once the account gets deleted. Only the // /zdv/project/<PROJECT NAME> // collections will be archived for an appropriate period (default: 10 years, as suggested by the [[https://www.dfg.de/foerderung/grundlagen_rahmenbedingungen/gwp/|DFG, Leitlinie 17]]). The data saved to the above project collection is owned by the group. This means after a user leaves the project, the data can still be accessed by the other group members, as long as the ACLs are not modified. </callout> Each user has a hidden directory ''${HOME}/.irods'' with the file ''irods_environment.json'' in the mogon home directory containing the connection information for the iRODS archive. Below you see the information template for ''irods_environment.json''. If you create this file by hand, make sure to replace // <$USER> // with your user-account. <code JavaScript> { "irods_client_server_negotiation": "request_server_negotiation", "irods_client_server_policy": "CS_NEG_REQUIRE", "irods_authentication_scheme": "KRB", "irods_host": "irods.zdv.uni-mainz.de", "irods_port": 1247, "irods_user_name": "<$USER>", "irods_zone_name": "zdv", "irods_encryption_key_size": 32, "irods_encryption_salt_size": 8, "irods_encryption_num_hash_rounds": 16, "irods_encryption_algorithm": "AES-256-CBC" } </code> Authentication is done via kerberos. To get access to the iRODS archive, use the ''kinit'' command and enter your password. Please do **not** use ''iinit'', it will not work and change your `${HOME}/.irods/irods_environment.json` file. In case it happened, remove the directory `${HOME}/.irods` and login again, it will be restored on login. <callout type="warning" title="Data persistence" color="Security Warning" icon="true"> If you initiate the command ''iinit'' it might happen that an additional file '//.irodsA//' is also in the directory '//${HOME}/.irods//'. Please remove this file! It contains your password in a decryptable form. </callout> ===== Commands overview ===== Here is a short summary over the most important iRODS commands with some important command line parameters. ==== Navigation ==== As mentioned above, iRODS is a kind of a virtual filesystem. The following commands can be used to for navigation. ^ Command ^ Parameters ^ Description ^ | ''ipwd'' | | print current iRODS working directory (colection) | | ''ils'' | -l, -L, -A | list iRODS collection (-l: with details; -L: more details; -A: ACL) | | ''icd'' | <target> | change iRODS collection | | ''imkdir'' | -p <coll> | create a new collection (directory; -p: with parents) | Each user gets his/her personal home under /zdv/home/${USER} and access to the associated Mogon I/II projects under /zdv/project/<PROJECT NAME>. Accessible collections: * ''/zdv/home/${USER}'' private directory * ''/zdv/project/<PROJECT NAME>'' project directory * ''/zdv/home/public'' every registered user can read/write/delete * ''/zdv/trash/home/${USER}'' private trash bin <callout type="info" icon="true"> Only the project directory are meant for permanent archiving. We are working on a solution to prevent archiving to the **volatile** iRODS homes. </callout> ==== Archiving ==== Uploading data to the iRODS-Archive is done with the command ''iput''. ^ Command ^ Parameters ^ Description ^ | ''iput'' | -K, -k, -r | Upload files/directories, (-k/K: calculate checksums/uppercase //K// validate all checksums; -r: recursive) | | ''ichksum'' | -r <obj%%|%%coll> | Compute and store checksums (-r: recursive) | The checksum is calculated server side and we highly recommend to switch it on immediately on upload. Nevertheless, You can also do it later on with ''ichksum -K <filename>''. It creates a checksum equivalent to the command ''sha256sum <local filename> | cut -d " " -f 1 | xxd -r -p | base64'', which you can compare to ensure data integrity. The checksums can be queried with ''ils -L'' and ''ichksum''. However, if you don't do it on upload with ''iput -k'', there will be no checksum for the TSM ressource. As mentioned above, several small files should be bundled. Nevertheless, you can still extract an uploaded tar archive on the server and index all contained files with the command ''ibun''. Please read its man page for further details (''man ibun''). ==== Access control: ''ichmod'' ==== ''ichmod'' has several mandatory parameters: ^ Parameter ^ Description ^ | %%null|read|write|own%% | access right | | %%User|Group%% | to whom | | %%Object|Collection%% | for what | '//-r//' is a usefull optional parameter for recursive ACL modifications. ==== Retrieving: ''iget'' ==== Getting data back from the iRODS archive is done via ''iget''. ^ Parameter ^ Description ^ | -r | recursive | | -f | overwrite local existing files | === Example === 1. Get your kerberos ticket and print some information about your iRODS account {{ :data_management:irods_01_kinit.png?600 |}} 2. Navigation {{ :data_management:irods_02_navigation.png?600 |}} 3. Archiving, retrieving files and simple information {{ :data_management:irods_03_archiving_files.png?600 |}} 4. Checksum {{ :data_management:irods_04_checksum.png?800 |}} ==== Metadata: ''imeta'' ==== Metadata is defined as so called AVU triplets (**A**ttribute, **V**alue, **U**nit). The first two fields (AV) are mandatory and must not be empty, the unit is optional. AV are defined as VARCHAR(2700) and U as VARCHAR(250), which means they are all text with a maximum size of 2700 and 250 characters, respectively. They might also contain JSON, XML or YAML as text. === Editing === ^ Parameter ^ Description ^ | %%add|set|rm|ls|cp%% | command, see next table for details (//ls%%|%%cp// do not require the AVU triplet) | | %% -d dataObject |-C collection%% | which object/collection (file/path) should be queried/edited | | Attribute Value [Unit] | AVU triplet, where the //Unit// is optional | Command Description: ^ Command ^ Description ^ | add | add a AV(U) triplet | | set | set a single value | | rm | remove an AV(U) triplet | | ls | list existing metadata. If Attribute is given, only metadata of the given attribute | | cp | copy existing metadata. Needs a target and source (e.g. ''imeta cp -d source -c target'') | == An Example == The following command lists the metadata automatically associated with the previously upladed file ''hello_world.txt'': <code bash> imeta ls -d hello_world.txt </code> The output of the query is: <code> AVUs defined for dataObj hello_world.txt: attribute: AccessRights value: closed units: ---- attribute: Creator value: Steinkamp, J. units: ---- attribute: Date value: 1566206896 units: ---- attribute: ExpiryDate value: 1882430896 units: ---- attribute: Location value: Mainz, Germany units: ---- attribute: protected value: false units: ---- attribute: Publisher value: Johannes Gutenberg-University units: [user@login01 ~]$ </code> You can now add a title, which is not created automatically: <code> imeta set -d hello_world.txt Title "Archive of experimental szstem from '$(date)'" </code> If you query the Attribute 'Table' with ''imeta ls -d hello_world.txt Title'' you get: <code> AVUs defined for dataObj hello_world.txt: attribute: Title value: Archive of experimental szstem from 'Mon Aug 19 11:39:48 CEST 2019' units: </code> <callout type="info" title="Adjusting Meta Data" icon="true"> In the example we deliberately made an error (you might have noticed). You can correct such glitches with the general syntax: <code shell> $ imeta mod -d <filename> <attribute> <old value> v:<new value> </code> or in our example: <code shell> imeta mod -d hello_world.txt Title "Archive of experimental szstem from 'Mon Aug 19 11:39:48 CEST 2019'" v:"Archive of experimental system from 'Mon Aug 19 11:39:48 CEST 2019'" </code> For further details see ''man imeta''. </callout> === Minimum set of Attributes === As you could see above, we generate as many metadata attributes as possible automatically, to hopefully simplify your life. Nevertheless, you can adjust and extend them to your needs. * Set automatically: * **Creator** full user name * **Publisher** "Johannes Gutenberg-University" * **Location** "Mainz, Germany" * **Date** Unix timestamp * **ExpiryDate** Date + 10 years * **protected** (//default: "false"//) * User input required: * **Title** free text * **Description** text * **Type** audio, data set, image, source code, ... * **Format** simply the file format (e.g. output from *file* command) * **AccessRights** "closed", "restricted", "embargoed", "open" (//default: "closed"//) * **AccessConditions** if AccessRights is "resticted" (not yet) * **EmbargoDate** if AccessRights is "embargoed" (not yet) <callout type="info" title="Write Protection" icon="true"> There is one attribute, which should be used with caution: **protected** (which default value is 'false'). If the attribute **protected** with the value **true** is set (case sensitive!) or modified to 'true', the user cannot delete/overwrite the object and most of the metadata attributes any more. This is for the case, if data integrity needs to be ensured, that p.e. after a publication the data cannot be changed any more. Nevertheless, additional metadata attributes can still be edited. </callout> If the dataset should be FAIR (**F**indable, **A**ccessible, **I**nteraperable, **R**eusable) are also mandatory: * **AccessRights** must not be //"closed"// * **Identifier** (provided by ZDV/UB, only if attribute "protected" is set; not yet) * **License** The license for reuse. Recommended: GPL for code, CC0 for data sets, otherwise CC-BY * **Keywords** any keywords === Additional Recommended Attributes === * **ORCID** [[https://orcid.org/|Open Researcher Contributor Identification Initiative]] * **Contributor** co-authors * **Reference** publication references Further fields can be inserted. This depends on the scientific field and is the responsibility of the respective researcher or group. * general * [[http://dublincore.org/|Dublin Core Metadata]] ([[https://en.wikipedia.org/wiki/Dublin_Core| on wikipedia]]) * [[https://schema.datacite.org/|DataCite]] * [[https://www.ddialliance.org/Data Documentation Initiative]] * [[https://www.radar-service.eu/radar-schema|RADAR]] * [[https://schema.org/|schema.org]] * subject specific * [[http://www.dcc.ac.uk/resources/metadata-standards|Digital Curation Centre]] ==== Searching ==== === for filenames: ''ilocate'' === <code bash> [user@login01 ~]$ ilocate -t "hello_world.txt" /zdv/home/user/hello_world.txt /zdv/home/public/hello_world.txt </code> === for metadata: ''imeta qu'' === You must know, if you want to search for a data object (''-d'') or a collection (''-C''). And you can use SQL wildcards (''%''), if you don't know the exact pattern you are looking for. The wildcard pattern matching is also applicable for ''ilocate''. <code bash> [user@login01 ~]$ imeta qu -d Title like "Archive%" collection: /zdv/home/user dataObj: hello_world.txt </code> === via database query: ''iquest'' === For this complex syntax consult the [[https://docs.irods.org/4.2.6/icommands/user/#iquest|Online help]]. ==== Publishing ==== For public access a **ticket** needs to be created for collections or data objects. For example, if you use the above uploaded ''hello_world.txt'' file again. <code bash> [user@login01 ~]$ iticket create read hello_world.txt ticket:ACR2RKDyuZMBRmb </code> With this ticket and the path everybody can query information and the content of collections and data objects vi a provided REST-API. JSON strings are returned for valid URLs. === General information about data objects === <code bash> [user@login01 ~]$ curl https://irods-web.zdv.uni-mainz.de/irods-rest/rest/dataObject/zdv/home/jsteinka/hello_world.txt?ticket=ACR2RKDyuZMBRmb </code> <code JavaScript> {"id":1808764, "collectionId":24346, "dataName":"hello_world.txt", "collectionName":"/zdv/home/jsteinka", "dataReplicationNumber":0, "dataVersion":0, "dataTypeName":"generic", "dataSize":24, "resourceGroupName":"", "resourceName":"netappResc", "dataPath":"/fsapp/iRODS/Vault/home/jsteinka/hello_world.txt", "dataOwnerName":"jsteinka", "dataOwnerZone":"zdv", "replicationStatus":"1", "dataStatus":"", "checksum":"sha2:XPdR4XQP49lWUGEfPJz0Jo+kmkndGxz6rCQUzCqHteA=", "expiry":"00000000000", "dataMapId":0, "comments":"", "createdAt":1566206868000, "updatedAt":1566206868000, "specColType":"NORMAL", "objectPath":"" } </code> === Querying the metadata === <code bash> [user@login01 ~]$ curl https://irods-web.zdv.uni-mainz.de/irods-rest/rest/dataObject/zdv/home/jsteinka/hello_world.txt/metadata?ticket=ACR2RKDyuZMBRmb </code> <code JavaScript> {"metadataEntries": [ {"count":1, "lastResult":true, "totalRecords":0, "attribute":"AccessRights", "value":"closed", "unit":""}, {"count":2, "lastResult":true, "totalRecords":0, "attribute":"Publisher", "value":"Johannes Gutenberg-University", "unit":""}, {"count":3, "lastResult":true, "totalRecords":0, "attribute":"Location", "value":"Mainz, Germany", "unit":""}, {"count":4, "lastResult":true, "totalRecords":0, "attribute":"protected", "value":"false", "unit":""}, {"count":5, "lastResult":true, "totalRecords":0, "attribute":"Creator", "value":"Steinkamp, J.", "unit":""}, {"count":6, "lastResult":true, "totalRecords":0, "attribute":"Date", "value":"1566206896", "unit":""}, {"count":7, "lastResult":true," totalRecords":0, "attribute":"ExpiryDate", "value":"1882430896", "unit":""}, {"count":8, "lastResult":true, "totalRecords":0, "attribute":"Title", "value":"Archive of experimental system from 'Mon Aug 19 11:39:48 CEST 2019'", "unit":""}], "objectType":"DATA_OBJECT","uniqueNameString":"/zdv/home/jsteinka/hello_world.txt"} </code> === Downloading data === The file content can be viewed with ''curl'' or downloaded with ''wget''. <code bash> curl https://irods-web.zdv.uni-mainz.de/irods-rest/rest/fileContents/zdv/home/jsteinka/hello_world.txt?ticket=ACR2RKDyuZMBRmb </code> === Retrieve the metadata of a collection === <code bash> curl https://irods-web.zdv.uni-mainz.de/irods-rest/rest/collection/zdv/home/public/helloCollection?ticket=mbyAAFGm7vhUdyM </code> <code JavaScript> { "collectionId":1808781, "collectionName":"/zdv/home/public/helloCollection", "objectPath":"", "collectionParentName":"/zdv/home/public/", "collectionOwnerName":"rods", "collectionOwnerZone":"zdv", "collectionMapId":"0", "collectionInheritance":"", "comments":"", "info1":"", "info2":"", "createdAt":1566213731000, "modifiedAt":1566213731000, "specColType":"NORMAL", "children":[] } </code> === REST-API URL === the URL for the REST-API consists of: * Server (https://irods-web.zdv.uni-mainz.de/irods-rest/rest) * what (collection|dataObject|fileContents) * iRODS path * optionally 'metadata' * Ticket string (?ticket=1234567890) For further information, please read the original [[https://github.com/DICE-UNC/irods-rest|IRODS-REST documentation]] ===== Data Policy/Recommendation ===== The "Creator" is the responsible person in the sense of the Urheberrechtsgesetz, taking care that reusing of third party data is legal and in the sense of the DSGVO, that personal data is handled correctly. Even if the "Creator" is not employed at the university any more. There exists a [[https://doi.org/10.5281/zenodo.3368293|decision guide]] if data can be published, sadly only in german. ==== Licensing ==== Different kinds of Licenses exist for various cases, this here is just an incomplete list of the most common [[https://en.wikipedia.org/wiki/Software_license|Open Access Licenses]] for the three most common datatypes: * Software * [[https://www.apache.org/licenses/LICENSE-2.0.html|Apache]] * [[https://www.gnu.org/licenses/|GPL, GPLv2, GPLv3]] * [[https://opensource.org/licenses/MIT|MIT]] * [[http://www.linfo.org/bsdlicense.html|BSD]] * Arts, Images, Text, etc. * [[https://creativecommons.org/choose/|Creative Commons (Text, Arts, Photos, ...)]] * Data sets * [[https://opendatacommons.org/licenses/|Open Data Commons]] The applicability of CC-BY licenses for Software is not recommended: [[https://creativecommons.org/about/program-areas/software/|CC-recommendation]] and [[https://opensource.stackexchange.com/questions/1717/why-is-cc-by-sa-discouraged-for-code|discussion]]. The same applies for datasets, their publication under a CC-license other than CC0 is [[https://ckan4rdm.wordpress.com/2019/06/05/creative-commons-lizenzen-sind-fur-forschungsdaten-ungeeignet/|doubtful]]. For other dataset licenses search at [[https://licenses.opendefinition.org/|Open Definition Licenses Service]]. Proprietary file formats should be avoided, since you don't know if the software to open them still exists in a few years. Try to stick to open standards. ===== Further Documentation ===== There are a lot more commands. You can look them up in the original documentation: [[https://docs.irods.org/|iRODS documentation]] other wikis: * [[https://research.csc.fi/csc-guide-archiving-data-to-the-archive-servers|CSC.fi]] * [[https://www.hpc.dtu.dk/?page_id=95|Technical university of Denmark]] start/fs_dm/archiving/irods.txt Last modified: 2021/01/28 16:55by jsteinka