Package starcluster :: Module config :: Class StarClusterConfig
[hide private]
[frames] | no frames]

Class StarClusterConfig

source code


Loads StarCluster configuration settings defined in config_file which defaults to ~/.starclustercfg

Settings are available as follows:

cfg = StarClusterConfig() or cfg = StarClusterConfig('/path/to/my/config.cfg') cfg.load() aws_info = cfg.aws cluster_cfg = cfg.clusters['mycluster'] key_cfg = cfg.keys['gsg-keypair'] print cluster_cfg

Instance Methods [hide private]
 
__init__(self, config_file=None, cache=False)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_get_urlfp(self, url) source code
 
_get_fp(self, config_file) source code
 
_get_bool(self, config, section, option) source code
 
_get_int(self, config, section, option) source code
 
_get_string(self, config, section, option) source code
 
__load_config(self)
Populates self._config with a new ConfigParser instance
source code
 
reload(self)
Reloads the configuration file
source code
 
load_settings(self, section_name, settings, store) source code
 
check_required(self, section_name, settings, store) source code
 
load_defaults(self, settings, store) source code
 
load_extends_variables(self, section_name, store) source code
 
load_keypairs(self, section_name, store) source code
 
load_volumes(self, section_name, store) source code
 
load_plugins(self, section_name, store) source code
 
load(self) source code
 
get_aws_from_environ(self)
Returns AWS credentials defined in the user's shell environment.
source code
 
get_aws_credentials(self)
Returns AWS credentials defined in the configuration file.
source code
 
get_cluster_names(self) source code
 
get_cluster_template(self, template_name, tag_name=None)
Returns Cluster instance configured with the settings in the config file.
source code
 
get_default_cluster_template(self, tag_name=None)
Returns the cluster template with "DEFAULT=True" in the config If more than one found, raises MultipleDefaultTemplates exception.
source code
 
get_clusters(self) source code
 
get_plugin(self, plugin) source code
 
get_key(self, keyname) source code
 
get_easy_s3(self)
Factory for EasyEC2 class that attempts to load AWS credentials from the StarCluster config file.
source code
 
get_easy_ec2(self)
Factory for EasyEC2 class that attempts to load AWS credentials from the StarCluster config file.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  global_settings = {'DEFAULT_TEMPLATE': (<type 'str'>, False, N...
  aws_settings = {'AWS_ACCESS_KEY_ID': (<type 'str'>, True, None...
  key_settings = {'KEY_LOCATION': (<type 'str'>, True, None)}
  volume_settings = {'DEVICE': (<type 'str'>, False, None), 'MOU...
  plugin_settings = {'SETUP_CLASS': (<type 'str'>, True, None)}
  cluster_settings = {'AVAILABILITY_ZONE': (<type 'str'>, False,...
  instance_types = {'c1.medium': 'i386', 'c1.xlarge': 'x86_64', ...
Properties [hide private]
  config

Inherited from object: __class__

Method Details [hide private]

__init__(self, config_file=None, cache=False)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

get_aws_credentials(self)

source code 

Returns AWS credentials defined in the configuration file. Defining any of the AWS settings in the environment overrides the configuration file.

get_cluster_template(self, template_name, tag_name=None)

source code 

Returns Cluster instance configured with the settings in the config file.

template_name is the name of a cluster section defined in the config

tag_name, if specified, will be passed to Cluster instance as cluster_tag

get_default_cluster_template(self, tag_name=None)

source code 

Returns the cluster template with "DEFAULT=True" in the config If more than one found, raises MultipleDefaultTemplates exception. If no cluster template has "DEFAULT=True", raises NoDefaultTemplateFound exception.

get_easy_s3(self)

source code 

Factory for EasyEC2 class that attempts to load AWS credentials from the StarCluster config file. Returns an EasyS3 object if successful.

get_easy_ec2(self)

source code 

Factory for EasyEC2 class that attempts to load AWS credentials from the StarCluster config file. Returns an EasyEC2 object if successful.


Class Variable Details [hide private]

global_settings

Value:
{'DEFAULT_TEMPLATE': (<type 'str'>, False, None),
 'ENABLE_EXPERIMENTAL': (<type 'bool'>, False, False)}

aws_settings

Value:
{'AWS_ACCESS_KEY_ID': (<type 'str'>, True, None),
 'AWS_EC2_PATH': (<type 'str'>, False, None),
 'AWS_IS_SECURE': (<type 'bool'>, False, None),
 'AWS_PORT': (<type 'int'>, False, None),
 'AWS_REGION_HOST': (<type 'str'>, False, None),
 'AWS_REGION_NAME': (<type 'str'>, False, None),
 'AWS_S3_PATH': (<type 'str'>, False, None),
 'AWS_SECRET_ACCESS_KEY': (<type 'str'>, True, None),
...

volume_settings

Value:
{'DEVICE': (<type 'str'>, False, None),
 'MOUNT_PATH': (<type 'str'>, True, None),
 'PARTITION': (<type 'int'>, False, 1),
 'VOLUME_ID': (<type 'str'>, True, None)}

cluster_settings

Value:
{'AVAILABILITY_ZONE': (<type 'str'>, False, None),
 'CLUSTER_SHELL': (<type 'str'>, False, 'bash'),
 'CLUSTER_SIZE': (<type 'int'>, True, None),
 'CLUSTER_USER': (<type 'str'>, False, 'sgeadmin'),
 'EXTENDS': (<type 'str'>, False, None),
 'KEYNAME': (<type 'str'>, True, None),
 'MASTER_IMAGE_ID': (<type 'str'>, False, None),
 'MASTER_INSTANCE_TYPE': (<type 'str'>, False, None),
...

instance_types

Value:
{'c1.medium': 'i386',
 'c1.xlarge': 'x86_64',
 'm1.large': 'x86_64',
 'm1.small': 'i386',
 'm1.xlarge': 'x86_64',
 'm2.2xlarge': 'x86_64',
 'm2.4xlarge': 'x86_64'}

Property Details [hide private]

config

Get Method:
unreachable.config(self)