Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

Commit

Permalink
add adjutant
Browse files Browse the repository at this point in the history
  • Loading branch information
okleinschmidt committed Jul 16, 2020
1 parent 4d95e37 commit b3069e5
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 1 deletion.
58 changes: 58 additions & 0 deletions docker/adjutant/adjutant-api/Dockerfile.j2
@@ -0,0 +1,58 @@
FROM {{ namespace }}/{{ image_prefix }}adjutant-base:{{ tag }}
{% block labels %}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% endblock %}

{% block adjutant_api_header %}{% endblock %}

{% import "macros.j2" as macros with context %}

{% if install_type == 'binary' %}
{% if base_package_type == 'rpm' %}

{% set adjutant_api_packages = [
'httpd',
'mod_ssl',
'openstack-adjutant-api',
'python3-mod_wsgi'
] %}
{{ macros.install_packages(adjutant_api_packages | customizable("packages")) }}
RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \
&& sed -i -r 's,^(Listen 443),#\1,' /etc/httpd/conf.d/ssl.conf

{% elif base_package_type == 'deb' %}

RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
&& /bin/false

{% endif %}

{% elif install_type == 'source' %}

{% if base_package_type == 'rpm' %}
{% set adjutant_api_packages = [
'httpd',
'mod_ssl',
'python3-mod_wsgi'
] %}
{{ macros.install_packages(adjutant_api_packages | customizable("packages")) }}
RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \
&& sed -i -r 's,^(Listen 443),#\1,' /etc/httpd/conf.d/ssl.conf

{% elif base_package_type == 'deb' %}
{% set adjutant_api_packages = [
'apache2',
'libapache2-mod-wsgi-py3'
] %}
{{ macros.install_packages(adjutant_api_packages | customizable("packages")) }}
RUN echo > /etc/apache2/ports.conf

{% endif %}

{% endif %}

COPY extend_start.sh /usr/local/bin/kolla_adjutant_extend_start
RUN chmod 755 /usr/local/bin/kolla_adjutant_extend_start

{% block adjutant_api_footer %}{% endblock %}
{% block footer %}{% endblock %}
11 changes: 11 additions & 0 deletions docker/adjutant/adjutant-api/extend_start.sh
@@ -0,0 +1,11 @@
#!/bin/bash

# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
adjutant-api migrate
exit 0
fi


. /usr/local/bin/kolla_httpd_setup
47 changes: 47 additions & 0 deletions docker/adjutant/adjutant-base/Dockerfile.j2
@@ -0,0 +1,47 @@
FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
{% block labels %}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% endblock %}

{% block adjutant_base_header %}{% endblock %}

{% import "macros.j2" as macros with context %}

{{ macros.configure_user(name='adjutant') }}

{% if install_type == 'binary' %}
{% if base_package_type == 'rpm' %}

RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
&& /bin/false

{% elif base_package_type == 'deb' %}

RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
&& /bin/false

{% endif %}

{{ macros.install_packages(adjutant_base_packages | customizable("packages")) }}

{% elif install_type == 'source' %}

{% set adjutant_base_pip_packages = [
'/adjutant'
] %}

ADD adjutant-base-archive /adjutant-base-source
RUN ln -s adjutant-base-source/* adjutant \
&& {{ macros.install_pip(adjutant_base_pip_packages | customizable("pip_packages")) }} \
&& mkdir -p /etc/adjutant \
&& cp -r /adjutant/etc/* /etc/adjutant/ \
&& chown -R adjutant: /etc/adjutant

{% endif %}

COPY extend_start.sh /usr/local/bin/kolla_extend_start

RUN touch /usr/local/bin/kolla_adjutant_extend_start \
&& chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_adjutant_extend_start

{% block adjutant_base_footer %}{% endblock %}
10 changes: 10 additions & 0 deletions docker/adjutant/adjutant-base/extend_start.sh
@@ -0,0 +1,10 @@
#!/bin/bash

if [[ ! -d "/var/log/kolla/adjutant" ]]; then
mkdir -p /var/log/kolla/adjutant
fi
if [[ $(stat -c %a /var/log/kolla/adjutant) != "755" ]]; then
chmod 755 /var/log/kolla/adjutant
fi

. /usr/local/bin/kolla_adjutant_extend_start
10 changes: 9 additions & 1 deletion kolla/common/config.py
Expand Up @@ -93,6 +93,7 @@
help='Main images'),
cfg.ListOpt('aux',
default=[
'adjutant',
'aodh',
'blazar',
'cloudkitty',
Expand Down Expand Up @@ -284,12 +285,15 @@
help='Clean all package cache.')
]


SOURCES = {
'openstack-base': {
'type': 'url',
'location': ('$tarballs_base/openstack/requirements/'
'requirements-stable-ussuri.tar.gz')},
'adjutant-base': {
'type': 'url',
'location': ('$tarballs_base/openstack/adjutant/'
'adjutant-stable-ussuri.tar.gz')},
'aodh-base': {
'type': 'url',
'location': ('$tarballs_base/openstack/aodh/'
Expand Down Expand Up @@ -1165,6 +1169,10 @@
'masakari-user': {
'uid': 42485,
'gid': 42485,
},
'adjutant-user': {
'uid': 42486,
'gid': 42486,
}
}

Expand Down

0 comments on commit b3069e5

Please sign in to comment.