Deprecate the Direct Engine

Add deprecation warning at sahara startup and during each cluster
operation with direct engine. Also add documentation about direct engine
deprecation.

Implements blueprint: deprecate-direct-engine

Change-Id: Ic478918834d3627557b0ba43873e37d9e6ff7dc9
This commit is contained in:
Vitaly Gridnev 2015-04-15 12:35:21 +03:00
parent 29488d6e1f
commit 101f51388b
4 changed files with 41 additions and 10 deletions

View File

@ -195,23 +195,25 @@ in the ``[oslo_messaging_qpid]`` section:
Orchestration configuration Orchestration configuration
--------------------------- ---------------------------
By default sahara is configured to use the direct engine for instance By default sahara is configured to use the heat engine for instance
creation. This engine makes calls directly to the services required creation. The heat engine uses the Openstack Orchestration service to
for instance provisioning. Sahara can be configured to use the OpenStack provision instances. Sahara can be configured to use the direct engine for
Orchestration service for this task instead of the direct engine. this purpose, but after the Liberty release it will be removed. This
engine makes calls directly to the services required for instance
provisioning. We recommend using the Openstack Orchestration service.
To configure sahara to utilize the Orchestration service for instance To configure sahara to use the direct engine for instance
provisioning the ``infrastructure_engine`` parameter should be modified in provisioning the ``infrastructure_engine`` parameter should be modified in
the configuration file as follows: the configuration file as follows:
.. sourcecode:: cfg .. sourcecode:: cfg
[DEFAULT] [DEFAULT]
infrastructure_engine=heat infrastructure_engine=direct
There is feature parity between the direct and heat infrastructure .. warning::
engines. We recommend using the heat engine for provisioning as the The direct engine will be removed after the Liberty release, we
direct is planned for deprecation. recommend using the heat engine.
.. _policy-configuration-label: .. _policy-configuration-label:

View File

@ -119,3 +119,17 @@ should be placed in the same directory as the sahara configuration file or
specified using the ``policy_file`` parameter. For more details about the specified using the ``policy_file`` parameter. For more details about the
policy file please see the policy file please see the
:ref:`policy section in the configuration guide <policy-configuration-label>`. :ref:`policy section in the configuration guide <policy-configuration-label>`.
Kilo -> Liberty
---------------
Direct engine deprecation
+++++++++++++++++++++++++
In the Liberty release the direct infrastructure engine has been deprecated
and the heat infrastructure engine is now default. This means, that it is preferable
to use heat engine instead now. In the Liberty release you can continue to
operate clusters with the direct engine (create, delete, scale). Using heat engine only
the delete operation is available on clusters that were created by the direct engine.
After the Liberty release the direct engine will be removed, this means that you will
only be able to delete clusters created with the direct engine.

View File

@ -31,6 +31,7 @@ from sahara.api import v11 as api_v11
from sahara import config from sahara import config
from sahara import context from sahara import context
from sahara.i18n import _LI from sahara.i18n import _LI
from sahara.i18n import _LW
from sahara.openstack.common import systemd from sahara.openstack.common import systemd
from sahara.plugins import base as plugins_base from sahara.plugins import base as plugins_base
from sahara.service import api as service_api from sahara.service import api as service_api
@ -50,7 +51,7 @@ opts = [
cfg.StrOpt('os_region_name', cfg.StrOpt('os_region_name',
help='Region name used to get services endpoints.'), help='Region name used to get services endpoints.'),
cfg.StrOpt('infrastructure_engine', cfg.StrOpt('infrastructure_engine',
default='direct', default='heat',
help='An engine which will be used to provision ' help='An engine which will be used to provision '
'infrastructure for Hadoop cluster.'), 'infrastructure for Hadoop cluster.'),
cfg.StrOpt('remote', cfg.StrOpt('remote',
@ -179,6 +180,11 @@ def _get_infrastructure_engine():
LOG.debug("Infrastructure engine {engine} is loading".format( LOG.debug("Infrastructure engine {engine} is loading".format(
engine=CONF.infrastructure_engine)) engine=CONF.infrastructure_engine))
if CONF.infrastructure_engine == "direct":
LOG.warning(_LW("Direct infrastructure engine is deprecated in Liberty"
" release and will be removed after that release."
" Use Heat infrastructure engine instead."))
return _load_driver('sahara.infrastructure.engine', return _load_driver('sahara.infrastructure.engine',
CONF.infrastructure_engine) CONF.infrastructure_engine)

View File

@ -40,11 +40,18 @@ LOG = logging.getLogger(__name__)
SSH_PORT = 22 SSH_PORT = 22
def _warning_logger():
LOG.warning(_LW("Direct infrastructure engine is deprecated in Liberty"
" release and will be removed after that release."
" Use Heat infrastructure engine instead."))
class DirectEngine(e.Engine): class DirectEngine(e.Engine):
def get_type_and_version(self): def get_type_and_version(self):
return "direct.1.0" return "direct.1.0"
def create_cluster(self, cluster): def create_cluster(self, cluster):
_warning_logger()
ctx = context.ctx() ctx = context.ctx()
self._update_rollback_strategy(cluster, shutdown=True) self._update_rollback_strategy(cluster, shutdown=True)
@ -75,6 +82,7 @@ class DirectEngine(e.Engine):
self._update_rollback_strategy(cluster) self._update_rollback_strategy(cluster)
def scale_cluster(self, cluster, node_group_id_map): def scale_cluster(self, cluster, node_group_id_map):
_warning_logger()
ctx = context.ctx() ctx = context.ctx()
cluster = g.change_cluster_status(cluster, "Scaling: Spawning") cluster = g.change_cluster_status(cluster, "Scaling: Spawning")
@ -110,6 +118,7 @@ class DirectEngine(e.Engine):
return instance_ids return instance_ids
def rollback_cluster(self, cluster, reason): def rollback_cluster(self, cluster, reason):
_warning_logger()
rollback_info = cluster.rollback_info or {} rollback_info = cluster.rollback_info or {}
self._update_rollback_strategy(cluster) self._update_rollback_strategy(cluster)