flux.cli.base module

class flux.cli.base.BatchAllocCmd(prog, usage=None, description=None, exclude_io=True)

Bases: MiniCmd

init_common(args)

Common initialization code for batch/alloc

jobspec_create(args)

Create a jobspec from args and return it to caller

update_jobspec_common(args, jobspec)

Common jobspec update code for batch/alloc

class flux.cli.base.BeginTimeAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)

Bases: Action

Convenience class to handle --begin-time file option

Append --begin-time options to the "dependency" list in namespace

class flux.cli.base.ConfAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)

Bases: Action

Handle batch/alloc --conf option

class flux.cli.base.EnvFileAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)

Bases: Action

Convenience class to handle --env-file option

Append --env-file options to the "env" list in namespace, with "^" prepended to the rule to indicate further rules are to be read from the indicated file.

This is required to preserve ordering between the --env and --env-file and --env-remove options.

class flux.cli.base.EnvFilterAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)

Bases: Action

Convenience class to handle --env-remove option

Append --env-remove options to the "env" list in namespace, with "-" prepended to the option argument.

This is required to preserve ordering between the --env and --env-remove options.

class flux.cli.base.MiniCmd(prog, usage=None, description=None, exclude_io=False)

Bases: object

MiniCmd is the base class for all flux submission subcommands

static create_parser(prog, usage=None, description=None, exclude_io=False, add_help=True)

Create default parser with args for submission subcommands :param prog: program name in usage output :type prog: str :param usage: usage string, by default

{prog} [OPTIONS...] COMMAND [ARGS...]

Parameters

description (str, optional) -- short description of command to follow usage. May be multiple lines.

get_parser()
init_jobspec(args)

Return initialized jobspec. This is an abstract method which must be provided by each base class

jobspec_create(args)

Create a jobspec from args and return it to caller

run_command()

Convenience method containing common code to run a command derived from the MiniCmd base class.

This function reopens standard output and error in a mode suitable for utf8 output, initializes the command's ArgParse parser, parses command line arguments and finally executes self.main(args).

submit(args, jobspec=None)
submit_async(args, jobspec=None)

Submit job, constructing jobspec from args unless jobspec is not None. Returns a SubmitFuture.

class flux.cli.base.SubmitBaseCmd(prog, usage=None, description=None)

Bases: MiniCmd

SubmitBaseCmd is an abstract class with shared code for job submission

init_jobspec(args)

Return initialized jobspec. This is an abstract method which must be provided by each base class

run_and_exit()
class flux.cli.base.SubmitBulkCmd(prog, usage=None, description=None)

Bases: SubmitBaseCmd

SubmitBulkCmd adds options for submitting copies of jobs, watching progress of submission, and waiting for job completion to the SubmitBaseCmd class

static cc_list(args)

Return a list of values representing job copies given by --cc/--bcc

jobs_per_sec()
main(args)
openlog(filename)
progress_start(args, total)

Initialize job submission progress bar if user requested --progress without --wait or --watch

progress_update(jobinfo=None, submit=False, submit_failed=False)

Update submission progress bar if one was requested

submit_async_with_cc(args, cclist=None)

Asynchronously submit jobs, optionally submitting a copy of each job for each member of a cc-list. If the cclist is not passed in to the method, then one is created from either --cc or --bcc options.

submit_cb(future, args, label='')
watcher_start(args)
class flux.cli.base.Xcmd(args, inputs=None, **kwargs)

Bases: object

Represent a Flux job with mutable command and option args

class Xinput(arg, methods)

Bases: object

A string class with convenient attributes for formatting args

This class represents a string with special attributes specific for use on the bulksubmit command line, e.g.:

{0.%}    : the argument without filename extension
{0./}    : the argument basename
{0.//}   : the argument dirname
{0./%}   : the basename without filename extension
{0.name} : the result of dynamically assigned method "name"
mutable_args = {'bank': '-B', 'bcc': '--bcc=', 'begin_time': '--begin-time=', 'cc': '--cc=', 'cores': '--cores=', 'cores_per_task': '-c', 'cwd': '--cwd=', 'dependency': '--dependency=', 'env': '--env=', 'env_file': '--env-file=', 'env_remove': '--env-remove=', 'error': '--error=', 'flags': '--flags=', 'gpus_per_node': '--gpus-per-node=', 'gpus_per_task': '-g', 'input': '--input=', 'job_name': '--job-name=', 'log': '--log=', 'log_stderr': '--log-stderr=', 'nodes': '-N', 'ntasks': '-n', 'output': '--output=', 'queue': '-q', 'requires': '--requires=', 'setattr': '--setattr=', 'setopt': '-o ', 'signal': '--signal=', 'taskmap': '--taskmap=', 'tasks_per_core': '--tasks-per-core=', 'tasks_per_node': '--tasks-per-node=', 'time_limit': '-t', 'urgency': '--urgency=', 'wait': '--wait-event='}
static preserve_mustache(val)

Preserve any mustache template in value 'val'

static restore_mustache(val)

Restore any mustache template in value 'val'