Skip to main content

Package for retrieving and calculating checksums for XRootD

Project description

xrdsum

XrootD plugin for calculating checksums and storing them in extended attributes. Currently supports ADLER32 checksum and HDFS as backend. Borrows heavily from cephsum plugin.

This plugin is designed to easily accommodate new checksum types and backends. Additional dependencies for backends are defined as optional dependencies for the package (see usage instructions).

Actions Status Documentation Status Code style: black

PyPI version PyPI platforms

GitHub Discussion Gitter

Usage

xrdsum requires Python version >=3.8. To install, run:

pip install xrdsum[hdfs]
xrdsum --help
Usage: xrdsum [OPTIONS] COMMAND [ARGS]...

  Callback to give the --verbose and --debug options to all commands

Options:
  -v, --verbose         Verbose output
  -d, --debug           Debug output
  -l, --log-file TEXT   Log file
  --install-completion  Install completion for the current shell.
  --show-completion     Show completion for the current shell, to copy it or
                        customize the installation.
  --help                Show this message and exit.

Commands:
  get     Get the checksum of a file.
  verify  Check if a file has the correct checksum.

Example:

/usr/bin/time -v xrdsum --verbose  --debug get  /xrootd/dteam/user/jwalder/file_1GB_020 --read-size 128

xrootd config

# ensure cksum adler32 is included in the tpc directive, in order to calculate by default on transfer
ofs.tpc cksum adler32 fcreds ?gsi =X509_USER_PROXY autorm xfr 40 pgm /etc/xrootd/xrdcp-tpc.sh

# add this line to trigger external checksum calculation. Would be overwritten by other xrootd.chksum lines
xrootd.chksum max 50 adler32 /etc/xrootd/xrdsum.sh

with /etc/xrootd/xrdcp-tpc.sh containing:

#!/bin/sh

# from https://github.com/snafus/cephsum/blob/master/scripts/xrdcp-tpc.sh
#Original code
#/usr/bin/xrdcp --server -f $1 root://$XRDXROOTD_PROXY/$2

# Get the last two variables as SRC and DST, all others are assumed as additional arguments
OTHERARGS="${@:1:$#-2}"
DSTFILE="${@:$#:1}"
SRCFILE="${@:$#-1:1}"


/usr/bin/xrdcp $OTHERARGS --server -f $SRCFILE root://$XRDXROOTD_PROXY/$DSTFILE

and with /etc/xrootd/xrdsum.sh containing:

#!/usr/bin/env bash

RESULT=$(xrdsum get --store-result --chunk-size 64 --verbose --storage-catalog /etc/xrootd/storage.xml "$1")
ECODE=$?

# XRootD expects return on stdout - checksum followed by a new line
printf "%s\n" "$RESULT"
exit "$ECODE"

Conda installation example

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -p /miniconda
rm -f Miniconda3-latest-Linux-x86_64.sh
export PATH="/miniconda/bin:$PATH"
conda init
conda update -y conda
conda install python=3.10
pip install xrdsum[hdfs]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xrdsum-2024.6.1.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

xrdsum-2024.6.1-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file xrdsum-2024.6.1.tar.gz.

File metadata

  • Download URL: xrdsum-2024.6.1.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.4

File hashes

Hashes for xrdsum-2024.6.1.tar.gz
Algorithm Hash digest
SHA256 96072eaa8f13c769f09c24b03d1172328f6233cd4614fb4258164bd5fae56630
MD5 1883ca8e767dc5a22efaabb06e3abdb3
BLAKE2b-256 c385242e9e5008fff05b2ecf38ff917c0be2e3e4d0b60442919c4f1f690187cc

See more details on using hashes here.

File details

Details for the file xrdsum-2024.6.1-py3-none-any.whl.

File metadata

  • Download URL: xrdsum-2024.6.1-py3-none-any.whl
  • Upload date:
  • Size: 19.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.4

File hashes

Hashes for xrdsum-2024.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 38b0c90796399ca8e01a5ab916cad27288d2b3214eaf2da2df02cec1d1de73af
MD5 073b8514f1f67cef2e35db1fac01da4f
BLAKE2b-256 56d310e59302de3ff96871dc1a8046f73b7b2e1fe671f4e7184b71607e6f4843

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page