dragon.infrastructure.process_desc

A class that uniquely defines properties of a managed Process for infrastructure communication.

Functions

mk_argmode_from_default(mode)

Populate and return the mode of arguments as per the ArgMode

Classes

ArgMode

Enum for mode of delivering the arguments, either process will be using the channel (or) to deliver the argdata directly

ProcessDescriptor

Globally available description of a managed process.

ProcessOptions

Open type, placeholder, for options on how to launch a process

class ArgMode

Bases: Enum

Enum for mode of delivering the arguments, either process will be using the channel (or) to deliver the argdata directly

NONE = 0
PYTHON_IMMEDIATE = 1
PYTHON_CHANNEL = 2
mk_argmode_from_default(mode)

Populate and return the mode of arguments as per the ArgMode

Returns:

Mode of delivering the arguments for the launching process

Return type:

ArgMode Enum

class ProcessDescriptor

Bases: object

Globally available description of a managed process.

Attributes:

ecodeint or None

exit code of the process, or None if still running

nodenonnegative int

which node of the allocation this process is/was on

namestr

user assigned unique name of the process

p_uidnonnegative int

unique process id

p_p_uidnonnegative int

parent process unique id

live_children : set of nonnegative int

gs_ret_cuidnonnegative int

c_uid of the global services return channel

shep_ret_cuidnonnegative int

c_uid of the local shepherd return channel (currently not used)

stateProcessDescriptor.State enum member

current run state of this process

stdin_sdesc : a serialized channel where the stdin of the process can be provided.

stdout_sdesc : a serialized channel where the stdout of the process is written.

stderr_sdesc : a serialized channel where the stderr of the process is written.

class State

Bases: Enum

Current state of the process.

PENDING = 1
ACTIVE = 2
DEAD = 3
__init__(*, p_uid, p_p_uid, name, node, h_uid=None, live_children=None, gs_ret_cuid=None, shep_ret_cuid=None, state=None, ecode=None, stdin_sdesc=None, stdout_sdesc=None, stderr_sdesc=None)
get_sdict()

Collect the entire information of the process.

Returns:

A dictionary with all key-value pairs of the available information of the process.

Return type:

Dictionary

classmethod from_sdict(sdict)

Returns the descriptor of the launched process.

class ProcessOptions

Bases: object

Open type, placeholder, for options on how to launch a process

Attributes:

argdata

argument data, bytes to deliver to the launching process

mode

mode of delivering the arguments, either process will be using the channel (or) to deliver the argdata directly

make_inf_channels

bool, default False, whether process should start making the infrastructure channels when they are needed, or just start the process directly.

__init__(make_inf_channels=False, mode=None, argdata=None)
get_sdict()

Collect the different attributes/options of launching the process.

Returns:

A dictionary with key-value pairs of the process options.

Return type:

Dictionary

static from_sdict(sdict)

Returns the options of the launched process.