Manages data storage for CKAN/DCOR (import, symlink, etc.)
Project description
This plugin manages how data are stored in DCOR. There are two types of files in DCOR:
Resources uploaded by users, imported from figshare, or imported from a data archive
Ancillary files that are generated upon resource creation, such as condensed DC data, preview images (see ckanext-dc_view).
This plugin implements:
Data storage management. All resources uploaded by a user are moved to /data/users-HOSTNAME/USERNAME-ORGNAME/PK/ID/PKGNAME_RESID_RESNAME and symlinks are created in /data/ckan-HOSTNAME/resources/RES/OUR/CEID. CKAN itself will not notice this. The idea is to have a filesystem overview about the datasets of each user.
Import datasets from figshare. Existing datasets from figshare are downloaded to the /data/depots/figshare directory and, upon resource creation, symlinked there from /data/ckan-HOSTNAME/resources/RES/OUR/CEID (Note that this is an exemption of the data storage management described above). When running the following command, the “figshare-import” organization is created and the datasets listed in figshare_dois.txt are added to CKAN:
ckan import-figshare
Populate an internal depot from RT-DC data stored in tar archives. This is part of an effort to have automated imports of RT-DC data from other sources. The idea is to move experimental data to the DCOR server in tar archives and DCOR can then populate the internal depot with it. The location of the internal depot is /data/depots/internal/ and it follows a very specific directory structure 201X/2019-08/20/2019-08-20_1126_c083de* where the path is generated from the acquisition date, time, and part of the hash (c083de) of the original data file. According to this scheme, all files with the same path stem belong to one dataset:
2019-08-20_1126_c083de.sha256sums a file containing SHA256 sums
2019-08-20_1126_c083de_v1.rtdc the actual measurement
2019-08-20_1126_c083de_v1_condensed.rtdc the condensed dataset
2019-08-20_1126_c083de_ad1_m001_bg.png an ancillary image
2019-08-20_1126_c083de_ad2_m002_bg.png another ancillary image
…
ckan depotize-archive
Import datasets from the internal depot. The previous command depotize-archive just populates the depot directory structure. To make the datasets available in CKAN, this step must be performed:
ckan import-internal
Upgrade datasets from the internal depot. If you find issues or have to add new versions of an .rtdc resource, simply create the _v2.rtdc files and run this command:
ckan upgrade-internal
Please make sure that the necessary file permissions are given in /data.
Installation
pip install ckanext-dcor_depot
Add this extension to the plugins and defaul_views in ckan.ini:
ckan.plugins = [...] dcor_depot ckan.storage_path=/data/ckan-HOSTNAME ckanext.dcor_depot.depots_path=/data/depots ckanext.dcor_depot.users_depot_name=users-HOSTNAME
This plugin stores resources to /data:
mkdir -p /data/depots/users-$(hostname) chown -R www-data /data/depots/users-$(hostname)
Testing
If CKAN/DCOR is installed and setup for testing, this extension can be tested with pytest:
pytest ckanext
Testing can also be done via vagrant in a virtualmachine using the dcor-test <https://app.vagrantup.com/paulmueller/boxes/dcor-test/> image. Make sure that vagrant and virtualbox are installed and run the following commands in the root of this repository:
# Setup virtual machine using `Vagrantfile` vagrant up # Run the tests vagrant ssh -- sudo bash /testing/vagrant-run-tests.sh
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ckanext-dcor_depot-0.9.2.tar.gz
.
File metadata
- Download URL: ckanext-dcor_depot-0.9.2.tar.gz
- Upload date:
- Size: 41.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3302cf7e837aa3e1aa6dd5e96e260c544f8b3c108782c2ca42daf7248eca88c4 |
|
MD5 | af7f78080c3b9fffc087e497da99b0ad |
|
BLAKE2b-256 | 05f325d82b268280ac7af7f0d39393a4f484bd86735c308ffa82b0a2ce1f4394 |
File details
Details for the file ckanext_dcor_depot-0.9.2-py3-none-any.whl
.
File metadata
- Download URL: ckanext_dcor_depot-0.9.2-py3-none-any.whl
- Upload date:
- Size: 49.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6fd4345a338487ed37a115d20188520e3441fea4c21066763bdf4bb3ccb3a68 |
|
MD5 | 667b14ee8609154b56f07a705cb93929 |
|
BLAKE2b-256 | a534441fde01d594e9aa3c5f2154ff2c0fe03e3d6e82ac216d66182f5a293c5e |