This class represents a single compute node in a StarCluster.
It contains all useful metadata for the node such as the
internal/external hostnames, ips, etc. as well as a paramiko ssh object
for executing commands, creating/modifying files on the node.
'key_location' arg is a string that contains the full path to the
private key corresponding to the keypair used to launch this node
'alias' keyword arg optionally names the node. If no alias is
provided, the alias is retrieved from the node's user_data based on the
node's launch index
|
__init__(self,
instance,
key_location,
alias=None,
user=' root ' )
x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
add_user_to_group(self,
user,
group)
Add user (if exists) to group (if exists) |
source code
|
|
|
get_group_map(self,
key_by_gid=False)
Returns dictionary where keys are remote group names and values are
grp.struct_grp objects from the standard grp module |
source code
|
|
|
get_user_map(self,
key_by_uid=False)
Returns dictionary where keys are remote usernames and values are
pwd.struct_passwd objects from the standard pwd module |
source code
|
|
|
getgrgid(self,
gid)
Remote version of the getgrgid method in the standard grp module |
source code
|
|
|
getgrnam(self,
groupname)
Remote version of the getgrnam method in the standard grp module |
source code
|
|
|
getpwuid(self,
uid)
Remote version of the getpwuid method in the standard pwd module |
source code
|
|
|
getpwnam(self,
username)
Remote version of the getpwnam method in the standard pwd module |
source code
|
|
|
add_user(self,
name,
uid=None,
gid=None,
shell=' bash ' )
Add a user to the remote system. |
source code
|
|
|
generate_key_for_user(self,
username,
ignore_existing=False,
auth_new_key=False,
auth_conn_key=False)
Generates an id_rsa/id_rsa.pub keypair combo for a user on the remote
machine. |
source code
|
|
|
|
|
remove_from_known_hosts(self,
username,
nodes)
Remove all network names for nodes from username's known_hosts file
on this Node |
source code
|
|
|
enable_passwordless_ssh(self,
username,
nodes)
Configure passwordless ssh for user between this Node and nodes |
source code
|
|
|
copy_remote_file_to_node(self,
remote_file,
node,
dest=None) |
source code
|
|
|
copy_remote_file_to_nodes(self,
remote_file,
nodes,
dest=None)
Copies a remote file from this Node instance to another Node instance
without passwordless ssh between the two. |
source code
|
|
|
remove_user(self,
name)
Remove a user from the remote system |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
mount_device(self,
device,
path)
Mount device to path |
source code
|
|
|
add_to_etc_hosts(self,
nodes)
Adds all names for node in nodes arg to this node's /etc/hosts file |
source code
|
|
|
remove_from_etc_hosts(self,
nodes)
Remove all network names for node in nodes arg from this node's
/etc/hosts file |
source code
|
|
|
|
|
detach_external_volumes(self)
Detaches all volumes returned by self.attached_vols |
source code
|
|
|
delete_root_volume(self)
Detach and destroy EBS root volume (EBS-backed node only) |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
start(self)
Starts EBS-backed instance and puts it in the 'running' state. |
source code
|
|
|
stop(self)
Shutdown EBS-backed instance and put it in the 'stopped' state. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
shell(self,
user=None)
Attempts to launch an interactive shell by first trying the system's
ssh client. |
source code
|
|
|
get_hosts_entry(self)
Returns /etc/hosts entry for this node |
source code
|
|
|
apt_command(self,
cmd)
Run an apt-get command with all the necessary options for
non-interactive use (DEBIAN_FRONTEND=interactive, -y, --force-yes,
etc) |
source code
|
|
|
|
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|