janelia-flyem / dvid

Distributed, Versioned, Image-oriented Dataservice
http://dvid.io
Other
196 stars 33 forks source link

Actions on command line vs. API #248

Closed rivo closed 6 years ago

rivo commented 6 years ago

Apologies if these questions are very basic but I can't find the answers anywhere myself. I'm using the official DVID Docker image.

(1) How do I delete a repo from the command line? I'm following the Simple Example instructions as well as the commands found here but I'm getting the following:

$ dvid repo c8 delete grayscale
RPC error for "repo c8 delete grayscale": Unknown command: "repo c8 delete grayscale"

$ dvid repos c8 delete
RPC error for "repos c8 delete": Unknown repos command: "c8"

Is there no "delete" command in the Docker version? Using the API to DELETE a repo works fine.

(2) Is there an API equivalent for the "load" command? How can I load PNG files into a repository using the API?

DocSavage commented 6 years ago

Sorry for the delay in answering. For (1), if you see something like "Unknown command" it's likely that the command is missing a key string. In your first command I'm not sure what's going on. I'll check to see if the docker image is older than that command. Seems odd that the rest of your command is treated as a single string, almost as if it's been quoted. The second command you've reversed the order of the last two fields since it expects dvid repos delete c8 per the command documentation.

For (2), we typically write programs that read data from wherever and then use POST /raw or /blocks. Image volumes are organized in 3d blocks so if you use 32x32x32 blocks (BlockSize = 32) for grayscale, you create a buffer of X x Y x 32, read in images until you either fill the buffer or just pad with zeros, then do the POST /raw. The original "load" command dates back to the very first uses of dvid and is quite old and frankly, we don't use it for any of our production work since we have more sophisticated pre-processing (e.g., spark cluster) that prepares the data volume and then does POST /blocks into the server.

rivo commented 6 years ago

Should the "load" command still work in the latest version? (It actually crashes my build, see #249.) My task is to add a new storage backend to DVID so I'm not using any sophisticated tools in front of DVID. Basically, I need something simple to test the storage and "load" seemed pretty good for that purpose. Or would you recommend doing something else? (I guess using /raw will require me to somehow chop up my PNGs myself, I wonder if I can get around that.)

DocSavage commented 6 years ago

The load should work ok. As I mentioned in the closed issue, you could specify a different form of compression for the uint8blk data instance you are using for your images, say uncompressed (if you don't care about size) or gzip (if you are concerned about size but less about speed). This amounts to adding "compression=none" or "compression=gzip" if on command line, or if you are creating instance using POST /instance, adding the compression field to the JSON.

rivo commented 6 years ago

Thanks. Will do.