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

Make current test.zr3 available via HTTP #32

Open
manzt opened this issue Nov 24, 2020 · 7 comments
Open

Make current test.zr3 available via HTTP #32

manzt opened this issue Nov 24, 2020 · 7 comments

Comments

@manzt
Copy link

manzt commented Nov 24, 2020

I have translated the current zarrita implementation into javascript here: https://github.com/manzt/zarrita.js

It would be great to have a live example test.zr3 somewhere so that I we can test/verify compatibility with other implementations. I think I remember there being some discussion in zarr-python about this, but I'm not sure if it was related to v3.

Not a major issue, but just wanted to make those interested aware.

@joshmoore
Copy link

cc: @Carreau @constantinpape

I'm happy to host on S3 if it will be useful. Another option would be to start working it into https://github.com/constantinpape/zarr_implementations

@alimanfoo
Copy link
Owner

Hi @manzt, that's fantastic news. Yes it would be great to build some datasets that we can use to verify compatibility. For the time being, if it's useful, the test.zr3 is up on GCS at this path and should be public: gs://zarr-demo/v3/test.zr3 ... happy to copy that to S3 or anywhere else if it would be useful.

@manzt
Copy link
Author

manzt commented Nov 24, 2020

Thanks @alimanfoo! Is it possible to set Access-Control-Allow-Origin: * for the bucket? https://cloud.google.com/storage/docs/cross-origin

This will enable CORS so that a webpage can make requests to the endpoint. If you open your browser console this currently errors:

>> await fetch('https://storage.googleapis.com/zarr-demo/v3/test.zr3/zarr.json')
// Content Security Policy: The page’s settings blocked the loading of a resource at https://storage.googleapis.com/zarr-demo/v3/test.zr3/zarr.json (“connect-src”).

For reference the HTTP endpoint works when using curl and not making cross-origin requests:

$ curl https://storage.googleapis.com/zarr-demo/v3/test.zr3/zarr.json | jq
{
  "zarr_format": "https://purl.org/zarr/spec/protocol/core/3.0",
  "metadata_encoding": "https://purl.org/zarr/spec/protocol/core/3.0",
  "metadata_key_suffix": ".json",
  "extensions": []
}

@joshmoore
Copy link

@manzt: a copy is available at https://s3.embassy.ebi.ac.uk/idr/share/zarr-demo/v3/test.zr3/

@manzt
Copy link
Author

manzt commented Nov 24, 2020

Thanks @joshmoore. Here is a live JS notebook if folks are interested: https://observablehq.com/d/7156b4838eed011d

(I'd like to set up some type of like "can-i-use" table for different types of arrays, since all can't be supported in the browser. For example, JavaScript doesn't have built in support for float16 or boolean arrays - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays)

@alimanfoo
Copy link
Owner

Thanks @alimanfoo! Is it possible to set Access-Control-Allow-Origin: * for the bucket?

I think I've done that, can you try again?

I did gsutil cors set cors.json gs://zarr-demo/ with this as cors.json:

    [
      {
        "origin": ["*"],
        "responseHeader": ["Content-Type"],
        "method": ["GET", "HEAD"],
        "maxAgeSeconds": 3600
      }
    ]

@manzt
Copy link
Author

manzt commented Nov 24, 2020

Working for me -- thanks! I added a drop down to toggle the endpoint.

image

Update: 11:41AM EST 2020-11-25, GCS link not working for me.

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

No branches or pull requests

3 participants