aboutsummaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-10-13 20:31:29 +0000
committerGerrit Code Review <review@openstack.org>2014-10-13 20:31:29 +0000
commit7b002e7317ab049768a9dcea763fe8fa8e09fe44 (patch)
treecdd902f5b4bca65af35da872523094c7f26aea02 /docker
parenta07d6603ac75ef8aea591884b9c683e4be1a1279 (diff)
parentff0d4d4c061d0ba3831bfe51a753af95c1991fc0 (diff)
downloadkolla-7b002e7317ab049768a9dcea763fe8fa8e09fe44.tar.gz
kolla-7b002e7317ab049768a9dcea763fe8fa8e09fe44.zip
Merge "add kolla-common shell library to base image"
Diffstat (limited to 'docker')
-rw-r--r--docker/fedora-rdo-base/Dockerfile13
-rw-r--r--docker/fedora-rdo-base/kolla-common.sh66
2 files changed, 78 insertions, 1 deletions
diff --git a/docker/fedora-rdo-base/Dockerfile b/docker/fedora-rdo-base/Dockerfile
index f3a46e260..6b93274fe 100644
--- a/docker/fedora-rdo-base/Dockerfile
+++ b/docker/fedora-rdo-base/Dockerfile
@@ -1,8 +1,15 @@
FROM fedora
MAINTAINER Steven Dake <sdake@redhat.com>
+# Set up repositories
RUN yum install -y https://rdo.fedorapeople.org/rdo-release.rpm
+RUN yum -y install dnf dnf-plugins-core; yum clean all
+RUN dnf copr enable -y larsks/crux
+
+# Update packages
RUN yum update -y; yum clean all
+
+# Install base packages
RUN yum install -y \
crux \
mariadb \
@@ -39,12 +46,12 @@ RUN yum install -y \
python-jsonschema \
python-keyring \
python-kombu \
+ python-ldap \
python-lesscpy \
python-lockfile \
python-lxml \
python-markdown \
python-memcached \
- python-ldap \
python-migrate \
python-msgpack \
python-netifaces \
@@ -83,3 +90,7 @@ RUN yum install -y \
python-werkzeug \
python-wsme \
; yum clean all
+
+RUN mkdir -p /opt/kolla
+ADD kolla-common.sh /opt/kolla/kolla-common.sh
+
diff --git a/docker/fedora-rdo-base/kolla-common.sh b/docker/fedora-rdo-base/kolla-common.sh
new file mode 100644
index 000000000..b625588b3
--- /dev/null
+++ b/docker/fedora-rdo-base/kolla-common.sh
@@ -0,0 +1,66 @@
+#!/bin/bash
+
+# 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
+}
+
+# Exit unless we receive a successful response from the Glance API.
+check_for_glance() {
+ check_required_vars GLANCE_API_SERVICE_HOST
+ GLANCE_API_URL="http://${GLANCE_API_SERVICE_HOST}:9292/"
+
+ curl -sf -o /dev/null "$GLANCE_API_URL" || {
+ echo "ERROR: glance is not available @ $GLANCE_API_URL" >&2
+ exit 1
+ }
+
+ echo "glance is active @ $GLANCE_API_URL"
+}
+
+# Exit unless we receive a successful response from the Keystone API.
+check_for_keystone() {
+ check_required_vars KEYSTONE_PUBLIC_SERVICE_HOST
+
+ KEYSTONE_URL="http://${KEYSTONE_PUBLIC_SERVICE_HOST}:5000/v2.0"
+
+ curl -sf -o /dev/null "$KEYSTONE_URL" || {
+ echo "ERROR: keystone is not available @ $KEYSTONE_URL" >&2
+ exit 1
+ }
+
+ echo "keystone is active @ $KEYSTONE_URL"
+}
+
+# Exit unless we receive a successful response from the database server.
+check_for_db() {
+ check_required_vars MARIADB_SERVICE_HOST DB_ROOT_PASSWORD
+
+ mysql -h ${MARIADB_SERVICE_HOST} -u root -p"${DB_ROOT_PASSWORD}" \
+ -e "select 1" mysql > /dev/null 2>&1 || {
+ echo "ERROR: database is not available @ $MARIADB_SERVICE_HOST" >&2
+ exit 1
+ }
+
+ echo "database is active @ ${MARIADB_SERVICE_HOST}"
+}
+
+# Dump shell environment to a file
+dump_vars() {
+ set -o posix
+ set > /pid_$$_vars.sh
+ set +o posix
+}
+