summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitrii Shcherbakov <dmitrii.shcherbakov@canonical.com>2018-02-09 16:45:22 +0300
committerDmitrii Shcherbakov <dmitrii.shcherbakov@canonical.com>2018-02-11 00:38:02 +0300
commit86175f8b0597eb53e496d79936f69e8a3c6d6b37 (patch)
treeda0ae4cee1e3796b6a755c5091cb973089854974
parent3ed4d0d8a996d157381c743cbbd6e6e9f79c9e88 (diff)
Configure WSGI worker processes dynamically
Use WSGI worker process configuration in Apache templates inline with other OpenStack Charms. Additionally: * fixes typos in functional tests; * removes zesty-ocata (zesty is EoL); * fixes tox.ini to run xenial-ocata as Panko is only available in Ocata; * fixes src/test-requirements.txt to use a github url instead of lp; * adds a repo link now that Panko is in OpenStack repos. Change-Id: If24ad0ee3e7cc7282186e8a80c8c2174ab4daa02 Closes-Bug: 1748432
Notes
Notes (review): Verified+1: Canonical CI <uosci-testing-bot@ubuntu.com> Code-Review+2: James Page <james.page@canonical.com> Workflow+1: James Page <james.page@canonical.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Sun, 11 Feb 2018 08:13:41 +0000 Reviewed-on: https://review.openstack.org/542832 Project: openstack/charm-panko Branch: refs/heads/master
-rw-r--r--src/layer.yaml1
-rw-r--r--src/templates/ocata/panko-api.conf2
-rw-r--r--src/templates/panko-api.conf2
-rw-r--r--src/test-requirements.txt4
-rw-r--r--src/tests/basic_deployment.py12
-rwxr-xr-xsrc/tests/gate-basic-zesty-ocata23
-rw-r--r--src/tox.ini4
7 files changed, 13 insertions, 35 deletions
diff --git a/src/layer.yaml b/src/layer.yaml
index 8183f23..466cf5b 100644
--- a/src/layer.yaml
+++ b/src/layer.yaml
@@ -1,4 +1,5 @@
1includes: ['layer:openstack-api', 'interface:panko'] 1includes: ['layer:openstack-api', 'interface:panko']
2repo: 'https://github.com/openstack/charm-panko'
2options: 3options:
3 basic: 4 basic:
4 use_venv: True 5 use_venv: True
diff --git a/src/templates/ocata/panko-api.conf b/src/templates/ocata/panko-api.conf
index fd0dd89..328f022 100644
--- a/src/templates/ocata/panko-api.conf
+++ b/src/templates/ocata/panko-api.conf
@@ -7,7 +7,7 @@
7Listen {{ options.service_listen_info.panko_api.public_port }} 7Listen {{ options.service_listen_info.panko_api.public_port }}
8 8
9<VirtualHost *:{{ options.service_listen_info.panko_api.public_port }}> 9<VirtualHost *:{{ options.service_listen_info.panko_api.public_port }}>
10 WSGIDaemonProcess panko-api processes=2 threads=10 user=panko display-name=%{GROUP} 10 WSGIDaemonProcess panko-api processes={{ options.wsgi_worker_context.processes }} threads=10 user=panko display-name=%{GROUP}
11 WSGIProcessGroup panko-api 11 WSGIProcessGroup panko-api
12 WSGIScriptAlias / /usr/lib/python2.7/dist-packages/panko/api/app.wsgi 12 WSGIScriptAlias / /usr/lib/python2.7/dist-packages/panko/api/app.wsgi
13 WSGIApplicationGroup %{GLOBAL} 13 WSGIApplicationGroup %{GLOBAL}
diff --git a/src/templates/panko-api.conf b/src/templates/panko-api.conf
index fd0dd89..328f022 100644
--- a/src/templates/panko-api.conf
+++ b/src/templates/panko-api.conf
@@ -7,7 +7,7 @@
7Listen {{ options.service_listen_info.panko_api.public_port }} 7Listen {{ options.service_listen_info.panko_api.public_port }}
8 8
9<VirtualHost *:{{ options.service_listen_info.panko_api.public_port }}> 9<VirtualHost *:{{ options.service_listen_info.panko_api.public_port }}>
10 WSGIDaemonProcess panko-api processes=2 threads=10 user=panko display-name=%{GROUP} 10 WSGIDaemonProcess panko-api processes={{ options.wsgi_worker_context.processes }} threads=10 user=panko display-name=%{GROUP}
11 WSGIProcessGroup panko-api 11 WSGIProcessGroup panko-api
12 WSGIScriptAlias / /usr/lib/python2.7/dist-packages/panko/api/app.wsgi 12 WSGIScriptAlias / /usr/lib/python2.7/dist-packages/panko/api/app.wsgi
13 WSGIApplicationGroup %{GLOBAL} 13 WSGIApplicationGroup %{GLOBAL}
diff --git a/src/test-requirements.txt b/src/test-requirements.txt
index 7d907c4..cb4b5bb 100644
--- a/src/test-requirements.txt
+++ b/src/test-requirements.txt
@@ -1,7 +1,7 @@
1# charm-proof 1# charm-proof
2charm-tools>=2.0.0 2charm-tools>=2.0.0
3# amulet deployment helpers 3# amulet deployment helpers
4bzr+lp:charm-helpers#egg=charmhelpers 4git+https://github.com/juju/charm-helpers#egg=charmhelpers
5# BEGIN: Amulet OpenStack Charm Helper Requirements 5# BEGIN: Amulet OpenStack Charm Helper Requirements
6# Liberty client lower constraints 6# Liberty client lower constraints
7amulet>=1.14.3,<2.0 7amulet>=1.14.3,<2.0
@@ -17,4 +17,4 @@ python-openstackclient>=1.7.0,<2.0
17python-swiftclient>=2.6.0,<3.0 17python-swiftclient>=2.6.0,<3.0
18pika>=0.10.0,<1.0 18pika>=0.10.0,<1.0
19distro-info 19distro-info
20# END: Amulet OpenStack Charm Helper Requirements \ No newline at end of file 20# END: Amulet OpenStack Charm Helper Requirements
diff --git a/src/tests/basic_deployment.py b/src/tests/basic_deployment.py
index 7d82b32..aba3966 100644
--- a/src/tests/basic_deployment.py
+++ b/src/tests/basic_deployment.py
@@ -40,7 +40,7 @@ class PankoCharmDeployment(amulet_deployment.OpenStackAmuletDeployment):
40 self._deploy() 40 self._deploy()
41 41
42 u.log.info('Waiting on extended status checks...') 42 u.log.info('Waiting on extended status checks...')
43 exclude_services = ['mysql', 'mongodb'] 43 exclude_services = ['percona-cluster', 'mongodb']
44 self._auto_wait_for_status(exclude_services=exclude_services) 44 self._auto_wait_for_status(exclude_services=exclude_services)
45 45
46 self._initialize_tests() 46 self._initialize_tests()
@@ -54,7 +54,7 @@ class PankoCharmDeployment(amulet_deployment.OpenStackAmuletDeployment):
54 """ 54 """
55 this_service = {'name': 'panko'} 55 this_service = {'name': 'panko'}
56 other_services = [ 56 other_services = [
57 {'name': 'mysql'}, 57 {'name': 'percona-cluster'},
58 {'name': 'mongodb'}, 58 {'name': 'mongodb'},
59 {'name': 'ceilometer'}, 59 {'name': 'ceilometer'},
60 {'name': 'keystone'}, 60 {'name': 'keystone'},
@@ -66,11 +66,11 @@ class PankoCharmDeployment(amulet_deployment.OpenStackAmuletDeployment):
66 def _add_relations(self): 66 def _add_relations(self):
67 """Add all of the relations for the services.""" 67 """Add all of the relations for the services."""
68 relations = { 68 relations = {
69 'keystone:shared-db': 'mysql:shared-db', 69 'keystone:shared-db': 'percona-cluster:shared-db',
70 'panko:identity-service': 'keystone:identity-service', 70 'panko:identity-service': 'keystone:identity-service',
71 'panko:shared-db': 'mysql:shared-db', 71 'panko:shared-db': 'percona-cluster:shared-db',
72 'ceilometer:identity-service': 'keystone:identity-service', 72 'ceilometer:identity-service': 'keystone:identity-service',
73 'ceilometer:shared-db': 'monogdb:database', 73 'ceilometer:shared-db': 'mongodb:database',
74 'ceilometer:amqp': 'rabbitmq-server:amqp', 74 'ceilometer:amqp': 'rabbitmq-server:amqp',
75 } 75 }
76 super(PankoCharmDeployment, self)._add_relations(relations) 76 super(PankoCharmDeployment, self)._add_relations(relations)
@@ -89,7 +89,7 @@ class PankoCharmDeployment(amulet_deployment.OpenStackAmuletDeployment):
89 """Perform final initialization before tests get run.""" 89 """Perform final initialization before tests get run."""
90 # Access the sentries for inspecting service units 90 # Access the sentries for inspecting service units
91 self.panko_sentry = self.d.sentry['panko'][0] 91 self.panko_sentry = self.d.sentry['panko'][0]
92 self.mysql_sentry = self.d.sentry['mysql'][0] 92 self.pxc_sentry = self.d.sentry['percona-cluster'][0]
93 self.keystone_sentry = self.d.sentry['keystone'][0] 93 self.keystone_sentry = self.d.sentry['keystone'][0]
94 self.panko_svcs = ['haproxy', 'apache2'] 94 self.panko_svcs = ['haproxy', 'apache2']
95 95
diff --git a/src/tests/gate-basic-zesty-ocata b/src/tests/gate-basic-zesty-ocata
deleted file mode 100755
index 74afd84..0000000
--- a/src/tests/gate-basic-zesty-ocata
+++ /dev/null
@@ -1,23 +0,0 @@
1#!/usr/bin/env python
2#
3# Copyright 2016 Canonical Ltd
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17"""Amulet tests on a basic Panko Charm deployment on zesty-ocata."""
18
19from basic_deployment import PankoCharmDeployment
20
21if __name__ == '__main__':
22 deployment = PankoCharmDeployment(series='zesty')
23 deployment.run_tests()
diff --git a/src/tox.ini b/src/tox.ini
index 879671c..bb794e7 100644
--- a/src/tox.ini
+++ b/src/tox.ini
@@ -35,7 +35,7 @@ commands =
35# Run a specific test as an Amulet smoke test (expected to always pass) 35# Run a specific test as an Amulet smoke test (expected to always pass)
36basepython = python2.7 36basepython = python2.7
37commands = 37commands =
38 bundletester -vl DEBUG -r json -o func-results.json gate-basic-xenial-mitaka --no-destroy 38 bundletester -vl DEBUG -r json -o func-results.json gate-basic-xenial-ocata --no-destroy
39 39
40[testenv:func27-dfs] 40[testenv:func27-dfs]
41# Run all deploy-from-source tests which are +x (may not always pass!) 41# Run all deploy-from-source tests which are +x (may not always pass!)
@@ -50,4 +50,4 @@ commands =
50 bundletester -vl DEBUG -r json -o func-results.json --test-pattern "dev-*" --no-destroy 50 bundletester -vl DEBUG -r json -o func-results.json --test-pattern "dev-*" --no-destroy
51 51
52[testenv:venv] 52[testenv:venv]
53commands = {posargs} \ No newline at end of file 53commands = {posargs}