diff options
author | Vu Tran <vu.tran@windriver.com> | 2014-07-10 10:23:42 -0400 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2014-07-17 00:12:13 -0400 |
commit | 3c40059598035598ec1f88775f0793c96dce2f5e (patch) | |
tree | 6c75c0575b80e16cc896481fc28fe87527778df5 /meta-openstack/recipes-devtools/python/python-rally_git.bb | |
parent | 5e29cf0fce2f768a3a179c2edd9ee1f2a1223ab0 (diff) | |
download | meta-cloud-services-3c40059598035598ec1f88775f0793c96dce2f5e.tar.gz |
introduce openstack Rally component
* Add Rally bb file
* Add Rally deployment json config for existing deployment
* Add task example
* To use custom Rally config file
Signed-off-by: Vu Tran <vu.tran@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-rally_git.bb')
-rw-r--r-- | meta-openstack/recipes-devtools/python/python-rally_git.bb | 145 |
1 files changed, 145 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-rally_git.bb b/meta-openstack/recipes-devtools/python/python-rally_git.bb new file mode 100644 index 0000000..811fd07 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-rally_git.bb | |||
@@ -0,0 +1,145 @@ | |||
1 | DESCRIPTION = "Rally - OpenStack benchmarking at a scale - is intended to provide the \ | ||
2 | community with a benchmarking tool that is capable of performing specific, \ | ||
3 | complicated and reproducible test cases on real deployment scenarios." | ||
4 | HOMEPAGE = "https://launchpad.net/rally" | ||
5 | SECTION = "devel/python" | ||
6 | LICENSE = "Apache-2.0" | ||
7 | LIC_FILES_CHKSUM = "file://LICENSE;md5=19cbd64715b51267a47bf3750cc6a8a5" | ||
8 | |||
9 | PR = "r0" | ||
10 | SRCNAME = "rally" | ||
11 | |||
12 | SRC_URI = "git://github.com/stackforge/${SRCNAME}.git;branch=master \ | ||
13 | file://rally.init \ | ||
14 | file://rally.conf \ | ||
15 | file://task-example.json \ | ||
16 | file://deployment-existing.json \ | ||
17 | " | ||
18 | |||
19 | SRCREV="b297cf00750f263b8b5bdeb71f6952f672e87f5a" | ||
20 | PV="git${SRCPV}" | ||
21 | S = "${WORKDIR}/git" | ||
22 | |||
23 | inherit setuptools update-rc.d hosts identity default_configs | ||
24 | |||
25 | do_install_append() { | ||
26 | RALLY_CONF_DIR=${D}${sysconfdir}/${SRCNAME} | ||
27 | RALLY_PYTHON_SITEPACKAGES_DIR=${D}${PYTHON_SITEPACKAGES_DIR}/${SRCNAME} | ||
28 | |||
29 | install -d ${RALLY_CONF_DIR} | ||
30 | install -m 600 ${WORKDIR}/rally.conf ${RALLY_CONF_DIR}/rally.conf | ||
31 | sed -e "s:%DB_USER%:${DB_USER}:g" -i ${RALLY_CONF_DIR}/rally.conf | ||
32 | sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${RALLY_CONF_DIR}/rally.conf | ||
33 | |||
34 | if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
35 | install -d ${D}${sysconfdir}/init.d | ||
36 | sed 's:@suffix@:api:' < ${WORKDIR}/rally.init > ${WORKDIR}/rally-api.init.sh | ||
37 | install -m 0755 ${WORKDIR}/rally-api.init.sh ${D}${sysconfdir}/init.d/rally-api | ||
38 | fi | ||
39 | |||
40 | install -d ${RALLY_PYTHON_SITEPACKAGES_DIR} | ||
41 | cp -r ${S}/tests* ${RALLY_PYTHON_SITEPACKAGES_DIR} | ||
42 | find ${RALLY_PYTHON_SITEPACKAGES_DIR}/tests* -name "*.py" | xargs \ | ||
43 | sed -i 's:^from tests:from rally.tests:g' | ||
44 | install -d ${RALLY_PYTHON_SITEPACKAGES_DIR}/doc/samples | ||
45 | cp -r ${S}/doc/samples/* ${RALLY_PYTHON_SITEPACKAGES_DIR}/doc/samples | ||
46 | |||
47 | install -d ${RALLY_CONF_DIR}/tasks | ||
48 | install -m 600 ${WORKDIR}/task-example.json ${RALLY_CONF_DIR}/tasks/example.json | ||
49 | |||
50 | install -d ${RALLY_CONF_DIR}/deployments | ||
51 | install -m 600 ${WORKDIR}/deployment-existing.json ${RALLY_CONF_DIR}/deployments/existing.json | ||
52 | sed -e "s:%ADMIN_TENANT_NAME%:admin:g" -i ${RALLY_CONF_DIR}/deployments/existing.json | ||
53 | sed -e "s:%ADMIN_USER%:admin:g" -i ${RALLY_CONF_DIR}/deployments/existing.json | ||
54 | sed -e "s:%ADMIN_PASSWORD%:${ADMIN_PASSWORD}:g" -i ${RALLY_CONF_DIR}/deployments/existing.json | ||
55 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${RALLY_CONF_DIR}/deployments/existing.json | ||
56 | |||
57 | cp ${S}/run_tests.sh ${RALLY_CONF_DIR} | ||
58 | cp -r ${S}/tools ${RALLY_CONF_DIR} | ||
59 | } | ||
60 | |||
61 | pkg_postinst_${SRCNAME}-setup () { | ||
62 | if [ "x$D" != "x" ]; then | ||
63 | exit 1 | ||
64 | fi | ||
65 | |||
66 | # This is to make sure postgres is configured and running | ||
67 | if ! pidof postmaster > /dev/null; then | ||
68 | /etc/init.d/postgresql-init | ||
69 | /etc/init.d/postgresql start | ||
70 | fi | ||
71 | |||
72 | if [ ! -d /var/log/rally ]; then | ||
73 | mkdir /var/log/rally | ||
74 | fi | ||
75 | |||
76 | sudo -u postgres createdb rally | ||
77 | rally-manage db recreate | ||
78 | } | ||
79 | |||
80 | PACKAGES += "${SRCNAME}-tests ${SRCNAME}-api ${SRCNAME} ${SRCNAME}-setup" | ||
81 | ALLOW_EMPTY_${SRCNAME}-setup = "1" | ||
82 | |||
83 | FILES_${PN} = "${libdir}/*" | ||
84 | |||
85 | FILES_${SRCNAME}-tests = "${sysconfdir}/${SRCNAME}/run_tests.sh \ | ||
86 | " | ||
87 | |||
88 | FILES_${SRCNAME} = "${bindir}/* \ | ||
89 | ${sysconfdir}/${SRCNAME}/* \ | ||
90 | " | ||
91 | |||
92 | FILES_${SRCNAME}-api = "${bindir}/rally-api \ | ||
93 | ${sysconfdir}/init.d/rally-api \ | ||
94 | " | ||
95 | |||
96 | DEPENDS += " \ | ||
97 | python-pip \ | ||
98 | python-pbr \ | ||
99 | " | ||
100 | |||
101 | RDEPENDS_${PN} += " python-babel \ | ||
102 | python-decorator \ | ||
103 | python-fixtures \ | ||
104 | python-iso8601 \ | ||
105 | python-jsonschema \ | ||
106 | python-netaddr \ | ||
107 | python-oslo.config \ | ||
108 | python-paramiko \ | ||
109 | python-pbr \ | ||
110 | python-pecan \ | ||
111 | python-prettytable \ | ||
112 | python-pyyaml \ | ||
113 | python-glanceclient \ | ||
114 | python-keystoneclient \ | ||
115 | python-novaclient \ | ||
116 | python-neutronclient \ | ||
117 | python-cinderclient \ | ||
118 | python-heatclient \ | ||
119 | python-ceilometerclient \ | ||
120 | python-subunit \ | ||
121 | python-requests \ | ||
122 | python-sqlalchemy \ | ||
123 | python-six \ | ||
124 | python-wsme \ | ||
125 | " | ||
126 | |||
127 | RDEPENDS_${SRCNAME}-tests = "${PN} \ | ||
128 | python-coverage \ | ||
129 | python-mock \ | ||
130 | python-testrepository \ | ||
131 | python-testtools \ | ||
132 | python-oslotest \ | ||
133 | " | ||
134 | |||
135 | RDEPENDS_${SRCNAME} = "${PN} \ | ||
136 | postgresql \ | ||
137 | postgresql-client \ | ||
138 | " | ||
139 | |||
140 | RDEPENDS_${SRCNAME}-setup = "postgresql sudo ${SRCNAME}" | ||
141 | RDEPENDS_${SRCNAME}-api = "${SRCNAME}" | ||
142 | |||
143 | INITSCRIPT_PACKAGES = "${SRCNAME}-api" | ||
144 | INITSCRIPT_NAME_${SRCNAME}-api = "${SRCNAME}-api" | ||
145 | INITSCRIPT_PARAMS_${SRCNAME}-api = "${OS_DEFAULT_INITSCRIPT_PARAMS}" | ||