在openbis的帮助下进行本地数据管理。

obis的Python项目详细描述


obis

obis是一个命令行工具,用于处理太大而无法存储在openbis中但仍需要在openbis中注册和跟踪的数据集。

先决条件

  • python 3.6
  • Git
  • git annex安装指南

安装

pip3 install obis

由于obis基于pybis,pip命令还将安装pybis及其所有依赖项。

用法

救命是你的朋友!

$ obis --help
Usage: obis [OPTIONS] COMMAND [ARGS]...

Options:
  --version                Show the version and exit.
  -q, --quiet              Suppress status reporting.
  -s, --skip_verification  Do not verify cerficiates
  -d, --debug              Show stack trace on error.
  --help                   Show this message and exit.

Commands:
  addref         Add the given repository as a reference to openBIS.
  clone          Clone the repository found in the given data set id.
  collection     Get/set settings related to the collection.
  commit         Commit the repository to git and inform openBIS.
  config         Get/set configurations.
  data_set       Get/set settings related to the data set.
  download       Download files of a linked data set.
  init           Initialize the folder as a data repository.
  init_analysis  Initialize the folder as an analysis folder.
  move           Move the repository found in the given data set id.
  object         Get/set settings related to the object.
  removeref      Remove the reference to the given repository from openBIS.
  repository     Get/set settings related to the repository.
  settings       Get all settings.
  status         Show the state of the obis repository.
  sync           Sync the repository with openBIS.

要显示特定命令的详细帮助,请键入obis<;command>;--help

$ obis commit --help
Usage: obis commit [OPTIONS] [REPOSITORY]

Options:
  -m, --msg TEXT               A message explaining what was done.
  -a, --auto_add               Automatically add all untracked files.
  -i, --ignore_missing_parent  If parent data set is missing, ignore it.
  --help                       Show this message and exit.

设置

使用get可以检索一个或多个设置。如果省略了键,则检索类型的所有设置:

obis [type] [options] get [key]

使用设置可以设置一个或多个设置:

obis [type] [options] set [key1]=[value1], [key2]=[value2], ...

使用清除可以取消一个或多个设置:

obis [type] [options] clear [key1]

使用类型设置可以一次获得所有设置:

obis settings [options] get

选项-g可用于与全局设置交互。全局设置存储在~/.obis中,并在创建时复制到obis存储库中。

存在以下设置:

