New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to submit a single command like sge_batch #35
Comments
Do we want to encourage people to rely on the old sge_batch paradigm? I'd be okay with a basic wrapper that allows qbatch to replace for this application, using the default qbatch settings (modified by environment) but not any argument passing. |
Do we want to encourage people to rely on the old sge_batch paradigm?
I do see how it's useful. Even without sge_batch, there are people that
use fsl_sub in the same way.
I'd be okay with a basic wrapper that allows qbatch to replace for
this application, using the default qbatch settings (modified by
environment) but not any argument passing.
Yeah, I agree. I'll leave this for post 1.0 though.
|
Do we have a name for this command? Pretty sure I can hack a bash wrapper really easily.. |
Hmm.. What about Are you thinking of doing: |
yes, that is indeed what I'm thinking, I agree, it doesn't seem like it's worth it, but if it can attract users who have that workflow, might as well offer it. |
There's an ambiguity here: with a single positional argument it's unclear whether the argument is a file of commands or a command itself, e.g. What about a "subcommand" to disambiguate:
e.g. Alternatively, we could use the double dash (--) separator as indicating that the user is submitting a command to run, not a file. eg. |
I'm all for using the -- version as this is common in other unix things. I'm sure I've used this before in argparse but couldn't find it so resorted http://stackoverflow.com/questions/25872515/python-argparse-treat-arguments-in-different-ways On 29 May 2016 at 21:43, Jon Pipitone notifications@github.com wrote:
|
Another very interesting option is docopt, I've used it a few times when On 30 May 2016 at 06:25, Andrew Janke a.janke@gmail.com wrote:
|
Absolutely love docopt. I didn't go with it because I wanted the flexibility of argparse and to avoid the added dependency. Neither are very strong reasons but docopt wouldn't help us here I don't think ; we'd still need to handle parsing ambiguities ourselves. In any case a +1 for --. I'll try it out and we can see what it's like in practice.
|
I've got something cooking over in https://github.com/pipitone/qbatch/tree/fix_single_command_submit It works, but:
In the meantime, you can use this bash wrapper: #!/bin/bash
# Submits a single command to qbatch (like sge_batch)
#
# Usage:
# qbatchsub.sh [qbatch options] -- command [options]
#
# For example,
# qbatchsub -o '-l walltime=30:00' --ppj 8 -- ./process.sh "hello world"
#
# This submits the command "./process.sh 'hello world'"
qbatch_args=()
cmd=()
dashdash_unseen="no"
while [[ $# > 0 ]]; do
if [[ $1 = "--" ]]; then
dashdash_unseen="yes"
elif [[ ${dashdash_unseen} = "no" ]]; then
qbatch_args+=("$1")
else
cmd+=( $(printf '%q' "$1") )
fi
shift;
done
echo "${cmd[@]}" | qbatch "${qbatch_args[@]}" - |
Hey @andrewjanke see implementation in #157 |
I like!
More reasons to dump my old perl script.
…On Thu, 26 Apr 2018 at 11:52, Gabriel A. Devenyi ***@***.***> wrote:
Hey @andrewjanke <https://github.com/andrewjanke> see implementation in
#157 <#157>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#35 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AATwivif27gPhPI4Iln1NLPOS1Rryc3Hks5tsShugaJpZM4HqaFT>
.
|
Great. can you do a quick look over and see if there's any other show stopping features you need? If so, open or poke some issues |
Fixed in #164 |
sge_batch
has the handy feature of being able to stick a call to it in front of a command line and that command gets submitted to the queue, like so:Should
qbatch
have this feature so that it can be a drop-in replacement?It will likely be annoying to make argparse handle this case, but I can think of a few other ways to achieve this same feature:
qbatch
, e.g.echo 'echo "hello world"' | qbatch -
. It works, but it's unwieldy.qbatch
as above. We may have to be a little clever if we also want users to be able to pass arguments toqbatch
.The text was updated successfully, but these errors were encountered: