Reduce memory consumption of gate tests

Recently, the gate jobs took too long to complete (between 2 to 8
hours). The reason is jenkins slave agent die during the test, which
cause the CI to re-start the whole test in a new VM.

The failure mainly occurred at magnum-api pipeline, but also occurred
at other pipelines. In term of distribution of test nodes, this
failure mainly occurred at OVH nodes, in which there is no dedicated
swap device. As a result, at OVH nodes, local disk is used for swap
when memory is over-consuming. It looks this leads to resource
starvation, which cause the failure.

This patch attempted to reduce the memory consumption of the gate
tests. In the api test, the number of worker nodes was reduced from
2 to 1. In all tests (api/k8s/swarm/mesos), the memory of worker node
was reduced from 1G to 512M.

Closes-Bug: #1542386
Change-Id: If7822d07f95ebc935a8763b92f038f10cf07b5ca
This commit is contained in:
Hongbin Lu 2016-02-05 18:53:34 -05:00 committed by Corey O'Brien
parent 7ebad29899
commit dca02f1d98
7 changed files with 28 additions and 7 deletions

View File

@ -44,6 +44,7 @@ Create the necessary keypair and flavor::
source /opt/stack/devstack/openrc admin admin
nova keypair-add --pub-key ~/.ssh/id_rsa.pub default
nova flavor-create m1.magnum 100 1024 8 1
nova flavor-create m1.magnum2 200 512 8 1
source /opt/stack/devstack/openrc demo demo
nova keypair-add --pub-key ~/.ssh/id_rsa.pub default

View File

@ -14,4 +14,5 @@ pass = password
image_id = fedora-21-atomic-5
nic_id = public
keypair_id = default
flavor_id = m1.magnum
flavor_id = m1.magnum2
master_flavor_id = m1.magnum

View File

@ -56,7 +56,8 @@ region_name = $OS_REGION_NAME
image_id = $IMAGE_ID
nic_id = $NIC_ID
keypair_id = default
flavor_id = m1.magnum
flavor_id = m1.magnum2
master_flavor_id = m1.magnum
copy_logs = true
EOF
@ -95,6 +96,7 @@ function add_flavor {
# Create magnum specific flavor for use in functional tests.
echo_summary "Create a flavor"
nova flavor-create m1.magnum 100 1024 8 1
nova flavor-create m1.magnum2 200 512 8 1
}
if ! function_exists echo_summary; then
@ -145,7 +147,8 @@ if [[ "api" == "$coe" ]]; then
iniset $BASE/new/tempest/etc/tempest.conf magnum image_id $IMAGE_ID
iniset $BASE/new/tempest/etc/tempest.conf magnum nic_id $NIC_ID
iniset $BASE/new/tempest/etc/tempest.conf magnum keypair_id default
iniset $BASE/new/tempest/etc/tempest.conf magnum flavor_id m1.magnum
iniset $BASE/new/tempest/etc/tempest.conf magnum flavor_id m1.magnum2
iniset $BASE/new/tempest/etc/tempest.conf magnum master_flavor_id m1.magnum
# show tempest config with magnum
cat etc/tempest.conf

View File

@ -91,6 +91,12 @@ class Config(object):
def set_magnum_url(cls, config):
cls.magnum_url = CONF.magnum.get('magnum_url', None)
@classmethod
def set_master_flavor_id(cls, config):
if 'master_flavor_id' not in CONF.magnum:
raise Exception('config missing master_flavor_id key')
cls.master_flavor_id = CONF.magnum.master_flavor_id
@classmethod
def setUp(cls):
cls.set_admin_creds(config)
@ -105,3 +111,4 @@ class Config(object):
cls.set_keypair_id(config)
cls.set_flavor_id(config)
cls.set_magnum_url(config)
cls.set_master_flavor_id(config)

View File

@ -181,7 +181,8 @@ def valid_swarm_baymodel():
return baymodel_data(image_id=config.Config.image_id,
fixed_network="192.168.0.0/24",
flavor_id=config.Config.flavor_id, public=False,
dns_nameserver="8.8.8.8", master_flavor_id=None,
dns_nameserver="8.8.8.8",
master_flavor_id=config.Config.master_flavor_id,
keypair_id=config.Config.keypair_id, coe="swarm",
docker_volume_size=3, cluster_distro=None,
ssh_authorized_key=None, external_network_id="public",
@ -223,7 +224,7 @@ def bay_data(name=data_utils.rand_name('bay'),
return model
def valid_bay_data(baymodel_id, name=data_utils.rand_name('bay'), node_count=2,
def valid_bay_data(baymodel_id, name=data_utils.rand_name('bay'), node_count=1,
master_count=1, bay_create_timeout=None):
"""Generates random bay data with valid

View File

@ -50,6 +50,7 @@ class BaseMagnumClient(base.TestCase):
image_id = cliutils.env('IMAGE_ID')
nic_id = cliutils.env('NIC_ID')
flavor_id = cliutils.env('FLAVOR_ID')
master_flavor_id = cliutils.env('MASTER_FLAVOR_ID')
keypair_id = cliutils.env('KEYPAIR_ID')
copy_logs = cliutils.env('COPY_LOGS')
@ -65,6 +66,8 @@ class BaseMagnumClient(base.TestCase):
image_id = image_id or config.get('magnum', 'image_id')
nic_id = nic_id or config.get('magnum', 'nic_id')
flavor_id = flavor_id or config.get('magnum', 'flavor_id')
master_flavor_id = master_flavor_id or config.get(
'magnum', 'master_flavor_id')
keypair_id = keypair_id or config.get('magnum', 'keypair_id')
try:
copy_logs = copy_logs or config.get('magnum', 'copy_logs')
@ -74,6 +77,7 @@ class BaseMagnumClient(base.TestCase):
cls.image_id = image_id
cls.nic_id = nic_id
cls.flavor_id = flavor_id
cls.master_flavor_id = master_flavor_id
cls.keypair_id = keypair_id
cls.copy_logs = bool(copy_logs)
cls.cs = v1client.Client(username=user,
@ -118,7 +122,7 @@ class BaseMagnumClient(base.TestCase):
external_network_id=cls.nic_id,
image_id=cls.image_id,
flavor_id=cls.flavor_id,
master_flavor_id=cls.flavor_id,
master_flavor_id=cls.master_flavor_id,
docker_volume_size=docker_volume_size,
network_driver=network_driver,
volume_driver=volume_driver,

View File

@ -41,10 +41,14 @@ MagnumGroup = [
help="Keypair id to use to log into nova instances."),
cfg.StrOpt("flavor_id",
default="m1.magnum",
default="m1.magnum2",
help="Flavor id to use for baymodels."),
cfg.StrOpt("magnum_url",
default=None,
help="Bypass URL for Magnum to skip service catalog lookup"),
cfg.StrOpt("master_flavor_id",
default="m1.magnum",
help="Master flavor id to use for baymodels."),
]