<表><广告>键入设置 说明 < /广告><正文>收藏id所创建数据集附加到的集合的标识符。使用这个或对象ID。配置仅允许使用https默认值为true。如果为false,则可以使用http连接到openbis。配置文件服务URL下载文件的URL。请参阅下载处理程序/文件信息处理程序服务。配置git_annex_后端用于计算文件哈希值的git附件后端。支持的后端是SHA256E(默认)、MD5和WORM。配置git_annex_hash_as_checksum默认值为true。如果为false,将为openbis计算crc32校验和。否则,将使用git annex计算的哈希值。配置主机名克隆/移动数据集以连接到原始副本所在的计算机时使用的主机名。配置openbis_url用于连接到OpenBIS的URL(仅限于protocol://host:port,无路径)。配置obis_metadata_文件夹obis将用于存储其元数据的文件夹的绝对路径。如果未设置,元数据将存储在与数据相同的位置。此设置在处理对数据的只读访问时非常有用。设置此选项后,"克隆"和"移动"命令将不起作用。配置用户连接到OpenBIS的用户。数据集键入OBIS创建的数据集类型。数据集属性obis创建的数据集的数据集属性。对象id所创建数据集附加到的对象的标识符。使用此或集合ID。存储库数据集id这是欧比斯设定的。is是obis创建的最新数据集的id,将用作下一个数据集的父级。存储库外部DMS\u id这是欧比斯设定的。openbis中外部dms的id。存储库id这是欧比斯设定的。OBIS存储库的ID。

这些设置作为json文件保存在obis存储库中的.obis文件夹中,或在~/.obis中进行全局设置。它们可以手动添加/编辑,这在与其他工具集成时可能很有用。

示例.obis/config.json

{
    "fileservice_url": null,
    "git_annex_hash_as_checksum": true,
    "hostname": "bsse-bs-dock-5-160.ethz.ch",
    "openbis_url": "http://localhost:8888"
}

示例.obis/data_set.json

{
    "properties": {
        "K1": "v1",
        "K2": "v2"
    },
    "type": "UNKNOWN"
}

命令

初始化

pip3 install obis
0

如果给定了文件夹,obis会将该文件夹初始化为obis存储库。否则,它将使用当前文件夹。

初始分析

pip3 install obis
1

通过init_分析,可以创建从父存储库派生的存储库。如果它是从存储库中调用的,则将用作父级。如果没有,则必须为父对象提供-p选项。

提交

pip3 install obis
2

commit命令将文件添加到openbis中的新数据集中。如果未使用-m选项定义提交消息,则会要求用户提供一条消息。

同步

pip3 install obis
3

手动完成git提交后,sync命令将在openbis中创建相应的数据集。请注意,当直接与git交互时,在适当的时候使用git-annex命令,例如使用"git-annex-add"而不是"git-add"。

状态

pip3 install obis
4

这将显示从中调用它的存储库文件夹的状态,或显示作为参数给定的存储库文件夹的状态。它显示文件更改以及存储库是否需要与openbis同步。

克隆

pip3 install obis
5

clone命令复制与数据集关联的存储库,并在openbis中注册新副本。如果存储库已经有多个副本,obis将询问要从哪个副本进行克隆。

  • 为了避免用户交互,可以使用选项-c
  • 选择复制索引
  • 使用选项-u可以定义用户从远程系统复制文件
  • 默认情况下,通过计算校验和检查文件完整性。使用-s

注意:设置obis_metadata_文件夹时,此命令不起作用。

移动

pip3 install obis
6

move命令的工作原理与clone相同,只是旧存储库将被删除。

注意:当设置了"obis元数据"文件夹时,此命令不起作用。

下载

pip3 install obis
7

download命令下载数据集的文件。与克隆相反,这不会在openbis中注册另一个副本。它只用于访问文件。此命令要求运行downloadhandler/fileinfohandler微服务,并且需要配置fileservice\u url

添加引用/删除引用

pip3 install obis
8

可以从openbis添加或删除obis存储库文件夹。在不使用movecopy命令移动或复制存储库时,这非常有用。

示例

创建一个obis存储库并提交给openbis

pip3 install obis
9

提交到Git并手动同步

$ obis --help
Usage: obis [OPTIONS] COMMAND [ARGS]...

Options:
  --version                Show the version and exit.
  -q, --quiet              Suppress status reporting.
  -s, --skip_verification  Do not verify cerficiates
  -d, --debug              Show stack trace on error.
  --help                   Show this message and exit.

Commands:
  addref         Add the given repository as a reference to openBIS.
  clone          Clone the repository found in the given data set id.
  collection     Get/set settings related to the collection.
  commit         Commit the repository to git and inform openBIS.
  config         Get/set configurations.
  data_set       Get/set settings related to the data set.
  download       Download files of a linked data set.
  init           Initialize the folder as a data repository.
  init_analysis  Initialize the folder as an analysis folder.
  move           Move the repository found in the given data set id.
  object         Get/set settings related to the object.
  removeref      Remove the reference to the given repository from openBIS.
  repository     Get/set settings related to the repository.
  settings       Get all settings.
  status         Show the state of the obis repository.
  sync           Sync the repository with openBIS.
0

创建分析存储库

$ obis --help
Usage: obis [OPTIONS] COMMAND [ARGS]...

Options:
  --version                Show the version and exit.
  -q, --quiet              Suppress status reporting.
  -s, --skip_verification  Do not verify cerficiates
  -d, --debug              Show stack trace on error.
  --help                   Show this message and exit.

Commands:
  addref         Add the given repository as a reference to openBIS.
  clone          Clone the repository found in the given data set id.
  collection     Get/set settings related to the collection.
  commit         Commit the repository to git and inform openBIS.
  config         Get/set configurations.
  data_set       Get/set settings related to the data set.
  download       Download files of a linked data set.
  init           Initialize the folder as a data repository.
  init_analysis  Initialize the folder as an analysis folder.
  move           Move the repository found in the given data set id.
  object         Get/set settings related to the object.
  removeref      Remove the reference to the given repository from openBIS.
  repository     Get/set settings related to the repository.
  settings       Get all settings.
  status         Show the state of the obis repository.
  sync           Sync the repository with openBIS.
1

大数据链路服务

大数据链接服务可用于下载包含在obis存储库中的文件。这些服务包含在openbis的安装文件夹中,位于servers/big_data_link_services下。有关如何配置和运行它们,请参阅readme.md文件。

OBIS的基本原理

像openbis这样的数据来源跟踪工具使得理解和跟踪研究过程成为可能。研究了什么,获取了什么数据,如何分析数据以得出最终结果发布的所有结果——这是openbis中捕获的信息。在标准使用场景中,openbis直接存储和管理数据。这有一个优点,即openbis充当数据的看门人,使备份或强制访问限制等变得容易。然而,这种工作方式并非适合所有情况。

一些研究小组处理大量数据(例如,多个tb),这使得openbis控制数据变得低效和不切实际。其他研究小组要求数据存储在一个定义良好的目录结构下的共享文件系统中,无论是出于历史原因还是由于它们使用的工具。在这种情况下,很难让openbis完全控制数据。

对于这种情况,我们开发了obis,这是一种在需要极大灵活性的条件下有序管理数据的工具。obis使得在文件系统上跟踪数据成为可能,在文件系统中,用户可以完全自由地按照自己的意愿构造和操作数据,同时保留openbis的好处。使用obis,openbis实际上只存储和管理元数据。数据本身是由用户在外部管理的,但是openbis知道它的存在,并且数据可以用于来源跟踪。obis被打包为一个独立的实用程序,在unix或类unix环境中,该实用程序只需添加到path变量即可使用。

在封面下,obis利用公共可用和经过测试的工具来管理文件系统上的数据。特别是,它使用gitgit annex来跟踪数据集的内容。使用git annex,甚至可以有效地跟踪大型二进制工件。为了与openbis通信,obis使用openbis api,它提供注册和跟踪openbis支持的所有元数据的能力。

文献

V.Korolev,A.Joshi,V.Korolev,M.A.Grasso,A.Joshi,M.A.Grasso等,"Prob:跟踪大数据实验来源和再现性的工具",重现14。HPCA 2014,第11卷,第264-2862014页。 http://ebiquity.umbc.edu//u文件目录/papers/693.pdf

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java通过Spring MVC web应用程序向客户端发送文本文件   java是否可以在运行时动态实例化DAO类?   调用VB。来自Java的net函数   java在Android中通过单击打开特定文件夹   java如何使用maven pom。xml标识非标准项目结构中的testng测试用例?   java为什么FOP在大文件上崩溃?   Architecture python+flask和spring boot+java   java Kafka工具根本没有启动Ubuntu 19.10   如何使用Eclipse运行Java USB API for Windows   java如何在Eclipse中查看J2EE预览服务器/容器的日志/控制台?   网页抓取是否可以使用Java crawler crawler4j暂停和恢复抓取?   java当我第二次按下按钮时,应用程序停止工作   带有偏移量和限制的java SQLite分页问题   java如何在OSX mavericks中将端口80转发到8080   java从泛型方法调用非泛型方法   java My代码未按预期工作。十进制输出不是它应该的样子   节点。java中的js加密(jasypt)和nodejs中的解密   java乘法表不工作数组索引超出范围   java将JDBC与Firebirdsql连接起来