Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR adding support for Zarr V3 #3068

Draft
wants to merge 38 commits into
base: main
Choose a base branch
from

Conversation

DennisHeimbigner
Copy link
Collaborator

@DennisHeimbigner DennisHeimbigner commented Dec 23, 2024

Update: 1/6/2025: Ok, this branch is usable except for MYS2 and Visual Studio.
They are failing on some kind of "out of space" error whose
meaning I cannot figure out
=============================================
Update (12/29/24): I am going ahead and merging the code from PR #3066 since that code is pretty easy to follow and I have the best knowledge of what kind of tailoring is needed to adapt to the numerous changes.
=============================================

I am posting this PR as a draft so that Manuel Reis and others can work with it. I will revise this PR description later.

Notes:

  1. It does not yet run on github actions without errors.
  2. It appears to have no memory leaks
  3. It has problems with the testing infrastructure that I am working on.
  4. CMake does not work for testing v3_nczarr_test because of CMake Policy CMP002.
  5. Ubuntu + Automake appears to work including testing v3_nczarr_test.
  6. make distcheck does not work because of difficulties with VPATH.It works with distcheck now.

can work with it. I will revise this PR description later.

### Notes:
1. It does not yet run on github actions without errors.
2. It appears to have no memory leaks
3. It has problems with the testing infrastructure that I am working on.
4. CMake does not work for testing v3_nczarr_test because of CMake Policy
   [CMP002](https://cmake.org/cmake/help/latest/policy/CMP0002.html).
5. Ubuntu + Automake appears to work including testing v3_nczarr_test.
6. make distcheck does not work because of difficulties with VPATH.
@DennisHeimbigner
Copy link
Collaborator Author

DennisHeimbigner commented Jan 7, 2025

Ok, this branch is usable except for MYS2 and Visual Studio.
They are failing on some kind of "out of space" error whose
meaning I cannot figure out.

@mannreis
Copy link
Contributor

mannreis commented Jan 9, 2025

Thanks a lot for including the feature from #3066 @DennisHeimbigner and apologies for the delay in the reply!
I just build this branch, rebased on Unidata/main and ran on ncdump -h a huge dataset:

  • I see that although the metadata handler is correctly initialized (dataset is consolidated) the format inference happens before that and it walks the storage which takes a lot of time for big datasets on our system. Since the dataset is consolidated (as verified after the walk), it is better to simply check for the existence of any of the zarr metadata files across all versions.
There're many ways to improve this but here's one quick fix I did on my side that improves the time it takes to get the header information of the big dataset. (Edited for breaking tests)
diff --git a/libnczarr/zinfer.c b/libnczarr/zinfer.c
index e11afd6f4..6181b7e32 100644
--- a/libnczarr/zinfer.c
+++ b/libnczarr/zinfer.c
@@ -51,11 +51,11 @@ struct ZarrObjects {
   int zarr_version;
   int haszmetadata;
} zarrobjects[] = {
-{"zarr.json",  ZARRFORMAT3,    0},
-{".zgroup",    ZARRFORMAT2,    0},
-{".zarray",    ZARRFORMAT2,    0},
-{".zattrs",    ZARRFORMAT2,    0},
-{".zmetadata", ZARRFORMAT2,    1},
+{"/zarr.json", ZARRFORMAT3,    0},
+{"/.zgroup",   ZARRFORMAT2,    0},
+{"/.zarray",   ZARRFORMAT2,    0},
+{"/.zattrs",   ZARRFORMAT2,    0},
+{"/.zmetadata",        ZARRFORMAT2,    1},
{NULL,         0,              0},
};

@@ -187,7 +187,6 @@ done:
   return THROW(stat);
}

