This repository has been archived by the owner on Nov 24, 2022. It is now read-only.
forked from openstack/kolla
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
15f2af1
commit 4d95e37
Showing
1 changed file
with
210 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,210 @@ | ||
From 92f52510f3a4d921c74402e08a6a001756b3cb5b Mon Sep 17 00:00:00 2001 | ||
From: Ole Kleinschmidt <ok@datenreisende.org> | ||
Date: Thu, 16 Jul 2020 13:04:25 +0000 | ||
Subject: [PATCH] add adjutant | ||
|
||
--- | ||
docker/adjutant/adjutant-api/Dockerfile.j2 | 58 +++++++++++++++++++ | ||
docker/adjutant/adjutant-api/extend_start.sh | 11 ++++ | ||
docker/adjutant/adjutant-base/Dockerfile.j2 | 47 +++++++++++++++ | ||
docker/adjutant/adjutant-base/extend_start.sh | 10 ++++ | ||
kolla/common/config.py | 10 +++- | ||
5 files changed, 135 insertions(+), 1 deletion(-) | ||
create mode 100644 docker/adjutant/adjutant-api/Dockerfile.j2 | ||
create mode 100644 docker/adjutant/adjutant-api/extend_start.sh | ||
create mode 100644 docker/adjutant/adjutant-base/Dockerfile.j2 | ||
create mode 100644 docker/adjutant/adjutant-base/extend_start.sh | ||
|
||
diff --git a/docker/adjutant/adjutant-api/Dockerfile.j2 b/docker/adjutant/adjutant-api/Dockerfile.j2 | ||
new file mode 100644 | ||
index 000000000..a661c0618 | ||
--- /dev/null | ||
+++ b/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 %} | ||
diff --git a/docker/adjutant/adjutant-api/extend_start.sh b/docker/adjutant/adjutant-api/extend_start.sh | ||
new file mode 100644 | ||
index 000000000..6db9fbc8a | ||
--- /dev/null | ||
+++ b/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 | ||
diff --git a/docker/adjutant/adjutant-base/Dockerfile.j2 b/docker/adjutant/adjutant-base/Dockerfile.j2 | ||
new file mode 100644 | ||
index 000000000..a34b9f9fd | ||
--- /dev/null | ||
+++ b/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 %} | ||
diff --git a/docker/adjutant/adjutant-base/extend_start.sh b/docker/adjutant/adjutant-base/extend_start.sh | ||
new file mode 100644 | ||
index 000000000..eb5e4b987 | ||
--- /dev/null | ||
+++ b/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 | ||
diff --git a/kolla/common/config.py b/kolla/common/config.py | ||
index 1073e88de..f4f8a3f2c 100755 | ||
--- a/kolla/common/config.py | ||
+++ b/kolla/common/config.py | ||
@@ -93,6 +93,7 @@ _PROFILE_OPTS = [ | ||
help='Main images'), | ||
cfg.ListOpt('aux', | ||
default=[ | ||
+ 'adjutant', | ||
'aodh', | ||
'blazar', | ||
'cloudkitty', | ||
@@ -284,12 +285,15 @@ _BASE_OPTS = [ | ||
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/' | ||
@@ -1165,6 +1169,10 @@ USERS = { | ||
'masakari-user': { | ||
'uid': 42485, | ||
'gid': 42485, | ||
+ }, | ||
+ 'adjutant-user': { | ||
+ 'uid': 42486, | ||
+ 'gid': 42486, | ||
} | ||
} | ||
|
||
-- | ||
2.17.1 | ||
|