elasticslice.clients.slurm package

Submodules

elasticslice.clients.slurm.slurm module

class elasticslice.clients.slurm.slurm.KnifeWrapper(config=None)[source]

Bases: object

Define operations for interacting with Chef via the knife command line utility installed locally

__init__(config=None)[source]
bootstrap_node(node=None, run_list=None, retries=5)[source]
purge_node(node=None, retries=5)[source]
run_cmd_on_all_clients(cmd_str=None, retries=5)[source]
class elasticslice.clients.slurm.slurm.SlurmDynamicManager(server, config=None)[source]

Bases: elasticslice.managers.core.SimpleElasticSliceHelper, elasticslice.managers.core.SimpleElasticSliceManager

CM_METHODS = ['ensure_sliver', 'update_sliver_status', 'update_available', 'update_all', 'add_nodes', 'delete_nodes']
DEF_INTERVAL = 60
DEF_INTERVALS = {'update_available': 600, 'ensure_sliver': 60, 'delete_nodes': 300, 'update_sliver_status': 60, 'update_all': 86400, 'renew': 3600, 'add_nodes': 300, 'ensure_slice': 60}
DEF_MAX_THRESHOLD = 10
DEF_MIN_THRESHOLD = 1
DEF_ORDER = ['ensure_slice', 'ensure_sliver', 'update_sliver_status', 'renew', 'update_all', 'update_available', 'get_system_state', 'add_nodes', 'delete_nodes', 'set_system_state']
METHOD_RESET_TRIGGERS = {'add_nodes': ['update_sliver_status', 'update_available', 'get_system_state', 'set_system_state'], 'delete_nodes': ['update_sliver_status', 'update_available', 'get_system_state', 'set_system_state']}
__init__(server, config=None)[source]
get_add_args(count=1)[source]
get_nodenames(include_IPs=False, include_fullnames=False)[source]

This method returns a list of short (virtual) nodenames for all nodes in the experiment. It can optionally also include external (physical) nodenames, as well as internal (experiment) IP addresses.

get_system_state()[source]
handle_added_node(node, status)[source]

This method should be called by a manager when it sees that an added node has become “ready” or “failed”. @node is a dict like

{ ‘client_id’:’node-1’,’node_id’:’pc100’,...}

and @status is either ‘ready’, ‘failed’. The return value is not checked by the caller.

handle_deleted_node(node)[source]

This method should be called by a manager when it sees that an added node has become “ready” or “failed”. @node is a dict like

{ ‘client_id’:’node-1’,’node_id’:’pc100’,...}

The return value is not checked by the caller.

set_system_state()[source]
update_etc_hosts()[source]

This method updates /etc/hosts file. It adds a block of entries for all experiment nodes (obtained using the get_nodenames() funcion) at the end of the file, unless it is already there. A special marker is used to determine whether such block is present or not. This method preserves all manually entered entries before the auto-generated block.

class elasticslice.clients.slurm.slurm.SlurmScheduler(config=None)[source]

Bases: object

Define operations for interacting with the SLURM resource manager and scheduler

__init__(config=None)[source]
get_future_compute_cycles(unit='s')[source]

Sum up all future compute cycles and convert to the specified units

get_job_count()[source]
get_running_job_ids()[source]
list_pending_jobs(show_header=True)[source]
list_running_jobs(show_header=True)[source]
queue_info()[source]

Return list of dictionaries where every element is a dict

update_slurm_config(node_list=[])[source]

This method updates SLURM configuration in /etc/slurm-llnl/slurm.conf. It adds an auto-generated block with lines such as “NodeName=” and “PartitionName=” with all current experiment nodes at the end of the file, unless they such block is already there. A special marker is used to determine whether such lines are present or not. This method preserves all lines that exist in the file before this block.

Arguments: node_list – list of short (virtual) nodenames to be added in SLURM config; if empty, the method does nothing

Module contents