Add initial version of Openstack Heat containering

Change-Id: I2f4f196ed736f987fd47e9f0a0312271cebc6d55
This commit is contained in:
Dmitry Russkikh 2016-07-27 11:34:26 +00:00
parent 4471da33fe
commit b42c088d6e
9 changed files with 207 additions and 0 deletions

View File

@ -0,0 +1,9 @@
FROM {{ namespace }}/heat-base:{{ tag }}
MAINTAINER {{ maintainer }}
#mysql-client only for provisioning need to be removed later
RUN apt-get install -y --no-install-recommends \
mysql-client \
&& apt-get clean
USER heat

View File

@ -0,0 +1,14 @@
FROM {{ namespace }}/openstack-base:{{ tag }}
MAINTAINER {{ maintainer }}
RUN curl -o heat-{{ branch }}.tar.gz http://tarballs.openstack.org/heat/heat-{{ branch }}.tar.gz \
&& tar -zxvf heat-{{ branch }}.tar.gz
RUN mv heat*/ heat-{{ branch }}/ \
&& ln -s heat-{{ branch }} /heat \
&& useradd --user-group heat \
&& /var/lib/microservices/venv/bin/pip --no-cache-dir install --upgrade -c /heat/requirements.txt /heat \
&& mkdir -p /var/lib/heat /etc/heat \
&& chown -R heat: /var/lib/heat /etc/heat \
&& cp -r /heat/etc/heat/* /etc/heat \
&& usermod -a -G microservices heat

View File

@ -0,0 +1,4 @@
FROM {{ namespace }}/heat-base:{{ tag }}
MAINTAINER {{ maintainer }}
USER heat

View File

@ -0,0 +1,13 @@
configs:
heat_api_port: 8004
heat_db_username: heat
heat_db_password: password
heat_db_name: heat
heat_user: heat
heat_password: password
heat_memcache_secret_key: secret_key
heat_debug: false

View File

@ -0,0 +1,51 @@
[DEFAULT]
debug = {{ heat_debug }}
use_syslog = False
use_stderr = True
use_forwarded_for = True
region_name_for_services = RegionOne
rpc_backend = rabbit
[database]
connection = mysql+pymysql://{{ heat_db_username }}:{{ heat_db_password }}@mariadb/{{ heat_db_name }}
[oslo_messaging_rabbit]
rabbit_userid = {{ rabbitmq_user }}
rabbit_password = {{ rabbitmq_password }}
rabbit_ha_queues = true
rabbit_hosts = rabbitmq
[keystone_authtoken]
auth_version = v3
auth_uri = http://keystone:{{ keystone_public_port }}/v3
auth_url = http://keystone:{{ keystone_admin_port }}/v3
auth_type = password
project_domain_id = default
user_domain_id = default
project_name = {{ openstack_project_name }}
username = {{ heat_user }}
password = {{ heat_password }}
memcache_security_strategy = ENCRYPT
memcache_secret_key = {{ heat_memcache_secret_key }}
memcached_servers = memcached:{{ memcached_port }}
[trustee]
user_domain_id = default
password = {{ heat_password }}
username = {{ heat_user }}
auth_uri = http://keystone:{{ keystone_public_port }}
auth_url = http://keystone:{{ keystone_admin_port }}
auth_type = password
[clients_keystone]
auth_uri = http://keystone:{{ keystone_public_port }}
[heat_api]
bind_host = {{ network_topology["private"]["address"] }}
bind_port = {{ heat_api_port }}
[cache]
backend = oslo_cache.memcache_pool
enabled = True
memcache_servers = memcached:{{ memcached_port }}

74
service/heat-api.yaml Normal file
View File

@ -0,0 +1,74 @@
service:
name: heat-api
ports:
- heat_api_port
containers:
- name: heat-api
image: heat-api
# TODO(drusskikh): add probes
probes:
readiness: "true"
liveness: "true"
pre:
- name: heat-db-create
dependencies:
- mariadb
type: single
command:
mysql -u root -p{{ db_root_password }} -h mariadb -e "create database {{ heat_db_name }};
grant all privileges on {{ heat_db_name }}.* to '{{ heat_db_username }}'@'%' identified by '{{ heat_db_password }}';"
- name: heat-db-sync
files:
- heat-conf
dependencies:
- heat-db-create
type: single
command: heat-manage db_sync
- name: heat-user-create
dependencies:
- keystone-create-project
type: single
command:
openstack user create --domain default --password {{ heat_password }} {{ heat_user }}
- name: heat-role-add
dependencies:
- heat-user-create
type: single
command:
openstack role add --project {{ openstack_project_name }} --user {{ heat_user }} admin
- name: heat-service-create
dependencies:
- keystone-create-project
type: single
command:
openstack service create --name heat --description "OpenStack orchestration service" orchestration
- name: heat-public-endpoint-create
dependencies:
- heat-service-create
type: single
command:
openstack endpoint create --region RegionOne orchestration public http://heat-api:{{ heat_api_port }}/v1/%\(tenant_id\)s
- name: heat-internal-endpoint-create
dependencies:
- heat-service-create
type: single
command:
openstack endpoint create --region RegionOne orchestration internal http://heat-api:{{ heat_api_port }}/v1/%\(tenant_id\)s
- name: heat-admin-endpoint-create
dependencies:
- heat-service-create
type: single
command:
openstack endpoint create --region RegionOne orchestration admin http://heat-api:{{ heat_api_port }}/v1/%\(tenant_id\)s
daemon:
name: heat-api
dependencies:
- rabbitmq
files:
- heat-conf
command: heat-api --config-file /etc/heat/heat.conf
files:
heat-conf:
path: /etc/heat/heat.conf
content: heat.conf.j2

21
service/heat-engine.yaml Normal file
View File

@ -0,0 +1,21 @@
service:
name: heat-engine
containers:
- name: heat-engine
image: heat-engine
# TODO(drusskikh): add probes
probes:
readiness: "true"
liveness: "true"
daemon:
command: heat-engine --config-file /etc/heat/heat.conf
dependencies:
- heat-api
- rabbitmq
files:
- heat.conf
files:
heat.conf:
path: /etc/heat/heat.conf
content: heat.conf.j2
perm: "0600"

7
tools/run-check-yaml-syntax.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
### Temp yaml syntax checker script.
set -e
for file in $(find . -name '*.yaml'); do
yamllint -d relaxed $file
done

14
tox.ini Normal file
View File

@ -0,0 +1,14 @@
[tox]
minversion = 1.6
envlist = linters,bashate
skipsdist = True
[testenv:linters]
deps = yamllint
commands =
{toxinidir}/tools/run-check-yaml-syntax.sh
[testenv:bashate]
deps = bashate>=0.2
whitelist_externals = bash
commands = bash -c "find {toxinidir} -type f -name '*.sh' -not -path '*/.tox/*' -print0 | xargs -0 bashate -v"