reanahub / reana-client

REANA command-line client
http://reana-client.readthedocs.io/
MIT License
10 stars 46 forks source link

download: add support for downloading directories #402

Closed tiborsimko closed 3 years ago

tiborsimko commented 4 years ago

Current behaviour

Currently reana-client does not support downloading directories:

$ reana-client ls -w roofit
NAME                SIZE     LAST-MODIFIED
results/plot.png    15450    2020-03-24T11:25:59
results/data.root   154454   2020-03-24T11:25:52
code/fitdata.C      1648     2020-03-24T11:25:38
code/gendata.C      1937     2020-03-24T11:25:38

$ reana-client download -w roofit results
File results downloaded to /home/simko/private/project/reana/src/reana-demo-root6-roofit.

$ ls -l results
-rw-r--r-- 1 simko simko 38 Mar 24 15:16 results

$ cat results
{"message":"results does not exist."}

This is "expected", because directory download support has not been added yet.

Expected behaviour

What we can do to improve the behaviour:

(1) At the least, we should verify on the server side whether the object the user wanted to download is a file, and if yes, proceed; if not, report an error.

(2) Ideally, we should add support for proper directory download, because some workflows may generate many files. So, if the user asks for a directory, then the server could iterate over its files and download them one by one, or return a zip file or something.

mvidalgarcia commented 3 years ago

Closed by https://github.com/reanahub/reana-workflow-controller/pull/369, https://github.com/reanahub/reana-client/pull/490 & https://github.com/reanahub/reana-server/pull/348.