Common start.sh

The majority of the start.sh code is identical. This removes that
duplicate code while still maintaining the ability to call code in a
specific container.

The start.sh is moved into /usr/local/bin/kolla_start in the container

The extend_start.sh script is called by the kolla_start script at the
location /usr/local/bin/kolla_extend_start . It always exists because
we create a noop kolla_extend_start in the base directory. We override
it with extend_start.sh in a specific image should we need to.

Of note, the neutron-agents container is exempt from this new
structure due to it being a fat container.

Additionally, we fix the inconsistent permissions throughout. 644 for
repo files and the scripts are set to 755 via a Docker RUN command to
ensure someones local perm change won't break upstream containers.

Change-Id: I7da8d19965463ad30ee522a71183e3f092e0d6ad
Closes-Bug: #1501295
This commit is contained in:
Sam Yaple 2015-09-30 11:23:39 +00:00
parent 3a56ce1826
commit cb4e875ae1
161 changed files with 167 additions and 961 deletions

View File

@ -188,4 +188,10 @@ RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com 199369E5404BD
{% endif %}
COPY set_configs.py kolla-common.sh /opt/kolla/
COPY set_configs.py /opt/kolla/
COPY start.sh /usr/local/bin/kolla_start
RUN touch /usr/local/bin/kolla_extend_start \
&& chmod 755 /usr/local/bin/kolla_start /usr/local/bin/kolla_extend_start /opt/kolla/set_configs.py
CMD ["kolla_start"]

View File

@ -1,5 +0,0 @@
#!/bin/bash
# Copying configs into place if needed and set run command
python /opt/kolla/set_configs.py
CMD=$(cat /run_command)

13
docker/base/start.sh Normal file
View File

@ -0,0 +1,13 @@
#!/bin/bash
set -o errexit
# Processing /opt/kolla/config_files/config.json
python /opt/kolla/set_configs.py
CMD=$(cat /run_command)
ARGS=""
# Run additional commands if present
source kolla_extend_start
echo "Running command: '${CMD}${ARGS:+ $ARGS}'"
exec ${CMD} ${ARGS}

View File

@ -10,9 +10,4 @@ RUN yum install -y openstack-ceilometer-alarm \
{% endif %}
{% endif %}
COPY ./start.sh /
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,10 +0,0 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/ceilometer-alarm"
ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
exec $CMD $ARGS

View File

@ -4,16 +4,13 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla)
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum install -y openstack-ceilometer-api \
&& yum clean all
{% endif %}
{% endif %}
COPY ./start.sh /
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}

View File

@ -1,11 +1,4 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/ceilometer-api"
ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@ -13,5 +6,3 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
su -s /bin/sh -c "ceilometer-manage db_sync" ceilometer
exit 0
fi
exec $CMD $ARGS

View File

@ -10,9 +10,4 @@ RUN yum install -y openstack-ceilometer-central \
{% endif %}
{% endif %}
COPY ./start.sh /
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,10 +0,0 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/ceilometer-agent-central"
ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
exec $CMD $ARGS

View File

@ -10,9 +10,4 @@ RUN yum install -y openstack-ceilometer-collector \
{% endif %}
{% endif %}
COPY ./start.sh /
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,10 +0,0 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/ceilometer-collector"
ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
exec $CMD $ARGS

View File

@ -4,7 +4,8 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla)
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum install -y openstack-ceilometer-compute \
RUN yum install -y \
openstack-ceilometer-compute \
python-ceilometerclient \
python-pecan \
&& yum clean all
@ -12,9 +13,4 @@ RUN yum install -y openstack-ceilometer-compute \
{% endif %}
{% endif %}
COPY ./start.sh /
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,10 +0,0 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/ceilometer-agent-compute"
ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
exec $CMD $ARGS

View File

@ -10,9 +10,4 @@ RUN yum install -y openstack-ceilometer-notification \
{% endif %}
{% endif %}
COPY ./start.sh /
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,10 +0,0 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/ceilometer-agent-notification"
ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
exec $CMD $ARGS

