Repository navigation
[dev] Use datalad-fuse's remfile backend and all other dev branches - #1957
Draft
CodyCBakerPhD wants to merge 24 commits into
Draft
CodyCBakerPhD wants to merge 24 commits into
CodyCBakerPhD wants to merge 24 commits into
Conversation
Add `dandi.support.datalad_fuse.AnnexedReadableFile`, a `Readable` for a locked annexed file whose content is not present locally, streamed with the adapter of datalad-fuse (no FUSE mount), which asks git-annex where the content is. It is available with the new `datalad` extra. Cache NWB metadata of locked annexed files, streamed or local, under their git-annex key paired with their path, with fscacher 0.5.0's `annex_key_fingerprint`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
Add a `stream` policy to `--missing-file-content`: the content of annexed files that is not present locally (as in a DataLad clone of a Dandiset) is streamed with datalad-fuse's adapter, so that pynwb and nwbinspector run on it without it being downloaded. pynwb validation results are cached under the files' git-annex keys. This is the validation integration of #1933, on top of the datalad-fuse readable rather than a git-only reader of the git-annex branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
annex_fingerprint is not specific to NWB files, and living in dandi.support.datalad_fuse it needs no deferred import. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
…am-via-datalad-fuse Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
As documented in datalad/datalad-fuse#138. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
…am-via-datalad-fuse
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
With the development version of datalad-fuse from datalad/datalad-fuse#131, use its RemoteFilesystemAdapter, which reads HDF5-based files such as NWB with remfile if installed (fsspec otherwise), and look up S3 exports for content without a registered URL. The released FsspecAdapter is still used with datalad-fuse 0.5.1. Test it in a new datalad-dev CI job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
fscacher imports joblib, which imports numpy, so importing it with the module made the CLI (via dandi.validate in the stacked PR) import numpy, failing test_no_heavy_imports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
…am-via-datalad-fuse Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
…talad-fuse-remfile Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## claude/validate-stream-via-datalad-fuse #1957 +/- ##
===========================================================================
+ Coverage 91.13% 91.15% +0.01%
===========================================================================
Files 94 94
Lines 14806 14837 +31
===========================================================================
+ Hits 13494 13525 +31
Misses 1312 1312
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
…am-via-datalad-fuse Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
…talad-fuse-remfile Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
h5py holds its global lock while reading from a Python file object, and the read waits for another thread to fetch the data over HTTP (fsspec's I/O thread, or an HTTP server in the same process as in the tests). A garbage collection in that thread could then run the finalizer of an unreferenced h5py-backed object (e.g., hdmf's HDF5IO.__del__), which waits for the same lock: a deadlock, as seen in CI in test_validate_stream, ended by pytest-timeout with a segfault. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
This reverts commit d18843d. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
…to claude/validate-stream-via-datalad-fuse
…talad-fuse-remfile Resolve the import conflict, and check the type of the file object wrapped by the one that pauses garbage collection in the remfile test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
CodyCBakerPhD
added this pull request to stack #1959
October 12, 2026 21:30
…talad-fuse-remfile Bring in the rebased base branch. The conflicting files are identical in the old and the rebased base, so they keep this branch's versions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
…ad-fuse' into claude/datalad-fuse-remfile
With datalad/datalad-fuse#131 and remfile installed, remfile reads HDF5 files, with its own read-ahead (chunks growing up to 100 MiB) that datalad-fuse does not let us configure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
…ad-fuse' into claude/datalad-fuse-remfile
…ad-fuse' into claude/datalad-fuse-remfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #1956. This tries the development version of datalad-fuse from datalad/datalad-fuse#131, which adds pluggable backends, including remfile for HDF5-based files.
Changes
get_adapter()usesdatalad_fuse.adapter.RemoteFilesystemAdapter(dandiset.yaml: should become READONLY locally, with a comment, no metadata uploaded from it #131) when it is available, and falls back to the releaseddatalad_fuse.fsspec.FsspecAdapter(0.5.1) otherwise.remfileinstalled, NWB and other HDF5 files are read through remfile; other files still go through fsspec.datalad.fusefs.backendssetting.get_annexed_readable()also tries the S3 exporttree URLs from dandiset.yaml: should become READONLY locally, with a comment, no metadata uploaded from it #131 when git-annex lists no URL, for older datasets that lack versioned S3 URLs.validatedocs.test_annexed_readable_remfilechecks that an NWB file is opened through datalad-fuse'sRemfileWrapperand read with h5py over the local HTTP range server. It is skipped unless both dandiset.yaml: should become READONLY locally, with a comment, no metadata uploaded from it #131 andremfileare installed.datalad-devjob installs git-annex,remfileand datalad-fuse fromrefs/pull/131/head. The existingdataladjob keeps testing the PyPI release.Locally, the datalad-fuse and
validatestream tests pass with both datalad-fuse 0.5.1 (where the remfile test is skipped) and #131 plus remfile.Once #131 is released, the CI install can switch to that release and the
dataladextra's lower bound can be raised.Follow-up branch: dev datalad-fuse and h5py instead of the workarounds
Branch
claude/use-dev-datalad-fuse-h5py(4484f3a) builds on this PR. It has no PR of its own yet. It moves the low-level streaming workarounds out of dandi-cli and into the libraries where they belong, using development branches of those libraries.dandi/support/datalad_fuse.py_coalescing_block_cache()and_read_in_small_blocks()fsspec_options(block_size,cache_type,cache_options) and its"coalescing-blockcache": CodyCBakerPhD/datalad-fuse#1, on top of datalad/datalad-fuse#131annex_initialized()init_annex=Falseandannex_initialized(same PR)_GCPausedFile(garbage collection paused while streamed files are open)The fsspec counterpart is CodyCBakerPhD/filesystem_spec#1. It makes fsspec's own
"blockcache"fetch each run of missing blocks with one request, so datalad-fuse could drop its own cache. That branch is not yet installed or used by the follow-up branch.CI on the follow-up branch: the
dataladanddatalad-devjobs install the datalad-fuse and h5py forks from git;datalad-devalso installs remfile. Building h5py from source needs the HDF5 headers, which the jobs install first (apt-get install libhdf5-dev,HDF5_DIR=/usr/lib/x86_64-linux-gnu/hdf5/serial).Results so far (local only):
validateandcmd_validatetests pass: 102 passed, with and without remfile.-J 1: 87 s.-J 8: 30 s, with the same results.🤖 Generated with Claude Code
https://claude.ai/code/session_01Qn5WBSiQgoZoL4fytF6nEr
Generated by Claude Code
Generated by Claude Code