Browse Source

Implement Almanach Docker images

Almanach record the utilization of OpenStack resources for each tenant.

Implements: blueprint containerized-almanach
Change-Id: Iba2e16772864a6f0169ec43d7a87d741882cd51c
changes/38/498938/10
Bertrand Lallau 4 years ago
committed by Duong Ha-Quang
parent
commit
b8f7693d41
  1. 1
      README.rst
  2. 16
      docker/almanach/almanach-api/Dockerfile.j2
  3. 34
      docker/almanach/almanach-base/Dockerfile.j2
  4. 8
      docker/almanach/almanach-base/extend_start.sh
  5. 16
      docker/almanach/almanach-collector/Dockerfile.j2
  6. 9
      kolla/common/config.py
  7. 4
      kolla/image/build.py
  8. 3
      releasenotes/notes/almanach-images-f0a9a424ac3fe7cd.yaml

1
README.rst

@ -75,6 +75,7 @@ OpenStack services
Kolla provides images to deploy the following OpenStack projects:
- `Almanach <https://almanach.readthedocs.io/>`__
- `Aodh <https://docs.openstack.org/aodh/latest/>`__
- `Barbican <https://docs.openstack.org/barbican/latest/>`__
- `Bifrost <https://docs.openstack.org/bifrost/latest/>`__

16
docker/almanach/almanach-api/Dockerfile.j2

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

34
docker/almanach/almanach-base/Dockerfile.j2

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

8
docker/almanach/almanach-base/extend_start.sh

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

16
docker/almanach/almanach-collector/Dockerfile.j2

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

9
kolla/common/config.py

@ -95,6 +95,7 @@ _PROFILE_OPTS = [
help='Main images'),
cfg.ListOpt('aux',
default=[
'almanach',
'aodh',
'blazar',
'cloudkitty',
@ -278,6 +279,10 @@ SOURCES = {
'type': 'url',
'location': ('$tarballs_base/requirements/'
'requirements-master.tar.gz')},
'almanach-base': {
'type': 'url',
'location': ('$tarballs_base/almanach/'
'almanach-master.tar.gz')},
'aodh-base': {
'type': 'url',
'location': ('$tarballs_base/aodh/'
@ -946,6 +951,10 @@ USERS = {
'fluentd-user': {
'uid': 42474,
'gid': 42474,
},
'almanach-user': {
'uid': 42475,
'gid': 42475,
}
}

4
kolla/image/build.py

@ -96,6 +96,7 @@ STATUS_ERRORS = (STATUS_CONNECTION_ERROR, STATUS_PUSH_ERROR,
SKIPPED_IMAGES = {
'centos+binary': [
"almanach-base",
"bifrost-base",
"blazar-base",
"dragonflow-base",
@ -117,6 +118,7 @@ SKIPPED_IMAGES = {
"ovsdpdk",
],
'ubuntu+binary': [
"almanach-base",
"bifrost-base",
"blazar-base",
"cloudkitty-base",
@ -145,6 +147,7 @@ SKIPPED_IMAGES = {
"tripleo-ui"
],
'debian+binary': [
"almanach-base",
"bifrost-base",
"blazar-base",
"cloudkitty-base",
@ -175,6 +178,7 @@ SKIPPED_IMAGES = {
"tripleo-ui"
],
'oraclelinux+binary': [
"almanach-base",
"bifrost-base",
"blazar-base",
"dragonflow-base",

3
releasenotes/notes/almanach-images-f0a9a424ac3fe7cd.yaml

@ -0,0 +1,3 @@
---
features:
- Almanach Docker images are available in Kolla
Loading…
Cancel
Save