aboutsummaryrefslogtreecommitdiff
path: root/docker/centos/binary/glance
diff options
context:
space:
mode:
authorPaul Bourke <paul.bourke@oracle.com>2015-06-17 11:14:59 +0000
committerPaul Bourke <paul.bourke@oracle.com>2015-06-19 17:12:05 +0000
commit897337cdd61f1702aa7e68da0466804bf0d21a86 (patch)
treed8489ef0f286ff69f10ebe0b42eca6cf8b1cc123 /docker/centos/binary/glance
parentc2b05b576f45ddf432571f817be45e6bcb188f75 (diff)
downloadkolla-897337cdd61f1702aa7e68da0466804bf0d21a86.tar.gz
kolla-897337cdd61f1702aa7e68da0466804bf0d21a86.zip
Symlink all non Dockerfile resources in images
The only files in the docker image directories that differ majorly between distros are the Dockerfiles (e.g. different package manager mechanisms, different repo sources, etc). The supporting files such as the start.sh/check.sh and config files should largely stay the same between base images. This change moves these files up into a "common" directory, and symlinks them in the same way that the build script is managed. This means when adding a new base distro only new Dockerfiles need to be created. Also, if a distro does happen to require a vastly different start.sh script for example, one can choose to simply not symlink to the common and instead drop in a custom one. Implements: blueprint refactor-base-image-layout Change-Id: Ic4db69d31ff54a1fb95af4853a2e5ae490064284
Diffstat (limited to 'docker/centos/binary/glance')
l---------[-rwxr-xr-x]docker/centos/binary/glance/glance-api/check.sh18
l---------[-rwxr-xr-x]docker/centos/binary/glance/glance-api/start.sh53
l---------[-rw-r--r--]docker/centos/binary/glance/glance-base/config-glance.sh64
l---------[-rwxr-xr-x]docker/centos/binary/glance/glance-registry/start.sh22
4 files changed, 4 insertions, 153 deletions
diff --git a/docker/centos/binary/glance/glance-api/check.sh b/docker/centos/binary/glance/glance-api/check.sh
index f97ef70f4..73dd5e253 100755..120000
--- a/docker/centos/binary/glance/glance-api/check.sh
+++ b/docker/centos/binary/glance/glance-api/check.sh
@@ -1,17 +1 @@
-#!/bin/bash
-
-RES=0
-
-. /openrc
-if ! keystone token-get > /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
-
+../../../../common/glance/glance-api/check.sh \ No newline at end of file
diff --git a/docker/centos/binary/glance/glance-api/start.sh b/docker/centos/binary/glance/glance-api/start.sh
index c546333f4..6740e1fe9 100755..120000
--- a/docker/centos/binary/glance/glance-api/start.sh
+++ b/docker/centos/binary/glance/glance-api/start.sh
@@ -1,52 +1 @@
-#!/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
+../../../../common/glance/glance-api/start.sh \ 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
index 97d076c11..d5c26f0b8 100644..120000
--- a/docker/centos/binary/glance/glance-base/config-glance.sh
+++ b/docker/centos/binary/glance/glance-base/config-glance.sh
@@ -1,63 +1 @@
-#!/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 <<EOF
-export OS_AUTH_URL="http://${KEYSTONE_PUBLIC_SERVICE_HOST}:5000/v2.0"
-export OS_USERNAME="${GLANCE_KEYSTONE_USER}"
-export OS_PASSWORD="${GLANCE_KEYSTONE_PASSWORD}"
-export OS_TENANT_NAME="${ADMIN_TENANT_NAME}"
-EOF
-
-for cfg in /etc/glance/glance-api.conf /etc/glance/glance-registry.conf; do
- crudini --set $cfg \
- DEFAULT \
- log_file \
- ""
-
- for option in auth_protocol auth_host auth_port; do
- crudini --del $cfg \
- keystone_authtoken \
- $option
- done
-
- crudini --set $cfg \
- keystone_authtoken \
- auth_uri \
- "http://${KEYSTONE_PUBLIC_SERVICE_HOST}:5000/"
- crudini --set $cfg \
- keystone_authtoken \
- admin_tenant_name \
- "${ADMIN_TENANT_NAME}"
- crudini --set $cfg \
- keystone_authtoken \
- admin_user \
- "${GLANCE_KEYSTONE_USER}"
- crudini --set $cfg \
- keystone_authtoken \
- admin_password \
- "${GLANCE_KEYSTONE_PASSWORD}"
-
- crudini --set $cfg \
- paste_deploy \
- flavor \
- keystone
-
- crudini --set $cfg \
- database \
- connection \
- "mysql://${GLANCE_DB_USER}:${GLANCE_DB_PASSWORD}@${MARIADB_SERVICE_HOST}/${GLANCE_DB_NAME}"
-done
-
+../../../../common/glance/glance-base/config-glance.sh \ No newline at end of file
diff --git a/docker/centos/binary/glance/glance-registry/start.sh b/docker/centos/binary/glance/glance-registry/start.sh
index 5f590fb1c..1295cdc31 100755..120000
--- a/docker/centos/binary/glance/glance-registry/start.sh
+++ b/docker/centos/binary/glance/glance-registry/start.sh
@@ -1,21 +1 @@
-#!/bin/bash
-
-set -e
-
-. /opt/kolla/kolla-common.sh
-. /opt/kolla/config-glance.sh
-
-check_required_vars GLANCE_DB_NAME GLANCE_DB_USER GLANCE_DB_PASSWORD
-# lets wait for the DB to be available
-wait_for 25 1 check_for_db
-
-mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF
-CREATE DATABASE IF NOT EXISTS ${GLANCE_DB_NAME} DEFAULT CHARACTER SET utf8;
-GRANT ALL PRIVILEGES ON ${GLANCE_DB_NAME}.* TO
- '${GLANCE_DB_USER}'@'%' IDENTIFIED BY '${GLANCE_DB_PASSWORD}'
-
-EOF
-
-/usr/bin/glance-manage db_sync
-
-exec /usr/bin/glance-registry
+../../../../common/glance/glance-registry/start.sh \ No newline at end of file