devstack: Move to devstack-plugin-container

A new openstack project has been created for docker interacting projects
to consolidate their code into a single repo.

This patch drops our code for installing & running docker and moves to
use the new plugin.

Depends-On: I78569f4c76e7023c58d8c67fcab17fce8b4e00fd
Change-Id: I194532a36d76441497b8ebd6c2a1338296bf4ea2
Fixes-Bug: https://bugs.launchpad.net/kuryr-kubernetes/+bug/1694914
Signed-off-by: Antoni Segura Puimedon <antonisp@celebdor.com>
This commit is contained in:
Antoni Segura Puimedon 2017-06-14 16:43:43 +02:00 committed by Antoni Segura Puimedon
parent 4437b6542d
commit 10d21d5758
5 changed files with 5 additions and 70 deletions

View File

@ -20,6 +20,7 @@
VARIANT=${1:-default}
export DEVSTACK_LOCAL_CONFIG="enable_plugin neutron-lbaas git://git.openstack.org/openstack/neutron-lbaas"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"enable_plugin devstack-plugin-container https://git.openstack.org/openstack/devstack-plugin-container"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"enable_plugin kuryr-kubernetes https://git.openstack.org/openstack/kuryr-kubernetes"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"NEUTRON_LBAAS_SERVICE_PROVIDERV2=LOADBALANCERV2:Haproxy:neutron_lbaas.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default"
export OVERRIDE_ENABLED_SERVICES=neutron,q-svc,key,mysql,rabbit,docker,etcd3,kubernetes-api,kubernetes-controller-manager,kubernetes-scheduler,kubelet,kuryr-kubernetes,q-lbaasv2

View File

@ -3,7 +3,7 @@
enable_plugin kuryr-kubernetes \
https://git.openstack.org/openstack/kuryr-kubernetes
enable_plugin dragonflow https://github.com/openstack/dragonflow
enable_plugin dragonflow https://git.openstack.org/openstack/dragonflow
# If you do not want stacking to clone new versions of the enabled services,
# like for example when you did local modifications and need to ./unstack.sh
@ -72,7 +72,7 @@ NEUTRON_LBAAS_SERVICE_PROVIDERV2="LOADBALANCERV2:Haproxy:neutron_lbaas.drivers.h
# ======
# If you already have docker configured, running and with its socket writable
# by the stack user, you can omit the following line.
enable_service docker
enable_plugin devstack-plugin-container https://git.openstack.org/openstack/devstack-plugin-container
# Etcd
# ====

View File

@ -25,7 +25,7 @@ RABBIT_HOST=$SERVICE_HOST
KURYR_CONFIGURE_NEUTRON_DEFAULTS=False
KURYR_CONFIGURE_BAREMETAL_KUBELET_IFACE=False
enable_service docker
enable_plugin devstack-plugin-container https://git.openstack.org/openstack/devstack-plugin-container
enable_service etcd3
enable_service kubernetes-api
enable_service kubernetes-controller-manager

View File

@ -54,7 +54,7 @@ enable_service rabbit
# ======
# If you already have docker configured, running and with its socket writable
# by the stack user, you can omit the following line.
enable_service docker
enable_plugin devstack-plugin-container https://git.openstack.org/openstack/devstack-plugin-container
# Etcd
# ====

View File

@ -257,66 +257,6 @@ function configure_neutron_defaults {
fi
}
function check_docker {
if is_ubuntu; then
dpkg -s docker-engine > /dev/null 2>&1
else
rpm -q docker-engine > /dev/null 2>&1 || rpm -q docker > /dev/null 2>&1
fi
}
function prepare_docker {
curl -L http://get.docker.com | sudo bash
}
function run_docker {
local dockerd_bin=$(which dockerd)
if [[ "$USE_SYSTEMD" = "True" ]]; then
# If systemd is being used, proceed as normal
run_process docker \
"$dockerd_bin --debug=true \
-H unix://$KURYR_DOCKER_ENGINE_SOCKET_FILE" "root" "root"
else
# If screen is being used, there is a possibility that the devstack
# environment is on a stable branch. Older versions of run_process have
# a different signature. Sudo is used as a workaround that works in
# both older and newer versions of devstack.
run_process docker \
"sudo $dockerd_bin --debug=true \
-H unix://$KURYR_DOCKER_ENGINE_SOCKET_FILE"
fi
# We put the stack user as owner of the socket so we do not need to
# run the Docker commands with sudo when developing.
echo -n "Waiting for Docker to create its socket file"
while [ ! -e "$KURYR_DOCKER_ENGINE_SOCKET_FILE" ]; do
echo -n "."
sleep 1
done
echo ""
sudo chown "$STACK_USER":docker "$KURYR_DOCKER_ENGINE_SOCKET_FILE"
}
function stop_docker {
stop_process docker
# Stop process does not handle well Docker 1.12+ new multi process
# split and doesn't kill them all. Let's leverage Docker's own pidfile
local DOCKER_PIDFILE="/var/run/docker.pid"
if [ -f "$DOCKER_PIDFILE" ]; then
echo "Killing docker"
sudo kill -s SIGTERM "$(cat "$DOCKER_PIDFILE")"
fi
while [ -e "$DOCKER_PIDFILE" ]; do
echo -n "."
sleep 1
done
if [ -e "$KURYR_DOCKER_ENGINE_SOCKET_FILE" ]; then
sudo rm "$KURYR_DOCKER_ENGINE_SOCKET_FILE"
fi
}
function get_hyperkube_container_cacert_setup_dir {
case "$1" in
1.[0-3].*) echo "/data";;
@ -563,12 +503,6 @@ if is_service_enabled kuryr-kubernetes; then
# sure Kuryr can start before neutron-server, so Kuryr start in "extra"
# phase. Bug: https://bugs.launchpad.net/kuryr/+bug/1587522
if is_service_enabled docker; then
check_docker || prepare_docker
stop_docker
run_docker
fi
if is_service_enabled legacy_etcd; then
prepare_etcd_legacy
run_etcd_legacy