项目作者: CONP-PCNO

项目描述 :
:link: Git annex remote for CONP
高级语言: Python
项目地址: git://github.com/CONP-PCNO/git-annex-remote-conp.git
创建时间: 2019-03-26T03:26:42Z
项目社区:https://github.com/CONP-PCNO/git-annex-remote-conp

开源协议:

下载


git-annex-remote-conp

Installation

  • Requires git-annex version 7.20 or newer.
  • Requires AnnexRemote module. Install dependency with pip install -r requirements.txt
  • Install git-annex-remote-conp somewhere in PATH and chmod +x the script.

Setup

  1. git annex initremote conp type=external externaltype=conp encryption=none autoenable=true

Content distribution

  1. git annex copy --to conp

Show remote log

  1. show git-annex:remote.log

Demo

1) Start virtual environment

  1. $ python3 -m venv venv
  2. $ source venv/bin/activate

2) Install dependencies

  1. $ pip install -r requirements.txt

3) Start demo conp-server, this

  1. $ ./demo/serve_conp.sh

You will see Serving HTTP on 0.0.0.0 port 8080 (http://0.0.0.0:8080/)

4) Run the sample preperation script prep_conp_ds.sh , needs to be in the PATH

  1. $ PATH=$PWD:$PATH bash demo/prep_conp_ds.sh

This script will create two directories demods (demo dataset) and clientds (client dataset) with a content sample dataset

Sample output:

  1. [INFO ] Creating a new annex repo at /some_path/git-annex-remote-conp/demods
  2. Total (3 ok out of 2): 30%|▎| 55.0/183 [00:00<00:00, 1.14kB create(ok): /some_path/git-annex-remote-conp/demods (dataset)
  3. initremote conp ok
  4. (recording state in git...)
  5. add(ok): content (file)
  6. save(ok): . (dataset)
  7. action summary:
  8. add (ok: 1)
  9. save (ok: 1)
  10. setpresentkey MD5E-s0--d41d8cd98f00b204e9800998ecf8427e ok
  11. drop(ok): /some_path/git-annex-remote-conp/demods/content (file)
  12. drop(ok): /some_path/git-annex-remote-conp/demods (directory)
  13. action summary:
  14. drop (ok: 2)
  15. [INFO ] Cloning demods into '/some_path/git-annex-remote-conp/clientds'
  16. install(ok): /some_path/git-annex-remote-conp/clientds (dataset)
  17. action summary:
  18. get (ok: 2)
  19. install (ok: 1)

5) You will see the GET request on the server:

  1. 127.0.0.1 - - [29/Mar/2019 14:10:58] "GET /MD5E-s0--d41d8cd98f00b204e9800998ecf8427e HTTP/1.1" 200 -

The hash MD5E-s0--d41d8cd98f00b204e9800998ecf8427e corresponds to a dummy file