View File

@ -1,7 +1,7 @@
FROM {{ namespace }}/{{ image_prefix }}ceph-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY start.sh /
COPY fetch_ceph_keys.py /usr/bin/
CMD ["/start.sh"]
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start /usr/bin/fetch_ceph_keys.py

View File

@ -1,5 +1,4 @@
#!/bin/bash
set -o errexit
# Setup common paths
KEYRING_ADMIN="/etc/ceph/ceph.client.admin.keyring"
@ -7,9 +6,6 @@ KEYRING_MON="/etc/ceph/ceph.client.mon.keyring"
MONMAP="/etc/ceph/ceph.monmap"
MON_DIR="/var/lib/ceph/mon/ceph-$(hostname)"
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
@ -37,5 +33,3 @@ if [[ ! -e "${MON_DIR}/keyring" ]]; then
ceph-mon --mkfs -i "$(hostname)" --monmap "${MONMAP}" --keyring "${KEYRING_TMP}"
rm "${KEYRING_TMP}"
fi
exec $CMD

0
docker/ceph/ceph-mon/fetch_ceph_keys.py Executable file → Normal file
View File

View File

@ -1,6 +1,5 @@
FROM {{ namespace }}/{{ image_prefix }}ceph-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY start.sh /
CMD ["/start.sh"]
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start

View File

@ -1,8 +1,4 @@
#!/bin/bash
set -o errexit
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@ -44,5 +40,3 @@ fi
JOURNAL_PARTITION=$(ls "${OSD_DEV}"* | egrep "${OSD_DEV}p?2")
OSD_DIR="/var/lib/ceph/osd/ceph-${OSD_ID}"
ARGS="-i ${OSD_ID} --osd-journal ${JOURNAL_PARTITION} -k ${OSD_DIR}/keyring"
exec $CMD $ARGS

View File

@ -10,8 +10,7 @@ RUN yum install -y python-keystone \
{% endif %}
{% endif %}
COPY ./start.sh /
CMD ["/start.sh"]
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}

View File

@ -1,14 +1,9 @@
#!/bin/bash
set -o errexit
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
su -s /bin/sh -c "cinder-manage db sync" cinder
exit 0
fi
exec $CMD

View File

@ -1,8 +1,4 @@
FROM {{ namespace }}/{{ image_prefix }}cinder-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY ./start.sh /
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,7 +0,0 @@
#!/bin/bash
set -o errexit
# Loading common functions.
source /opt/kolla/kolla-common.sh
exec $CMD

View File

@ -1,8 +1,4 @@
FROM {{ namespace }}/{{ image_prefix }}cinder-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY ./start.sh /
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,7 +0,0 @@
#!/bin/bash
set -o errexit
# Loading common functions.
source /opt/kolla/kolla-common.sh
exec $CMD

View File

@ -4,15 +4,12 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla)
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum install -y lvm2 \
RUN yum install -y \
lvm2 \
scsi-target-utils \
&& yum clean all
{% endif %}
{% endif %}
COPY ./start.sh /
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,7 +0,0 @@
#!/bin/bash
set -o errexit
# Loading common functions.
source /opt/kolla/kolla-common.sh
exec $CMD

View File

@ -11,9 +11,7 @@ RUN yum install -y \
{% endif %}
{% endif %}
COPY start.sh /start.sh
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}

View File

@ -1,11 +1,4 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/designate-api"
ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@ -13,5 +6,3 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
su -s /bin/sh -c "designate-manage db_sync" designate
exit 0
fi
exec $CMD $ARGS

View File

@ -11,9 +11,4 @@ RUN yum install -y bind \
{% endif %}
{% endif %}
COPY start.sh /start.sh
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,10 +0,0 @@
#!/bin/bash
set -o errexit
CMD="/usr/sbin/named"
ARGS="-u named -g"
# Execute config strategy
source /opt/kolla/kolla-common.sh
exec $CMD $ARGS

