Implement blazar Docker images

Blazar is a resource reservation service for OpenStack,
allows to reserve compute host for tenants.
Really usefull for HPC, NFV and Scientific environments.

Implements: blueprint blazar-images
Change-Id: If42087a791a7f84105c867509e4bbc7b423cb41e
This commit is contained in:
Eduardo Gonzalez 2017-04-07 12:18:16 +01:00
parent da4396a86d
commit 7b1e550c3f
9 changed files with 107 additions and 0 deletions

View File

@ -78,6 +78,7 @@ Kolla provides images to deploy the following OpenStack projects:
- `Aodh <https://docs.openstack.org/developer/aodh/>`__ - `Aodh <https://docs.openstack.org/developer/aodh/>`__
- `Barbican <https://docs.openstack.org/developer/barbican/>`__ - `Barbican <https://docs.openstack.org/developer/barbican/>`__
- `Bifrost <https://docs.openstack.org/developer/bifrost/>`__ - `Bifrost <https://docs.openstack.org/developer/bifrost/>`__
- `Blazar <https://blazar.readthedocs.io/en/latest/>`__
- `Ceilometer <https://docs.openstack.org/developer/ceilometer/>`__ - `Ceilometer <https://docs.openstack.org/developer/ceilometer/>`__
- `Cinder <https://docs.openstack.org/developer/cinder/>`__ - `Cinder <https://docs.openstack.org/developer/cinder/>`__
- `CloudKitty <https://docs.openstack.org/developer/cloudkitty/>`__ - `CloudKitty <https://docs.openstack.org/developer/cloudkitty/>`__

View File

@ -0,0 +1,19 @@
FROM {{ namespace }}/{{ image_prefix }}blazar-base:{{ tag }}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% block blazar_api_header %}{% endblock %}
{% if install_type == 'binary' %}
RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
&& /bin/false
{% endif %}
COPY extend_start.sh /usr/local/bin/kolla_blazar_extend_start
RUN chmod 755 /usr/local/bin/kolla_blazar_extend_start
{% block blazar_api_footer %}{% endblock %}
{% block footer %}{% endblock %}
USER blazar

View File

@ -0,0 +1,8 @@
#!/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
blazar-db-manage --config-file /etc/blazar/blazar.conf upgrade head
exit 0
fi

View File

@ -0,0 +1,37 @@
FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% block blazar_base_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{{ macros.configure_user(name='blazar') }}
{% if install_type == 'binary' %}
RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
&& /bin/false
{% elif install_type == 'source' %}
ADD blazar-base-archive /blazar-base-source
{% set blazar_base_pip_packages = [
'/blazar'
] %}
RUN ln -s blazar-base-source/* blazar \
&& {{ macros.install_pip(blazar_base_pip_packages | customizable("pip_packages")) }} \
&& mkdir -p /etc/blazar \
&& cp -r /blazar/etc/blazar/* /etc/blazar \
&& cp /blazar/etc/policy.json /etc/blazar \
&& chown -R blazar: /etc/blazar
{% endif %}
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN touch /usr/local/bin/kolla_blazar_extend_start \
&& chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_blazar_extend_start
{% block blazar_base_footer %}{% endblock %}

View File

@ -0,0 +1,10 @@
#!/bin/bash
if [[ ! -d "/var/log/kolla/blazar" ]]; then
mkdir -p /var/log/kolla/blazar
fi
if [[ $(stat -c %a /var/log/kolla/blazar) != "755" ]]; then
chmod 755 /var/log/kolla/blazar
fi
. /usr/local/bin/kolla_blazar_extend_start

View File

@ -0,0 +1,16 @@
FROM {{ namespace }}/{{ image_prefix }}blazar-base:{{ tag }}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% block blazar_manager_header %}{% endblock %}
{% if install_type == 'binary' %}
RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
&& /bin/false
{% endif %}
{% block blazar_manager_footer %}{% endblock %}
{% block footer %}{% endblock %}
USER blazar

View File

@ -94,6 +94,7 @@ _PROFILE_OPTS = [
cfg.ListOpt('aux', cfg.ListOpt('aux',
default=[ default=[
'aodh', 'aodh',
'blazar',
'cloudkitty', 'cloudkitty',
'congress', 'congress',
'designate', 'designate',
@ -284,6 +285,10 @@ SOURCES = {
'type': 'url', 'type': 'url',
'location': ('$tarballs_base/bifrost/' 'location': ('$tarballs_base/bifrost/'
'bifrost-master.tar.gz')}, 'bifrost-master.tar.gz')},
'blazar-base': {
'type': 'url',
'location': ('$tarballs_base/blazar/'
'blazar-master.tar.gz')},
'ceilometer-base': { 'ceilometer-base': {
'type': 'url', 'type': 'url',
'location': ('$tarballs_base/ceilometer/' 'location': ('$tarballs_base/ceilometer/'
@ -905,6 +910,10 @@ USERS = {
'novajoin-user': { 'novajoin-user': {
'uid': 42470, 'uid': 42470,
'gid': 42470, 'gid': 42470,
},
'blazar-user': {
'uid': 42471,
'gid': 42471,
} }
} }

View File

@ -0,0 +1,3 @@
---
features:
- Blazar Docker images are available in Kolla

View File

@ -74,6 +74,7 @@ class BuildTest(object):
class BuildTestCentosBinary(BuildTest, base.BaseTestCase): class BuildTestCentosBinary(BuildTest, base.BaseTestCase):
excluded_images = [ excluded_images = [
"bifrost-base", "bifrost-base",
"blazar-base",
"dragonflow-base", "dragonflow-base",
"freezer-base", "freezer-base",
"kafka", "kafka",
@ -114,6 +115,7 @@ class BuildTestCentosSource(BuildTest, base.BaseTestCase):
class BuildTestUbuntuBinary(BuildTest, base.BaseTestCase): class BuildTestUbuntuBinary(BuildTest, base.BaseTestCase):
excluded_images = [ excluded_images = [
"bifrost-base", "bifrost-base",
"blazar-base",
"cloudkitty-base", "cloudkitty-base",
"congress-base", "congress-base",
"dragonflow-base", "dragonflow-base",
@ -158,6 +160,7 @@ class BuildTestUbuntuSource(BuildTest, base.BaseTestCase):
class BuildTestDebianBinary(BuildTest, base.BaseTestCase): class BuildTestDebianBinary(BuildTest, base.BaseTestCase):
excluded_images = [ excluded_images = [
"bifrost-base", "bifrost-base",
"blazar-base",
"cloudkitty-base", "cloudkitty-base",
"congress-base", "congress-base",
"dragonflow-base", "dragonflow-base",
@ -204,6 +207,7 @@ class BuildTestDebianSource(BuildTest, base.BaseTestCase):
class BuildTestOracleLinuxBinary(BuildTest, base.BaseTestCase): class BuildTestOracleLinuxBinary(BuildTest, base.BaseTestCase):
excluded_images = [ excluded_images = [
"bifrost-base", "bifrost-base",
"blazar-base",
"dragonflow-base", "dragonflow-base",
"freezer-base", "freezer-base",
"kafka", "kafka",