grisu / gricli

Grisu commandline client
7 stars 2 forks source link

revise submit command #53

Closed yuriyh closed 13 years ago

yuriyh commented 13 years ago

Instead of submit "single command line" it should probably be

submit command line

(and auto-completion on arguments). Users actually expect shell expansions to work, but not sure how/on what level to implement that. Ideally something like that should work:

set application jdk set executable java submit ${GRISU_EXE} grid://jobs/active/experiment1/output.txt ${HOME}/common_input.txt

output from job experiment1 is automatically attached, path to executable is calculated from mds, home directory is auto-expanded.

makkus commented 13 years ago

I don't like the

set executable java submit ${GRISU_EXE} xxx

part. Too complicated I think. But we can auto-complete for executables (based on all or package specific executables), that shouldn't be a problem.

Also, I like the ${VAR} thing. We could pass over some environment variables when executing gricli along with a script like:

java -jar gricli.sh --appInputFile=/home/markus/whatever -f gricli.script

and then, in gricli, we would submit a job like:

submit cat ${appInputFile}

That way, gricli.jar combined with a gricli script would almost be something like a commandline template that people could share. And it would even be more than a template is for the swing client, because it could be a template for a whole workflow...

makkus commented 13 years ago

I refactored the way code completion caching works. yuriyh, if you think that makes sense I can add a method to complete executables for the submit command...

yuriyh commented 13 years ago

it definitely makes sense, just make sure completion works on whole path (as sometimes executable published in MDS is not on $PATH)

vladimir-mencl-eresearch commented 13 years ago

Hi,

I would strongly support this.

The current syntax where I have to do submit "Executable Arg1 Arg2" is wrong...

To be consistent with shell syntax, it would ideally be

submit Executable Arg1 Arg2 "Filename with spaces"

Though, this might be tricky with Grisu (where the job arguments are a single string?), so I'm not pushing this hard - files with spaces in the name should be banned anyway :-)

Cheers, Vlad

On 30/06/11 22:05, yuriyh wrote:

Instead of submit "single command line" it should probably be

submit command line

(and auto-completion on arguments). Users actually expect shell expansions to work, but not sure how/on what level to implement that. Ideally something like that should work:

set application jdk set executable java submit ${GRISU_EXE} grid://jobs/active/experiment1/output.txt ${HOME}/common_input.txt

output from job experiment1 is automatically attached, path to executable is calculated from mds, home directory is auto-expanded.

Vladimir Mencl, Ph.D. E-Research Services and Systems Consultant BlueFern Computing Services University of Canterbury Private Bag 4800 Christchurch 8140 New Zealand

http://www.bluefern.canterbury.ac.nz mailto:vladimir.mencl@canterbury.ac.nz Phone: +64 3 364 3012 Mobile: +64 21 997 352 Fax: +64 3 364 3002

yuriyh commented 13 years ago

should be also check exec command in the same manner? i.e. instead of

exec "ls -lah"

it would be

exec ls -lah

makkus commented 13 years ago

Yes, that'd be good...

makkus commented 13 years ago

Tab completion for all executables takes ages, because we don't have a method in the Grisu API to get them directly, a client needs to get details for every application for every submission location. Per version! So, even if I load that on startup in the background, it takes a minute or two to populate.

Added an issue: https://github.com/grisu/grisu/issues/27

We can have tab-completion for the case when a user set an application (and maybe submission location). Then we can probably provide (without too much lag) all exes available for that context. Should I do that?

makkus commented 13 years ago

Ok, dev gricli and backend now have new code that allows for completion of executables for the current context. It also completes attached input files, which should prevent typos.

Yuriy, did you have a look at removing the "'s from submit command?