From 7d4c7e09b4882077471c3b2cb097c237c2016f96 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 12 Mar 2014 08:05:08 -0400 Subject: [PATCH] remove docker from devstack with I1c9bea2fdeebc4199c4f7d8fca4580a6fb7fed5b nova removed docker from it's driver tree. We shouldn't have driver support inside of devstack that's not part of upstream projects (this has been a line we've been pretty clear on with Neutron drivers in the past). Remove docker driver accordingly. Change-Id: Ib91d415ea1616d99a5c5e7bc3b9015392fda5847 --- README.md | 6 +- exercises/boot_from_volume.sh | 3 - exercises/euca.sh | 3 - exercises/floating_ips.sh | 3 - exercises/sec_groups.sh | 3 - exercises/volumes.sh | 3 - lib/nova_plugins/hypervisor-docker | 132 ----------------------------- stackrc | 3 - tools/docker/README.md | 13 --- tools/docker/install_docker.sh | 68 --------------- 10 files changed, 1 insertion(+), 236 deletions(-) delete mode 100644 lib/nova_plugins/hypervisor-docker delete mode 100644 tools/docker/README.md delete mode 100755 tools/docker/install_docker.sh diff --git a/README.md b/README.md index 9914b1ed69..a0f5b2689d 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ does not run if started as root. This is a recent change (Oct 2013) from the previous behaviour of automatically creating a ``stack`` user. Automatically creating user accounts is not the right response to running as root, so -that bit is now an explicit step using ``tools/create-stack-user.sh``. +that bit is now an explicit step using ``tools/create-stack-user.sh``. Run that (as root!) or just check it out to see what DevStack's expectations are for the account it runs under. Many people simply use their usual login (the default 'ubuntu' login on a UEC image @@ -253,10 +253,6 @@ If tempest has been successfully configured, a basic set of smoke tests can be r If you would like to use Xenserver as the hypervisor, please refer to the instructions in `./tools/xen/README.md`. -# DevStack on Docker - -If you would like to use Docker as the hypervisor, please refer to the instructions in `./tools/docker/README.md`. - # Additional Projects DevStack has a hook mechanism to call out to a dispatch script at specific diff --git a/exercises/boot_from_volume.sh b/exercises/boot_from_volume.sh index f679669eea..dff8e7a632 100755 --- a/exercises/boot_from_volume.sh +++ b/exercises/boot_from_volume.sh @@ -44,9 +44,6 @@ source $TOP_DIR/exerciserc # the exercise is skipped is_service_enabled cinder || exit 55 -# Also skip if the hypervisor is Docker -[[ "$VIRT_DRIVER" == "docker" ]] && exit 55 - # Instance type to create DEFAULT_INSTANCE_TYPE=${DEFAULT_INSTANCE_TYPE:-m1.tiny} diff --git a/exercises/euca.sh b/exercises/euca.sh index ad852a4f79..3768b56d4e 100755 --- a/exercises/euca.sh +++ b/exercises/euca.sh @@ -40,9 +40,6 @@ source $TOP_DIR/exerciserc # the exercise is skipped is_service_enabled n-api || exit 55 -# Skip if the hypervisor is Docker -[[ "$VIRT_DRIVER" == "docker" ]] && exit 55 - # Instance type to create DEFAULT_INSTANCE_TYPE=${DEFAULT_INSTANCE_TYPE:-m1.tiny} diff --git a/exercises/floating_ips.sh b/exercises/floating_ips.sh index 8b7b96197e..1416d4dc6a 100755 --- a/exercises/floating_ips.sh +++ b/exercises/floating_ips.sh @@ -40,9 +40,6 @@ source $TOP_DIR/exerciserc # the exercise is skipped is_service_enabled n-api || exit 55 -# Skip if the hypervisor is Docker -[[ "$VIRT_DRIVER" == "docker" ]] && exit 55 - # Instance type to create DEFAULT_INSTANCE_TYPE=${DEFAULT_INSTANCE_TYPE:-m1.tiny} diff --git a/exercises/sec_groups.sh b/exercises/sec_groups.sh index d71a1e0755..5f8b0a4d5d 100755 --- a/exercises/sec_groups.sh +++ b/exercises/sec_groups.sh @@ -37,9 +37,6 @@ source $TOP_DIR/exerciserc # the exercise is skipped is_service_enabled n-api || exit 55 -# Skip if the hypervisor is Docker -[[ "$VIRT_DRIVER" == "docker" ]] && exit 55 - # Testing Security Groups # ======================= diff --git a/exercises/volumes.sh b/exercises/volumes.sh index 83d25c779c..0d556df9e7 100755 --- a/exercises/volumes.sh +++ b/exercises/volumes.sh @@ -41,9 +41,6 @@ source $TOP_DIR/exerciserc # exercise is skipped. is_service_enabled cinder || exit 55 -# Also skip if the hypervisor is Docker -[[ "$VIRT_DRIVER" == "docker" ]] && exit 55 - # Instance type to create DEFAULT_INSTANCE_TYPE=${DEFAULT_INSTANCE_TYPE:-m1.tiny} diff --git a/lib/nova_plugins/hypervisor-docker b/lib/nova_plugins/hypervisor-docker deleted file mode 100644 index fd3c4fefc8..0000000000 --- a/lib/nova_plugins/hypervisor-docker +++ /dev/null @@ -1,132 +0,0 @@ -# lib/nova_plugins/docker -# Configure the Docker hypervisor - -# Enable with: -# -# VIRT_DRIVER=docker - -# Dependencies: -# -# - ``functions`` file -# - ``nova`` and ``glance`` configurations - -# install_nova_hypervisor - install any external requirements -# configure_nova_hypervisor - make configuration changes, including those to other services -# start_nova_hypervisor - start any external services -# stop_nova_hypervisor - stop any external services -# cleanup_nova_hypervisor - remove transient data and cache - -# Save trace setting -MY_XTRACE=$(set +o | grep xtrace) -set +o xtrace - - -# Defaults -# -------- - -# Set up default directories -DOCKER_DIR=$DEST/docker - -DOCKER_UNIX_SOCKET=/var/run/docker.sock -DOCKER_PID_FILE=/var/run/docker.pid -DOCKER_REGISTRY_PORT=${DOCKER_REGISTRY_PORT:-5042} - -DOCKER_IMAGE=${DOCKER_IMAGE:-cirros:latest} -DOCKER_IMAGE_NAME=$DEFAULT_IMAGE_NAME -DOCKER_REGISTRY_IMAGE=${DOCKER_REGISTRY_IMAGE:-registry:latest} -DOCKER_REGISTRY_IMAGE_NAME=registry -DOCKER_REPOSITORY_NAME=${SERVICE_HOST}:${DOCKER_REGISTRY_PORT}/${DOCKER_IMAGE_NAME} - -DOCKER_APT_REPO=${DOCKER_APT_REPO:-https://get.docker.io/ubuntu} - - -# Entry Points -# ------------ - -# clean_nova_hypervisor - Clean up an installation -function cleanup_nova_hypervisor { - stop_service docker - - # Clean out work area - sudo rm -rf /var/lib/docker -} - -# configure_nova_hypervisor - Set config files, create data dirs, etc -function configure_nova_hypervisor { - iniset $NOVA_CONF DEFAULT compute_driver docker.DockerDriver - iniset $GLANCE_API_CONF DEFAULT container_formats ami,ari,aki,bare,ovf,docker -} - -# is_docker_running - Return 0 (true) if Docker is running, otherwise 1 -function is_docker_running { - local docker_pid - if [ -f "$DOCKER_PID_FILE" ]; then - docker_pid=$(cat "$DOCKER_PID_FILE") - fi - if [[ -z "$docker_pid" ]] || ! ps -p "$docker_pid" | grep [d]ocker; then - return 1 - fi - return 0 -} - -# install_nova_hypervisor() - Install external components -function install_nova_hypervisor { - # So far this is Ubuntu only - if ! is_ubuntu; then - die $LINENO "Docker is only supported on Ubuntu at this time" - fi - - # Make sure Docker is installed - if ! is_package_installed lxc-docker; then - die $LINENO "Docker is not installed. Please run tools/docker/install_docker.sh" - fi - - if ! (is_docker_running); then - die $LINENO "Docker not running" - fi -} - -# start_nova_hypervisor - Start any required external services -function start_nova_hypervisor { - if ! (is_docker_running); then - die $LINENO "Docker not running" - fi - - # Start the Docker registry container - docker run -d -p ${DOCKER_REGISTRY_PORT}:5000 \ - -e SETTINGS_FLAVOR=openstack -e OS_USERNAME=${OS_USERNAME} \ - -e OS_PASSWORD=${OS_PASSWORD} -e OS_TENANT_NAME=${OS_TENANT_NAME} \ - -e OS_GLANCE_URL="${SERVICE_PROTOCOL}://${GLANCE_HOSTPORT}" \ - -e OS_AUTH_URL=${OS_AUTH_URL} \ - $DOCKER_REGISTRY_IMAGE_NAME ./docker-registry/run.sh - - echo "Waiting for docker registry to start..." - DOCKER_REGISTRY=${SERVICE_HOST}:${DOCKER_REGISTRY_PORT} - if ! timeout $SERVICE_TIMEOUT sh -c "while ! curl -s $DOCKER_REGISTRY; do sleep 1; done"; then - die $LINENO "docker-registry did not start" - fi - - # Tag image if not already tagged - if ! docker images | grep $DOCKER_REPOSITORY_NAME; then - docker tag $DOCKER_IMAGE_NAME $DOCKER_REPOSITORY_NAME - fi - - # Make sure we copied the image in Glance - if ! (glance image-show "$DOCKER_IMAGE"); then - docker push $DOCKER_REPOSITORY_NAME - fi -} - -# stop_nova_hypervisor - Stop any external services -function stop_nova_hypervisor { - # Stop the docker registry container - docker kill $(docker ps | grep docker-registry | cut -d' ' -f1) -} - - -# Restore xtrace -$MY_XTRACE - -# Local variables: -# mode: shell-script -# End: diff --git a/stackrc b/stackrc index 6bb6f37195..756ec275dc 100644 --- a/stackrc +++ b/stackrc @@ -320,9 +320,6 @@ case "$VIRT_DRIVER" in openvz) DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-ubuntu-12.04-x86_64} IMAGE_URLS=${IMAGE_URLS:-"http://download.openvz.org/template/precreated/ubuntu-12.04-x86_64.tar.gz"};; - docker) - DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-cirros} - IMAGE_URLS=${IMAGE_URLS:-};; libvirt) case "$LIBVIRT_TYPE" in lxc) # the cirros root disk in the uec tarball is empty, so it will not work for lxc diff --git a/tools/docker/README.md b/tools/docker/README.md deleted file mode 100644 index 976111f750..0000000000 --- a/tools/docker/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# DevStack on Docker - -Using Docker as Nova's hypervisor requries two steps: - -* Configure DevStack by adding the following to `localrc`:: - - VIRT_DRIVER=docker - -* Download and install the Docker service and images:: - - tools/docker/install_docker.sh - -After this, `stack.sh` should run as normal. diff --git a/tools/docker/install_docker.sh b/tools/docker/install_docker.sh deleted file mode 100755 index 27c8c8210b..0000000000 --- a/tools/docker/install_docker.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env bash - -# **install_docker.sh** - Do the initial Docker installation and configuration - -# install_docker.sh -# -# Install docker package and images -# * downloads a base busybox image and a glance registry image if necessary -# * install the images in Docker's image cache - - -# Keep track of the current directory -SCRIPT_DIR=$(cd $(dirname "$0") && pwd) -TOP_DIR=$(cd $SCRIPT_DIR/../..; pwd) - -# Import common functions -source $TOP_DIR/functions - -# Load local configuration -source $TOP_DIR/stackrc - -FILES=$TOP_DIR/files - -# Get our defaults -source $TOP_DIR/lib/nova_plugins/hypervisor-docker - -SERVICE_TIMEOUT=${SERVICE_TIMEOUT:-60} - - -# Install Docker Service -# ====================== - -if is_fedora; then - install_package docker-io socat -else - # Stop the auto-repo updates and do it when required here - NO_UPDATE_REPOS=True - - # Set up home repo - curl https://get.docker.io/gpg | sudo apt-key add - - install_package python-software-properties && \ - sudo sh -c "echo deb $DOCKER_APT_REPO docker main > /etc/apt/sources.list.d/docker.list" - apt_get update - install_package --force-yes lxc-docker socat -fi - -# Start the daemon - restart just in case the package ever auto-starts... -restart_service docker - -echo "Waiting for docker daemon to start..." -DOCKER_GROUP=$(groups | cut -d' ' -f1) -CONFIGURE_CMD="while ! /bin/echo -e 'GET /v1.3/version HTTP/1.0\n\n' | socat - unix-connect:$DOCKER_UNIX_SOCKET 2>/dev/null | grep -q '200 OK'; do - # Set the right group on docker unix socket before retrying - sudo chgrp $DOCKER_GROUP $DOCKER_UNIX_SOCKET - sudo chmod g+rw $DOCKER_UNIX_SOCKET - sleep 1 -done" -if ! timeout $SERVICE_TIMEOUT sh -c "$CONFIGURE_CMD"; then - die $LINENO "docker did not start" -fi - -# Get guest container image -docker pull $DOCKER_IMAGE -docker tag $DOCKER_IMAGE $DOCKER_IMAGE_NAME - -# Get docker-registry image -docker pull $DOCKER_REGISTRY_IMAGE -docker tag $DOCKER_REGISTRY_IMAGE $DOCKER_REGISTRY_IMAGE_NAME