From 6e8657912c40fc56c243f1c300e36c629ce6b6c0 Mon Sep 17 00:00:00 2001 From: guilhermesteinmuller Date: Wed, 8 Dec 2021 17:26:13 -0300 Subject: [PATCH] Drop Mesos code The coe mesos has not been maintained for quite some time and hasn't got much attention from the community in general. As discussed in the mailing list [1] we are dropping for now. [1] http://lists.openstack.org/pipermail/openstack-discuss/2021-December/026230.html Co-Authored-By: jake.yip@ardc.edu.au Change-Id: Ie7de9a37bfad6214f52d0605409e74d62a51df47 --- api-ref/source/parameters.yaml | 2 +- doc/source/admin/magnum-proxy.rst | 2 +- doc/source/user/index.rst | 2 +- magnum/api/attr_validator.py | 66 +---------------- magnum/api/validation.py | 12 ---- magnum/conductor/scale_manager.py | 2 +- magnum/conf/cluster_templates.py | 11 --- magnum/objects/fields.py | 4 +- magnum/tests/contrib/gate_hook.sh | 4 +- magnum/tests/contrib/post_test_hook.sh | 8 +-- magnum/tests/functional/python_client_base.py | 2 - .../controllers/v1/test_cluster_template.py | 4 +- magnum/tests/unit/api/test_attr_validator.py | 72 +------------------ magnum/tests/unit/objects/test_fields.py | 3 +- magnum/tests/unit/objects/test_objects.py | 2 +- .../notes/drop_mesos-DzAlnyYHjbQC6IfMq.yaml | 5 ++ 16 files changed, 20 insertions(+), 181 deletions(-) create mode 100644 releasenotes/notes/drop_mesos-DzAlnyYHjbQC6IfMq.yaml diff --git a/api-ref/source/parameters.yaml b/api-ref/source/parameters.yaml index 3163fbdbf4..8758a64666 100644 --- a/api-ref/source/parameters.yaml +++ b/api-ref/source/parameters.yaml @@ -142,7 +142,7 @@ coe: required: true description: | Specify the Container Orchestration Engine to use. Supported COEs - include ``kubernetes``, ``swarm``, ``mesos``. If your environment has + include ``kubernetes``, ``swarm``. If your environment has additional bay/cluster drivers installed, refer to the bay/cluster driver documentation for the new COE names. coe_version: diff --git a/doc/source/admin/magnum-proxy.rst b/doc/source/admin/magnum-proxy.rst index d5940ca51d..6e412112f3 100644 --- a/doc/source/admin/magnum-proxy.rst +++ b/doc/source/admin/magnum-proxy.rst @@ -3,7 +3,7 @@ Using Proxies in magnum if running under firewall ================================================= If you are running magnum behind a firewall then you may need a proxy -for using services like docker, kubernetes. Use these steps +for using services like docker and kubernetes. Use these steps when your firewall will not allow you to use those services without a proxy. diff --git a/doc/source/user/index.rst b/doc/source/user/index.rst index a54439af6f..b58ac46980 100644 --- a/doc/source/user/index.rst +++ b/doc/source/user/index.rst @@ -92,7 +92,7 @@ They are loosely grouped as: mandatory, infrastructure, COE specific. --coe \ Specify the Container Orchestration Engine to use. Supported - COE's include 'kubernetes', 'swarm'. If your environment + COE's include 'kubernetes' and 'swarm'. If your environment has additional cluster drivers installed, refer to the cluster driver documentation for the new COE names. This is a mandatory parameter and there is no default value. diff --git a/magnum/api/attr_validator.py b/magnum/api/attr_validator.py index 9a2fe753d4..46386ecd78 100644 --- a/magnum/api/attr_validator.py +++ b/magnum/api/attr_validator.py @@ -14,7 +14,6 @@ from glanceclient import exc as glance_exception from novaclient import exceptions as nova_exception -from oslo_serialization import jsonutils from magnum.api import utils as api_utils from magnum.common import clients @@ -113,64 +112,6 @@ def validate_labels(labels): validate_method(labels) -def validate_labels_isolation(labels): - """Validate mesos_slave_isolation""" - mesos_slave_isolation = labels.get('mesos_slave_isolation') - mesos_slave_isolation_list = mesos_slave_isolation.split(',') - unsupported_isolations = set(mesos_slave_isolation_list) - set( - SUPPORTED_ISOLATION) - if (len(unsupported_isolations) > 0): - raise exception.InvalidParameterValue(_( - 'property "labels/mesos_slave_isolation" with value ' - '"%(isolation_val)s" is not supported, supported values are: ' - '%(supported_isolation)s') % { - 'isolation_val': ', '.join(list(unsupported_isolations)), - 'supported_isolation': ', '.join( - SUPPORTED_ISOLATION + ['unspecified'])}) - - -def validate_labels_image_providers(labels): - """Validate mesos_slave_image_providers""" - mesos_slave_image_providers = labels.get('mesos_slave_image_providers') - mesos_slave_image_providers_list = mesos_slave_image_providers.split(',') - isolation_with_valid_data = False - for image_providers_val in mesos_slave_image_providers_list: - image_providers_val = image_providers_val.lower() - if image_providers_val not in SUPPORTED_IMAGE_PROVIDERS: - raise exception.InvalidParameterValue(_( - 'property "labels/mesos_slave_image_providers" with value ' - '"%(image_providers)s" is not supported, supported values ' - 'are: %(supported_image_providers)s') % { - 'image_providers': image_providers_val, - 'supported_image_providers': ', '.join( - SUPPORTED_IMAGE_PROVIDERS + ['unspecified'])}) - - if image_providers_val == 'docker': - mesos_slave_isolation = labels.get('mesos_slave_isolation') - if mesos_slave_isolation is not None: - mesos_slave_isolation_list = mesos_slave_isolation.split(',') - for isolations_val in mesos_slave_isolation_list: - if isolations_val == 'docker/runtime': - isolation_with_valid_data = True - if mesos_slave_isolation is None or not isolation_with_valid_data: - raise exception.RequiredParameterNotProvided(_( - "Docker runtime isolator has to be specified if 'docker' " - "is included in 'mesos_slave_image_providers' Please add " - "'docker/runtime' to 'mesos_slave_isolation' labels " - "flags")) - - -def validate_labels_executor_env_variables(labels): - """Validate executor_environment_variables""" - mesos_slave_executor_env_val = labels.get( - 'mesos_slave_executor_env_variables') - try: - jsonutils.loads(mesos_slave_executor_env_val) - except ValueError: - err = (_("Json format error")) - raise exception.InvalidParameterValue(err) - - def validate_labels_strategy(labels): """Validate swarm_strategy""" swarm_strategy = list(labels.get('swarm_strategy', "").split()) @@ -249,9 +190,4 @@ validators = {'image_id': validate_image, 'fixed_network': validate_fixed_network, 'labels': validate_labels} -labels_validators = {'mesos_slave_isolation': validate_labels_isolation, - 'mesos_slave_image_providers': - validate_labels_image_providers, - 'mesos_slave_executor_env_variables': - validate_labels_executor_env_variables, - 'swarm_strategy': validate_labels_strategy} +labels_validators = {'swarm_strategy': validate_labels_strategy} diff --git a/magnum/api/validation.py b/magnum/api/validation.py index 760a38733b..ae23603834 100755 --- a/magnum/api/validation.py +++ b/magnum/api/validation.py @@ -341,15 +341,3 @@ class SwarmValidator(Validator): swarm_default_network_driver) supported_volume_driver = ['rexray'] - - -class MesosValidator(Validator): - - supported_network_drivers = ['docker'] - supported_server_types = ['vm', 'bm'] - allowed_network_drivers = (CONF.cluster_template. - mesos_allowed_network_drivers) - default_network_driver = (CONF.cluster_template. - mesos_default_network_driver) - - supported_volume_driver = ['rexray'] diff --git a/magnum/conductor/scale_manager.py b/magnum/conductor/scale_manager.py index ee6e34197f..af878bcd76 100755 --- a/magnum/conductor/scale_manager.py +++ b/magnum/conductor/scale_manager.py @@ -28,7 +28,7 @@ def get_scale_manager(context, osclient, cluster): cluster_driver = Driver.get_driver_for_cluster(context, cluster) manager = cluster_driver.get_scale_manager(context, osclient, cluster) - # NOTE: Currently only kubernetes and mesos cluster scale managers + # NOTE: Currently only kubernetes cluster scale managers # are available. return manager diff --git a/magnum/conf/cluster_templates.py b/magnum/conf/cluster_templates.py index e48aea120f..4e1dc1fae0 100644 --- a/magnum/conf/cluster_templates.py +++ b/magnum/conf/cluster_templates.py @@ -43,17 +43,6 @@ cluster_template_opts = [ help=_("Default network driver for docker swarm " "cluster-templates."), deprecated_group='baymodel'), - cfg.ListOpt('mesos_allowed_network_drivers', - default=['all'], - help=_("Allowed network drivers for mesos cluster-templates. " - "Use 'all' keyword to allow all drivers supported " - "for mesos cluster-templates. Supported network " - "drivers include docker."), - deprecated_group='baymodel'), - cfg.StrOpt('mesos_default_network_driver', - default='docker', - help=_("Default network driver for mesos cluster-templates."), - deprecated_group='baymodel'), ] diff --git a/magnum/objects/fields.py b/magnum/objects/fields.py index 64786f8afc..7a55a601df 100644 --- a/magnum/objects/fields.py +++ b/magnum/objects/fields.py @@ -99,9 +99,9 @@ class ContainerStatus(fields.Enum): class ClusterType(fields.Enum): ALL = ( - KUBERNETES, SWARM, MESOS, DCOS, SWARM_MODE, + KUBERNETES, SWARM, SWARM_MODE, ) = ( - 'kubernetes', 'swarm', 'mesos', 'dcos', 'swarm-mode', + 'kubernetes', 'swarm', 'swarm-mode', ) def __init__(self): diff --git a/magnum/tests/contrib/gate_hook.sh b/magnum/tests/contrib/gate_hook.sh index dfb3f6d842..b4c6364bbd 100755 --- a/magnum/tests/contrib/gate_hook.sh +++ b/magnum/tests/contrib/gate_hook.sh @@ -41,9 +41,7 @@ if [[ -e /etc/ci/mirror_info.sh ]]; then source /etc/ci/mirror_info.sh fi -if [ "$coe" = "mesos" ]; then - export DEVSTACK_LOCAL_CONFIG+=$'\n'"MAGNUM_GUEST_IMAGE_URL=https://fedorapeople.org/groups/magnum/ubuntu-mesos-ocata.qcow2" -elif [ "$coe" = "k8s-coreos" ]; then +if [ "$coe" = "k8s-coreos" ]; then export DEVSTACK_LOCAL_CONFIG+=$'\n'"MAGNUM_GUEST_IMAGE_URL=http://beta.release.core-os.net/amd64-usr/current/coreos_production_openstack_image.img.bz2" elif [ "${coe}${special}" = "k8s-ironic" ]; then export DEVSTACK_LOCAL_CONFIG+=$'\n'"MAGNUM_GUEST_IMAGE_URL='https://fedorapeople.org/groups/magnum/fedora-kubernetes-ironic-latest.tar.gz'" diff --git a/magnum/tests/contrib/post_test_hook.sh b/magnum/tests/contrib/post_test_hook.sh index d40669863b..d297a0c41d 100755 --- a/magnum/tests/contrib/post_test_hook.sh +++ b/magnum/tests/contrib/post_test_hook.sh @@ -29,10 +29,7 @@ function create_test_data { coe=$1 special=$2 - if [ $coe == 'mesos' ]; then - local image_name="ubuntu.*mesos" - local container_format="bare" - elif [ $coe == 'k8s-coreos' ]; then + if [ $coe == 'k8s-coreos' ]; then local image_name="coreos" local container_format="bare" elif [ "${coe}${special}" == 'k8s-ironic' ]; then @@ -158,8 +155,7 @@ export MAGNUM_DIR="$BASE/new/magnum" sudo chown -R $USER:stack $MAGNUM_DIR # Run functional tests -# Currently we support functional-api, functional-k8s, will support swarm, -# mesos later. +# Currently we support functional-api, functional-k8s, will support swarm. echo "Running magnum functional test suite for $1" diff --git a/magnum/tests/functional/python_client_base.py b/magnum/tests/functional/python_client_base.py index 7d7cee668d..93d27d7960 100755 --- a/magnum/tests/functional/python_client_base.py +++ b/magnum/tests/functional/python_client_base.py @@ -382,8 +382,6 @@ extendedKeyUsage = clientAuth output_keys = ["swarm_primary_master", "swarm_secondary_masters", "swarm_nodes"] - elif self.cluster_template.coe == "mesos": - output_keys = ["mesos_master", "mesos_slaves"] for output in stack_outputs: for key in output_keys: diff --git a/magnum/tests/unit/api/controllers/v1/test_cluster_template.py b/magnum/tests/unit/api/controllers/v1/test_cluster_template.py index dc20796f05..db64ebac17 100644 --- a/magnum/tests/unit/api/controllers/v1/test_cluster_template.py +++ b/magnum/tests/unit/api/controllers/v1/test_cluster_template.py @@ -1138,9 +1138,9 @@ class TestPost(api_base.FunctionalTest): def test_create_cluster_with_disabled_driver(self): cfg.CONF.set_override('disabled_drivers', - ['mesos_ubuntu_v1'], + ['swarm_fedora_atomic_v1'], group='drivers') - bdict = apiutils.cluster_template_post_data(coe="mesos") + bdict = apiutils.cluster_template_post_data(coe="swarm") self.assertRaises(AppError, self.post_json, '/clustertemplates', bdict) diff --git a/magnum/tests/unit/api/test_attr_validator.py b/magnum/tests/unit/api/test_attr_validator.py index e1454d1bf7..9e43281885 100644 --- a/magnum/tests/unit/api/test_attr_validator.py +++ b/magnum/tests/unit/api/test_attr_validator.py @@ -125,76 +125,6 @@ class TestAttrValidator(base.BaseTestCase): fake_labels = {} attr_validator.validate_labels(fake_labels) - def test_validate_labels_main_isolation_invalid_label(self): - fake_labels = {'mesos_slave_isolation': 'abc'} - self.assertRaises(exception.InvalidParameterValue, - attr_validator.validate_labels, - fake_labels) - - def test_validate_labels_isolation_valid(self): - fake_labels = {'mesos_slave_isolation': - 'filesystem/posix,filesystem/linux'} - attr_validator.validate_labels_isolation(fake_labels) - - def test_validate_labels_main_with_valid_providers_none_isolation(self): - fake_labels = {'mesos_slave_image_providers': 'docker'} - self.assertRaises(exception.RequiredParameterNotProvided, - attr_validator.validate_labels, - fake_labels) - - def test_validate_labels_with_valid_providers_invalid_isolation(self): - fake_labels = {'mesos_slave_image_providers': 'docker', - 'mesos_slave_isolation': 'abc'} - self.assertRaises(exception.RequiredParameterNotProvided, - attr_validator.validate_labels_image_providers, - fake_labels) - - def test_validate_labels_with_valid_providers_invalid_providers(self): - fake_labels = {'mesos_slave_image_providers': 'appc'} - attr_validator.validate_labels_image_providers(fake_labels) - - def test_validate_labels_with_invalid_providers(self): - fake_labels = {'mesos_slave_image_providers': 'abc'} - self.assertRaises(exception.InvalidParameterValue, - attr_validator.validate_labels_image_providers, - fake_labels) - - def test_validate_labels_with_valid_providers_none_isolation(self): - fake_labels = {'mesos_slave_image_providers': 'docker'} - self.assertRaises(exception.RequiredParameterNotProvided, - attr_validator.validate_labels_image_providers, - fake_labels) - - def test_validate_labels_with_valid_providers_valid_isolation(self): - fake_labels = {'mesos_slave_image_providers': 'docker', - 'mesos_slave_isolation': 'docker/runtime'} - attr_validator.validate_labels_image_providers(fake_labels) - - def test_validate_labels_with_environment_variables_valid_json(self): - contents = '{"step": "upgrade", "interface": "deploy"}' - fack_labels = {'mesos_slave_executor_env_variables': contents} - attr_validator.validate_labels_executor_env_variables( - fack_labels) - - def test_validate_labels_with_environment_variables_bad_json(self): - fack_labels = {'mesos_slave_executor_env_variables': 'step'} - self.assertRaisesRegex( - exception.InvalidParameterValue, - "Json format error", - attr_validator.validate_labels_executor_env_variables, - fack_labels) - - def test_validate_labels_with_valid_isolation(self): - fake_labels = {'mesos_slave_isolation': - 'filesystem/posix,filesystem/linux'} - attr_validator.validate_labels_isolation(fake_labels) - - def test_validate_labels_isolation_invalid(self): - fake_labels = {'mesos_slave_isolation': 'filesystem'} - self.assertRaises(exception.InvalidParameterValue, - attr_validator.validate_labels_isolation, - fake_labels) - def test_validate_labels_strategy_valid(self): fake_labels = {'swarm_strategy': 'spread'} attr_validator.validate_labels_strategy(fake_labels) @@ -306,7 +236,7 @@ class TestAttrValidator(base.BaseTestCase): @mock.patch('magnum.api.attr_validator.validate_labels') def test_validate_os_resources_with_label(self, mock_validate_labels, mock_os_cli): - mock_cluster_template = {'labels': {'mesos_slave_isolation': 'abc'}} + mock_cluster_template = {'labels': {'swarm_strategy': 'abc'}} mock_context = mock.MagicMock() self.assertRaises(exception.InvalidParameterValue, attr_validator.validate_os_resources, mock_context, diff --git a/magnum/tests/unit/objects/test_fields.py b/magnum/tests/unit/objects/test_fields.py index 836c95906a..d41e7ba9dd 100644 --- a/magnum/tests/unit/objects/test_fields.py +++ b/magnum/tests/unit/objects/test_fields.py @@ -95,8 +95,7 @@ class TestClusterType(test_fields.TestField): super(TestClusterType, self).setUp() self.field = fields.ClusterTypeField() self.coerce_good_values = [('kubernetes', 'kubernetes'), - ('swarm', 'swarm'), - ('mesos', 'mesos'), ] + ('swarm', 'swarm'), ] self.coerce_bad_values = ['invalid'] self.to_primitive_values = self.coerce_good_values[0:1] diff --git a/magnum/tests/unit/objects/test_objects.py b/magnum/tests/unit/objects/test_objects.py index dfd573553b..3d2c9e54b5 100644 --- a/magnum/tests/unit/objects/test_objects.py +++ b/magnum/tests/unit/objects/test_objects.py @@ -356,7 +356,7 @@ class TestObject(test_base.TestCase, _TestObject): # https://docs.openstack.org/magnum/latest/contributor/objects.html object_data = { 'Cluster': '1.23-dfaf9ecb65a5fcab4f6c36497a8bc866', - 'ClusterTemplate': '1.20-85469623f678e916f26e3cb5924ae664', + 'ClusterTemplate': '1.20-ea3b06c5fdbf4a3fba0db9865cd2ba4c', 'Certificate': '1.2-64f24db0e10ad4cbd72aea21d2075a80', 'MyObj': '1.0-34c4b1aadefd177b13f9a2f894cc23cd', 'X509KeyPair': '1.2-d81950af36c59a71365e33ce539d24f9', diff --git a/releasenotes/notes/drop_mesos-DzAlnyYHjbQC6IfMq.yaml b/releasenotes/notes/drop_mesos-DzAlnyYHjbQC6IfMq.yaml new file mode 100644 index 0000000000..83863e097e --- /dev/null +++ b/releasenotes/notes/drop_mesos-DzAlnyYHjbQC6IfMq.yaml @@ -0,0 +1,5 @@ +--- +other: + - | + We are dropping mesos for the lack of support/test + and no usage from the community.