brainlife / cli

brainlife.io Command Line Interface (CLI)
https://brainlife.io
MIT License
2 stars 5 forks source link

Allow user to upload dataset by specifying individual file path #18

Closed soichih closed 6 years ago

soichih commented 6 years ago

Currently, we require users to prepare a directory containing files that are expected for each dataset and specify the directory name as an argument. For simple datasets (like t1w, t2w) this seems an unnecessary work that user must do to upload datasets.

We should keep the existing directory based upload approach, but I believe we should also allow users to upload dataset by simply specifying file paths for each input file/dir IDs. Like..

bl dataset upload --t1 t1.nii.gz
bl dataset upload --track mytrack.nii.gz
bl dataset upload --output freesurfer (* it's unfortunate that freesufer directory is called "output")

The CLI can then on-the-fly create a tar ball (using npm tar or archiver module) and stream it to task upload API.

soichih commented 6 years ago

I tried uploading by specifying the file IDs

Like..

bl dataset upload -p 5a74ccd66ed91402ce400cc6 -d neuro/dwi -s test --dwi 20171117_114153DSIMB3253dAPSTS3S1s029a001.nii.gz --bvecs 20171117_114153DSIMB3253dAPSTS3S1s029a001.bvec --bvals 20171117_114153DSIMB3253dAPSTS3S1s029a001.bval

This somehow ended up uploading text files that contains the filename as the file content (instead of the actual content of the file..) We need to fix this.

Also, we should update the README to make this the default / preferred method of uploading datasets (by specifying files)