View File

@ -4,16 +4,10 @@ MAINTAINER Kolla Project (https://launchpad.net.kolla)
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum install -y \
openstack-designate-central \
RUN yum install -y openstack-designate-central \
&& yum clean all
{% endif %}
{% endif %}
COPY start.sh /start.sh
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,10 +0,0 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/designate-central"
ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
exec $CMD $ARGS

View File

@ -10,9 +10,4 @@ RUN yum install -y openstack-designate-mdns \
{% endif %}
{% endif %}
COPY start.sh /start.sh
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,10 +0,0 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/designate-mdns"
ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
exec $CMD $ARGS

View File

@ -13,9 +13,4 @@ RUN yum install -y \
{% endif %}
{% endif %}
COPY start.sh /start.sh
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,10 +0,0 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/designate-pool-manager"
ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
exec $CMD $ARGS

View File

@ -12,9 +12,4 @@ RUN yum install -y \
{% endif %}
{% endif %}
COPY start.sh /start.sh
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,10 +0,0 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/designate-sink"
ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
exec $CMD $ARGS

View File

@ -1,8 +1,7 @@
FROM {{ namespace }}/{{ image_prefix }}glance-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY start.sh /
CMD ["/start.sh"]
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}

View File

@ -1,8 +1,4 @@
#!/bin/bash
set -o errexit
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@ -10,5 +6,3 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
su -s /bin/sh -c "glance-manage db_sync" glance
exit 0
fi
exec $CMD

View File

@ -1,8 +1,4 @@
FROM {{ namespace }}/{{ image_prefix }}glance-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY start.sh /
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,7 +0,0 @@
#!/bin/bash
set -o errexit
# Loading common functions.
source /opt/kolla/kolla-common.sh
exec $CMD

View File

@ -13,9 +13,7 @@ RUN yum install -y \
{% endif %}
{% endif %}
COPY start.sh /
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}

View File

@ -1,11 +1,4 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/gnocchi-api"
ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@ -13,6 +6,3 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
su -s /bin/sh -c "gnocchi-manage db_sync" gnocchi
exit 0
fi
exec $CMD $ARGS

View File

@ -10,9 +10,4 @@ RUN yum install -y openstack-gnocchi-statsd \
{% endif %}
{% endif %}
COPY start.sh /
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,11 +0,0 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/gnocchi-statsd"
ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
exec $CMD $ARGS

View File

@ -19,9 +19,9 @@ RUN apt-get install -y --no-install-recommends haproxy \
{% endif %}
COPY start.sh /
COPY ensure_latest_config.sh /opt/kolla/
CMD ["/start.sh"]
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start /opt/kolla/ensure_latest_config.sh
{{ include_footer }}

0
docker/haproxy/ensure_latest_config.sh Executable file → Normal file
View File

View File

@ -1,10 +1,6 @@
#!/bin/bash
set -o errexit
# Loading common functions.
source /opt/kolla/kolla-common.sh
# We are intentionally not using exec so we can reload the haproxy config later
echo "Running command: '${CMD}'"
$CMD
# TODO(SamYaple): This has the potential for a race condition triggered by a
@ -12,3 +8,6 @@ $CMD
while [[ -e "/proc/$(cat /run/haproxy.pid)" ]]; do
sleep 5
done
# Based on the above loop this point should never be reached
exit 1

View File

@ -10,8 +10,4 @@ RUN yum -y install openstack-heat-api-cfn \
{% endif %}
{% endif %}
COPY start.sh /
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,7 +0,0 @@
#!/bin/bash
set -o errexit
# Loading common functions.
source /opt/kolla/kolla-common.sh
exec $CMD

View File

@ -10,8 +10,7 @@ RUN yum -y install openstack-heat-api \
{% endif %}
{% endif %}
COPY start.sh /
CMD ["/start.sh"]
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}

View File

@ -1,8 +1,4 @@
#!/bin/bash
set -o errexit
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@ -13,5 +9,3 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
openstack role add --domain heat_user_domain --user heat_domain_admin admin
exit 0
fi
exec $CMD

