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

[cirro-server] open dataset from url path #210

Open
yuhuyoyo opened this issue Feb 14, 2024 · 6 comments
Open

[cirro-server] open dataset from url path #210

yuhuyoyo opened this issue Feb 14, 2024 · 6 comments

Comments

@yuhuyoyo
Copy link

Is your feature request related to a problem? Please describe.
e.g. i have a cirrocumulus server running and I mounted the data to ./cirro-data. such as /cirro_data/pbmc3k.zarr
Then I'd like to open it by appending http://localhost:3000/cirro_data/pbmc3k.zarr to the path or as a query param to directly open it.

Currently I need to import the dataset and then open it from inside the UI.

Describe the solution you'd like
I'd like to open it by appending http://localhost:3000/cirro_data/pbmc3k.zarr to the path or as a query param to directly open it.

@joshua-gould
Copy link
Contributor

As a workaround, you can programmatically add a dataset by posting to the /api/dataset endpoint:

curl http://localhost:5000/api/dataset -X POST -F 'name=my_name' -F 'url=data/my_dataset_path' -F 'description=my_desc' -F 'species=Mus musculus'

Then you can link to the added dataset by id.

@yuhuyoyo
Copy link
Author

i can see that's useful if I'm importing my data from somewhere else. but if I already have the data mounted as volume inside the container, why do i still need to do this step?

@yuhuyoyo
Copy link
Author

also when you say link to the added dataset by id, do you mean i can go there through a path based routing (e.g. localhost:5000/datasets/<my_dataset_name>) or do you mean from the open button in the UI?

i'm fine with curling /api/dataset to add the dataset. but I'd also like to be able to get to it directly via localhost:5000/datasets/<my_dataset_name> as a follow-up step. i'm happy to contribute to the code too if you think the request is reasonable.

alternatively, we could have dynamic routing:

  1. pass in the root dir as env var, e.g. ./cirro_data
  2. find all the supported files inside and handle them as dataset.

@joshua-gould
Copy link
Contributor

After you add your dataset, you can link to the dataset by id. For example:
http://127.0.0.1:5000/#q={"dataset":"65cfa6fcddd71edd9e7ff6d4"}

You can retrieve all datasets on the server using the datasets endpoint (e.g. http://127.0.0.1:5000/api/datasets)
Does this work for your use case? Thanks.

@yuhuyoyo
Copy link
Author

thanks Josh, I can work with that :)

@yuhuyoyo
Copy link
Author

Hi josh, circling back here.

can we support [http://127.0.0.1:5000/#q={"url":"/path/to/*.zarr"}] too? any reason we are not forcing uniqueness based on the dataset path?

@yuhuyoyo yuhuyoyo reopened this Mar 19, 2024
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

2 participants