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:
parent
370736abb7
commit
fcda6a06d8
docker
centos/source
common/keystone
tools
@ -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
|
# Dependencies required for building/installing source components
|
||||||
RUN yum install -y \
|
RUN yum install -y \
|
||||||
MySQL-python \
|
crux \
|
||||||
git \
|
crudini \
|
||||||
python-pip \
|
|
||||||
python-devel \
|
|
||||||
gcc \
|
gcc \
|
||||||
tar \
|
git \
|
||||||
openssl-devel \
|
|
||||||
libffi-devel \
|
libffi-devel \
|
||||||
|
mariadb \
|
||||||
|
MySQL-python \
|
||||||
|
openssl \
|
||||||
|
openssl-devel \
|
||||||
|
python-devel \
|
||||||
|
python-pip \
|
||||||
|
tar \
|
||||||
&& yum clean all
|
&& yum clean all
|
||||||
|
|
||||||
RUN pip install --upgrade pip
|
RUN pip install --upgrade pip
|
||||||
|
10
docker/centos/source/keystone/.buildinfo
Normal file
10
docker/centos/source/keystone/.buildinfo
Normal 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}
|
30
docker/centos/source/keystone/Dockerfile
Normal file
30
docker/centos/source/keystone/Dockerfile
Normal 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"]
|
1
docker/centos/source/keystone/build
Symbolic link
1
docker/centos/source/keystone/build
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../../tools/build-docker-image
|
1
docker/centos/source/keystone/check.sh
Symbolic link
1
docker/centos/source/keystone/check.sh
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../common/keystone/check.sh
|
1
docker/centos/source/keystone/config-external.sh
Symbolic link
1
docker/centos/source/keystone/config-external.sh
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../common/keystone/config-external.sh
|
1
docker/centos/source/keystone/config-internal.sh
Symbolic link
1
docker/centos/source/keystone/config-internal.sh
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../common/keystone/config-internal.sh
|
1
docker/centos/source/keystone/start.sh
Symbolic link
1
docker/centos/source/keystone/start.sh
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../common/keystone/start.sh
|
@ -112,9 +112,6 @@ export OS_PASSWORD=${KEYSTONE_ADMIN_PASSWORD}
|
|||||||
export OS_TENANT_NAME=${ADMIN_TENANT_NAME}
|
export OS_TENANT_NAME=${ADMIN_TENANT_NAME}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Create keystone user and group if they don't exist
|
|
||||||
id -u keystone &>/dev/null || useradd --user-group keystone
|
|
||||||
|
|
||||||
# Run PKI Setup script
|
# Run PKI Setup script
|
||||||
echo "Setting up PKI"
|
echo "Setting up PKI"
|
||||||
/usr/bin/keystone-manage pki_setup --keystone-user keystone --keystone-group keystone
|
/usr/bin/keystone-manage pki_setup --keystone-user keystone --keystone-group keystone
|
||||||
|
@ -36,6 +36,7 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
[ -f $TOPDIR/.buildconf ] && . $TOPDIR/.buildconf
|
[ -f $TOPDIR/.buildconf ] && . $TOPDIR/.buildconf
|
||||||
|
[ -f $IMGDIR/.buildinfo ] && . $IMGDIR/.buildinfo
|
||||||
[ -f $IMGDIR/.buildconf ] && . $IMGDIR/.buildconf
|
[ -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; }
|
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_PREFIX%%|${PREFIX}|g" $TMPDIR/Dockerfile
|
||||||
sed -i.bak "s|%%KOLLA_TAG%%|${PARENT_TAG}|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
|
TRY=0
|
||||||
while [ $((MAX_TRIES - 1)) -gt $TRY ]; do
|
while [ $((MAX_TRIES - 1)) -gt $TRY ]; do
|
||||||
if docker build ${BUILDFLAGS} -t "$FULLIMAGE" $TMPDIR; then
|
if docker build ${BUILDFLAGS} -t "$FULLIMAGE" $TMPDIR; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user