View File

@ -15,8 +15,4 @@ RUN yum -y install \
{% endif %}
{% endif %}
COPY start.sh /
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -56,8 +56,7 @@ RUN ln -s horizon-source/* horizon \
{% endif %}
COPY start.sh /
CMD ["/start.sh"]
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}

View File

@ -1,13 +1,7 @@
#!/bin/bash
set -o errexit
# Loading common functions
source /opt/kolla/kolla-common.sh
if [[ "${KOLLA_BASE_DISTRO}" == "ubuntu" || \
"${KOLLA_BASE_DISTRO}" == "debian" ]]; then
# Loading Apache2 ENV variables
source /etc/apache2/envvars
fi
exec $CMD

View File

@ -13,8 +13,7 @@ RUN VER_TO_GET=$(yum --showduplicates list openstack-ironic-api | awk '/delorean
{% endif %}
{% endif %}
COPY start.sh /
CMD ["/start.sh"]
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}

View File

@ -1,7 +1,4 @@
#!/bin/bash
set -o errexit
source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@ -9,5 +6,3 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
su -s /bin/sh -c "ironic-dbsync upgrade" ironic
exit 0
fi
exec $CMD

View File

@ -13,8 +13,4 @@ RUN VER_TO_GET=$(yum --showduplicates list openstack-ironic-conductor | awk '/de
{% endif %}
{% endif %}
COPY start.sh /
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,6 +0,0 @@
#!/bin/bash
set -o errexit
source /opt/kolla/kolla-common.sh
exec $CMD

View File

@ -13,8 +13,4 @@ RUN pip install ironic-discoverd
{% endif %}
{% endif %}
COPY start.sh /
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,6 +0,0 @@
#!/bin/bash
set -o errexit
source /opt/kolla/kolla-common.sh
exec $CMD

View File

@ -23,8 +23,5 @@ RUN apt-get install --no-install-recommends \
{% endif %}
COPY tftp-map-file /tftpboot/map-file
COPY start.sh /
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,6 +0,0 @@
#!/bin/bash
set -o errexit
source /opt/kolla/kolla-common.sh
exec $CMD

View File

@ -18,8 +18,9 @@ RUN apt-get install -y --no-install-recommends \
{% endif %}
COPY start.sh check_alive.sh /
COPY check_alive.sh /
CMD ["/start.sh"]
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start /check_alive.sh
{{ include_footer }}

0
docker/keepalived/check_alive.sh Executable file → Normal file
View File

View File

@ -1,8 +1,4 @@
#!/bin/bash
set -o errexit
# Loading common functions.
source /opt/kolla/kolla-common.sh
modprobe ip_vs
@ -10,5 +6,3 @@ modprobe ip_vs
if [ -f /run/keepalived.pid ]; then
rm /run/keepalived.pid
fi
exec $CMD

View File

@ -50,8 +50,7 @@ RUN ln -s keystone-source/* keystone \
RUN chown -R keystone: /var/www/cgi-bin/keystone \
&& chmod 755 /var/www/cgi-bin/keystone/*
COPY start.sh /
CMD ["/start.sh"]
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}

View File

@ -1,8 +1,4 @@
#!/bin/bash
set -o errexit
# Loading common functions
source /opt/kolla/kolla-common.sh
if [[ "${KOLLA_BASE_DISTRO}" == "ubuntu" || \
"${KOLLA_BASE_DISTRO}" == "debian" ]]; then
@ -32,5 +28,3 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
fi
ARGS="-DFOREGROUND"
echo "Running command: ${CMD} ${ARGS}"
exec $CMD $ARGS

13
docker/logging/rsyslog/Dockerfile.j2 Executable file → Normal file
View File

@ -3,15 +3,14 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla)
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \
rsyslog \
RUN yum -y install rsyslog \
&& yum clean all
{% elif base_distro in ['ubuntu', 'debian'] %}
RUN apt-get install -y --no-install-recommends \
rsyslog \
RUN apt-get install -y --no-install-recommends rsyslog \
&& apt-get clean
{% endif %}
COPY start.sh /
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,7 +0,0 @@
#!/bin/bash
set -o errexit
# Loading common functions.
source /opt/kolla/kolla-common.sh
exec $CMD $ARGS

View File

@ -10,10 +10,7 @@ RUN yum -y install openstack-magnum-api \
{% endif %}
{% endif %}
COPY ./start.sh /
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}

View File

@ -1,11 +1,4 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/magnum-api"
ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@ -13,5 +6,3 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
su -s /bin/sh -c "magnum-manage db_sync" magnum
exit 0
fi
exec $CMD $ARGS

View File

@ -4,7 +4,8 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla)
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install openstack-magnum-conductor \
RUN yum -y install \
openstack-magnum-conductor \
tar \
&& yum clean all
@ -14,10 +15,4 @@ RUN cd /tmp && curl -L https://github.com/GoogleCloudPlatform/kubernetes/release
{% endif %}
{% endif %}
COPY ./start.sh /
COPY config-external.sh /opt/kolla/
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,10 +0,0 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/magnum-conductor"
ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
exec $CMD $ARGS

View File

@ -28,9 +28,7 @@ RUN apt-get install -y --no-install-recommends \
{% endif %}
COPY config-galera.sh /opt/kolla/config/
COPY start.sh /
CMD ["/start.sh"]
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}

View File

@ -31,6 +31,12 @@ function bootstrap_db {
mysqladmin -p"${DB_ROOT_PASSWORD}" shutdown
}
function populate_db {
chown mysql: /var/lib/mysql
# This catches all cases of the BOOTSTRAP variable being set, including empty
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]] && [[ ! -e /var/lib/mysql/cluster.exists ]]; then
ARGS="--wsrep-new-cluster"
touch /var/lib/mysql/cluster.exists
mysql_install_db --user=mysql
}
bootstrap_db
fi

View File

@ -1,20 +0,0 @@
#!/bin/bash
set -o errexit
# Loading common functions
source /opt/kolla/kolla-common.sh
source /opt/kolla/config/config-galera.sh
chown mysql: /var/lib/mysql
# This catches all cases of the BOOTSTRAP variable being set, including empty
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]] && [[ ! -e /var/lib/mysql/cluster.exists ]]; then
ARGS="--wsrep-new-cluster"
touch /var/lib/mysql/cluster.exists
populate_db
bootstrap_db
exec $CMD $ARGS
exit 0
fi
exec $CMD

View File

@ -13,8 +13,4 @@ RUN apt-get install -y --no-install-recommends memcached \
{% endif %}
COPY start.sh /
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,7 +0,0 @@
#!/bin/bash
set -o errexit
# Loading common functions.
source /opt/kolla/kolla-common.sh
exec $CMD

View File

@ -17,9 +17,7 @@ RUN apt-get install -y --no-install-recommends mongodb-server \
RUN mkdir -p /data/db
VOLUME /data/db
VOLUME /var/log/mongodb
ENTRYPOINT exec /bin/mongod --dbpath /data/db --logpath /var/log/mongodb/mongo.log --noprealloc --smallfiles
# TODO(SamYaple): updated mongodb to match the rest of Kolla
#ENTRYPOINT exec /bin/mongod --dbpath /data/db --logpath /var/log/mongodb/mongo.log --noprealloc --smallfiles
{{ include_footer }}

View File

@ -1,8 +1,7 @@
FROM {{ namespace }}/{{ image_prefix }}murano-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY start.sh /
CMD ["/start.sh"]
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}

View File

@ -1,8 +1,4 @@
#!/bin/bash
set -o errexit
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@ -10,5 +6,3 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
su -s /bin/sh -c "murano-db-manage --config-file /etc/murano/murano.conf upgrade" murano
exit 0
fi
exec $CMD

View File

@ -1,8 +1,4 @@
FROM {{ namespace }}/{{ image_prefix }}murano-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY start.sh /
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,7 +0,0 @@
#!/bin/bash
set -o errexit
# Loading common functions.
source /opt/kolla/kolla-common.sh
exec $CMD

View File

@ -31,6 +31,7 @@ COPY fwaas_driver.ini /etc/neutron/
COPY neutron-dhcp-agent/ /opt/kolla/neutron-dhcp-agent
COPY neutron-l3-agent/ /opt/kolla/neutron-l3-agent
COPY neutron-metadata-agent/ /opt/kolla/neutron-metadata-agent
COPY config-sudoers.sh /opt/kolla/
COPY start.sh /

View File

@ -1,7 +1,7 @@
#!/bin/bash
set -o errexit
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Processing /opt/kolla/config_files/config.json
python /opt/kolla/set_configs.py
exec /usr/bin/supervisord

View File

@ -40,4 +40,5 @@ RUN ln -s neutron-base-source/* neutron \
{% endif %}
COPY config-sudoers.sh /opt/kolla/
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start

View File

@ -0,0 +1,11 @@
#!/bin/bash
# Neutron uses rootwrap which requires a tty for sudo.
# Since the container is running in daemon mode, a tty
# is not present and requiretty must be commented out.
if [ ! -f /sudo-modified ]; then
chmod 0640 /etc/sudoers
sed -i '/Defaults requiretty/s/^/#/' /etc/sudoers
chmod 0440 /etc/sudoers
touch /sudo-modified
fi

4
docker/neutron/neutron-base/ip_wrapper.py Executable file → Normal file
View File

@ -19,7 +19,9 @@
# access all of the neutron network namespaces as well as all
# containers that bind mount /run/netns from the host.
# This is required for "thin" neutron containers to function properly
# This is required for "thin" neutron containers to function properly. However,
# due to a missing feature/bug in Docker it is not possible to use this script
# at this time. Once Docker updates with this feature we will usre this again.
import nsenter
import subprocess

View File

@ -15,13 +15,10 @@ RUN yum install -y \
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
# Install required packages
RUN yum install -y ebtables && yum clean all
RUN yum install -y ebtables \
&& yum clean all
{% endif %}
{% endif %}
COPY start.sh /
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,8 +0,0 @@
#!/bin/bash
set -o errexit
# Loading common functions.
source /opt/kolla/kolla-common.sh
source /opt/kolla/config-sudoers.sh
exec $CMD

View File

@ -15,15 +15,10 @@ RUN yum install -y \
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
# Install required packages
RUN yum install -y \
openvswitch \
RUN yum install -y openvswitch \
&& yum clean all
{% endif %}
{% endif %}
COPY start.sh /
CMD ["/start.sh"]
{{ include_footer }}

View File

@ -1,8 +0,0 @@
#!/bin/bash
set -o errexit
# Loading common functions.
source /opt/kolla/kolla-common.sh
source /opt/kolla/config-sudoers.sh
exec $CMD

View File

@ -23,8 +23,7 @@ RUN yum install -y which \
{% endif %}
{% endif %}
COPY start.sh /
CMD ["/start.sh"]
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}

View File

@ -1,8 +1,4 @@
#!/bin/bash
set -o errexit
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@ -11,4 +7,12 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
exit 0
fi
exec $CMD
# Neutron uses rootwrap which requires a tty for sudo.
# Since the container is running in daemon mode, a tty
# is not present and requiretty must be commented out.
if [ ! -f /sudo-modified ]; then
chmod 0640 /etc/sudoers
sed -i '/Defaults requiretty/s/^/#/' /etc/sudoers
chmod 0440 /etc/sudoers
touch /sudo-modified
fi

View File

@ -10,8 +10,7 @@ RUN yum -y install openstack-nova-api \
{% endif %}
{% endif %}
COPY start.sh /
CMD ["/start.sh"]
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}

Some files were not shown because too many files have changed in this diff Show More