Add kafka image

Change-Id: I6c9b8f8b0cf254c2c3333ca789c5da364c7d5c73
Partially-Implements: blueprint monasca-containers
This commit is contained in:
Sam Yaple 2016-12-05 09:55:12 +00:00
parent c780a98758
commit 259266ceb8
5 changed files with 58 additions and 6 deletions

View File

@ -0,0 +1,32 @@
FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
MAINTAINER {{ maintainer }}
{% block kafka_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
&& /bin/false
{% elif base_distro in ['ubuntu', 'debian'] %}
{% set kafka_packages = [
'default-jre',
] %}
{% endif %}
{{ macros.install_packages(kafka_packages | customizable("packages")) }}
COPY extend_start.sh /usr/local/bin/kolla_extend_start
ADD kafka-archive /
RUN ln -s kafka* kafka \
&& useradd --user-group --home-dir /kafka kafka \
&& chmod 755 /usr/local/bin/kolla_extend_start \
&& usermod -a -G kolla kafka \
&& chown -R kafka: /kafka
{% block kafka_footer %}{% endblock %}
{% block footer %}{% endblock %}
USER kafka

View File

@ -0,0 +1,9 @@
#!/bin/bash
# Create log directory, with appropriate permissions
if [[ ! -d "/var/log/kolla/kafka" ]]; then
mkdir -p /var/log/kolla/kafka
fi
if [[ $(stat -c %a /var/log/kolla/kafka) != "755" ]]; then
chmod 755 /var/log/kolla/kafka
fi

View File

@ -46,11 +46,11 @@ _PROFILE_OPTS = [
help='Main images'), help='Main images'),
cfg.ListOpt('aux', cfg.ListOpt('aux',
default=['aodh', 'cloudkitty', 'congress', 'designate', default=['aodh', 'cloudkitty', 'congress', 'designate',
'freezer', 'gnocchi', 'influxdb', 'ironic', 'karbor', 'freezer', 'gnocchi', 'influxdb', 'ironic', 'kafka',
'kuryr', 'magnum', 'manila', 'mistral', 'murano', 'karbor', 'kuryr', 'magnum', 'manila', 'mistral',
'octavia', 'panko', 'rally', 'sahara', 'searchlight', 'murano', 'octavia', 'panko', 'rally', 'sahara',
'senlin', 'solum', 'tacker' 'telegraf', 'trove', 'searchlight', 'senlin', 'solum', 'tacker',
'zaqar', 'zookeeper'], 'telegraf', 'trove', 'zaqar', 'zookeeper'],
help='Aux Images'), help='Aux Images'),
cfg.ListOpt('default', cfg.ListOpt('default',
default=['chrony', 'cron', 'kolla-toolbox', 'glance', default=['chrony', 'cron', 'kolla-toolbox', 'glance',
@ -266,6 +266,10 @@ SOURCES = {
'type': 'url', 'type': 'url',
'location': ('http://tarballs.openstack.org/ironic-inspector/' 'location': ('http://tarballs.openstack.org/ironic-inspector/'
'ironic-inspector-master.tar.gz')}, 'ironic-inspector-master.tar.gz')},
'kafka': {
'type': 'url',
'location': ('http://apache.osuosl.org/kafka/0.10.1.0/'
'kafka_2.11-0.10.1.0.tgz')},
'karbor-base': { 'karbor-base': {
'type': 'url', 'type': 'url',
'location': ('http://tarballs.openstack.org/karbor/' 'location': ('http://tarballs.openstack.org/karbor/'

View File

@ -0,0 +1,3 @@
---
features:
- Add kafka image, used in Monasca

View File

@ -78,6 +78,7 @@ class BuildTestCentosBinary(BuildTest, base.BaseTestCase):
"bifrost-base", "bifrost-base",
"cloudkitty-base", "cloudkitty-base",
"freezer-base", "freezer-base",
"kafka",
"zookeeper", "zookeeper",
"tacker"] "tacker"]
@ -89,6 +90,7 @@ class BuildTestCentosBinary(BuildTest, base.BaseTestCase):
class BuildTestCentosSource(BuildTest, base.BaseTestCase): class BuildTestCentosSource(BuildTest, base.BaseTestCase):
excluded_images = ["mistral-base", excluded_images = ["mistral-base",
"kafka",
"zookeeper"] "zookeeper"]
def setUp(self): def setUp(self):
@ -144,6 +146,7 @@ class BuildTestOracleLinuxBinary(BuildTest, base.BaseTestCase):
"bifrost-base", "bifrost-base",
"cloudkitty-base", "cloudkitty-base",
"freezer-base", "freezer-base",
"kafka",
"zookeeper", "zookeeper",
"tacker"] "tacker"]
@ -154,7 +157,8 @@ class BuildTestOracleLinuxBinary(BuildTest, base.BaseTestCase):
class BuildTestOracleLinuxSource(BuildTest, base.BaseTestCase): class BuildTestOracleLinuxSource(BuildTest, base.BaseTestCase):
excluded_images = ["zookeeper"] excluded_images = ["kafka",
"zookeeper"]
def setUp(self): def setUp(self):
super(BuildTestOracleLinuxSource, self).setUp() super(BuildTestOracleLinuxSource, self).setUp()