viash-io / viash

script + metadata = standalone component
https://viash.io
GNU General Public License v3.0
39 stars 2 forks source link

Using dash in docker parameter results in error #3

Closed ddemaeyer closed 4 years ago

ddemaeyer commented 4 years ago

Adding paths to the platform volume mounting for docker with dashes results in invalid definitions for docker:

I.e.

- name: output-dir
  mount: /output

Running example 
./output/scrublet --input /data/pbmc_1k_protein_v3_filtered_feature_bc_matrix.h5ad --data $(pwd)/test --output-dir $(dirname $(dirname $(pwd)))/test-output --output /output/pbmc_1k_protein_v3_filtered_feature_bc_matrix.scrublet.h5ad

Results in 
./output/scrublet: line 54: VOLUME_OUTPUT-DIR=/projects/processedData/2020/CS/ddemaey1/git/scPipelineViash/test-output: No such file or directory
docker: Error response from daemon: create -DIR: "-DIR" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path.
See 'docker run --help'.
[ddemaey1@awsaivirl1108 scrublet]$ ./run_test.sh 

This can be resolved by renaming

- name: outputdir
  mount: /output
rcannood commented 4 years ago

Hmm. I think allowing names with dashes will cause all sorts of downstream problems in bash. I suggest using outputdir, output_dir, or outputDir instead.

I added an extra check to the class of the docker volumes, so that a more useful error will be produced during the viash export instead of when you try to run the code.

Is this okay for you?

ddemaeyer commented 4 years ago

Yes

Op wo 6 mei 2020 11:08 schreef Robrecht Cannoodt notifications@github.com:

Hmm. I think allowing names with dashes will cause all sorts of downstream problems in bash. I suggest using outputdir, output_dir, or outputDir instead.

I added an extra check to the class of the docker volumes, so that a more useful error will be produced during the viash export instead of when you try to run the code.

Is this okay for you?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/data-intuitive/Viash/issues/3#issuecomment-624530958, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANREDZS55WZLOTE325SYRDRQESJ3ANCNFSM4M2HII6Q .