diff --git a/docker/novajoin/novajoin-base/Dockerfile.j2 b/docker/novajoin/novajoin-base/Dockerfile.j2 new file mode 100644 index 0000000000..2ac0c15f74 --- /dev/null +++ b/docker/novajoin/novajoin-base/Dockerfile.j2 @@ -0,0 +1,55 @@ +FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }} +LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}" + +{% block novajoin_base_header %}{% endblock %} + +{% import "macros.j2" as macros with context %} + +{{ macros.configure_user(name='novajoin') }} + +{% if install_type == 'binary' %} + {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %} + + {% set novajoin_base_packages = [ + 'python-novajoin' + ] %} + + {% else %} +RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ + && /bin/false + {% endif %} + +{{ macros.install_packages(novajoin_base_packages | customizable("packages")) }} + +{% elif install_type == 'source' %} + {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %} + {% set novajoin_base_packages = [ + 'ipa-admintools', + ] %} + {% elif base_distro in ['ubuntu'] %} + {% set novajoin_base_packages = [ + 'freeipa-admintools', + ] %} + {% endif %} + +{{ macros.install_packages(novajoin_base_packages | customizable("packages")) }} + +ADD novajoin-base-archive /novajoin-base-source + +{% set novajoin_base_pip_packages = [ + '/novajoin' +] %} + +RUN ln -s novajoin-base-source/* novajoin \ + && {{ macros.install_pip(novajoin_base_pip_packages | customizable("pip_packages")) }} \ + && mkdir -p /etc/nova /etc/novajoin \ + && chown -R novajoin: /etc/nova /etc/novajoin + +{% endif %} + +COPY extend_start.sh /usr/local/bin/kolla_extend_start +RUN chmod 750 /etc/sudoers.d \ + && touch /usr/local/bin/kolla_novajoin_extend_start \ + && chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_novajoin_extend_start + +{% block novajoin_base_footer %}{% endblock %} diff --git a/docker/novajoin/novajoin-base/extend_start.sh b/docker/novajoin/novajoin-base/extend_start.sh new file mode 100644 index 0000000000..f5b38b898e --- /dev/null +++ b/docker/novajoin/novajoin-base/extend_start.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +if [[ ! -d "/var/log/kolla/novajoin" ]]; then + mkdir -p /var/log/kolla/novajoin +fi +if [[ $(stat -c %a /var/log/kolla/novajoin) != "755" ]]; then + chmod 755 /var/log/kolla/novajoin +fi + +. /usr/local/bin/kolla_novajoin_extend_start diff --git a/docker/novajoin/novajoin-notifier/Dockerfile.j2 b/docker/novajoin/novajoin-notifier/Dockerfile.j2 new file mode 100644 index 0000000000..9be1cdfbc4 --- /dev/null +++ b/docker/novajoin/novajoin-notifier/Dockerfile.j2 @@ -0,0 +1,16 @@ +FROM {{ namespace }}/{{ image_prefix }}novajoin-base:{{ tag }} +LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}" + +{% block novajoin_notifier_header %}{% endblock %} + +{% import "macros.j2" as macros with context %} + +{% if install_type == 'binary' %} + {% if base_distro not in ['centos', 'oraclelinux', 'rhel'] %} +RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ + && /bin/false + {% endif %} +{% endif %} + +{% block novajoin_notifier_footer %}{% endblock %} +{% block footer %}{% endblock %} diff --git a/docker/novajoin/novajoin-server/Dockerfile.j2 b/docker/novajoin/novajoin-server/Dockerfile.j2 new file mode 100644 index 0000000000..423aa5955a --- /dev/null +++ b/docker/novajoin/novajoin-server/Dockerfile.j2 @@ -0,0 +1,16 @@ +FROM {{ namespace }}/{{ image_prefix }}novajoin-base:{{ tag }} +LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}" + +{% block novajoin_server_header %}{% endblock %} + +{% import "macros.j2" as macros with context %} + +{% if install_type == 'binary' %} + {% if base_distro not in ['centos', 'oraclelinux', 'rhel'] %} +RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ + && /bin/false + {% endif %} +{% endif %} + +{% block novajoin_server_footer %}{% endblock %} +{% block footer %}{% endblock %} diff --git a/kolla/common/config.py b/kolla/common/config.py index f717934906..5fe373a15e 100755 --- a/kolla/common/config.py +++ b/kolla/common/config.py @@ -87,7 +87,7 @@ _PROFILE_OPTS = [ 'iscsi', 'keystone', 'neutron', - 'nova', + 'nova-', 'swift', ], help='Main images'), @@ -111,6 +111,7 @@ _PROFILE_OPTS = [ 'mistral', 'monasca', 'murano', + 'novajoin', 'octavia', 'panko', 'rally', @@ -143,7 +144,7 @@ _PROFILE_OPTS = [ 'mariadb', 'memcached', 'neutron', - 'nova', + 'nova-', 'openvswitch', 'rabbitmq', ], @@ -162,7 +163,7 @@ _PROFILE_OPTS = [ 'mariadb', 'memcached', 'neutron', - 'nova', + 'nova-', 'openvswitch', 'rabbitmq', ], @@ -553,6 +554,10 @@ SOURCES = { 'type': 'url', 'location': ('$tarballs_base/blazar-nova/' 'blazar-nova-master.tar.gz')}, + 'novajoin-base': { + 'type': 'url', + 'location': ('$tarballs_base/novajoin/' + 'novajoin-master.tar.gz')}, 'octavia-base': { 'type': 'url', 'location': ('$tarballs_base/octavia/' @@ -896,6 +901,10 @@ USERS = { 'kuryr-user': { 'uid': 42469, 'gid': 42469, + }, + 'novajoin-user': { + 'uid': 42470, + 'gid': 42470, } } diff --git a/releasenotes/notes/add-novajoin-9e8ae602b29335b7.yaml b/releasenotes/notes/add-novajoin-9e8ae602b29335b7.yaml new file mode 100644 index 0000000000..e91502c774 --- /dev/null +++ b/releasenotes/notes/add-novajoin-9e8ae602b29335b7.yaml @@ -0,0 +1,3 @@ +--- +features: + - Add novajoin image. diff --git a/tests/test_build.py b/tests/test_build.py index c138ae34a1..6fd605a532 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -122,6 +122,7 @@ class BuildTestUbuntuBinary(BuildTest, base.BaseTestCase): "kuryr-base", "mistral-event-engine", "monasca-base", + "novajoin-base", "octavia-base", "panko-base", "searchlight-base", @@ -165,6 +166,7 @@ class BuildTestDebianBinary(BuildTest, base.BaseTestCase): "kuryr-base", "mistral-event-engine", "monasca-base", + "novajoin-base", "octavia-base", "panko-base", "searchlight-base",