-int
NCZ_infer_open_zarr_format(NC_FILE_INFO_T* file)
{
   int stat = NC_NOERR;
@@ -198,8 +197,19 @@ NCZ_infer_open_zarr_format(NC_FILE_INFO_T* file)
   NC_UNUSED(file);

   /* Probe the map for tell-tale objects and dict keys */
-
   if(zarrformat == 0) {
+       size_t seglen = 0;
+       struct ZarrObjects *zo = NULL;
+       stat = NC_ENOTZARR; // Until proven otherwise we aren't sure it's a zarr dataset
+       /* We search on the root path for V2 or V3 tags */
+       for (zo = zarrobjects; zo->name; zo++) {
+               if ((stat = nczmap_exists(zfile->map,zo->name)) == NC_NOERR) {
+                       zarrformat = zo->zarr_version;
+                       break; /* No need to look for more keys */
+               }
+       }
+    }
+    if(zarrformat == 0 || stat != NC_NOERR) {
       /* We need to search subtree for a V2 or V3 tag */
       switch(stat = nczmap_walk(zfile->map,"/",tagsearch, &param)) {
       case NC_ENOOBJECT:
@@ -308,7 +318,7 @@ tagsearch(NCZMAP* map, const char* prefix, const char* key, void* param)
   if(seglen == 0) return NC_NOERR;
   
   for(zo=zarrobjects;zo->name;zo++) {
-       if(strcasecmp(segment,zo->name)==0) {
+       if(strcasecmp(segment,zo->name+1)==0) {
           formats->zarrformat = zo->zarr_version;
          return NC_NOERR; /* tell walker to stop */
      }

@mannreis
Copy link
Contributor

mannreis commented Jan 15, 2025

The first suggestion was breaking some tests so I added a commit to tackle this in a better way: mannreis@806c1a7 (s3consolidate-patch.txt)
This will check for presence of individual metadatafiles and fall back to listing the contents of the storage in case they aren't present on the top level.

@DennisHeimbigner DennisHeimbigner marked this pull request as ready for review January 15, 2025 21:31
@DennisHeimbigner DennisHeimbigner changed the title Draft PR adding support for Zarr V3 PR adding support for Zarr V3 Jan 15, 2025
@DennisHeimbigner
Copy link
Collaborator Author

Added a fix for issue (#3075)

@mannreis
Copy link
Contributor

Yes. I think a separate PR for that will help with closing this one.

@DennisHeimbigner
Copy link
Collaborator Author

I see the out of space problem is still there.

@WardF WardF self-assigned this Jan 30, 2025
@WardF
Copy link
Member

WardF commented Jan 30, 2025

I had hoped to include this, it feels like we're almost there, but I'm going to get v4.9.3 out and then come back to this for the subsequent v4.10.0 release.

@WardF WardF added this to the v4.10.0 milestone Jan 30, 2025
@DennisHeimbigner
Copy link
Collaborator Author

I agree. This PR has been nothing but a disaster and I take full responsibility for it.

DennisHeimbigner added a commit to DennisHeimbigner/netcdf-c that referenced this pull request Feb 5, 2025
re: PR Unidata#3068

Update the ncjson and ncproplist code to lastest.
@DennisHeimbigner DennisHeimbigner marked this pull request as draft February 6, 2025 00:16
DennisHeimbigner added a commit to DennisHeimbigner/netcdf-c that referenced this pull request Feb 7, 2025
re: PR Unidata#3068

1. Update the ncjson and ncproplist code to lastest.
2. Fix some references to older API functions.
3. Update the netcdf_json and netcdf_proplist builds.
DennisHeimbigner added a commit to DennisHeimbigner/netcdf-c that referenced this pull request Feb 10, 2025
re: PR Unidata#3068

1. Update the ncjson and ncproplist code to lastest.
2. Fix some references to older API functions.
3. Update the netcdf_json and netcdf_proplist builds.
@WardF
Copy link
Member

WardF commented Feb 10, 2025

@DennisHeimbigner Refreshing my memory on this, the original issue appears to have been fixed by some of the changes I made. Now the failures are somehow related to the string comparison output where character counts differ. See 6875ae3 and surrounding commits I made to see what I changed.

@DennisHeimbigner
Copy link
Collaborator Author

I am still seeing the "out of space error".
See https://github.com/Unidata/netcdf-c/actions/runs/13252775288/job/36993997437.
Here is a subset of the log showing the "out of space" error:

fgrep '[run_corrupt.sh]' mlog
3978:[run_corrupt.sh] +++ uname
3979:[run_corrupt.sh] ++ system=MINGW64_NT-10.0-20348
3980:[run_corrupt.sh] ++ test x = x
3981:[run_corrupt.sh] ++ alias '*** -W'
3982:[run_corrupt.sh] ++ top_srcdir=/d/a/netcdf-c/netcdf-c
3983:[run_corrupt.sh] ++ top_builddir=/d/a/netcdf-c/netcdf-c
3984:[run_corrupt.sh] ++ test x. = x
3985:[run_corrupt.sh] +++ pwd -W
3986:[run_corrupt.sh] ++ builddir=D:/a/netcdf-c/netcdf-c/nczarr_test
3987:[run_corrupt.sh] ++ execdir=D:/a/netcdf-c/netcdf-c/nczarr_test
3988:[run_corrupt.sh] +++ basename .
3989:[run_corrupt.sh] ++ thisdir=.
3990:[run_corrupt.sh] +++ pwd -W
3991:[run_corrupt.sh] ++ WD=D:/a/netcdf-c/netcdf-c/nczarr_test
3992:[run_corrupt.sh] ++ cd .
3993:[run_corrupt.sh] +++ pwd -W
3994:[run_corrupt.sh] ++ srcdir=D:/a/netcdf-c/netcdf-c/nczarr_test
3995:[run_corrupt.sh] ++ cd D:/a/netcdf-c/netcdf-c/nczarr_test
3996:[run_corrupt.sh] ++ cd /d/a/netcdf-c/netcdf-c
3997:[run_corrupt.sh] +++ pwd -W
3998:[run_corrupt.sh] ++ top_srcdir=D:/a/netcdf-c/netcdf-c
3999:[run_corrupt.sh] ++ cd D:/a/netcdf-c/netcdf-c/nczarr_test
4000:[run_corrupt.sh] ++ cd D:/a/netcdf-c/netcdf-c/nczarr_test
4001:[run_corrupt.sh] +++ pwd -W
4002:[run_corrupt.sh] ++ builddir=D:/a/netcdf-c/netcdf-c/nczarr_test
4003:[run_corrupt.sh] ++ cd D:/a/netcdf-c/netcdf-c/nczarr_test
4004:[run_corrupt.sh] ++ cd /d/a/netcdf-c/netcdf-c
4005:[run_corrupt.sh] +++ pwd -W
4006:[run_corrupt.sh] ++ top_builddir=D:/a/netcdf-c/netcdf-c
4007:[run_corrupt.sh] ++ cd D:/a/netcdf-c/netcdf-c/nczarr_test
4008:[run_corrupt.sh] ++ cd D:/a/netcdf-c/netcdf-c/nczarr_test
4009:[run_corrupt.sh] +++ pwd -W
4010:[run_corrupt.sh] ++ execdir=D:/a/netcdf-c/netcdf-c/nczarr_test
4011:[run_corrupt.sh] ++ cd D:/a/netcdf-c/netcdf-c/nczarr_test
4012:[run_corrupt.sh] ++ export srcdir top_srcdir builddir top_builddir execdir
4013:[run_corrupt.sh] ++ test -e D:/a/netcdf-c/netcdf-c/ncdump/ncdump.exe
4014:[run_corrupt.sh] ++ ext=.exe
4015:[run_corrupt.sh] ++ export NCDUMP=/d/a/netcdf-c/netcdf-c/ncdump/ncdump.exe
4016:[run_corrupt.sh] ++ NCDUMP=/d/a/netcdf-c/netcdf-c/ncdump/ncdump.exe
4017:[run_corrupt.sh] ++ export NCCOPY=/d/a/netcdf-c/netcdf-c/ncdump/nccopy.exe
4018:[run_corrupt.sh] ++ NCCOPY=/d/a/netcdf-c/netcdf-c/ncdump/nccopy.exe
4019:[run_corrupt.sh] ++ export NCVALID=/d/a/netcdf-c/netcdf-c/ncdump/ncvalidator.exe
4020:[run_corrupt.sh] ++ NCVALID=/d/a/netcdf-c/netcdf-c/ncdump/ncvalidator.exe
4021:[run_corrupt.sh] ++ export NCGEN=/d/a/netcdf-c/netcdf-c/ncgen/ncgen.exe
4022:[run_corrupt.sh] ++ NCGEN=/d/a/netcdf-c/netcdf-c/ncgen/ncgen.exe
4023:[run_corrupt.sh] ++ export NCGEN3=/d/a/netcdf-c/netcdf-c/ncgen3/ncgen3.exe
4024:[run_corrupt.sh] ++ NCGEN3=/d/a/netcdf-c/netcdf-c/ncgen3/ncgen3.exe
4025:[run_corrupt.sh] ++ export NCPATHCVT=/d/a/netcdf-c/netcdf-c/ncdump/ncpathcvt.exe
4026:[run_corrupt.sh] ++ NCPATHCVT=/d/a/netcdf-c/netcdf-c/ncdump/ncpathcvt.exe
4027:[run_corrupt.sh] ++ ncgen3c0=/d/a/netcdf-c/netcdf-c/ncgen3/c0.cdl
4028:[run_corrupt.sh] ++ ncgenc0=/d/a/netcdf-c/netcdf-c/ncgen/c0.cdl
4029:[run_corrupt.sh] ++ ncgenc04=/d/a/netcdf-c/netcdf-c/ncgen/c0_4.cdl
4030:[run_corrupt.sh] ++ test x = xyes
4031:[run_corrupt.sh] ++ test x = xyes
4032:[run_corrupt.sh] ++ test x = xyes
4033:[run_corrupt.sh] ++ test x = xyes
4034:[run_corrupt.sh] ++ cd D:/a/netcdf-c/netcdf-c/nczarr_test
4035:[run_corrupt.sh] + . D:/a/netcdf-c/netcdf-c/nczarr_test/test_nczarr.sh
4036:[run_corrupt.sh] ++ test x = x
4037:[run_corrupt.sh] ++ export TEST_NCZARR_SH=1
4038:[run_corrupt.sh] ++ TEST_NCZARR_SH=1
4039:[run_corrupt.sh] ++ test x1 '!=' x
4040:[run_corrupt.sh] ++ set -x
4041:[run_corrupt.sh] +++ pwd -W
4042:[run_corrupt.sh] ++ TMP=D:/a/netcdf-c/netcdf-c/nczarr_test
4043:[run_corrupt.sh] +++ basename D:/a/netcdf-c/netcdf-c/nczarr_test
4044:[run_corrupt.sh] ++ NCZARRDIR=nczarr_test
4045:[run_corrupt.sh] ++ test xnczarr_test = xnczarr_test
4046:[run_corrupt.sh] ++ export NCZARRFORMAT=2
4047:[run_corrupt.sh] ++ NCZARRFORMAT=2
4048:[run_corrupt.sh] ++ export NCNOZMETADATA=1
4049:[run_corrupt.sh] ++ NCNOZMETADATA=1
4050:[run_corrupt.sh] ++ echo '@@@ NCZARRFORMAT=2 NCNOZMETADATA=1'
4051:[run_corrupt.sh] @@@ NCZARRFORMAT=2 NCNOZMETADATA=1
4052:[run_corrupt.sh] ++ test x = x
4053:[run_corrupt.sh] ++ export NCZARR_S3_TEST_HOST=s3.us-east-1.amazonaws.com
4054:[run_corrupt.sh] ++ NCZARR_S3_TEST_HOST=s3.us-east-1.amazonaws.com
4055:[run_corrupt.sh] ++ test x = x
4056:[run_corrupt.sh] ++ export NCZARR_S3_TEST_BUCKET=unidata-zarr-test-data
4057:[run_corrupt.sh] ++ NCZARR_S3_TEST_BUCKET=unidata-zarr-test-data
4058:[run_corrupt.sh] ++ export NCZARR_S3_TEST_URL=https://s3.us-east-1.amazonaws.com/unidata-zarr-test-data
4059:[run_corrupt.sh] ++ NCZARR_S3_TEST_URL=https://s3.us-east-1.amazonaws.com/unidata-zarr-test-data
4060:[run_corrupt.sh] ++ test x2 = x3
4061:[run_corrupt.sh] ++ export ZDF=
4062:[run_corrupt.sh] ++ ZDF=
4063:[run_corrupt.sh] ++ NCZARRDIR=D:/a/netcdf-c/netcdf-c/nczarr_test/../nczarr_test
4064:[run_corrupt.sh] ++ ZMD=D:/a/netcdf-c/netcdf-c/nczarr_test/../nczarr_test/zmapio
4065:[run_corrupt.sh] ++ S3UTIL=D:/a/netcdf-c/netcdf-c/nczarr_test/../nczarr_test/s3util
4066:[run_corrupt.sh] ++ ZS3PARSE=D:/a/netcdf-c/netcdf-c/nczarr_test/../nczarr_test/zs3parse
4067:[run_corrupt.sh] ++ NCDUMPCHUNKS=D:/a/netcdf-c/netcdf-c/nczarr_test/../nczarr_test/ncdumpchunks
4068:[run_corrupt.sh] ++ ZHEX=D:/a/netcdf-c/netcdf-c/nczarr_test/../nczarr_test/zhex
4069:[run_corrupt.sh] ++ ZISJSON=D:/a/netcdf-c/netcdf-c/nczarr_test/../nczarr_test/zisjson
4070:[run_corrupt.sh] +++ pwd -W
4071:[run_corrupt.sh] ++ WD=D:/a/netcdf-c/netcdf-c/nczarr_test
4072:[run_corrupt.sh] ++ cd D:/a/netcdf-c/netcdf-c/nczarr_test
4073:[run_corrupt.sh] +++ pwd -W
4074:[run_corrupt.sh] ++ abs_srcdir=D:/a/netcdf-c/netcdf-c/nczarr_test
4075:[run_corrupt.sh] ++ cd D:/a/netcdf-c/netcdf-c/nczarr_test
4076:[run_corrupt.sh] ++ cd D:/a/netcdf-c/netcdf-c/nczarr_test
4077:[run_corrupt.sh] +++ pwd -W
4078:[run_corrupt.sh] ++ abs_execdir=D:/a/netcdf-c/netcdf-c/nczarr_test
4079:[run_corrupt.sh] ++ cd D:/a/netcdf-c/netcdf-c/nczarr_test
4080:[run_corrupt.sh] +++ pwd -W
4081:[run_corrupt.sh] ++ WD=D:/a/netcdf-c/netcdf-c/nczarr_test
4082:[run_corrupt.sh] ++ test x '!=' x
4083:[run_corrupt.sh] ++ test xyes = xyes
4084:[run_corrupt.sh] ++ . D:/a/netcdf-c/netcdf-c/nczarr_test/findplugin.sh
4085:[run_corrupt.sh] +++ TOPSRCDIR=/d/a/netcdf-c/netcdf-c
4086:[run_corrupt.sh] +++ TOPBUILDDIR=/d/a/netcdf-c/netcdf-c
4087:[run_corrupt.sh] +++ test xD:/a/netcdf-c/netcdf-c/nczarr_test = x
4088:[run_corrupt.sh] +++ . /d/a/netcdf-c/netcdf-c/test_common.sh
4089:[run_corrupt.sh] ++++ test x1 = x
4090:[run_corrupt.sh] +++ unset HDF5_PLUGIN_DIR
4091:[run_corrupt.sh] +++ findpluginext
4092:[run_corrupt.sh] ++++ find /d/a/netcdf-c/netcdf-c/plugins -name 'misc.so'
4093:[run_corrupt.sh] +++ TSO=
4094:[run_corrupt.sh] ++++ find /d/a/netcdf-c/netcdf-c/plugins -name 'misc.dylib'
4095:[run_corrupt.sh] +++ TDY=
4096:[run_corrupt.sh] ++++ find /d/a/netcdf-c/netcdf-c/plugins -name 'cyg
misc.dll'
4097:[run_corrupt.sh] +++ TCYG=
4098:[run_corrupt.sh] ++++ find /d/a/netcdf-c/netcdf-c/plugins -name 'lib
misc.dll'
4099:[run_corrupt.sh] +++ TMING='/d/a/netcdf-c/netcdf-c/plugins/.libs/lib__nch5misc.dll
4100:[run_corrupt.sh] /d/a/netcdf-c/netcdf-c/plugins/.libs/lib__nczmisc.dll'
4101:[run_corrupt.sh] ++++ find /d/a/netcdf-c/netcdf-c/plugins -name '*misc.dll'
4102:[run_corrupt.sh] +++ TDLL='/d/a/netcdf-c/netcdf-c/plugins/.libs/lib__nch5misc.dll
4103:[run_corrupt.sh] /d/a/netcdf-c/netcdf-c/plugins/.libs/lib__nczmisc.dll'
4104:[run_corrupt.sh] +++ test x '!=' x
4105:[run_corrupt.sh] +++ test x '!=' x
4106:[run_corrupt.sh] +++ test x '!=' x
4107:[run_corrupt.sh] +++ test 'x/d/a/netcdf-c/netcdf-c/plugins/.libs/lib__nch5misc.dll
4108:[run_corrupt.sh] /d/a/netcdf-c/netcdf-c/plugins/.libs/lib__nczmisc.dll' '!=' x
4109:[run_corrupt.sh] +++ FP_PLUGIN_EXT=dll
4110:[run_corrupt.sh] +++ FP_PLUGIN_PRE=lib__nc
4111:[run_corrupt.sh] +++ findplugindir
4112:[run_corrupt.sh] +++ FP_PLUGIN_DIR=
4113:[run_corrupt.sh] ++++ pwd -W
4114:[run_corrupt.sh] +++ CURWD=D:/a/netcdf-c/netcdf-c/nczarr_test
4115:[run_corrupt.sh] +++ cd /d/a/netcdf-c/netcdf-c/plugins
4116:[run_corrupt.sh] ++++ pwd -W
4117:[run_corrupt.sh] +++ FP_PLUGINS=D:/a/netcdf-c/netcdf-c/plugins
4118:[run_corrupt.sh] +++ cd D:/a/netcdf-c/netcdf-c/nczarr_test
4119:[run_corrupt.sh] +++ test x '!=' x
4120:[run_corrupt.sh] +++ test -e D:/a/netcdf-c/netcdf-c/plugins/.libs
4121:[run_corrupt.sh] +++ FP_PLUGIN_DIR=D:/a/netcdf-c/netcdf-c/plugins/.libs
4122:[run_corrupt.sh] +++ test xD:/a/netcdf-c/netcdf-c/plugins/.libs = x
4123:[run_corrupt.sh] ++++ /d/a/netcdf-c/netcdf-c/ncdump/ncpathcvt.exe -F D:/a/netcdf-c/netcdf-c/plugins/.libs
4124:[run_corrupt.sh] +++ FP_PLUGIN_DIR=D:/a/netcdf-c/netcdf-c/plugins/.libs
4125:[run_corrupt.sh] +++ HDF5_PLUGIN_DIR=D:/a/netcdf-c/netcdf-c/plugins/.libs
4126:[run_corrupt.sh] +++ test x = x
4127:[run_corrupt.sh] +++ HDF5_PLUGIN_PATH=D:/a/netcdf-c/netcdf-c/plugins/.libs
4128:[run_corrupt.sh] ++ echo 'findplugin.sh loaded'
4129:[run_corrupt.sh] findplugin.sh loaded
4130:[run_corrupt.sh] ++ findplugin h5misc
4131:[run_corrupt.sh] ++ FP_NAME=h5misc
4132:[run_corrupt.sh] ++ FP_PLUGIN_LIB=
4133:[run_corrupt.sh] ++ FP_PLUGIN_LIB=lib__nch5misc.dll
4134:[run_corrupt.sh] ++ test -f D:/a/netcdf-c/netcdf-c/plugins/.libs/lib__nch5misc.dll
4135:[run_corrupt.sh] ++ HDF5_PLUGIN_LIB=lib__nch5misc.dll
4136:[run_corrupt.sh] ++ HDF5_PLUGIN_DIR=D:/a/netcdf-c/netcdf-c/plugins/.libs
4137:[run_corrupt.sh] ++ return 0
4138:[run_corrupt.sh] ++ echo 'final HDF5_PLUGIN_DIR=D:/a/netcdf-c/netcdf-c/plugins/.libs'
4139:[run_corrupt.sh] final HDF5_PLUGIN_DIR=D:/a/netcdf-c/netcdf-c/plugins/.libs
4140:[run_corrupt.sh] ++ export HDF5_PLUGIN_PATH=D:/a/netcdf-c/netcdf-c/plugins/.libs
4141:[run_corrupt.sh] ++ HDF5_PLUGIN_PATH=D:/a/netcdf-c/netcdf-c/plugins/.libs
4142:[run_corrupt.sh] ++ GDBB='gdb -batch -ex r -ex bt -ex q --args'
4143:[run_corrupt.sh] ++ resetrc
4144:[run_corrupt.sh] ++ test x = x1
4145:[run_corrupt.sh] ++ rm -f D:/a/netcdf-c/netcdf-c/nczarr_test/.dodsrc D:/a/netcdf-c/netcdf-c/nczarr_test/.daprc D:/a/netcdf-c/netcdf-c/nczarr_test/.ncrc
4146:[run_corrupt.sh] ++ unset NCRCENV_IGNORE
4147:[run_corrupt.sh] ++ unset NCRCENV_RC
4148:[run_corrupt.sh] ++ unset DAPRCFILE
4149:[run_corrupt.sh] + set -x
4150:[run_corrupt.sh] + set -e
4151:[run_corrupt.sh] + s3isolate testdir_corrupt
4152:[run_corrupt.sh] + test x = x
4153:[run_corrupt.sh] + test x = x
4154:[run_corrupt.sh] + isolate testdir_corrupt
4155:[run_corrupt.sh] + test x = x
4156:[run_corrupt.sh] ++ pwd -W
4157:[run_corrupt.sh] + ISOTESTDIR=D:/a/netcdf-c/netcdf-c/nczarr_test
4158:[run_corrupt.sh] ++ basename D:/a/netcdf-c/netcdf-c/nczarr_test
4159:[run_corrupt.sh] + ISOTESTDIR=nczarr_test
4160:[run_corrupt.sh] + test x = x
4161:[run_corrupt.sh] + ISOUID=1739231499
4162:[run_corrupt.sh] + ISOPATH=D:/a/netcdf-c/netcdf-c/alltests_1739231499/nczarr_test
4163:[run_corrupt.sh] + ISODIR=testdir_corrupt
4164:[run_corrupt.sh] + ISOPATH=D:/a/netcdf-c/netcdf-c/alltests_1739231499/nczarr_test/testdir_corrupt
4165:[run_corrupt.sh] + rm -fr D:/a/netcdf-c/netcdf-c/alltests_1739231499/nczarr_test/testdir_corrupt
4166:[run_corrupt.sh] + mkdir -p D:/a/netcdf-c/netcdf-c/alltests_1739231499/nczarr_test/testdir_corrupt
4167:[run_corrupt.sh] ++ basename D:/a/netcdf-c/netcdf-c/nczarr_test
4168:[run_corrupt.sh] + BNAME=nczarr_test
4169:[run_corrupt.sh] + S3ISODIR=nczarr_test_1739231499/testdir_corrupt
4170:[run_corrupt.sh] + S3ISOPATH=netcdf-c/nczarr_test_1739231499/testdir_corrupt
4171:[run_corrupt.sh] ++ pwd -W
4172:[run_corrupt.sh] + THISDIR=D:/a/netcdf-c/netcdf-c/nczarr_test
4173:[run_corrupt.sh] + cd D:/a/netcdf-c/netcdf-c/alltests_1739231499/nczarr_test/testdir_corrupt
4174:[run_corrupt.sh] + export NCLOGGING=WARN
4175:[run_corrupt.sh] + NCLOGGING=WARN
4176:[run_corrupt.sh] + testnoshape1
4177:[run_corrupt.sh] + zext=file
4178:[run_corrupt.sh] + unzip D:/a/netcdf-c/netcdf-c/nczarr_test/ref_noshape.file.zip
4179:[run_corrupt.sh] Archive: D:/a/netcdf-c/netcdf-c/nczarr_test/ref_noshape.file.zip
4180:[run_corrupt.sh] creating: ref_noshape.file/
4181:[run_corrupt.sh] creating: ref_noshape.file/v/
4182:[run_corrupt.sh] inflating: ref_noshape.file/v/0
4183:[run_corrupt.sh] inflating: ref_noshape.file/v/.zarray
4184:[run_corrupt.sh] extracting: ref_noshape.file/v/.zattrs
4185:[run_corrupt.sh] extracting: ref_noshape.file/.zgroup
4186:[run_corrupt.sh] extracting: ref_noshape.file/.zattrs
4187:[run_corrupt.sh] + fileargs D:/a/netcdf-c/netcdf-c/alltests_1739231499/nczarr_test/testdir_corrupt/ref_noshape mode=zarr,file
4188:[run_corrupt.sh] + f=D:/a/netcdf-c/netcdf-c/alltests_1739231499/nczarr_test/testdir_corrupt/ref_noshape
4189:[run_corrupt.sh] + frag=mode=zarr,file
4190:[run_corrupt.sh] + test xmode=zarr,file = x
4191:[run_corrupt.sh] + case "$zext" in
4192:[run_corrupt.sh] + file=D:/a/netcdf-c/netcdf-c/alltests_1739231499/nczarr_test/testdir_corrupt/ref_noshape.file
4193:[run_corrupt.sh] + fileurl=file://D:/a/netcdf-c/netcdf-c/alltests_1739231499/nczarr_test/testdir_corrupt/ref_noshape.file#mode=zarr,file
4194:[run_corrupt.sh] + rm -f tmp_noshape1_file.cdl
4195:[run_corrupt.sh] + find D:/a/netcdf-c/netcdf-c/alltests_1739231499/nczarr_test/testdir_corrupt
4196:[run_corrupt.sh] D:/a/netcdf-c/netcdf-c/alltests_1739231499/nczarr_test/testdir_corrupt
4197:[run_corrupt.sh] D:/a/netcdf-c/netcdf-c/alltests_1739231499/nczarr_test/testdir_corrupt/ref_noshape.file
4198:[run_corrupt.sh] D:/a/netcdf-c/netcdf-c/alltests_1739231499/nczarr_test/testdir_corrupt/ref_noshape.file/.zattrs
4199:[run_corrupt.sh] D:/a/netcdf-c/netcdf-c/alltests_1739231499/nczarr_test/testdir_corrupt/ref_noshape.file/.zgroup
4200:[run_corrupt.sh] D:/a/netcdf-c/netcdf-c/alltests_1739231499/nczarr_test/testdir_corrupt/ref_noshape.file/v
4201:[run_corrupt.sh] D:/a/netcdf-c/netcdf-c/alltests_1739231499/nczarr_test/testdir_corrupt/ref_noshape.file/v/.zarray
4202:[run_corrupt.sh] D:/a/netcdf-c/netcdf-c/alltests_1739231499/nczarr_test/testdir_corrupt/ref_noshape.file/v/.zattrs
4203:[run_corrupt.sh] D:/a/netcdf-c/netcdf-c/alltests_1739231499/nczarr_test/testdir_corrupt/ref_noshape.file/v/0
4204:[run_corrupt.sh] + D:/a/netcdf-c/netcdf-c/nczarr_test/../nczarr_test/zmapio -h -t int file://D:/a/netcdf-c/netcdf-c/alltests_1739231499/nczarr_test/testdir_corrupt/ref_noshape.file#mode=zarr,file
4205:[run_corrupt.sh] Default action: objdump
4206:[run_corrupt.sh] fail: Not enough space

DennisHeimbigner added a commit to DennisHeimbigner/netcdf-c that referenced this pull request Feb 11, 2025
re: PR Unidata#3068

1. Fix a namespace problem in tinyxml2.cpp.
   Note that this is a visual studio problem hence use of _MSC_VER.
@mannreis
Copy link
Contributor

I did some fixes in this branch to be able to build it (command below). Also for building with aws-sdk-cpp. Since I'm not sure how to push them in the context of this PR, I believe this could bring them here DennisHeimbigner#2

cmake ../ -DNETCDF_ENABLE_NCZARR=ON -DNETCDF_ENABLE_NCZARR_S3=ON -DNETCDF_ENABLE_S3_AWS=ON -DNETCDF_ENABLE_NCZARR=ON -D{NETCDF_,}ENABLE_PLUGIN_INSTALL=YES  -DNETCDF_ENABLE_LOGGING=ON  -DNETCDF_ENABLE_NETCDF_4=ON -DNETCDF_ENABLE_ZOH=ON

DennisHeimbigner added a commit to DennisHeimbigner/netcdf-c that referenced this pull request Feb 11, 2025
re: PR Unidata#3068

1. Fix a namespace problem in tinyxml2.cpp.
   Note that this is a visual studio problem hence use of _MSC_VER.
DennisHeimbigner added a commit to DennisHeimbigner/netcdf-c that referenced this pull request Feb 13, 2025
re: PR Unidata#3068

Part of splitting PR 3068.

General goal is to fix minor bugs and issues involving
S3 code outside of libnczarr.

1. libsrc/s3io.c:
    - Fix handling of error output of NC_s3sdkinfo.
    - Implement delete arg to s3io_close
2. Add support for Zarr-Over-HTTP (ZOH) protocol, but leave disabled until given the go-ahead from Manuel Reis.
3. Change the ncs3sdk API to light of eventual addition of Zarr V3 support.
4. Modify s3cleanup.in to catch and remove some previously overlooked entries in the Unidata S3 test bucket.
5. Modify s3gc.in to catch and properly remove Unidata S3 test bucket entries with old UIDs.
6. Modify ds3util.c:
    - Support use of a non-standard port -- H/T Manuel Reis
    - Clean up some memory leaks
    - Add disabled ZOH support
    - Better doc on how URLs are interpreted.
    - Document how .aws/config and .aws/credentials files are parsed.
7. Repair bugs in the internal S3 reader/writer module.
    - Allow API functions to return an http code (see also nch5s3comms.h).
    - Fix some casting warnings.
8. Fixes to ncs3sdk_h5.c, the dispatch wrapper for the internal S3 reader/writer
    - Move httptonc to this file.
    - Make conform to API modifications
    - Refactor the key search code.
    - Rename getkeys to list and searchkeys to listall.
9. Fixes to nczarr_test/s3util.c
    - Reflect ds3util.c API changes: e.g search->listall.
10. Add s3util.c to v3_nczarr_directory
11. Extend unit_test/test_s3dk.c to reflect S3 API changes.
12. Extend unit_test/run_s3sdk.sh to add new tests involving S3 API changes.
DennisHeimbigner added a commit to DennisHeimbigner/netcdf-c that referenced this pull request Feb 14, 2025
re: PR Unidata#3068

Part of splitting PR 3068

1. Libdap2+Libdap4: Update to change "_FillValue" to NC_FillValue constant.
2. Libdap4: Update the algorithm for sizing the packet buffer.
3. Libdap4: Dynamically sort the ATOMICTYPEINFO table so it can be used
   with binary search in lookupAtomicType function
4. Mark some unused function arguments.
5. Subsume the Hyrax changes in PR Unidata#3089.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants