From 13062e23e86b5d86020949754540460cb5b0b4fe Mon Sep 17 00:00:00 2001 From: Sam Yaple Date: Wed, 13 May 2015 06:46:24 -0500 Subject: Restructure builds to allow more flexibility As a restructure, nothing is changed from the original behaviour and naming despite the file structure changing. The symlinks to build had to be updated generating lots of "deleted" and "new_file". The new structure is: docker/${base_distro}/${type}/${container} base_distro == centos, ubuntu, fedora, etc type == source, binary, rdo type rdo is a symlink to binary for backwards compatibility Two new flags are added to the build-all script to support the ability to support different base distros and a flag to support binary or source containers. There are several added folders that are empty to hold the directory structure for future containers of these types. To use a prefix other than centos-rdo- you can set PREFIX in the toplevel directory .buildconf file Change-Id: Ifc7bac0d827470f506c8b5c004a833da9ce13b90 --- docker/centos/binary/barbican/Dockerfile | 40 ++++ docker/centos/binary/barbican/build | 1 + docker/centos/binary/barbican/start.sh | 81 ++++++++ docker/centos/binary/base/kolla-common.sh | 170 +++++++++++++++++ docker/centos/binary/base/service_hosts.sh | 45 +++++ .../binary/ceilometer/ceilometer-alarm/Dockerfile | 7 + .../binary/ceilometer/ceilometer-alarm/build | 1 + .../binary/ceilometer/ceilometer-alarm/start.sh | 10 + .../binary/ceilometer/ceilometer-api/Dockerfile | 7 + .../centos/binary/ceilometer/ceilometer-api/build | 1 + .../binary/ceilometer/ceilometer-api/start.sh | 51 +++++ .../binary/ceilometer/ceilometer-base/Dockerfile | 5 + .../centos/binary/ceilometer/ceilometer-base/build | 1 + .../ceilometer-base/config-ceilometer.sh | 71 +++++++ .../ceilometer/ceilometer-central/Dockerfile | 7 + .../binary/ceilometer/ceilometer-central/build | 1 + .../binary/ceilometer/ceilometer-central/start.sh | 14 ++ .../ceilometer/ceilometer-collector/Dockerfile | 7 + .../binary/ceilometer/ceilometer-collector/build | 1 + .../ceilometer/ceilometer-collector/start.sh | 9 + .../ceilometer/ceilometer-compute/Dockerfile | 8 + .../binary/ceilometer/ceilometer-compute/build | 1 + .../binary/ceilometer/ceilometer-compute/start.sh | 25 +++ .../ceilometer/ceilometer-notification/Dockerfile | 7 + .../ceilometer/ceilometer-notification/build | 1 + .../ceilometer/ceilometer-notification/start.sh | 9 + docker/centos/binary/centos-binary-base/.buildconf | 1 + docker/centos/binary/centos-binary-base/Dockerfile | 113 +++++++++++ docker/centos/binary/centos-binary-base/build | 1 + .../binary/centos-binary-base/kolla-common.sh | 1 + .../binary/centos-binary-base/service_hosts.sh | 1 + docker/centos/binary/centos-rdo-base | 1 + docker/centos/binary/cinder/Dockerfile | 8 + docker/centos/binary/cinder/build | 1 + docker/centos/binary/cinder/start.sh | 145 ++++++++++++++ docker/centos/binary/docker-compose/README.md | 107 +++++++++++ docker/centos/binary/fedora-binary-base/.buildconf | 1 + docker/centos/binary/fedora-binary-base/Dockerfile | 108 +++++++++++ docker/centos/binary/fedora-binary-base/build | 1 + .../binary/fedora-binary-base/kolla-common.sh | 1 + .../binary/fedora-binary-base/service_hosts.sh | 1 + docker/centos/binary/fedora-rdo-base | 1 + docker/centos/binary/glance/glance-api/Dockerfile | 9 + docker/centos/binary/glance/glance-api/build | 1 + docker/centos/binary/glance/glance-api/check.sh | 17 ++ docker/centos/binary/glance/glance-api/start.sh | 52 +++++ docker/centos/binary/glance/glance-base/Dockerfile | 10 + docker/centos/binary/glance/glance-base/build | 1 + .../binary/glance/glance-base/config-glance.sh | 63 +++++++ .../binary/glance/glance-registry/Dockerfile | 5 + docker/centos/binary/glance/glance-registry/build | 1 + .../centos/binary/glance/glance-registry/start.sh | 21 +++ docker/centos/binary/hautoproxy/Dockerfile | 9 + docker/centos/binary/hautoproxy/build | 1 + docker/centos/binary/hautoproxy/haproxy.cfg.tmpl | 26 +++ docker/centos/binary/hautoproxy/start.py | 65 +++++++ docker/centos/binary/heat/heat-api-cfn/Dockerfile | 12 ++ docker/centos/binary/heat/heat-api-cfn/build | 1 + docker/centos/binary/heat/heat-api-cfn/check.sh | 16 ++ docker/centos/binary/heat/heat-api-cfn/start.sh | 28 +++ docker/centos/binary/heat/heat-api/Dockerfile | 14 ++ docker/centos/binary/heat/heat-api/build | 1 + docker/centos/binary/heat/heat-api/check.sh | 16 ++ docker/centos/binary/heat/heat-api/start.sh | 29 +++ docker/centos/binary/heat/heat-base/Dockerfile | 5 + docker/centos/binary/heat/heat-base/build | 1 + docker/centos/binary/heat/heat-base/config-heat.sh | 67 +++++++ docker/centos/binary/heat/heat-engine/Dockerfile | 9 + docker/centos/binary/heat/heat-engine/build | 1 + docker/centos/binary/heat/heat-engine/start.sh | 17 ++ docker/centos/binary/horizon/Dockerfile | 16 ++ docker/centos/binary/horizon/build | 1 + docker/centos/binary/horizon/start.sh | 36 ++++ docker/centos/binary/keystone/Dockerfile | 14 ++ docker/centos/binary/keystone/build | 1 + docker/centos/binary/keystone/check.sh | 12 ++ docker/centos/binary/keystone/start.sh | 162 ++++++++++++++++ docker/centos/binary/magnum/magnum-api/Dockerfile | 11 ++ docker/centos/binary/magnum/magnum-api/build | 1 + docker/centos/binary/magnum/magnum-api/check.sh | 16 ++ docker/centos/binary/magnum/magnum-api/start.sh | 27 +++ docker/centos/binary/magnum/magnum-base/Dockerfile | 9 + docker/centos/binary/magnum/magnum-base/build | 1 + .../binary/magnum/magnum-base/config-magnum.sh | 46 +++++ .../binary/magnum/magnum-conductor/Dockerfile | 13 ++ docker/centos/binary/magnum/magnum-conductor/build | 1 + .../centos/binary/magnum/magnum-conductor/start.sh | 17 ++ docker/centos/binary/mariadb-app/Dockerfile | 18 ++ docker/centos/binary/mariadb-app/build | 1 + docker/centos/binary/mariadb-app/config-mysql.sh | 24 +++ .../centos/binary/mariadb-app/mysql-entrypoint.sh | 49 +++++ docker/centos/binary/mariadb-data/Dockerfile | 8 + docker/centos/binary/mariadb-data/build | 1 + docker/centos/binary/mongodb/Dockerfile | 11 ++ docker/centos/binary/mongodb/build | 1 + .../binary/neutron/neutron-agents/Dockerfile | 39 ++++ docker/centos/binary/neutron/neutron-agents/build | 1 + .../check-scripts/check-dhcp-agent.sh | 13 ++ .../neutron-agents/check-scripts/check-l3-agent.sh | 13 ++ .../check-scripts/check-linuxbridge-agent.sh | 13 ++ .../check-scripts/check-metadata-agent.sh | 13 ++ .../config-scripts/config-dhcp-agent.sh | 88 +++++++++ .../config-scripts/config-l3-agent.sh | 85 +++++++++ .../config-scripts/config-linuxbridge-agent.sh | 29 +++ .../config-scripts/config-metadata-agent.sh | 74 ++++++++ .../config-scripts/config-sudoers.sh | 12 ++ .../binary/neutron/neutron-agents/fwaas_driver.ini | 3 + .../binary/neutron/neutron-agents/supervisord.conf | 53 ++++++ .../centos/binary/neutron/neutron-base/Dockerfile | 7 + docker/centos/binary/neutron/neutron-base/build | 1 + .../binary/neutron/neutron-base/config-neutron.sh | 210 +++++++++++++++++++++ .../binary/neutron/neutron-server/Dockerfile | 13 ++ docker/centos/binary/neutron/neutron-server/build | 1 + .../centos/binary/neutron/neutron-server/check.sh | 17 ++ .../centos/binary/neutron/neutron-server/start.sh | 98 ++++++++++ docker/centos/binary/nova-base/Dockerfile | 11 ++ docker/centos/binary/nova-base/build | 1 + docker/centos/binary/nova-base/config-nova.sh | 137 ++++++++++++++ .../nova-compute/nova-compute-data/Dockerfile | 10 + .../binary/nova-compute/nova-compute-data/build | 1 + .../binary/nova-compute/nova-compute/Dockerfile | 13 ++ .../centos/binary/nova-compute/nova-compute/build | 1 + .../nova-compute/config-nova-compute.sh | 29 +++ .../binary/nova-compute/nova-compute/start.sh | 10 + .../binary/nova-compute/nova-libvirt/Dockerfile | 16 ++ .../centos/binary/nova-compute/nova-libvirt/build | 1 + .../binary/nova-compute/nova-libvirt/start.sh | 22 +++ .../binary/nova-compute/nova-network/Dockerfile | 10 + .../centos/binary/nova-compute/nova-network/build | 1 + .../nova-network/config-nova-network.sh | 30 +++ .../binary/nova-compute/nova-network/start.sh | 8 + .../binary/nova-controller/nova-api/Dockerfile | 10 + .../centos/binary/nova-controller/nova-api/build | 1 + .../binary/nova-controller/nova-api/check.sh | 17 ++ .../binary/nova-controller/nova-api/start.sh | 46 +++++ .../nova-controller/nova-conductor/Dockerfile | 8 + .../binary/nova-controller/nova-conductor/build | 1 + .../binary/nova-controller/nova-conductor/start.sh | 24 +++ .../nova-controller/nova-consoleauth/Dockerfile | 8 + .../binary/nova-controller/nova-consoleauth/build | 1 + .../nova-controller/nova-consoleauth/start.sh | 11 ++ .../nova-controller/nova-novncproxy/Dockerfile | 10 + .../binary/nova-controller/nova-novncproxy/build | 1 + .../nova-controller/nova-novncproxy/start.sh | 22 +++ .../nova-controller/nova-scheduler/Dockerfile | 8 + .../binary/nova-controller/nova-scheduler/build | 1 + .../binary/nova-controller/nova-scheduler/start.sh | 15 ++ docker/centos/binary/rabbitmq/Dockerfile | 18 ++ docker/centos/binary/rabbitmq/build | 1 + docker/centos/binary/rabbitmq/rabbitmq-env.conf | 2 + docker/centos/binary/rabbitmq/rabbitmq.config | 11 ++ docker/centos/binary/rabbitmq/start.sh | 24 +++ docker/centos/binary/rhel-osp-base/Dockerfile | 92 +++++++++ docker/centos/binary/rhel-osp-base/build | 1 + .../centos/binary/swift/swift-account/Dockerfile | 6 + docker/centos/binary/swift/swift-account/build | 1 + docker/centos/binary/swift/swift-account/start.sh | 35 ++++ docker/centos/binary/swift/swift-base/24q124 | 8 + docker/centos/binary/swift/swift-base/Dockerfile | 8 + docker/centos/binary/swift/swift-base/build | 1 + .../centos/binary/swift/swift-container/Dockerfile | 6 + docker/centos/binary/swift/swift-container/build | 1 + .../centos/binary/swift/swift-container/start.sh | 35 ++++ docker/centos/binary/swift/swift-object/Dockerfile | 6 + docker/centos/binary/swift/swift-object/build | 1 + docker/centos/binary/swift/swift-object/start.sh | 35 ++++ .../binary/swift/swift-proxy-server/Dockerfile | 6 + .../centos/binary/swift/swift-proxy-server/build | 1 + .../binary/swift/swift-proxy-server/start.sh | 5 + docker/centos/binary/zaqar/Dockerfile | 9 + docker/centos/binary/zaqar/build | 1 + docker/centos/binary/zaqar/check.sh | 10 + docker/centos/binary/zaqar/start.sh | 64 +++++++ 173 files changed, 3724 insertions(+) create mode 100644 docker/centos/binary/barbican/Dockerfile create mode 120000 docker/centos/binary/barbican/build create mode 100755 docker/centos/binary/barbican/start.sh create mode 100644 docker/centos/binary/base/kolla-common.sh create mode 100755 docker/centos/binary/base/service_hosts.sh create mode 100644 docker/centos/binary/ceilometer/ceilometer-alarm/Dockerfile create mode 120000 docker/centos/binary/ceilometer/ceilometer-alarm/build create mode 100644 docker/centos/binary/ceilometer/ceilometer-alarm/start.sh create mode 100644 docker/centos/binary/ceilometer/ceilometer-api/Dockerfile create mode 120000 docker/centos/binary/ceilometer/ceilometer-api/build create mode 100644 docker/centos/binary/ceilometer/ceilometer-api/start.sh create mode 100644 docker/centos/binary/ceilometer/ceilometer-base/Dockerfile create mode 120000 docker/centos/binary/ceilometer/ceilometer-base/build create mode 100644 docker/centos/binary/ceilometer/ceilometer-base/config-ceilometer.sh create mode 100644 docker/centos/binary/ceilometer/ceilometer-central/Dockerfile create mode 120000 docker/centos/binary/ceilometer/ceilometer-central/build create mode 100644 docker/centos/binary/ceilometer/ceilometer-central/start.sh create mode 100644 docker/centos/binary/ceilometer/ceilometer-collector/Dockerfile create mode 120000 docker/centos/binary/ceilometer/ceilometer-collector/build create mode 100644 docker/centos/binary/ceilometer/ceilometer-collector/start.sh create mode 100644 docker/centos/binary/ceilometer/ceilometer-compute/Dockerfile create mode 120000 docker/centos/binary/ceilometer/ceilometer-compute/build create mode 100644 docker/centos/binary/ceilometer/ceilometer-compute/start.sh create mode 100644 docker/centos/binary/ceilometer/ceilometer-notification/Dockerfile create mode 120000 docker/centos/binary/ceilometer/ceilometer-notification/build create mode 100644 docker/centos/binary/ceilometer/ceilometer-notification/start.sh create mode 100644 docker/centos/binary/centos-binary-base/.buildconf create mode 100644 docker/centos/binary/centos-binary-base/Dockerfile create mode 120000 docker/centos/binary/centos-binary-base/build create mode 120000 docker/centos/binary/centos-binary-base/kolla-common.sh create mode 120000 docker/centos/binary/centos-binary-base/service_hosts.sh create mode 120000 docker/centos/binary/centos-rdo-base create mode 100644 docker/centos/binary/cinder/Dockerfile create mode 120000 docker/centos/binary/cinder/build create mode 100755 docker/centos/binary/cinder/start.sh create mode 100644 docker/centos/binary/docker-compose/README.md create mode 100644 docker/centos/binary/fedora-binary-base/.buildconf create mode 100644 docker/centos/binary/fedora-binary-base/Dockerfile create mode 120000 docker/centos/binary/fedora-binary-base/build create mode 120000 docker/centos/binary/fedora-binary-base/kolla-common.sh create mode 120000 docker/centos/binary/fedora-binary-base/service_hosts.sh create mode 120000 docker/centos/binary/fedora-rdo-base create mode 100644 docker/centos/binary/glance/glance-api/Dockerfile create mode 120000 docker/centos/binary/glance/glance-api/build create mode 100755 docker/centos/binary/glance/glance-api/check.sh create mode 100755 docker/centos/binary/glance/glance-api/start.sh create mode 100644 docker/centos/binary/glance/glance-base/Dockerfile create mode 120000 docker/centos/binary/glance/glance-base/build create mode 100644 docker/centos/binary/glance/glance-base/config-glance.sh create mode 100644 docker/centos/binary/glance/glance-registry/Dockerfile create mode 120000 docker/centos/binary/glance/glance-registry/build create mode 100755 docker/centos/binary/glance/glance-registry/start.sh create mode 100644 docker/centos/binary/hautoproxy/Dockerfile create mode 120000 docker/centos/binary/hautoproxy/build create mode 100644 docker/centos/binary/hautoproxy/haproxy.cfg.tmpl create mode 100755 docker/centos/binary/hautoproxy/start.py create mode 100644 docker/centos/binary/heat/heat-api-cfn/Dockerfile create mode 120000 docker/centos/binary/heat/heat-api-cfn/build create mode 100755 docker/centos/binary/heat/heat-api-cfn/check.sh create mode 100755 docker/centos/binary/heat/heat-api-cfn/start.sh create mode 100644 docker/centos/binary/heat/heat-api/Dockerfile create mode 120000 docker/centos/binary/heat/heat-api/build create mode 100755 docker/centos/binary/heat/heat-api/check.sh create mode 100755 docker/centos/binary/heat/heat-api/start.sh create mode 100644 docker/centos/binary/heat/heat-base/Dockerfile create mode 120000 docker/centos/binary/heat/heat-base/build create mode 100755 docker/centos/binary/heat/heat-base/config-heat.sh create mode 100644 docker/centos/binary/heat/heat-engine/Dockerfile create mode 120000 docker/centos/binary/heat/heat-engine/build create mode 100755 docker/centos/binary/heat/heat-engine/start.sh create mode 100644 docker/centos/binary/horizon/Dockerfile create mode 120000 docker/centos/binary/horizon/build create mode 100755 docker/centos/binary/horizon/start.sh create mode 100644 docker/centos/binary/keystone/Dockerfile create mode 120000 docker/centos/binary/keystone/build create mode 100755 docker/centos/binary/keystone/check.sh create mode 100755 docker/centos/binary/keystone/start.sh create mode 100644 docker/centos/binary/magnum/magnum-api/Dockerfile create mode 120000 docker/centos/binary/magnum/magnum-api/build create mode 100755 docker/centos/binary/magnum/magnum-api/check.sh create mode 100755 docker/centos/binary/magnum/magnum-api/start.sh create mode 100644 docker/centos/binary/magnum/magnum-base/Dockerfile create mode 120000 docker/centos/binary/magnum/magnum-base/build create mode 100755 docker/centos/binary/magnum/magnum-base/config-magnum.sh create mode 100644 docker/centos/binary/magnum/magnum-conductor/Dockerfile create mode 120000 docker/centos/binary/magnum/magnum-conductor/build create mode 100755 docker/centos/binary/magnum/magnum-conductor/start.sh create mode 100644 docker/centos/binary/mariadb-app/Dockerfile create mode 120000 docker/centos/binary/mariadb-app/build create mode 100755 docker/centos/binary/mariadb-app/config-mysql.sh create mode 100755 docker/centos/binary/mariadb-app/mysql-entrypoint.sh create mode 100644 docker/centos/binary/mariadb-data/Dockerfile create mode 120000 docker/centos/binary/mariadb-data/build create mode 100644 docker/centos/binary/mongodb/Dockerfile create mode 120000 docker/centos/binary/mongodb/build create mode 100644 docker/centos/binary/neutron/neutron-agents/Dockerfile create mode 120000 docker/centos/binary/neutron/neutron-agents/build create mode 100755 docker/centos/binary/neutron/neutron-agents/check-scripts/check-dhcp-agent.sh create mode 100755 docker/centos/binary/neutron/neutron-agents/check-scripts/check-l3-agent.sh create mode 100755 docker/centos/binary/neutron/neutron-agents/check-scripts/check-linuxbridge-agent.sh create mode 100755 docker/centos/binary/neutron/neutron-agents/check-scripts/check-metadata-agent.sh create mode 100755 docker/centos/binary/neutron/neutron-agents/config-scripts/config-dhcp-agent.sh create mode 100755 docker/centos/binary/neutron/neutron-agents/config-scripts/config-l3-agent.sh create mode 100755 docker/centos/binary/neutron/neutron-agents/config-scripts/config-linuxbridge-agent.sh create mode 100755 docker/centos/binary/neutron/neutron-agents/config-scripts/config-metadata-agent.sh create mode 100755 docker/centos/binary/neutron/neutron-agents/config-scripts/config-sudoers.sh create mode 100644 docker/centos/binary/neutron/neutron-agents/fwaas_driver.ini create mode 100644 docker/centos/binary/neutron/neutron-agents/supervisord.conf create mode 100644 docker/centos/binary/neutron/neutron-base/Dockerfile create mode 120000 docker/centos/binary/neutron/neutron-base/build create mode 100644 docker/centos/binary/neutron/neutron-base/config-neutron.sh create mode 100644 docker/centos/binary/neutron/neutron-server/Dockerfile create mode 120000 docker/centos/binary/neutron/neutron-server/build create mode 100755 docker/centos/binary/neutron/neutron-server/check.sh create mode 100755 docker/centos/binary/neutron/neutron-server/start.sh create mode 100644 docker/centos/binary/nova-base/Dockerfile create mode 120000 docker/centos/binary/nova-base/build create mode 100755 docker/centos/binary/nova-base/config-nova.sh create mode 100644 docker/centos/binary/nova-compute/nova-compute-data/Dockerfile create mode 120000 docker/centos/binary/nova-compute/nova-compute-data/build create mode 100644 docker/centos/binary/nova-compute/nova-compute/Dockerfile create mode 120000 docker/centos/binary/nova-compute/nova-compute/build create mode 100755 docker/centos/binary/nova-compute/nova-compute/config-nova-compute.sh create mode 100755 docker/centos/binary/nova-compute/nova-compute/start.sh create mode 100644 docker/centos/binary/nova-compute/nova-libvirt/Dockerfile create mode 120000 docker/centos/binary/nova-compute/nova-libvirt/build create mode 100755 docker/centos/binary/nova-compute/nova-libvirt/start.sh create mode 100644 docker/centos/binary/nova-compute/nova-network/Dockerfile create mode 120000 docker/centos/binary/nova-compute/nova-network/build create mode 100755 docker/centos/binary/nova-compute/nova-network/config-nova-network.sh create mode 100755 docker/centos/binary/nova-compute/nova-network/start.sh create mode 100644 docker/centos/binary/nova-controller/nova-api/Dockerfile create mode 120000 docker/centos/binary/nova-controller/nova-api/build create mode 100755 docker/centos/binary/nova-controller/nova-api/check.sh create mode 100755 docker/centos/binary/nova-controller/nova-api/start.sh create mode 100644 docker/centos/binary/nova-controller/nova-conductor/Dockerfile create mode 120000 docker/centos/binary/nova-controller/nova-conductor/build create mode 100755 docker/centos/binary/nova-controller/nova-conductor/start.sh create mode 100644 docker/centos/binary/nova-controller/nova-consoleauth/Dockerfile create mode 120000 docker/centos/binary/nova-controller/nova-consoleauth/build create mode 100755 docker/centos/binary/nova-controller/nova-consoleauth/start.sh create mode 100644 docker/centos/binary/nova-controller/nova-novncproxy/Dockerfile create mode 120000 docker/centos/binary/nova-controller/nova-novncproxy/build create mode 100755 docker/centos/binary/nova-controller/nova-novncproxy/start.sh create mode 100644 docker/centos/binary/nova-controller/nova-scheduler/Dockerfile create mode 120000 docker/centos/binary/nova-controller/nova-scheduler/build create mode 100755 docker/centos/binary/nova-controller/nova-scheduler/start.sh create mode 100644 docker/centos/binary/rabbitmq/Dockerfile create mode 120000 docker/centos/binary/rabbitmq/build create mode 100644 docker/centos/binary/rabbitmq/rabbitmq-env.conf create mode 100644 docker/centos/binary/rabbitmq/rabbitmq.config create mode 100755 docker/centos/binary/rabbitmq/start.sh create mode 100644 docker/centos/binary/rhel-osp-base/Dockerfile create mode 120000 docker/centos/binary/rhel-osp-base/build create mode 100644 docker/centos/binary/swift/swift-account/Dockerfile create mode 120000 docker/centos/binary/swift/swift-account/build create mode 100644 docker/centos/binary/swift/swift-account/start.sh create mode 100644 docker/centos/binary/swift/swift-base/24q124 create mode 100644 docker/centos/binary/swift/swift-base/Dockerfile create mode 120000 docker/centos/binary/swift/swift-base/build create mode 100644 docker/centos/binary/swift/swift-container/Dockerfile create mode 120000 docker/centos/binary/swift/swift-container/build create mode 100644 docker/centos/binary/swift/swift-container/start.sh create mode 100644 docker/centos/binary/swift/swift-object/Dockerfile create mode 120000 docker/centos/binary/swift/swift-object/build create mode 100644 docker/centos/binary/swift/swift-object/start.sh create mode 100644 docker/centos/binary/swift/swift-proxy-server/Dockerfile create mode 120000 docker/centos/binary/swift/swift-proxy-server/build create mode 100644 docker/centos/binary/swift/swift-proxy-server/start.sh create mode 100644 docker/centos/binary/zaqar/Dockerfile create mode 120000 docker/centos/binary/zaqar/build create mode 100755 docker/centos/binary/zaqar/check.sh create mode 100755 docker/centos/binary/zaqar/start.sh (limited to 'docker/centos/binary') diff --git a/docker/centos/binary/barbican/Dockerfile b/docker/centos/binary/barbican/Dockerfile new file mode 100644 index 000000000..0a124dc38 --- /dev/null +++ b/docker/centos/binary/barbican/Dockerfile @@ -0,0 +1,40 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +ADD ./start.sh /start.sh + +# Install required packages +# NOTE: these packages (tar especially) can be pruned once converted to +# installation via RPM: https://bugs.launchpad.net/kolla/+bug/1453926 +RUN yum install -y gcc Cython sqlite-devel mysql-devel libffi-devel tar && yum clean all + +# use the Barbican Juno version +# setting this as environment variable also keeps pbr version checking happy +# TODO: when the Barbican rpm from cloudkeep.io is usable, +# switch to using that instead +ENV PBR_VERSION 2014.2 + +# Get and extract the Barbican tar ball +RUN curl -o /barbican-$PBR_VERSION.tar.gz https://github.com/openstack/barbican/archive/$PBR_VERSION.tar.gz -L +RUN tar -xzf barbican-$PBR_VERSION.tar.gz + +# Install Barbican requirements +RUN pip install -r barbican-$PBR_VERSION/requirements.txt +RUN pip install MySQL-python + +# Install Barbican +RUN cd barbican-$PBR_VERSION && python setup.py install + +# Configure Barbican +RUN mkdir -p /etc/barbican +RUN mkdir -p /var/log/barbican +RUN cp -r /barbican-$PBR_VERSION/etc/barbican/* /etc/barbican + +# Instal uwsgi as that is what we will use to run Barbican +RUN pip install uwsgi + +# Cleanup files not required anymore +RUN rm -rf /barbican-$PBR_VERSION +RUN rm -rf /barbican-$PBR_VERSION.tar.gz + +CMD ["/start.sh"] diff --git a/docker/centos/binary/barbican/build b/docker/centos/binary/barbican/build new file mode 120000 index 000000000..8d652f7ee --- /dev/null +++ b/docker/centos/binary/barbican/build @@ -0,0 +1 @@ +../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/barbican/start.sh b/docker/centos/binary/barbican/start.sh new file mode 100755 index 000000000..673aa4339 --- /dev/null +++ b/docker/centos/binary/barbican/start.sh @@ -0,0 +1,81 @@ +#!/bin/bash + +set -e + +: ${BARBICAN_DB_USER:=barbican} +: ${BARBICAN_DB_NAME:=barbican} +: ${KEYSTONE_AUTH_PROTOCOL:=http} +: ${BARBICAN_KEYSTONE_USER:=barbican} +: ${ADMIN_TENANT_NAME:=admin} + +if ! [ "$BARBICAN_DB_PASSWORD" ]; then + BARBICAN_DB_PASSWORD=$(openssl rand -hex 15) + export BARBICAN_DB_PASSWORD +fi + +check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \ + KEYSTONE_ADMIN_SERVICE_PORT BARBICAN_ADMIN_PASSWORD +fail_unless_db +fail_unless_os_service_running keystone + +mysql -h ${MARIADB_SERVICE_HOST} -u root -p"${DB_ROOT_PASSWORD}" mysql < /dev/null 2>&1 || /bin/keystone user-create --name ${BARBICAN_KEYSTONE_USER} --pass ${BARBICAN_ADMIN_PASSWORD} + +keystone role-get observer > /dev/null 2>&1 || /bin/keystone role-create --name observer +keystone role-get creator > /dev/null 2>&1 || /bin/keystone role-create --name creator + +keystone user-get ${BARBICAN_KEYSTONE_USER} > /dev/null 2>&1 || /bin/keystone user-role-add --user ${BARBICAN_KEYSTONE_USER} --role admin --tenant ${ADMIN_TENANT_NAME} + +# launch Barbican using uwsgi +exec uwsgi --master --emperor /etc/barbican/vassals diff --git a/docker/centos/binary/base/kolla-common.sh b/docker/centos/binary/base/kolla-common.sh new file mode 100644 index 000000000..8c2ef5ec1 --- /dev/null +++ b/docker/centos/binary/base/kolla-common.sh @@ -0,0 +1,170 @@ +#!/bin/bash + +. /opt/kolla/service_hosts.sh + +# Set some generally useful defaults. +MY_IP=$(ip route get $(ip route | awk '$1 == "default" {print $3}') | + awk '$4 == "src" {print $5}') + +: ${PUBLIC_IP:=${MY_IP}} + +# Iterate over a list of variable names and exit if one is +# undefined. +check_required_vars() { + for var in $*; do + if [ -z "${!var}" ]; then + echo "ERROR: missing $var" >&2 + exit 1 + fi + done +} + +# The usage of the wait_for function looks like the following +# wait_for LOOPS_NUMBER SLEEP_TIME ARGS +# +# The ARGS are read and concatenated together into a single command and the +# command is executed in a loop until it succeeds or reaches the max number of +# attempts (LOOPS_NUMBER). +# +# Optional variables SUCCESSFUL_MATCH_OUTPUT and FAIL_MATCH_OUTPUT variable may +# also be set to control if the loop exits early if the commands stdout/stderr +# matches the supplied regex string. Consider using the `wait_for_output` and +# `wait_for_output_unless` functions in case there is a need to check for the +# command output. +# +# The script exits on failure, either when output contains string identified as +# failure, or when it reaches a timeout. +# +# Examples: +# wait_for 30 10 ping -c 1 192.0.2.2 +# wait_for 10 1 ls file_we_are_waiting_for +# wait_for 10 3 date \| grep 8 +wait_for() { + local loops=${1:-""} + local sleeptime=${2:-""} + FAIL_MATCH_OUTPUT=${FAIL_MATCH_OUTPUT:-""} + SUCCESSFUL_MATCH_OUTPUT=${SUCCESSFUL_MATCH_OUTPUT:-""} + shift 2 || true + local command="$@" + + if [ -z "$loops" -o -z "$sleeptime" -o -z "$command" ]; then + echo "wait_for is missing a required parameter" + exit 1 + fi + + local i=0 + while [ $i -lt $loops ]; do + i=$((i + 1)) + local status=0 + local output=$(eval $command 2>&1) || status=$? + if [[ -n "$SUCCESSFUL_MATCH_OUTPUT" ]] \ + && [[ $output =~ $SUCCESSFUL_MATCH_OUTPUT ]]; then + return 0 + elif [[ -n "$FAIL_MATCH_OUTPUT" ]] \ + && [[ $output =~ $FAIL_MATCH_OUTPUT ]]; then + echo "Command output matched '$FAIL_MATCH_OUTPUT'." + exit 1 + elif [[ -z "$SUCCESSFUL_MATCH_OUTPUT" ]] && [[ $status -eq 0 ]]; then + return 0 + fi + sleep $sleeptime + done + local seconds=$((loops * sleeptime)) + printf 'Timing out after %d seconds:\ncommand=%s\nOUTPUT=%s\n' \ + "$seconds" "$command" "$output" + exit 1 +} + +# Helper function to `wait_for` that only succeeds when the given regex is +# matching the command's output. Exit early with a failure when the second +# supplied regexp is matching the output. +# +# Example: +# wait_for_output_unless CREATE_COMPLETE CREATE_FAIL 30 10 heat stack-show undercloud +wait_for_output_unless() { + SUCCESSFUL_MATCH_OUTPUT=$1 + FAIL_MATCH_OUTPUT=$2 + shift 2 + wait_for $@ + local status=$? + unset SUCCESSFUL_MATCH_OUTPUT + unset FAIL_MATCH_OUTPUT + return $status +} + +# Helper function to `wait_for` that only succeeds when the given regex is +# matching the command's output. +# +# Example: +# wait_for_output CREATE_COMPLETE 30 10 heat stack-show undercloud +wait_for_output() { + local expected_output=$1 + shift + wait_for_output_unless $expected_output '' $@ +} + +# Check if we receive a successful response from corresponding OpenStack +# service endpoint. +check_for_os_service_endpoint() { + local name=$1 + local host_var=$2 + local port_var=$3 + local api_version=$4 + + check_required_vars $host_var $port_var + + local endpoint="http://${!host_var}:${!port_var}/$api_version" + + curl -sf -o /dev/null "$endpoint" || { + echo "ERROR: $name is not available @ $endpoint" >&2 + return 1 + } + + echo "$name is active @ $endpoint" +} + +check_for_os_service_running() { + local service=$1 + local args= + case $service in + ("glance") args="GLANCE_API_SERVICE_HOST GLANCE_API_SERVICE_PORT" ;; + ("keystone") args="KEYSTONE_PUBLIC_SERVICE_HOST KEYSTONE_PUBLIC_SERVICE_PORT v2.0" ;; + ("neutron") args="NEUTRON_SERVER_SERVICE_HOST NEUTRON_SERVER_SERVICE_PORT" ;; + ("nova") args="NOVA_API_SERVICE_HOST NOVA_API_SERVICE_PORT" ;; + (*) + echo "Unknown service $service" + return 1 ;; + esac + check_for_os_service_endpoint $service $args +} + +fail_unless_os_service_running() { + check_for_os_service_running $@ || exit $? +} + +# Check if we receive a successful response from the database server. +# Optionally takes a database name to check for. Defaults to 'mysql'. +check_for_db() { + local database=${1:-mysql} + check_required_vars MARIADB_SERVICE_HOST DB_ROOT_PASSWORD + + mysql -h ${MARIADB_SERVICE_HOST} -u root -p"${DB_ROOT_PASSWORD}" \ + -e "select 1" $database > /dev/null 2>&1 || { + echo "ERROR: database $database is not available @ $MARIADB_SERVICE_HOST" >&2 + return 1 + } + + echo "database is active @ ${MARIADB_SERVICE_HOST}" +} + +fail_unless_db() { + check_for_db $@ || exit $? +} + +# Dump shell environment to a file +dump_vars() { + set -o posix + set > /pid_$$_vars.sh + set +o posix +} + diff --git a/docker/centos/binary/base/service_hosts.sh b/docker/centos/binary/base/service_hosts.sh new file mode 100755 index 000000000..c3006f720 --- /dev/null +++ b/docker/centos/binary/base/service_hosts.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# Kubernetes currently creates FOO_SERVICE_HOST and FOO_SERVICE_PORT env vars +# as part of starting the containers. However this is not done when starting +# them with plain docker. Defaulting variables to their common version if +# they're not already set allows the usage of --link in plain 'docker run' to +# wire together containers. + +: ${BARBICAN_ADMIN_SERVICE_HOST:=$BARBICAN_ADMIN_PORT_9312_TCP_ADDR} +: ${BARBICAN_ADMIN_SERVICE_PORT:=9312} +: ${BARBICAN_PUBLIC_SERVICE_HOST:=$BARBICAN_PUBLIC_PORT_9311_TCP_ADDR} +: ${BARBICAN_PUBLIC_SERVICE_PORT:=9311} +: ${CEILOMETER_API_SERVICE_HOST:=$CEILOMETER_API_PORT_8777_TCP_ADDR} +: ${CEILOMETER_API_SERVICE_PORT:=8777} +: ${GLANCE_API_SERVICE_HOST:=$GLANCE_API_PORT_9292_TCP_ADDR} +: ${GLANCE_API_SERVICE_PORT:=9292} +: ${GLANCE_REGISTRY_SERVICE_HOST:=$GLANCE_REGISTRY_PORT_9191_TCP_ADDR} +: ${GLANCE_REGISTRY_SERVICE_PORT:=9191} +: ${HEAT_API_SERVICE_HOST:=$HEAT_API_PORT_8004_TCP_ADDR} +: ${HEAT_API_SERVICE_PORT:=8004} +: ${HORIZON_SERVICE_HOST:=$HORIZON_PORT_80_TCP_ADDR} +: ${HORIZON_SERVICE_PORT:=80} +: ${KEYSTONE_ADMIN_SERVICE_HOST:=$KEYSTONE_PORT_35357_TCP_ADDR} +: ${KEYSTONE_ADMIN_SERVICE_PORT:=35357} +: ${KEYSTONE_PUBLIC_SERVICE_HOST:=$KEYSTONE_PORT_5000_TCP_ADDR} +: ${KEYSTONE_PUBLIC_SERVICE_PORT:=5000} +: ${MARIADB_SERVICE_HOST:=$MARIADB_PORT_3306_TCP_ADDR} +: ${MARIADB_SERVICE_PORT:=3306} +: ${MONGODB_SERVICE_HOST:=$MONGODB_PORT_27017_TCP_ADDR} +: ${MONGODB_SERVICE_PORT:=27017} +: ${NEUTRON_SERVER_SERVICE_HOST:=$NEUTRON_SERVER_PORT_9696_TCP_ADDR} +: ${NEUTRON_SERVER_SERVICE_PORT:=9696} +: ${NOVA_API_SERVICE_HOST:=$NOVA_API_PORT_8774_TCP_ADDR} +: ${NOVA_API_SERVICE_PORT:=8774} +: ${NOVA_EC2_API_SERVICE_HOST:=$NOVA_EC2_API_PORT_8773_TCP_ADDR} +: ${NOVA_EC2_API_SERVICE_PORT:=8773} +: ${NOVA_LIBVIRT_SERVICE_HOST:=$NOVA_LIBVIRT_PORT_16509_TCP_ADDR} +: ${NOVA_LIBVIRT_SERVICE_PORT:=16509} +: ${NOVA_METADATA_API_SERVICE_HOST:=$NOVA_METADATA_API_PORT_8775_TCP_ADDR} +: ${NOVA_METADATA_API_SERVICE_PORT:=8775} +: ${RABBITMQ_SERVICE_HOST:=$RABBITMQ_PORT_5672_TCP_ADDR} +: ${RABBITMQ_SERVICE_PORT:=5672} +: ${ZAQAR_SERVER_SERVICE_HOST:=$ZAQAR_SERVER_PORT_8888_TCP_ADDR} +: ${ZAQAR_SERVER_SERVICE_PORT:=8888} + diff --git a/docker/centos/binary/ceilometer/ceilometer-alarm/Dockerfile b/docker/centos/binary/ceilometer/ceilometer-alarm/Dockerfile new file mode 100644 index 000000000..fe6c44fc2 --- /dev/null +++ b/docker/centos/binary/ceilometer/ceilometer-alarm/Dockerfile @@ -0,0 +1,7 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%ceilometer-base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +RUN yum install -y openstack-ceilometer-alarm && yum clean all + +ADD ./start.sh /start.sh +CMD ["/start.sh"] diff --git a/docker/centos/binary/ceilometer/ceilometer-alarm/build b/docker/centos/binary/ceilometer/ceilometer-alarm/build new file mode 120000 index 000000000..ec1913803 --- /dev/null +++ b/docker/centos/binary/ceilometer/ceilometer-alarm/build @@ -0,0 +1 @@ +../../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/ceilometer/ceilometer-alarm/start.sh b/docker/centos/binary/ceilometer/ceilometer-alarm/start.sh new file mode 100644 index 000000000..7470ae608 --- /dev/null +++ b/docker/centos/binary/ceilometer/ceilometer-alarm/start.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +. /opt/kolla/kolla-common.sh +. /opt/kolla/config-ceilometer.sh + + +exec /usr/bin/ceilometer-alarm-evaluator & +exec /usr/bin/ceilometer-alarm-notifier diff --git a/docker/centos/binary/ceilometer/ceilometer-api/Dockerfile b/docker/centos/binary/ceilometer/ceilometer-api/Dockerfile new file mode 100644 index 000000000..7a1337c7b --- /dev/null +++ b/docker/centos/binary/ceilometer/ceilometer-api/Dockerfile @@ -0,0 +1,7 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%ceilometer-base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +RUN yum install -y openstack-ceilometer-api && yum clean all + +ADD ./start.sh /start.sh +CMD ["/start.sh"] diff --git a/docker/centos/binary/ceilometer/ceilometer-api/build b/docker/centos/binary/ceilometer/ceilometer-api/build new file mode 120000 index 000000000..ec1913803 --- /dev/null +++ b/docker/centos/binary/ceilometer/ceilometer-api/build @@ -0,0 +1 @@ +../../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/ceilometer/ceilometer-api/start.sh b/docker/centos/binary/ceilometer/ceilometer-api/start.sh new file mode 100644 index 000000000..f081c9f84 --- /dev/null +++ b/docker/centos/binary/ceilometer/ceilometer-api/start.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +set -e + +. /opt/kolla/kolla-common.sh +. /opt/kolla/config-ceilometer.sh + +check_required_vars CEILOMETER_DB_USER CEILOMETER_DB_NAME \ + CEILOMETER_DB_PASSWORD KEYSTONE_ADMIN_TOKEN \ + KEYSTONE_AUTH_PROTOCOL KEYSTONE_ADMIN_SERVICE_HOST \ + KEYSTONE_ADMIN_SERVICE_PORT ADMIN_TENANT_NAME \ + CEILOMETER_KEYSTONE_USER CEILOMETER_ADMIN_PASSWORD \ + CEILOMETER_API_SERVICE_HOST PUBLIC_IP + +fail_unless_os_service_running keystone +fail_unless_db + +#TODO(pkilambi): Add mongodb support + +mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql < /openrc < /dev/null; then + echo "ERROR: keystone token-get failed" >&2 + RES=1 +else + if ! glance image-list > /dev/null; then + echo "ERROR: glance image-list failed" >&2 + RES=1 + fi +fi + +exit $RES + diff --git a/docker/centos/binary/glance/glance-api/start.sh b/docker/centos/binary/glance/glance-api/start.sh new file mode 100755 index 000000000..c546333f4 --- /dev/null +++ b/docker/centos/binary/glance/glance-api/start.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +set -e + +. /opt/kolla/kolla-common.sh +. /opt/kolla/config-glance.sh +: ${GLANCE_API_SERVICE_HOST:=$PUBLIC_IP} + +check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \ + GLANCE_KEYSTONE_USER GLANCE_KEYSTONE_PASSWORD \ + ADMIN_TENANT_NAME GLANCE_API_SERVICE_HOST \ + PUBLIC_IP + +fail_unless_os_service_running keystone + +export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}" +export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:${KEYSTONE_ADMIN_SERVICE_PORT}/v2.0" + +crux user-create --update \ + -n "${GLANCE_KEYSTONE_USER}" \ + -p "${GLANCE_KEYSTONE_PASSWORD}" \ + -t "${ADMIN_TENANT_NAME}" \ + -r admin + +crux endpoint-create --remove-all \ + -n glance -t image \ + -I "http://${GLANCE_API_SERVICE_HOST}:9292" \ + -P "http://${PUBLIC_IP}:9292" \ + -A "http://${GLANCE_API_SERVICE_HOST}:9292" + +# turn on notification sending by glance +crudini --set /etc/glance/glance-api.conf \ + DEFAULT \ + notification_driver \ + "messaging" + +crudini --set /etc/glance/glance-api.conf \ + DEFAULT \ + rabbit_host \ + "${RABBITMQ_SERVICE_HOST}" + +crudini --set /etc/glance/glance-api.conf \ + DEFAULT \ + registry_host \ + "${GLANCE_REGISTRY_SERVICE_HOST}" + +crudini --set /etc/glance/glance-api.conf \ + DEFAULT \ + debug \ + "True" + +exec /usr/bin/glance-api diff --git a/docker/centos/binary/glance/glance-base/Dockerfile b/docker/centos/binary/glance/glance-base/Dockerfile new file mode 100644 index 000000000..dcd70678d --- /dev/null +++ b/docker/centos/binary/glance/glance-base/Dockerfile @@ -0,0 +1,10 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +# We really shouldn't need to install python-oslo-log or python-oslo-policy +# See: https://bugzilla.redhat.com/show_bug.cgi?id=1218349 +RUN yum -y install openstack-glance python-oslo-log python-oslo-policy && yum clean all + +RUN mkdir -p /opt/kolla +COPY config-glance.sh /opt/kolla/config-glance.sh + diff --git a/docker/centos/binary/glance/glance-base/build b/docker/centos/binary/glance/glance-base/build new file mode 120000 index 000000000..ec1913803 --- /dev/null +++ b/docker/centos/binary/glance/glance-base/build @@ -0,0 +1 @@ +../../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/glance/glance-base/config-glance.sh b/docker/centos/binary/glance/glance-base/config-glance.sh new file mode 100644 index 000000000..aed044df5 --- /dev/null +++ b/docker/centos/binary/glance/glance-base/config-glance.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +set -e + +. /opt/kolla/kolla-common.sh + +: ${ADMIN_TENANT_NAME:=admin} +: ${GLANCE_DB_NAME:=glance} +: ${GLANCE_DB_USER:=glance} +: ${GLANCE_KEYSTONE_USER:=glance} +: ${KEYSTONE_AUTH_PROTOCOL:=http} +: ${PUBLIC_IP:=$GLANCE_API_PORT_9292_TCP_ADDR} + +check_required_vars GLANCE_DB_PASSWORD GLANCE_KEYSTONE_PASSWORD +dump_vars + +cat > /openrc <.*)_PORT_(?P\d+)_(?P(UDP|TCP))$') + +def parse_args(): + p = argparse.ArgumentParser() + p.add_argument('--output', '-o', + default='/etc/haproxy/haproxy.cfg') + p.add_argument('--no-start', '-n', + action='store_true') + p.add_argument('--template-dir', '-t', + default='/etc/haproxy/templates') + return p.parse_args() + +def discover_services(): + services = [] + for k in os.environ: + mo = re_url.match(k) + + if mo: + parts = urlparse.urlparse(os.environ[k]) + remote_host,remote_port = parts.netloc.split(':') + service_name = '%(name)s-%(port)s' % mo.groupdict() + + services.append({ + 'remote_name': mo.group('name'), + 'remote_addr': remote_host, + 'remote_port': remote_port, + 'remote_proto': parts.scheme, + 'local_port': mo.group('port'), + 'service_name': service_name, + }) + + return services + +def main(): + args = parse_args() + services = discover_services() + + env = Environment(loader=FileSystemLoader(['.', + args.template_dir])) + template = env.get_template('haproxy.cfg.tmpl') + with open(args.output, 'w') as fd: + fd.write(template.render(services=services)) + + if args.no_start: + return + + os.execlp('haproxy', 'haproxy', '-f', args.output, '-db') + +if __name__ == '__main__': + main() + diff --git a/docker/centos/binary/heat/heat-api-cfn/Dockerfile b/docker/centos/binary/heat/heat-api-cfn/Dockerfile new file mode 100644 index 000000000..18a7e369d --- /dev/null +++ b/docker/centos/binary/heat/heat-api-cfn/Dockerfile @@ -0,0 +1,12 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%heat-base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +RUN yum -y install \ + openstack-heat-api-cfn \ + python-openstackclient \ + && yum clean all + +ADD ./start.sh /start.sh +ADD ./check.sh /check.sh + +CMD ["/start.sh"] diff --git a/docker/centos/binary/heat/heat-api-cfn/build b/docker/centos/binary/heat/heat-api-cfn/build new file mode 120000 index 000000000..ec1913803 --- /dev/null +++ b/docker/centos/binary/heat/heat-api-cfn/build @@ -0,0 +1 @@ +../../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/heat/heat-api-cfn/check.sh b/docker/centos/binary/heat/heat-api-cfn/check.sh new file mode 100755 index 000000000..ee03dc6d2 --- /dev/null +++ b/docker/centos/binary/heat/heat-api-cfn/check.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +RES=0 + +. /openrc +if ! keystone token-get > /dev/null; then + echo "ERROR: keystone token-get failed" >&2 + RES=1 +else + if ! heat stack-list > /dev/null; then + echo "ERROR: heat stack-list failed" >&2 + RES=1 + fi +fi + +exit $RES diff --git a/docker/centos/binary/heat/heat-api-cfn/start.sh b/docker/centos/binary/heat/heat-api-cfn/start.sh new file mode 100755 index 000000000..bcd72250b --- /dev/null +++ b/docker/centos/binary/heat/heat-api-cfn/start.sh @@ -0,0 +1,28 @@ +#!/bin/bash +set -e + +. /opt/kolla/kolla-common.sh +. /opt/kolla/config-heat.sh + +check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \ + HEAT_CFN_KEYSTONE_USER HEAT_CFN_KEYSTONE_PASSWORD \ + KEYSTONE_AUTH_PROTOCOL KEYSTONE_ADMIN_SERVICE_PORT \ + ADMIN_TENANT_NAME HEAT_API_CFN_SERVICE_HOST \ + HEAT_API_CFN_SERVICE_PORT + +fail_unless_os_service_running keystone + +export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}" +export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:${KEYSTONE_ADMIN_SERVICE_PORT}/v2.0" + +crux user-create -n ${HEAT_CFN_KEYSTONE_USER} \ + -p ${HEAT_CFN_KEYSTONE_PASSWORD} \ + -t ${ADMIN_TENANT_NAME} \ + -r admin + +crux endpoint-create --remove-all -n ${HEAT_CFN_KEYSTONE_USER} -t cloudformation \ + -I "${KEYSTONE_AUTH_PROTOCOL}://${HEAT_API_CFN_SERVICE_HOST}:${HEAT_API_CFN_SERVICE_PORT}/v1" \ + -P "${KEYSTONE_AUTH_PROTOCOL}://${HEAT_API_CFN_SERVICE_HOST}:${HEAT_API_CFN_SERVICE_PORT}/v1" \ + -A "${KEYSTONE_AUTH_PROTOCOL}://${HEAT_API_CFN_SERVICE_HOST}:${HEAT_API_CFN_SERVICE_PORT}/v1" + +exec /usr/bin/heat-api-cfn diff --git a/docker/centos/binary/heat/heat-api/Dockerfile b/docker/centos/binary/heat/heat-api/Dockerfile new file mode 100644 index 000000000..407aee601 --- /dev/null +++ b/docker/centos/binary/heat/heat-api/Dockerfile @@ -0,0 +1,14 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%heat-base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +# TODO: configure cfn and cloudwatch +# TODO: remove python-openstackclient once crux feature is added in start.sh +RUN yum -y install \ + openstack-heat-api \ + python-openstackclient \ + && yum clean all + +ADD ./start.sh /start.sh +ADD ./check.sh /check.sh + +CMD ["/start.sh"] diff --git a/docker/centos/binary/heat/heat-api/build b/docker/centos/binary/heat/heat-api/build new file mode 120000 index 000000000..ec1913803 --- /dev/null +++ b/docker/centos/binary/heat/heat-api/build @@ -0,0 +1 @@ +../../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/heat/heat-api/check.sh b/docker/centos/binary/heat/heat-api/check.sh new file mode 100755 index 000000000..ee03dc6d2 --- /dev/null +++ b/docker/centos/binary/heat/heat-api/check.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +RES=0 + +. /openrc +if ! keystone token-get > /dev/null; then + echo "ERROR: keystone token-get failed" >&2 + RES=1 +else + if ! heat stack-list > /dev/null; then + echo "ERROR: heat stack-list failed" >&2 + RES=1 + fi +fi + +exit $RES diff --git a/docker/centos/binary/heat/heat-api/start.sh b/docker/centos/binary/heat/heat-api/start.sh new file mode 100755 index 000000000..b57aaa710 --- /dev/null +++ b/docker/centos/binary/heat/heat-api/start.sh @@ -0,0 +1,29 @@ +#!/bin/bash +set -e + +. /opt/kolla/kolla-common.sh +. /opt/kolla/config-heat.sh + +check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \ + HEAT_KEYSTONE_USER HEAT_KEYSTONE_PASSWORD \ + KEYSTONE_AUTH_PROTOCOL ADMIN_TENANT_NAME \ + HEAT_API_SERVICE_HOST PUBLIC_IP + +fail_unless_os_service_running keystone + +export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}" +export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0" +crux user-create -n ${HEAT_KEYSTONE_USER} \ + -p ${HEAT_KEYSTONE_PASSWORD} \ + -t ${ADMIN_TENANT_NAME} \ + -r admin + +crux endpoint-create --remove-all -n ${HEAT_KEYSTONE_USER} -t orchestration \ + -I "${KEYSTONE_AUTH_PROTOCOL}://${HEAT_API_SERVICE_HOST}:8004/v1/%(tenant_id)s" \ + -P "${KEYSTONE_AUTH_PROTOCOL}://${PUBLIC_IP}:8004/v1/%(tenant_id)s" \ + -A "${KEYSTONE_AUTH_PROTOCOL}://${HEAT_API_SERVICE_HOST}:8004/v1/%(tenant_id)s" + +# will use crux after https://github.com/larsks/crux/issues/1 is implemented +openstack role list --os-token="${KEYSTONE_ADMIN_TOKEN}" --os-url $SERVICE_ENDPOINT -f csv | tail -n +2 | awk -F, '{print $2}' | grep heat_stack_user || keystone role-create --name heat_stack_user + +exec /usr/bin/heat-api diff --git a/docker/centos/binary/heat/heat-base/Dockerfile b/docker/centos/binary/heat/heat-base/Dockerfile new file mode 100644 index 000000000..ebe9fa15c --- /dev/null +++ b/docker/centos/binary/heat/heat-base/Dockerfile @@ -0,0 +1,5 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +RUN mkdir -p /opt/kolla +COPY config-heat.sh /opt/kolla/config-heat.sh diff --git a/docker/centos/binary/heat/heat-base/build b/docker/centos/binary/heat/heat-base/build new file mode 120000 index 000000000..ec1913803 --- /dev/null +++ b/docker/centos/binary/heat/heat-base/build @@ -0,0 +1 @@ +../../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/heat/heat-base/config-heat.sh b/docker/centos/binary/heat/heat-base/config-heat.sh new file mode 100755 index 000000000..74b2718a4 --- /dev/null +++ b/docker/centos/binary/heat/heat-base/config-heat.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +set -e + +. /opt/kolla/kolla-common.sh + +: ${ADMIN_TENANT_NAME:=admin} +: ${HEAT_DB_NAME:=heat} +: ${HEAT_DB_USER:=heat} +: ${HEAT_KEYSTONE_USER:=heat} +: ${HEAT_CFN_KEYSTONE_USER:=heat_cfn} +: ${KEYSTONE_AUTH_PROTOCOL:=http} +: ${PUBLIC_IP:=$HEAT_API_PORT_8004_TCP_ADDR} +: ${RABBIT_USER:=guest} +: ${RABBIT_PASSWORD:=guest} + +check_required_vars HEAT_DB_PASSWORD HEAT_KEYSTONE_PASSWORD \ + KEYSTONE_PUBLIC_SERVICE_HOST RABBITMQ_SERVICE_HOST + +fail_unless_db +dump_vars + +cat > /openrc < /dev/null; then + echo "ERROR: keystone token-get failed" >&2 + RES=1 +fi + +exit $RES + diff --git a/docker/centos/binary/keystone/start.sh b/docker/centos/binary/keystone/start.sh new file mode 100755 index 000000000..408f250e0 --- /dev/null +++ b/docker/centos/binary/keystone/start.sh @@ -0,0 +1,162 @@ +#!/bin/bash + +set -e + +# Run Kolla common script +echo "Running the kolla-common script" +. /opt/kolla/kolla-common.sh + +# Credentials, token, etc.. +: ${ADMIN_USER:=admin} +: ${ADMIN_USER_PASSWORD:=password} +: ${ADMIN_TENANT_NAME:=admin} +: ${KEYSTONE_USER:=keystone} +: ${KEYSTONE_ADMIN_PASSWORD:=password} +: ${KEYSTONE_ADMIN_TOKEN:=changeme} +# DB Settings +: ${INIT_DB:=true} +: ${KEYSTONE_DB_NAME:=keystone} +: ${KEYSTONE_DB_USER:=keystone} +: ${DB_ROOT_PASSWORD:=password} +: ${MARIADB_SERVICE_HOST:=$PUBLIC_IP} +: ${KEYSTONE_DB_PASSWORD:=password} +# Service Addresses/Ports/Version +: ${KEYSTONE_PUBLIC_SERVICE_HOST:=$PUBLIC_IP} +: ${KEYSTONE_ADMIN_SERVICE_HOST:=$PUBLIC_IP} +: ${KEYSTONE_PUBLIC_SERVICE_PORT:=5000} +: ${KEYSTONE_ADMIN_SERVICE_PORT:=35357} +: ${KEYSTONE_API_VERSION:=2.0} +# Logging +: ${LOG_FILE:=/var/log/keystone/keystone.log} +: ${VERBOSE_LOGGING:=true} +: ${DEBUG_LOGGING:=false} +: ${USE_STDERR:=false} +# Token provider, driver, etc.. +: ${TOKEN_PROVIDER:=uuid} +: ${TOKEN_DRIVER:=sql} + +## Check DB connectivity and required variables +echo "Checking connectivity to the DB" +fail_unless_db +echo "Checking for required variables" +check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_DB_PASSWORD \ + KEYSTONE_ADMIN_PASSWORD ADMIN_TENANT_NAME \ + KEYSTONE_PUBLIC_SERVICE_HOST KEYSTONE_ADMIN_SERVICE_HOST \ + PUBLIC_IP +dump_vars + +# Setup the Keystone DB +echo "Setting up Keystone DB" +mysql -h ${MARIADB_SERVICE_HOST} -u root -p"${DB_ROOT_PASSWORD}" mysql < /openrc < /dev/null; then + echo "ERROR: keystone token-get failed" >&2 + RES=1 +else + if ! heat stack-list > /dev/null; then + echo "ERROR: heat stack-list failed" >&2 + RES=1 + fi +fi + +exit $RES diff --git a/docker/centos/binary/magnum/magnum-api/start.sh b/docker/centos/binary/magnum/magnum-api/start.sh new file mode 100755 index 000000000..00a51b3cd --- /dev/null +++ b/docker/centos/binary/magnum/magnum-api/start.sh @@ -0,0 +1,27 @@ +#!/bin/bash +set -e + +. /opt/kolla/kolla-common.sh +. /opt/kolla/config-magnum.sh + +check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \ + MAGNUM_KEYSTONE_USER MAGNUM_KEYSTONE_PASSWORD \ + KEYSTONE_AUTH_PROTOCOL ADMIN_TENANT_NAME \ + MAGNUM_API_SERVICE_HOST KEYSTONE_ADMIN_SERVICE_PORT \ + MAGNUM_API_SERVICE_PORT + +fail_unless_os_service_running keystone + +export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}" +export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:${KEYSTONE_ADMIN_SERVICE_PORT}/v2.0" +crux user-create -n ${MAGNUM_KEYSTONE_USER} \ + -p ${MAGNUM_KEYSTONE_PASSWORD} \ + -t ${ADMIN_TENANT_NAME} \ + -r admin + +crux endpoint-create --remove-all -n ${MAGNUM_KEYSTONE_USER} -t container \ + -I "${KEYSTONE_AUTH_PROTOCOL}://${MAGNUM_API_SERVICE_HOST}:${MAGNUM_API_SERVICE_PORT}/v1" \ + -P "${KEYSTONE_AUTH_PROTOCOL}://${MAGNUM_API_SERVICE_HOST}:${MAGNUM_API_SERVICE_PORT}/v1" \ + -A "${KEYSTONE_AUTH_PROTOCOL}://${MAGNUM_API_SERVICE_HOST}:${MAGNUM_API_SERVICE_PORT}/v1" + +exec /usr/bin/magnum-api diff --git a/docker/centos/binary/magnum/magnum-base/Dockerfile b/docker/centos/binary/magnum/magnum-base/Dockerfile new file mode 100644 index 000000000..c9c3db08b --- /dev/null +++ b/docker/centos/binary/magnum/magnum-base/Dockerfile @@ -0,0 +1,9 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +# Magnum is not yet in upstream RDO packaging + +RUN curl https://copr.fedoraproject.org/coprs/sdake/openstack-magnum/repo/epel-7/sdake-openstack-magnum-epel-7.repo -o /etc/yum.repos.d/sdake-openstack-magnum-epel-7.repo + +RUN mkdir -p /opt/kolla +COPY config-magnum.sh /opt/kolla/config-magnum.sh diff --git a/docker/centos/binary/magnum/magnum-base/build b/docker/centos/binary/magnum/magnum-base/build new file mode 120000 index 000000000..ec1913803 --- /dev/null +++ b/docker/centos/binary/magnum/magnum-base/build @@ -0,0 +1 @@ +../../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/magnum/magnum-base/config-magnum.sh b/docker/centos/binary/magnum/magnum-base/config-magnum.sh new file mode 100755 index 000000000..03599d359 --- /dev/null +++ b/docker/centos/binary/magnum/magnum-base/config-magnum.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +set -e + +. /opt/kolla/kolla-common.sh + +check_required_vars MAGNUM_DB_PASSWORD MAGNUM_KEYSTONE_PASSWORD \ + KEYSTONE_PUBLIC_SERVICE_HOST KEYSTONE_PUBLIC_SERVICE_PORT \ + MAGNUM_KEYSTONE_USER ADMIN_TENANT_NAME \ + MAGNUM_DB_USER MAGNUM_DB_NAME KEYSTONE_AUTH_PROTOCOL \ + KEYSTONE_PUBLIC_SERVICE_PORT RABBITMQ_SERVICE_HOST \ + VERBOSE_LOGGING DEBUG_LOGGING + +fail_unless_db +dump_vars + +cat > /openrc <&2 'error: database is uninitialized and MARIADB_ROOT_PASSWORD not set' + echo >&2 ' Did you forget to add -e MARIADB_ROOT_PASSWORD=... ?' + exit 1 + fi + + mysql_install_db --user=mysql --datadir="$DATADIR" + + # These statements _must_ be on individual lines, and _must_ end with + # semicolons (no line breaks or comments are permitted). + # TODO proper SQL escaping on ALL the things D: + TEMP_FILE='/tmp/mysql-first-time.sql' + cat > "$TEMP_FILE" <<-EOSQL + DELETE FROM mysql.user ; + CREATE USER 'root'@'%' IDENTIFIED BY '${MARIADB_ROOT_PASSWORD}' ; + GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ; + DROP DATABASE IF EXISTS test ; + EOSQL + + if [ "$MARIADB_DATABASE" ]; then + echo "CREATE DATABASE IF NOT EXISTS $MARIADB_DATABASE ;" >> "$TEMP_FILE" + fi + + if [ "$MARIADB_USER" -a "$MARIADB_PASSWORD" ]; then + echo "CREATE USER '$MARIADB_USER'@'%' IDENTIFIED BY '$MARIADB_PASSWORD' ;" >> "$TEMP_FILE" + + if [ "$MARIADB_DATABASE" ]; then + echo "GRANT ALL ON $MARIADB_DATABASE.* TO '$MARIADB_USER'@'%' ;" >> "$TEMP_FILE" + fi + fi + + echo 'FLUSH PRIVILEGES ;' >> "$TEMP_FILE" + + set -- "$@" --init-file="$TEMP_FILE" +fi + +chown -R mysql:mysql "$DATADIR" + +exec "$@" diff --git a/docker/centos/binary/mariadb-data/Dockerfile b/docker/centos/binary/mariadb-data/Dockerfile new file mode 100644 index 000000000..f60599d16 --- /dev/null +++ b/docker/centos/binary/mariadb-data/Dockerfile @@ -0,0 +1,8 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +VOLUME [ "/var/lib/mysql" ] + +# Command needed to start the data container. +# Note: data containers do not need to be persistent. +CMD ["/bin/bash"] diff --git a/docker/centos/binary/mariadb-data/build b/docker/centos/binary/mariadb-data/build new file mode 120000 index 000000000..8d652f7ee --- /dev/null +++ b/docker/centos/binary/mariadb-data/build @@ -0,0 +1 @@ +../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/mongodb/Dockerfile b/docker/centos/binary/mongodb/Dockerfile new file mode 100644 index 000000000..e05047f02 --- /dev/null +++ b/docker/centos/binary/mongodb/Dockerfile @@ -0,0 +1,11 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +RUN yum -y install mongodb mongodb-server && yum clean all + +RUN mkdir -p /data/db + +VOLUME /data/db +VOLUME /var/log/mongodb + +ENTRYPOINT exec /bin/mongod --dbpath /data/db --logpath /var/log/mongodb/mongo.log --noprealloc --smallfiles diff --git a/docker/centos/binary/mongodb/build b/docker/centos/binary/mongodb/build new file mode 120000 index 000000000..8d652f7ee --- /dev/null +++ b/docker/centos/binary/mongodb/build @@ -0,0 +1 @@ +../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-agents/Dockerfile b/docker/centos/binary/neutron/neutron-agents/Dockerfile new file mode 100644 index 000000000..89ce874bb --- /dev/null +++ b/docker/centos/binary/neutron/neutron-agents/Dockerfile @@ -0,0 +1,39 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%neutron-base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +# Install supervisor +RUN easy_install supervisor + +# Install supervisor-stdout +RUN pip install supervisor-stdout + +# Install required packages +RUN yum install -y openstack-neutron openstack-neutron-linuxbridge \ + net-tools \ + && yum clean all + +# Add config scripts +ADD config-scripts/config-linuxbridge-agent.sh /opt/kolla/neutron/ +ADD config-scripts/config-dhcp-agent.sh /opt/kolla/neutron/ +ADD config-scripts/config-l3-agent.sh /opt/kolla/neutron/ +ADD config-scripts/config-metadata-agent.sh /opt/kolla/neutron/ +ADD config-scripts/config-sudoers.sh /opt/kolla/ + +# Add check scripts +ADD check-scripts/check-linuxbridge-agent.sh /opt/kolla/neutron/ +ADD check-scripts/check-dhcp-agent.sh /opt/kolla/neutron/ +ADD check-scripts/check-l3-agent.sh /opt/kolla/neutron/ +ADD check-scripts/check-metadata-agent.sh /opt/kolla/neutron/ + +# This is needed to workaround a problem with the agents exiting if the +# file is not present. This file really shouldn't need to be present and +# implies a configuration problem somewhere else in the code base, but +# we are out of time. +COPY fwaas_driver.ini /etc/neutron/ + +# Configure supervisord +RUN mkdir -p /var/log/supervisor/ +ADD supervisord.conf /etc/ + +# Start supervisor +CMD ["/usr/bin/supervisord"] diff --git a/docker/centos/binary/neutron/neutron-agents/build b/docker/centos/binary/neutron/neutron-agents/build new file mode 120000 index 000000000..ec1913803 --- /dev/null +++ b/docker/centos/binary/neutron/neutron-agents/build @@ -0,0 +1 @@ +../../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-agents/check-scripts/check-dhcp-agent.sh b/docker/centos/binary/neutron/neutron-agents/check-scripts/check-dhcp-agent.sh new file mode 100755 index 000000000..7dda736ef --- /dev/null +++ b/docker/centos/binary/neutron/neutron-agents/check-scripts/check-dhcp-agent.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +RES=0 + +check=$(/usr/bin/neutron agent-list | awk '/ DHCP / {print $9}') +error="ERROR: Neutron DHCP Agent is not alive." + +if [[ $check != ":-)" ]]; then + echo $error >&2 + RES=1 +fi + +exit $RES diff --git a/docker/centos/binary/neutron/neutron-agents/check-scripts/check-l3-agent.sh b/docker/centos/binary/neutron/neutron-agents/check-scripts/check-l3-agent.sh new file mode 100755 index 000000000..d32c1e272 --- /dev/null +++ b/docker/centos/binary/neutron/neutron-agents/check-scripts/check-l3-agent.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +RES=0 + +check=$(/usr/bin/neutron agent-list | awk '/ L3 / {print $9}') +error="ERROR: Neutron L3 Agent is not alive." + +if [[ $check != ":-)" ]]; then + echo $error >&2 + RES=1 +fi + +exit $RES diff --git a/docker/centos/binary/neutron/neutron-agents/check-scripts/check-linuxbridge-agent.sh b/docker/centos/binary/neutron/neutron-agents/check-scripts/check-linuxbridge-agent.sh new file mode 100755 index 000000000..4485fc1ec --- /dev/null +++ b/docker/centos/binary/neutron/neutron-agents/check-scripts/check-linuxbridge-agent.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +RES=0 + +check=$(/usr/bin/neutron agent-list | awk '/ Linux / {print $10}') +error="ERROR: Neutron Linux Bridge agent is not alive." + +if [[ $check != ":-)" ]]; then + echo $error >&2 + RES=1 +fi + +exit $RES diff --git a/docker/centos/binary/neutron/neutron-agents/check-scripts/check-metadata-agent.sh b/docker/centos/binary/neutron/neutron-agents/check-scripts/check-metadata-agent.sh new file mode 100755 index 000000000..fd1c6812b --- /dev/null +++ b/docker/centos/binary/neutron/neutron-agents/check-scripts/check-metadata-agent.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +RES=0 + +check=$(/usr/bin/neutron agent-list | awk '/ Metadata / {print $9}') +error="ERROR: Neutron Metadata Agent is not alive." + +if [[ $check != ":-)" ]]; then + echo $error >&2 + RES=1 +fi + +exit $RES diff --git a/docker/centos/binary/neutron/neutron-agents/config-scripts/config-dhcp-agent.sh b/docker/centos/binary/neutron/neutron-agents/config-scripts/config-dhcp-agent.sh new file mode 100755 index 000000000..1295d9c57 --- /dev/null +++ b/docker/centos/binary/neutron/neutron-agents/config-scripts/config-dhcp-agent.sh @@ -0,0 +1,88 @@ +#!/bin/bash + +set -e + +. /opt/kolla/config-neutron.sh +. /opt/kolla/config-sudoers.sh + +: ${DHCP_DRIVER:=neutron.agent.linux.dhcp.Dnsmasq} +: ${USE_NAMESPACES:=true} +: ${DELETE_NAMESPACES:=true} +: ${DNSMASQ_CONFIG_FILE:=/etc/neutron/dnsmasq/dnsmasq-neutron.conf} +: ${ROOT_HELPER:=sudo neutron-rootwrap /etc/neutron/rootwrap.conf} + +mkdir -p $(dirname $DNSMASQ_CONFIG_FILE) + +check_required_vars VERBOSE_LOGGING DEBUG_LOGGING MECHANISM_DRIVERS \ + DHCP_DRIVER USE_NAMESPACES DELETE_NAMESPACES \ + NEUTRON_LOG_DIR DNSMASQ_CONFIG_FILE \ + +cfg=/etc/neutron/dhcp_agent.ini +neutron_conf=/etc/neutron/neutron.conf + +# Workaround bug in dhclient in cirros images which does not correctly +# handle setting checksums of packets when using hardware with checksum +# offloading. See: +# https://www.rdoproject.org/forum/discussion/567/packstack-allinone-grizzly-cirros-image-cannot-get-a-dhcp-address-when-a-centos-image-can/p1 + +/usr/sbin/iptables -A POSTROUTING -t mangle -p udp --dport bootpc \ + -j CHECKSUM --checksum-fill + +if [[ ${MECHANISM_DRIVERS} =~ linuxbridge ]]; then + interface_driver="neutron.agent.linux.interface.BridgeInterfaceDriver" +elif [[ ${MECHANISM_DRIVERS} == "openvswitch" ]]; then + interface_driver="neutron.agent.linux.interface.OVSInterfaceDriver" +fi + +# Logging +crudini --set $neutron_conf \ + DEFAULT \ + log_file \ + "${NEUTRON_DHCP_AGENT_LOG_FILE}" + +# Configure dhcp_agent.ini +crudini --set $cfg \ + DEFAULT \ + verbose \ + "${VERBOSE_LOGGING}" +crudini --set $cfg \ + DEFAULT \ + debug \ + "${DEBUG_LOGGING}" +crudini --set $cfg \ + DEFAULT \ + interface_driver \ + "$interface_driver" +crudini --set $cfg \ + DEFAULT \ + dhcp_driver \ + "${DHCP_DRIVER}" +crudini --set $cfg \ + DEFAULT \ + use_namespaces \ + "${USE_NAMESPACES}" +crudini --set $cfg \ + DEFAULT \ + delete_namespaces \ + "${DELETE_NAMESPACES}" +crudini --set $cfg \ + DEFAULT \ + dnsmasq_config_file \ + "${DNSMASQ_CONFIG_FILE}" +crudini --set $cfg \ + DEFAULT \ + root_helper \ + "${ROOT_HELPER}" + +cat > ${DNSMASQ_CONFIG_FILE} < /openrc < /dev/null; then + echo "ERROR: keystone token-get failed" >&2 + RES=1 +else + if ! neutron ext-list > /dev/null; then + echo "ERROR: neutron ext-list failed" >&2 + RES=1 + fi +fi + +exit $RES + diff --git a/docker/centos/binary/neutron/neutron-server/start.sh b/docker/centos/binary/neutron/neutron-server/start.sh new file mode 100755 index 000000000..aaaa7a994 --- /dev/null +++ b/docker/centos/binary/neutron/neutron-server/start.sh @@ -0,0 +1,98 @@ +#!/bin/bash + +set -e + +. /opt/kolla/config-neutron.sh + +: ${NEUTRON_FLAT_NETWORK_NAME:=physnet1} +: ${NEUTRON_FLAT_NETWORK_INTERFACE:=eth1} + +check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \ + KEYSTONE_AUTH_PROTOCOL NOVA_API_SERVICE_HOST \ + NOVA_KEYSTONE_USER NOVA_KEYSTONE_PASSWORD \ + NEUTRON_DB_NAME NEUTRON_DB_USER NEUTRON_DB_PASSWORD \ + NEUTRON_KEYSTONE_USER NEUTRON_KEYSTONE_PASSWORD \ + ADMIN_TENANT_NAME NEUTRON_SERVER_SERVICE_HOST \ + PUBLIC_IP NEUTRON_DB_PASSWORD +fail_unless_os_service_running keystone +fail_unless_db + +mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql < /openrc < /etc/sysconfig/network-scripts/ifcfg-$FLAT_INTERFACE < /dev/null; then + echo "ERROR: keystone token-get failed" >&2 + RES=1 +else + if ! nova list > /dev/null; then + echo "ERROR: nova list failed" >&2 + RES=1 + fi +fi + +exit $RES + diff --git a/docker/centos/binary/nova-controller/nova-api/start.sh b/docker/centos/binary/nova-controller/nova-api/start.sh new file mode 100755 index 000000000..7928370a4 --- /dev/null +++ b/docker/centos/binary/nova-controller/nova-api/start.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +set -e + +. /opt/kolla/config-nova.sh + +check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \ + NOVA_KEYSTONE_USER NOVA_KEYSTONE_PASSWORD \ + ADMIN_TENANT_NAME NOVA_API_SERVICE_HOST \ + NOVA_EC2_API_SERVICE_HOST PUBLIC_IP NOVA_DB_NAME +fail_unless_os_service_running keystone +fail_unless_db $NOVA_DB_NAME + +export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}" +export SERVICE_ENDPOINT="http://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0" + +cfg=/etc/nova/nova.conf + +# configure logging +crudini --set $cfg DEFAULT log_file "${NOVA_API_LOG_FILE}" + +crux user-create --update \ + -n "${NOVA_KEYSTONE_USER}" \ + -p "${NOVA_KEYSTONE_PASSWORD}" \ + -t "${ADMIN_TENANT_NAME}" \ + -r admin + +crux endpoint-create --remove-all \ + -n ec2 -t ec2 \ + -I "http://${NOVA_EC2_API_SERVICE_HOST}:8773/services/Cloud" \ + -P "http://${PUBLIC_IP}:8773/services/Cloud" \ + -A "http://${NOVA_EC2_API_SERVICE_HOST}:8773/services/Admin" + +crux endpoint-create --remove-all \ + -n nova -t compute \ + -I "http://${NOVA_API_SERVICE_HOST}:8774/v2/\$(tenant_id)s" \ + -P "http://${PUBLIC_IP}:8774/v2/\$(tenant_id)s" \ + -A "http://${NOVA_API_SERVICE_HOST}:8774/v2/\$(tenant_id)s" + +crux endpoint-create --remove-all \ + -n novav3 -t computev3 \ + -I "http://${NOVA_API_SERVICE_HOST}:8774/v3" \ + -P "http://${PUBLIC_IP}:8774/v3" \ + -A "http://${NOVA_API_SERVICE_HOST}:8774/v3" + +exec /usr/bin/nova-api --config-file /etc/nova/nova.conf diff --git a/docker/centos/binary/nova-controller/nova-conductor/Dockerfile b/docker/centos/binary/nova-controller/nova-conductor/Dockerfile new file mode 100644 index 000000000..f91113bad --- /dev/null +++ b/docker/centos/binary/nova-controller/nova-conductor/Dockerfile @@ -0,0 +1,8 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%nova-base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +RUN yum -y install \ + openstack-nova-conductor && yum clean all + +ADD ./start.sh /start.sh +CMD ["/start.sh"] diff --git a/docker/centos/binary/nova-controller/nova-conductor/build b/docker/centos/binary/nova-controller/nova-conductor/build new file mode 120000 index 000000000..ec1913803 --- /dev/null +++ b/docker/centos/binary/nova-controller/nova-conductor/build @@ -0,0 +1 @@ +../../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/nova-controller/nova-conductor/start.sh b/docker/centos/binary/nova-controller/nova-conductor/start.sh new file mode 100755 index 000000000..5e01b7f30 --- /dev/null +++ b/docker/centos/binary/nova-controller/nova-conductor/start.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +. /opt/kolla/config-nova.sh + +check_required_vars NOVA_DB_NAME NOVA_DB_USER NOVA_DB_PASSWORD +fail_unless_db + +cfg=/etc/nova/nova.conf + +# configure logging +crudini --set $cfg DEFAULT log_file "${NOVA_CONDUCTOR_LOG_FILE}" + +mysql -h ${MARIADB_SERVICE_HOST} -u root \ + -p${DB_ROOT_PASSWORD} mysql <>}, + {default_pass, <<"@RABBITMQ_PASS@">>} + ]}, + {kernel, [ + + ]} +]. +% EOF + diff --git a/docker/centos/binary/rabbitmq/start.sh b/docker/centos/binary/rabbitmq/start.sh new file mode 100755 index 000000000..3284368f3 --- /dev/null +++ b/docker/centos/binary/rabbitmq/start.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +: ${RABBITMQ_USER:=guest} +: ${RABBITMQ_PASS:=guest} +: ${RABBITMQ_NODENAME:=rabbit} +: ${RABBITMQ_LOG_BASE:=/var/log/rabbitmq} + +sed -i ' + s|@RABBITMQ_USER@|'"$RABBITMQ_USER"'|g + s|@RABBITMQ_PASS@|'"$RABBITMQ_PASS"'|g +' /etc/rabbitmq/rabbitmq.config + +sed -i ' + s|@RABBITMQ_NODENAME@|'"$RABBITMQ_NODENAME"'|g + s|@RABBITMQ_LOG_BASE@|'"$RABBITMQ_LOG_BASE"'|g +' /etc/rabbitmq/rabbitmq-env.conf + +# work around: +# https://bugs.launchpad.net/ubuntu/+source/rabbitmq-server/+bug/653405 +echo "${RABBITMQ_SERVICE_HOST} `/usr/bin/hostname -s`" > /etc/hosts + +exec /usr/sbin/rabbitmq-server diff --git a/docker/centos/binary/rhel-osp-base/Dockerfile b/docker/centos/binary/rhel-osp-base/Dockerfile new file mode 100644 index 000000000..422875dd6 --- /dev/null +++ b/docker/centos/binary/rhel-osp-base/Dockerfile @@ -0,0 +1,92 @@ +FROM rhel7 +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +RUN yum install -y \ + mariadb-libs \ + openstack-utils \ + pyparsing \ + python-alembic \ + python-amqp \ + python-amqplib \ + python-anyjson \ + python-boto \ + python-ceilometerclient \ + python-cheetah \ + python-cinderclient \ + python-cliff \ + python-cmd2 \ + python-croniter \ + python-crypto \ + python-d2to1 \ + python-docutils \ + python-dogpile-cache \ + python-dogpile-core \ + python-empy \ + python-eventlet \ + python-flask \ + python-futures \ + python-glanceclient \ + python-greenlet \ + python-heatclient \ + python-httplib2 \ + python-iso8601 \ + python-itsdangerous \ + python-jinja2 \ + python-jsonpatch \ + python-jsonpath-rw \ + python-jsonpointer \ + python-jsonschema \ + python-keyring \ + python-keystoneclient \ + python-kombu \ + python-lesscpy \ + python-lockfile \ + python-lxml \ + python-markdown \ + python-memcached \ + python-ldap \ + python-migrate \ + python-msgpack \ + python-netifaces \ + python-networkx \ + python-neutronclient \ + python-novaclient \ + python-oauthlib \ + python-openstackclient \ + python-oslo-config \ + python-oslo-messaging \ + python-oslo-rootwrap \ + python-oslo-vmware \ + python-paramiko \ + python-passlib \ + python-paste-deploy \ + python-pbr \ + python-pecan \ + python-ply \ + python-prettytable \ + python-psutil \ + python-pycadf \ + python-pygments \ + python-pymongo \ + python-qpid \ + python-repoze-lru \ + python-requests \ + python-routes \ + python-saharaclient \ + python-simplegeneric \ + python-simplejson \ + python-singledispatch \ + python-six \ + python-sqlalchemy \ + python-stevedore \ + python-swiftclient \ + python-taskflow \ + python-troveclient \ + python-versiontools \ + python-warlock \ + python-webob \ + python-websockify \ + python-webtest \ + python-werkzeug \ + python-wsme \ + && yum clean all diff --git a/docker/centos/binary/rhel-osp-base/build b/docker/centos/binary/rhel-osp-base/build new file mode 120000 index 000000000..8d652f7ee --- /dev/null +++ b/docker/centos/binary/rhel-osp-base/build @@ -0,0 +1 @@ +../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/swift/swift-account/Dockerfile b/docker/centos/binary/swift/swift-account/Dockerfile new file mode 100644 index 000000000..2c26802e3 --- /dev/null +++ b/docker/centos/binary/swift/swift-account/Dockerfile @@ -0,0 +1,6 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%swift-base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +ADD ./start.sh /start.sh +CMD ["/start.sh"] + diff --git a/docker/centos/binary/swift/swift-account/build b/docker/centos/binary/swift/swift-account/build new file mode 120000 index 000000000..ec1913803 --- /dev/null +++ b/docker/centos/binary/swift/swift-account/build @@ -0,0 +1 @@ +../../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/swift/swift-account/start.sh b/docker/centos/binary/swift/swift-account/start.sh new file mode 100644 index 000000000..f634f6e54 --- /dev/null +++ b/docker/centos/binary/swift/swift-account/start.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +: ${SWIFT_DB_USER:=swift} +: ${SWIFT_DB_NAME:=swift} +: ${KEYSTONE_AUTH_PROTOCOL:=http} +: ${SWIFT_KEYSTONE_USER:=swift} +: ${ADMIN_TENANT_NAME:=admin} + +check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \ + SWIFT_ADMIN_PASSWORD +fail_unless_db +fail_unless_os_service_running keystone + +if ! [ "$SWIFT_DB_PASSWORD" ]; then + SWIFT_DB_PASSWORD=$(openssl rand -hex 15) + export SWIFT_DB_PASSWORD +fi + +sh /opt/swift/config-swift.sh account-server + +mysql -h ${MARIADB_SERVICE_HOST} -u root \ + -p${DB_ROOT_PASSWORD} mysql < + +RUN yum -y install openstack-utils openstack-swift && yum clean all + +# These will come after we sort out start time config +RUN mkdir /opt/swift +#COPY config-swift.sh /opt/swift/config-swift.sh diff --git a/docker/centos/binary/swift/swift-base/Dockerfile b/docker/centos/binary/swift/swift-base/Dockerfile new file mode 100644 index 000000000..59600a23d --- /dev/null +++ b/docker/centos/binary/swift/swift-base/Dockerfile @@ -0,0 +1,8 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +RUN yum -y install openstack-utils openstack-swift && yum clean all + +# These will come after we sort out start time config +RUN mkdir /opt/swift +config-swift.sh /opt/swift/config-swift.sh diff --git a/docker/centos/binary/swift/swift-base/build b/docker/centos/binary/swift/swift-base/build new file mode 120000 index 000000000..ec1913803 --- /dev/null +++ b/docker/centos/binary/swift/swift-base/build @@ -0,0 +1 @@ +../../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/swift/swift-container/Dockerfile b/docker/centos/binary/swift/swift-container/Dockerfile new file mode 100644 index 000000000..2c26802e3 --- /dev/null +++ b/docker/centos/binary/swift/swift-container/Dockerfile @@ -0,0 +1,6 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%swift-base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +ADD ./start.sh /start.sh +CMD ["/start.sh"] + diff --git a/docker/centos/binary/swift/swift-container/build b/docker/centos/binary/swift/swift-container/build new file mode 120000 index 000000000..ec1913803 --- /dev/null +++ b/docker/centos/binary/swift/swift-container/build @@ -0,0 +1 @@ +../../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/swift/swift-container/start.sh b/docker/centos/binary/swift/swift-container/start.sh new file mode 100644 index 000000000..6e303872b --- /dev/null +++ b/docker/centos/binary/swift/swift-container/start.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +: ${SWIFT_DB_USER:=swift} +: ${SWIFT_DB_NAME:=swift} +: ${KEYSTONE_AUTH_PROTOCOL:=http} +: ${SWIFT_KEYSTONE_USER:=swift} +: ${ADMIN_TENANT_NAME:=admin} + +check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \ + SWIFT_ADMIN_PASSWORD +fail_unless_db +fail_unless_os_service_running keystone + +if ! [ "$SWIFT_DB_PASSWORD" ]; then + SWIFT_DB_PASSWORD=$(openssl rand -hex 15) + export SWIFT_DB_PASSWORD +fi + +sh /opt/swift/config-swift.sh container + +mysql -h ${MARIADB_SERVICE_HOST} -u root \ + -p${DB_ROOT_PASSWORD} mysql < /openrc <