diff --git a/docker/tripleo-ui/Dockerfile.j2 b/docker/tripleo-ui/Dockerfile.j2 new file mode 100644 index 0000000000..0c4bac8d88 --- /dev/null +++ b/docker/tripleo-ui/Dockerfile.j2 @@ -0,0 +1,59 @@ +FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }} +LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}" + +{% block tripleo_ui_header %}{% endblock %} + +{% import "macros.j2" as macros with context %} + +{% if install_type == 'binary' %} + {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %} + + {% set tripleo_ui_packages = [ + 'httpd', + 'mod_ssl', + 'openstack-tripleo-ui' + + ] %} + + {{ macros.install_packages(tripleo_ui_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 + + {% else %} +RUN echo 'tripleo-ui not yet available for {{ base_distro }}' && /bin/false + {% endif %} + +{% elif install_type == 'source' %} + {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %} + {% set tripleo_ui_packages = [ + 'httpd', + 'mod_ssl', + 'bzip2', + 'nodejs' + + ] %} + + {{ macros.install_packages(tripleo_ui_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_distro in ['debian', 'ubuntu'] %} +RUN echo 'tripleo-ui not yet available for {{ base_distro }}' && /bin/false + {% endif %} + +ADD tripleo-ui-archive /tripleo-ui-source +RUN cd tripleo-ui-source/package \ + && npm install \ + && npm run build \ + && mkdir -p /var/www/openstack-tripleo-ui \ + && cp -rf dist /var/www/openstack-tripleo-ui/ + +{% endif %} + +COPY extend_start.sh /usr/local/bin/kolla_extend_start +RUN chmod 755 /usr/local/bin/kolla_extend_start + +{% block tripleo_ui_footer %}{% endblock %} +{% block footer %}{% endblock %} diff --git a/docker/tripleo-ui/extend_start.sh b/docker/tripleo-ui/extend_start.sh new file mode 100644 index 0000000000..ada839e961 --- /dev/null +++ b/docker/tripleo-ui/extend_start.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# Assume the service runs on top of Apache when user is root +if [[ "$(whoami)" == 'root' ]]; then + # NOTE(pbourke): httpd will not clean up after itself in some cases which + # results in the container not being able to restart. (bug #1489676, 1557036) + if [[ "${KOLLA_BASE_DISTRO}" =~ debian|ubuntu ]]; then + # Loading Apache2 ENV variables + . /etc/apache2/envvars + rm -rf /var/run/apache2/* + else + rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd* + fi +fi diff --git a/kolla/common/config.py b/kolla/common/config.py index 6b2c83a6e2..afe4a97e57 100755 --- a/kolla/common/config.py +++ b/kolla/common/config.py @@ -625,6 +625,10 @@ SOURCES = { 'type': 'url', 'location': ('$tarballs_base/tempest/' 'tempest-master.tar.gz')}, + 'tripleo-ui': { + 'type': 'url', + 'location': ('$tarballs_base/tripleo-ui/' + 'tripleo-ui-latest.tar.gz')}, 'trove-base': { 'type': 'url', 'location': ('$tarballs_base/trove/' diff --git a/kolla/image/build.py b/kolla/image/build.py index b6e959b468..6caed40bad 100755 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -137,6 +137,7 @@ SKIPPED_IMAGES = { "senlin-base", "solum-base", "tacker-base", + "tripleo-ui", "vitrage-base", "vmtp", "zaqar", @@ -144,6 +145,7 @@ SKIPPED_IMAGES = { ], 'ubuntu+source': [ "bifrost-base", + "tripleo-ui" ], 'debian+binary': [ "bifrost-base", @@ -165,6 +167,7 @@ SKIPPED_IMAGES = { "sensu-base", "solum-base", "tacker-base", + "tripleo-ui", "vitrage-base", "vmtp", "zaqar", @@ -173,6 +176,7 @@ SKIPPED_IMAGES = { 'debian+source': [ "bifrost-base", "sensu-base", + "tripleo-ui" ], 'oraclelinux+binary': [ "bifrost-base", diff --git a/releasenotes/notes/add-tripleo-ui-image-6a17f9a31894d908.yaml b/releasenotes/notes/add-tripleo-ui-image-6a17f9a31894d908.yaml new file mode 100644 index 0000000000..15453c6c2f --- /dev/null +++ b/releasenotes/notes/add-tripleo-ui-image-6a17f9a31894d908.yaml @@ -0,0 +1,3 @@ +--- +features: + - Add tripleo-ui image