Browse Source

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
changes/45/454745/14
Eduardo Gonzalez 5 years ago
parent
commit
7b1e550c3f
  1. 1
      README.rst
  2. 19
      docker/blazar/blazar-api/Dockerfile.j2
  3. 8
      docker/blazar/blazar-api/extend_start.sh
  4. 37
      docker/blazar/blazar-base/Dockerfile.j2
  5. 10
      docker/blazar/blazar-base/extend_start.sh
  6. 16
      docker/blazar/blazar-manager/Dockerfile.j2
  7. 9
      kolla/common/config.py
  8. 3
      releasenotes/notes/blazar-images-c54435b3bd5b0425.yaml
  9. 4
      tests/test_build.py

1
README.rst

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

19
docker/blazar/blazar-api/Dockerfile.j2

@ -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

8
docker/blazar/blazar-api/extend_start.sh

@ -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

37
docker/blazar/blazar-base/Dockerfile.j2

@ -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 %}

10
docker/blazar/blazar-base/extend_start.sh

@ -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

16
docker/blazar/blazar-manager/Dockerfile.j2

@ -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

9
kolla/common/config.py

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

3
releasenotes/notes/blazar-images-c54435b3bd5b0425.yaml

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

4
tests/test_build.py

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

Loading…
Cancel
Save