Read + Write Zarr with consolidated metadata - #3066
Conversation
|
@DennisHeimbigner Failures in the code preventing compilation aside, I'd be interested in your thoughts on this, particularly in advance of our scheduled conversation with @mannreis and Flo re: consolidated metadata. Thanks! |
|
In our meeting this morning, you indicated that you had modified ncjson |
|
I mentioned that with respect to my developments on |
|
I've merged the latest |
|
See draft pr #3068 |
|
@WardF this PR is already reaching if not crossed the limit of what I consider re-viewable. Now I'd focus on removing, improving and documenting rather than adding. Both read and write are supported but only if Doing so would also align with the I could further align the implementation with 3068 but I'm more comfortable going with this one for the moment and opening PRs solely for refactoring Some minor but importatn things that need some attention are:
|
|
We need a better plan for this.
Does that work. Can you suggest other small steps? |
This feature is disabled by default, meaning it should be fairly safe to add. Then create branches Hopefully each PR could be easier and quicker to review. Let me know your take @WardF The design won't change much @DennisHeimbigner. If you have already any suggestion feel free to start a "review" and highlight whatever you'd like modified |
| int zarr_format; /* Zarr format version */ | ||
| int dispatch_version; /* Dispatch table version*/ | ||
| size64_t flags; /* Metadata handling flags */ | ||
| NCjson *jcsl; // Consolidated JSON view or NULL |
There was a problem hiding this comment.
@DennisHeimbigner I merged NCZ_Metadata_Dispatcher and NCZ_Metadata, adding the NCjson* in the same struct. Was there any reason to keep it separate? This way we keep a single layer instead of two.
There was a problem hiding this comment.
That should be ok. As a rule, I make the dispatch table itself constant, but its a small issue.
|
I am thinking about miimizing the size of each PR. 3-4 small PRs may be preferable to 1 larger one. |
I went ahead and split this PR:
This was a bit of an puzzle for me but should make life easier for someone. I've rebased them on each other thus you see repeated commits that would be skipped if already merged. Here's a summary: echo Part 1: $(git diff main...zarr-csl-1 --shortstat);
for i in {2..7}; do
echo Part $i: $(git diff zarr-csl-$((i-1))...zarr-csl-${i} --shortstat);
donePart 1 to 3 add dead code which starts being used in Part 4 and 5. Glad to get some feedback and get things moving :) |
|
Let me know when you reach a reasonably steady state of PRs so I can begin reviewing them. |
They are ready! I need to rebase the later ones but so will I need, once there are changes. Thanks a lot!!! |
|
I hate to propose it but you are staging each zarr-csl-xx against Unidata/main rather than the previous |
I can do that but then the PR will be my fork as I can't create branches upstream. Another option is to review one at a time and once you're happy and the merge takes place I rebase the next one and you get a clean history. Yet another option is to trim each of zarr-csl-x to have only the their commits. This option may not even build in some cases... I'm not so experienced with scaffolding PRs but I'm learning. Tomorrow I'll address what you've reviewed so far. Many thanks Dennis! |
|
Good point. I guess I will do the deltas by hand rather than using the PR file changes. |
|
I think at this point, maintaining PR's against |
|
Merged via #3225 |
This PR is motivated by #2987 and it is a follow up on the closed PR2992. It infers if the dataset is consolidated and acts accordingly. The implementations was inspired on the developments in Zarr3 support (by @DennisHeimbigner) which could simplify adding the same feature on the next version.
In short, this PR adds a layer (
NCZMD, for NetCDF ZarrMetaData) that implements:.zattrs,.zgroup,.zarray)This layer would be extended in the same way for writing (updating internal consolidated json and sync it on closure)
Depending on the existence of
/.zmetadatathe operations above are either process from it's content, or done directly on the storage, viazmap.The feature above allows the S3 client implementation to be used against to vanilla HTTP servers, when authentication is out of the picture. But such is only possible because of 0832d450d207223fe43a9ee619bb722f9a29bff8, which avoids the S3 ListObjects.
As an example on how to produce a consolidated dataset in python:
This can be used to check if the reading output remains the same after (re)moving the
.zmetadataSimilar is done on 6346e91 taking into accound
zipandfilemodes. Integrated tests exercising S3 are limited on my side (i'll try to add some here). However I have used it against my own endpoints and it seems to be functional.Edit: set no compressor otherwise Blosc is used by default and adds dependency for the tests