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 --- .../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 ++++ 15 files changed, 155 insertions(+) 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 (limited to 'docker/centos/binary/swift') 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 <