Jump to: navigation, search

Difference between revisions of "Sahara/PluggableProvisioning/PluginAPI"

(Config)
(сonfig)
Line 55: Line 55:
 
* Each plugin may have different names for the same processes.
 
* Each plugin may have different names for the same processes.
  
==== Config ====
+
==== сonfig ====
  
 
{| class="wikitable"
 
{| class="wikitable"

Revision as of 10:09, 23 May 2013

Plugin API

get_versions()

Returns all versions of Hadoop that could be used with the plugin. It is responsibility of the plugin to make sure that all required images for each hadoop version are available, as well as configs and whatever else that plugin needs to create the Hadoop cluster.
Returns: list of strings - Hadoop versions
Example Return Value: (“Apache Hadoop 1.1.1”, “CDH 3”, “HDP 1.2”)

get_configs(hadoop_version)

Lists all configs supported by plugin with descriptions, defaults and targets for which this config is applicable.
Returns: list of configs
Example Return Value: ((“heap size”, “512”, true, “jt”))

get_node_processes(hadoop_version)

Lists of all supported node_processes for a given Hadoop version.
Returns: list of strings - node processes
Example Return Value: (“jt”, “nn”, “tt”, “dt”)

convert(cluster, file)

Provides plugin with ability to create cluster based on plugin-specific config. Savanna expects plugin to fill in all the required fields. See “Cluster Lifecycle for Config File Mode” section below for clarification.

validate_cluster(cluster)

Validates a given cluster object. Returns empty list if it is correct. Otherwise for each incorrect field the method should return validation_error with meaningful content.
Returns: list of validation_errors
Example Return Value: ((“heap size”), (“Heap size is a required field and must be specified”), (“mapred.task.timeout”, “The parameter must be int”))

update_infra(cluster)'

Plugin has a chance to change cluster description here. Specifically, plugin
  • must specify image for VMs
  • could change VMs specs in any way it needs.
For instance, plugin can ask for additional VMs for the management tool.
Returns: None

configure_cluster(cluster)

Configures cluster on provisioned by savanna VMs. In this function plugin should perform all actions like adjusting OS, installing required packages (including Hadoop, if needed), configuring Hadoop, etc.
Returns: None

start_cluster(cluster)

Start already configured cluster. This method is guaranteed to be called only on cluster which was already prepared with configure_cluster(...) call.
Returns: None

scale_cluster(cluster, remaining_vm_specs, new_vm_specs, delete_vm_specs)

To be changed
Scales cluster - adds/removes nodes to/from active cluster. This function should configure new nodes and attach them to cluster. Additionally here plugin can make some cleanup on VMs that will be deleted.
Returns: None

on_terminate_cluster(cluster)

When user terminates cluster, Savanna simply shuts down all the cluster VMs. This method is guaranteed to be invoked before that, allowing plugin to do some clean-up.
Returns: None

Object Model

Here is a description of all the objects involved in the API. Notes:

  • cluster and node_group have ‘extra’ field allowing plugin to persist any complementary info about the cluster.
  • node_process is just a process that runs at some node in cluster. Example list of node processes:
  1. jobtracker
  2. namenode
  3. tasktracker
  4. datanode
  • Each plugin may have different names for the same processes.

сonfig

Name Type Constraints Description
name string
description string
type enum possible values are: 'string', 'integer', 'boolean'
default_value same as 'type'
is_optional boolean
applicable_target string The target could be either a node_process, ‘node’ or ‘cluster’

user_input

Value provided by user for a specific config.

Name Type Constraints Description
config object a config object for which this user_input is provided
value string a value provided by the user for the config


instance

An instance created for the cluster

Name Type Constraints Description
id string
ip string
credentials
extra


node_group

Specifies group of nodes within a cluster.

Name Type Constraints Description
name string helps uniquely identify the node_group
image string image ID from Glance. All instances from this node_group are launched from this image
flavor string OpenStack’s flavor which is applied to all instances from this node_group
node_processes list of strings list of node processes which run on all nodes of this node_group
node_configs list of user_inputs list of configs provided by user. The configs either are for node processes running on this group or they are for general node configuration
anti_affinity_group that parameter will be used to control node placement for DN nodes. TBD
count int number of instances in that group
instances list of instances list of created instances
vm_requirements
extra


cluster

Contains all relevant info about cluster. This object is is provided to the plugin for both cluster creation and scaling. The “Cluster Lifecycle” section below further specifies which fields are filled at which moment

Name Type Constraints Description
name string
plugin string
hadoop_version string
default_image string Glance image ID specified by user. Plugin could use it as a base image for cluster nodes
cluster_configs list of user_inputs list of cluster-wide configs
node_groups list of node_groups
extra


validation_error

Describes what is wrong with one of the values provided by user.

Name Type Constraints Description
config_name string
error_message string