Merge "Add support for deploying Apache Storm"

This commit is contained in:
Zuul 2018-07-13 19:38:08 +00:00 committed by Gerrit Code Review
commit 42d7cecbca
4 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,42 @@
FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% block storm %}{% endblock %}
{% import "macros.j2" as macros with context %}
{{ macros.configure_user(name='storm', homedir='/opt/storm') }}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set storm_packages = [
'java-1.8.0-openjdk-headless',
] %}
{% elif base_distro in ['debian', 'ubuntu'] %}
{% set storm_packages = [
'default-jre-headless',
] %}
{% endif %}
{{ macros.install_packages(storm_packages | customizable("packages")) }}
{% block storm_version %}
ENV storm_version=1.1.2
ENV storm_url=http://www.mirrorservice.org/sites/ftp.apache.org/storm/apache-storm-${storm_version}/apache-storm-${storm_version}.tar.gz
ENV storm_pkg_sha512sum=4ec7554d4e242c5cfa3b010f63b2ed65866d0768bfa04c7ae87004d21994041ef25b198a236a87f14ac3b36b698f117338080d9b7d9c0f561b7de256bf2e10d2
{% endblock %}
{% block storm_install %}
RUN curl -sSL -o /tmp/storm.tgz ${storm_url} \
&& echo "${storm_pkg_sha512sum} /tmp/storm.tgz" | sha512sum -c \
&& tar --strip 1 -xvf /tmp/storm.tgz -C /opt/storm \
&& rm -f /tmp/storm.tgz
{% endblock %}
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
{% block storm_footer %}{% endblock %}
{% block footer %}{% endblock %}
USER storm

View File

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

View File

@ -70,6 +70,7 @@ _PROFILE_OPTS = [
'redis',
'rsyslog',
'skydive',
'storm',
'tgtd',
],
help='Infra images'),
@ -1098,6 +1099,10 @@ USERS = {
'logstash-user': {
'uid': 42478,
'gid': 42478,
},
'storm-user': {
'uid': 42479,
'gid': 42479,
}
}

View File

@ -0,0 +1,3 @@
---
features:
- Add support for building an Apache Storm image.