Hongbin Lu 6dc2866167 Mova NovaDocker driver to contrib
We decided to deprecated NovaDocker driver in the team meeting [1].
Therefore, we moved the driver to the contrib folder. NovaDocker
was an experimental driver that attempts to leverage Nova to provide
networking to containers. However, as kuryr integration implemented,
this driver is not needed anymore.

[1] http://eavesdrop.openstack.org/meetings/zun/2017/
    zun.2017-07-11-03.00.log.html

Change-Id: I770fe13a004dc56ad20fe8eca545f05c4504e48e
2017-09-14 12:09:47 -04:00

64 lines
1.9 KiB
Bash

#!/bin/bash
#
# lib/nova
# Configure the docker hypervisor
# Dependencies:
#
# - ``functions`` file
# - ``DEST``, ``NOVA_CONF``, ``STACK_USER`` must be defined
# ``stack.sh`` calls the entry points in this order:
#
# - configure_nova_docker
# Save trace setting
_XTRACE_ZUN_NOVA=$(set +o | grep xtrace)
set +o xtrace
# Defaults
# --------
NOVA_CONF_DIR=${NOVA_CONF_DIR:-/etc/nova}
NOVA_CONF=${NOVA_CONF:-NOVA_CONF_DIR/nova.conf}
# Entry Points
# ------------
# configure_nova_docker - Set config files, create data dirs, etc
function configure_nova_docker {
iniset $NOVA_CONF DEFAULT compute_driver zun.DockerDriver
# CentOS/RedHat distros don't start the services just after the package
# is installed if it is not explicitily set. So the script fails on
# them in this killall because there is nothing to kill.
sudo killall docker || true
# Enable debug level logging
if [ -f "/etc/default/docker" ]; then
sudo cat /etc/default/docker
sudo sed -i 's/^.*DOCKER_OPTS=.*$/DOCKER_OPTS=\"--debug --storage-opt dm.override_udev_sync_check=true\"/' /etc/default/docker
sudo cat /etc/default/docker
fi
if [ -f "/etc/sysconfig/docker" ]; then
sudo cat /etc/sysconfig/docker
sudo sed -i 's/^.*OPTIONS=.*$/OPTIONS=--debug --selinux-enabled/' /etc/sysconfig/docker
sudo cat /etc/sysconfig/docker
fi
if [ -f "/usr/lib/systemd/system/docker.service" ]; then
sudo cat /usr/lib/systemd/system/docker.service
sudo sed -i 's/docker daemon/docker daemon --debug/' /usr/lib/systemd/system/docker.service
sudo cat /usr/lib/systemd/system/docker.service
sudo systemctl daemon-reload
fi
sudo service docker start || true
# setup rootwrap filters
local rootwrap_conf_src_dir="$DEST/zun/etc/nova"
sudo install -o root -g root -m 644 $rootwrap_conf_src_dir/rootwrap.d/*.filters /etc/nova/rootwrap.d
}
# Restore xtrace
$_XTRACE_ZUN_NOVA