Enable Zesty-Ocata Amulet Tests
- Turn on Zesty-Ocata Amulet test definitions. - Standardize test-requirements.txt - Sync charm helpers for various fixes Change-Id: I9ceda024bbf467a03a0cb6b99c84f60155baf01c
This commit is contained in:
parent
89677aec92
commit
50b656c5fa
|
@ -1232,19 +1232,19 @@ MAX_DEFAULT_WORKERS = 4
|
||||||
DEFAULT_MULTIPLIER = 2
|
DEFAULT_MULTIPLIER = 2
|
||||||
|
|
||||||
|
|
||||||
class WorkerConfigContext(OSContextGenerator):
|
def _calculate_workers():
|
||||||
|
'''
|
||||||
|
Determine the number of worker processes based on the CPU
|
||||||
|
count of the unit containing the application.
|
||||||
|
|
||||||
@property
|
Workers will be limited to MAX_DEFAULT_WORKERS in
|
||||||
def num_cpus(self):
|
container environments where no worker-multipler configuration
|
||||||
# NOTE: use cpu_count if present (16.04 support)
|
option been set.
|
||||||
if hasattr(psutil, 'cpu_count'):
|
|
||||||
return psutil.cpu_count()
|
|
||||||
else:
|
|
||||||
return psutil.NUM_CPUS
|
|
||||||
|
|
||||||
def __call__(self):
|
@returns int: number of worker processes to use
|
||||||
|
'''
|
||||||
multiplier = config('worker-multiplier') or DEFAULT_MULTIPLIER
|
multiplier = config('worker-multiplier') or DEFAULT_MULTIPLIER
|
||||||
count = int(self.num_cpus * multiplier)
|
count = int(_num_cpus() * multiplier)
|
||||||
if multiplier > 0 and count == 0:
|
if multiplier > 0 and count == 0:
|
||||||
count = 1
|
count = 1
|
||||||
|
|
||||||
|
@ -1256,7 +1256,26 @@ class WorkerConfigContext(OSContextGenerator):
|
||||||
# Reference: https://pad.lv/1665270
|
# Reference: https://pad.lv/1665270
|
||||||
count = min(count, MAX_DEFAULT_WORKERS)
|
count = min(count, MAX_DEFAULT_WORKERS)
|
||||||
|
|
||||||
ctxt = {"workers": count}
|
return count
|
||||||
|
|
||||||
|
|
||||||
|
def _num_cpus():
|
||||||
|
'''
|
||||||
|
Compatibility wrapper for calculating the number of CPU's
|
||||||
|
a unit has.
|
||||||
|
|
||||||
|
@returns: int: number of CPU cores detected
|
||||||
|
'''
|
||||||
|
try:
|
||||||
|
return psutil.cpu_count()
|
||||||
|
except AttributeError:
|
||||||
|
return psutil.NUM_CPUS
|
||||||
|
|
||||||
|
|
||||||
|
class WorkerConfigContext(OSContextGenerator):
|
||||||
|
|
||||||
|
def __call__(self):
|
||||||
|
ctxt = {"workers": _calculate_workers()}
|
||||||
return ctxt
|
return ctxt
|
||||||
|
|
||||||
|
|
||||||
|
@ -1264,7 +1283,7 @@ class WSGIWorkerConfigContext(WorkerConfigContext):
|
||||||
|
|
||||||
def __init__(self, name=None, script=None, admin_script=None,
|
def __init__(self, name=None, script=None, admin_script=None,
|
||||||
public_script=None, process_weight=1.00,
|
public_script=None, process_weight=1.00,
|
||||||
admin_process_weight=0.75, public_process_weight=0.25):
|
admin_process_weight=0.25, public_process_weight=0.75):
|
||||||
self.service_name = name
|
self.service_name = name
|
||||||
self.user = name
|
self.user = name
|
||||||
self.group = name
|
self.group = name
|
||||||
|
@ -1276,8 +1295,7 @@ class WSGIWorkerConfigContext(WorkerConfigContext):
|
||||||
self.public_process_weight = public_process_weight
|
self.public_process_weight = public_process_weight
|
||||||
|
|
||||||
def __call__(self):
|
def __call__(self):
|
||||||
multiplier = config('worker-multiplier') or 1
|
total_processes = _calculate_workers()
|
||||||
total_processes = self.num_cpus * multiplier
|
|
||||||
ctxt = {
|
ctxt = {
|
||||||
"service_name": self.service_name,
|
"service_name": self.service_name,
|
||||||
"user": self.user,
|
"user": self.user,
|
||||||
|
|
|
@ -10,4 +10,3 @@ Jinja2>=2.6 # BSD License (3 clause)
|
||||||
six>=1.9.0
|
six>=1.9.0
|
||||||
dnspython>=1.12.0
|
dnspython>=1.12.0
|
||||||
psutil>=1.1.1,<2.0.0
|
psutil>=1.1.1,<2.0.0
|
||||||
python-neutronclient>=2.6.0
|
|
||||||
|
|
|
@ -11,13 +11,17 @@ requests==2.6.0
|
||||||
# Liberty client lower constraints
|
# Liberty client lower constraints
|
||||||
amulet>=1.14.3,<2.0
|
amulet>=1.14.3,<2.0
|
||||||
bundletester>=0.6.1,<1.0
|
bundletester>=0.6.1,<1.0
|
||||||
python-ceilometerclient>=1.5.0,<2.0
|
python-ceilometerclient>=1.5.0
|
||||||
python-cinderclient>=1.4.0,<2.0
|
python-cinderclient>=1.4.0
|
||||||
python-glanceclient>=1.1.0,<2.0
|
python-glanceclient>=1.1.0
|
||||||
python-heatclient>=0.8.0,<1.0
|
python-heatclient>=0.8.0
|
||||||
python-novaclient>=2.30.1,<3.0
|
python-keystoneclient>=1.7.1
|
||||||
python-openstackclient>=1.7.0,<2.0
|
python-neutronclient>=3.1.0
|
||||||
python-swiftclient>=2.6.0,<3.0
|
python-novaclient>=2.30.1
|
||||||
|
python-openstackclient>=1.7.0
|
||||||
|
python-swiftclient>=2.6.0
|
||||||
pika>=0.10.0,<1.0
|
pika>=0.10.0,<1.0
|
||||||
distro-info
|
distro-info
|
||||||
# END: Amulet OpenStack Charm Helper Requirements
|
# END: Amulet OpenStack Charm Helper Requirements
|
||||||
|
# NOTE: workaround for 14.04 pip/tox
|
||||||
|
pytz
|
||||||
|
|
5
tox.ini
5
tox.ini
|
@ -21,6 +21,11 @@ basepython = python2.7
|
||||||
deps = -r{toxinidir}/requirements.txt
|
deps = -r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
|
|
||||||
|
[testenv:py35]
|
||||||
|
basepython = python3.5
|
||||||
|
deps = -r{toxinidir}/requirements.txt
|
||||||
|
-r{toxinidir}/test-requirements.txt
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
basepython = python2.7
|
basepython = python2.7
|
||||||
deps = -r{toxinidir}/requirements.txt
|
deps = -r{toxinidir}/requirements.txt
|
||||||
|
|
Loading…
Reference in New Issue