Keystone installation from source

Makes use of new gen-source-tar script to provide a source based
keystone image.

This patch introduces a new concept of a .buildinfo file, which provides
variables specific to the image being built which cannot be defaulted in
a generic way, at least until the build script is overhauled. This file
is sourced before the .buildconf which still leaves everything
customisable by the user.

Co-Authored-By: Paul Bourke <paul.bourke@oracle.com>
Change-Id: I0ec6b9cfe6d4173f3192e4ae5833fb0f6d333f1c
Implements: blueprint install-from-source
This commit is contained in:
Alicja Kwasniewska 2015-07-02 17:08:59 +00:00 committed by Paul Bourke
parent 370736abb7
commit fcda6a06d8
10 changed files with 60 additions and 9 deletions

View File

@ -11,14 +11,18 @@ RUN curl https://copr.fedoraproject.org/coprs/sdake/crux/repo/epel-7/sdake-crux-
# Dependencies required for building/installing source components
RUN yum install -y \
MySQL-python \
git \
python-pip \
python-devel \
crux \
crudini \
gcc \
tar \
openssl-devel \
git \
libffi-devel \
mariadb \
MySQL-python \
openssl \
openssl-devel \
python-devel \
python-pip \
tar \
&& yum clean all
RUN pip install --upgrade pip

View File

@ -0,0 +1,10 @@
# Build info specific to this image. All values can be overridden in .buildconf
COMPONENT=keystone
SOURCE_INSTALL_AVAILABLE=1
# Used for git install method
: ${CLONE_FROM:=https://github.com/openstack/keystone}
# Used for curl install method
: ${TARBALL_URI:=http://tarballs.openstack.org/keystone/keystone-2015.1.0.tar.gz}

View File

@ -0,0 +1,30 @@
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
RUN yum -y install \
httpd \
mod_wsgi \
&& yum clean all
ADD ./keystone.tar /
RUN ln -s /keystone-* /keystone
RUN cd /keystone \
&& useradd --user-group keystone \
&& pip install -r requirements.txt \
&& pip install /keystone \
&& mkdir /etc/keystone /var/log/keystone /var/www/cgi-bin/keystone \
&& cp /keystone/etc/keystone.conf.sample /etc/keystone/keystone.conf \
&& cp -r /keystone/etc/* /etc/keystone/ \
&& cp -a httpd/wsgi-keystone.conf /etc/httpd/conf.d \
&& sed -i 's,/var/log/apache2,/var/log/httpd,' /etc/httpd/conf.d/wsgi-keystone.conf \
&& sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \
&& cp -a httpd/keystone.py /var/www/cgi-bin/keystone/main \
&& cp -a httpd/keystone.py /var/www/cgi-bin/keystone/admin \
&& chown -R keystone: /var/www/cgi-bin/keystone /var/log/keystone \
&& chmod 755 /var/www/cgi-bin/keystone/*
COPY start.sh check.sh /
COPY config-internal.sh config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -0,0 +1 @@
../../../../tools/build-docker-image

View File

@ -0,0 +1 @@
../../../common/keystone/check.sh

View File

@ -0,0 +1 @@
../../../common/keystone/config-external.sh

View File

@ -0,0 +1 @@
../../../common/keystone/config-internal.sh

View File

@ -0,0 +1 @@
../../../common/keystone/start.sh

View File

@ -112,9 +112,6 @@ export OS_PASSWORD=${KEYSTONE_ADMIN_PASSWORD}
export OS_TENANT_NAME=${ADMIN_TENANT_NAME}
EOF
# Create keystone user and group if they don't exist
id -u keystone &>/dev/null || useradd --user-group keystone
# Run PKI Setup script
echo "Setting up PKI"
/usr/bin/keystone-manage pki_setup --keystone-user keystone --keystone-group keystone

View File

@ -36,6 +36,7 @@ EOF
}
[ -f $TOPDIR/.buildconf ] && . $TOPDIR/.buildconf
[ -f $IMGDIR/.buildinfo ] && . $IMGDIR/.buildinfo
[ -f $IMGDIR/.buildconf ] && . $IMGDIR/.buildconf
ARGS=$(getopt -o hr:n:t:pfuN -l help,prefix:,namespace:,push,pull,private-registry:,release,tag:,force-rm,no-cache,no-use-released-parent,retry: -- "$@") || { usage >&2; exit 2; }
@ -149,6 +150,10 @@ sed -i.bak "s|%%KOLLA_NAMESPACE%%|${NAMESPACE}|g" $TMPDIR/Dockerfile
sed -i.bak "s|%%KOLLA_PREFIX%%|${PREFIX}|g" $TMPDIR/Dockerfile
sed -i.bak "s|%%KOLLA_TAG%%|${PARENT_TAG}|g" $TMPDIR/Dockerfile
if [[ "${SOURCE_INSTALL_AVAILABLE}" == "1" ]]; then
. ${TOPDIR}/tools/gen-source-tar.sh
fi
TRY=0
while [ $((MAX_TRIES - 1)) -gt $TRY ]; do
if docker build ${BUILDFLAGS} -t "$FULLIMAGE" $TMPDIR; then