xenon-middleware / xenon-cli

Perform files and jobs operations with Xenon library from command line
http://nlesc.github.io/Xenon/
Apache License 2.0
2 stars 3 forks source link

List accounting info for all jobs #68

Open arnikz opened 4 years ago

arnikz commented 4 years ago

I'd like to query the accounting info after submitting many jobs, however,

$ xenon --version
Xenon CLI v3.0.4, Xenon library v3.0.4, Xenon cloud library v3.0.2
$ xenon scheduler gridengine --location local:// list
Job identifier  Name    State   Running Done    Error   Exit code   Information

returns an empty list. Alternatively, one must enter jobid(s) one by one using the --identifier option.

sverhoeven commented 4 years ago

The help of the list subcommand says Command without--identifierflag will only return jobs which are pending or runnning.

The Xenon library is unable to return status of a completed job without a job identifier so the Xenon CLI can not do it either.

arnikz commented 4 years ago

OK, could you then add support for multiple job IDs (e.g., using a comma-separated list) and/or an option to filter by a job status?

sverhoeven commented 4 years ago

It already does by repeating --identifier <id> for example:

docker run --detach --publish 10022:22 --name=xenon-gridengine xenonmiddleware/gridengine
ssh -p 10022 xenon@localhost
echo hostname | qsub
echo date | qsub
xenon scheduler gridengine --location ssh://localhost:10022 --user xenon --password javagat \
  list --identifier 1 --identifier 2
Job identifier  Name    State   Running Done    Error   Exit code   Information
1   STDIN   done    false   true        0   {ru_utime=0.037, ru_maxrss=3528, project=NONE, ru_idrss=0, ru_inblock=0, granted_pe=NONE, exit_status=0, ru_nivcsw=12, ru_majflt=0, iow=0.000, hostname=876a4edbaf70, mem=0.000, ru_minflt=377, qname=default, ru_msgrcv=0, ru_nswap=0, department=defaultdepartment, qsub_time=Tue Dec 10 08:16:26 2019, ru_ixrss=0, ru_msgsnd=0, maxvmem=0.000, jobname=STDIN, taskid=undefined, ru_wallclock=0, ru_nsignals=0, group=xenon, owner=xenon, arid=undefined, ru_stime=0.076, ru_nvcsw=3, io=0.000, end_time=Tue Dec 10 08:16:27 2019, cpu=0.113, failed=0, priority=0, ru_ismrss=0, start_time=Tue Dec 10 08:16:27 2019, slots=1, jobnumber=1, ru_isrss=0, ru_oublock=16, account=sge}
2   STDIN   done    false   true        0   {ru_utime=0.033, ru_maxrss=3408, project=NONE, ru_idrss=0, ru_inblock=0, granted_pe=NONE, exit_status=0, ru_nivcsw=14, ru_majflt=0, iow=0.000, hostname=876a4edbaf70, mem=0.000, ru_minflt=379, qname=default, ru_msgrcv=0, ru_nswap=0, department=defaultdepartment, qsub_time=Tue Dec 10 08:16:31 2019, ru_ixrss=0, ru_msgsnd=0, maxvmem=0.000, jobname=STDIN, taskid=undefined, ru_wallclock=0, ru_nsignals=0, group=xenon, owner=xenon, arid=undefined, ru_stime=0.081, ru_nvcsw=3, io=0.000, end_time=Tue Dec 10 08:16:32 2019, cpu=0.114, failed=0, priority=0, ru_ismrss=0, start_time=Tue Dec 10 08:16:32 2019, slots=1, jobnumber=2, ru_isrss=0, ru_oublock=16, account=sge}
arnikz commented 4 years ago

That's good, however, something shorter would be better e.g. --identifier ID1,ID2,... (list) and/or --identifier ID1..IDn.step(range). Do you agree?

sverhoeven commented 4 years ago

I can add an -i alias. For example

xenon scheduler gridengine --location ssh://localhost:10022 --user xenon --password javagat \
  list -i 1 -i 2

Parsing the identifier is problematic as a scheduler could work with any job identifier even ones including commas or dots.

arnikz commented 4 years ago

You could also have a list of IDs separated by space instead. In fact, I haven't seen a job ID consisting of other chars than numerics (except for GE array jobs).