Browse code

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

Sean Dague authored on 2014/03/12 21:05:08
Showing 10 changed files
... ...
@@ -73,7 +73,7 @@ does not run if started as root.
73 73
 This is a recent change (Oct 2013) from the previous behaviour of
74 74
 automatically creating a ``stack`` user.  Automatically creating
75 75
 user accounts is not the right response to running as root, so
76
-that bit is now an explicit step using ``tools/create-stack-user.sh``. 
76
+that bit is now an explicit step using ``tools/create-stack-user.sh``.
77 77
 Run that (as root!) or just check it out to see what DevStack's
78 78
 expectations are for the account it runs under.  Many people simply
79 79
 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
253 253
 
254 254
 If you would like to use Xenserver as the hypervisor, please refer to the instructions in `./tools/xen/README.md`.
255 255
 
256
-# DevStack on Docker
257
-
258
-If you would like to use Docker as the hypervisor, please refer to the instructions in `./tools/docker/README.md`.
259
-
260 256
 # Additional Projects
261 257
 
262 258
 DevStack has a hook mechanism to call out to a dispatch script at specific
... ...
@@ -44,9 +44,6 @@ source $TOP_DIR/exerciserc
44 44
 # the exercise is skipped
45 45
 is_service_enabled cinder || exit 55
46 46
 
47
-# Also skip if the hypervisor is Docker
48
-[[ "$VIRT_DRIVER" == "docker" ]] && exit 55
49
-
50 47
 # Instance type to create
51 48
 DEFAULT_INSTANCE_TYPE=${DEFAULT_INSTANCE_TYPE:-m1.tiny}
52 49
 
... ...
@@ -40,9 +40,6 @@ source $TOP_DIR/exerciserc
40 40
 # the exercise is skipped
41 41
 is_service_enabled n-api || exit 55
42 42
 
43
-# Skip if the hypervisor is Docker
44
-[[ "$VIRT_DRIVER" == "docker" ]] && exit 55
45
-
46 43
 # Instance type to create
47 44
 DEFAULT_INSTANCE_TYPE=${DEFAULT_INSTANCE_TYPE:-m1.tiny}
48 45
 
... ...
@@ -40,9 +40,6 @@ source $TOP_DIR/exerciserc
40 40
 # the exercise is skipped
41 41
 is_service_enabled n-api || exit 55
42 42
 
43
-# Skip if the hypervisor is Docker
44
-[[ "$VIRT_DRIVER" == "docker" ]] && exit 55
45
-
46 43
 # Instance type to create
47 44
 DEFAULT_INSTANCE_TYPE=${DEFAULT_INSTANCE_TYPE:-m1.tiny}
48 45
 
... ...
@@ -37,9 +37,6 @@ source $TOP_DIR/exerciserc
37 37
 # the exercise is skipped
38 38
 is_service_enabled n-api || exit 55
39 39
 
40
-# Skip if the hypervisor is Docker
41
-[[ "$VIRT_DRIVER" == "docker" ]] && exit 55
42
-
43 40
 
44 41
 # Testing Security Groups
45 42
 # =======================
... ...
@@ -41,9 +41,6 @@ source $TOP_DIR/exerciserc
41 41
 # exercise is skipped.
42 42
 is_service_enabled cinder || exit 55
43 43
 
44
-# Also skip if the hypervisor is Docker
45
-[[ "$VIRT_DRIVER" == "docker" ]] && exit 55
46
-
47 44
 # Instance type to create
48 45
 DEFAULT_INSTANCE_TYPE=${DEFAULT_INSTANCE_TYPE:-m1.tiny}
49 46
 
50 47
deleted file mode 100644
... ...
@@ -1,132 +0,0 @@
1
-# lib/nova_plugins/docker
2
-# Configure the Docker hypervisor
3
-
4
-# Enable with:
5
-#
6
-#   VIRT_DRIVER=docker
7
-
8
-# Dependencies:
9
-#
10
-# - ``functions`` file
11
-# - ``nova`` and ``glance`` configurations
12
-
13
-# install_nova_hypervisor - install any external requirements
14
-# configure_nova_hypervisor - make configuration changes, including those to other services
15
-# start_nova_hypervisor - start any external services
16
-# stop_nova_hypervisor - stop any external services
17
-# cleanup_nova_hypervisor - remove transient data and cache
18
-
19
-# Save trace setting
20
-MY_XTRACE=$(set +o | grep xtrace)
21
-set +o xtrace
22
-
23
-
24
-# Defaults
25
-# --------
26
-
27
-# Set up default directories
28
-DOCKER_DIR=$DEST/docker
29
-
30
-DOCKER_UNIX_SOCKET=/var/run/docker.sock
31
-DOCKER_PID_FILE=/var/run/docker.pid
32
-DOCKER_REGISTRY_PORT=${DOCKER_REGISTRY_PORT:-5042}
33
-
34
-DOCKER_IMAGE=${DOCKER_IMAGE:-cirros:latest}
35
-DOCKER_IMAGE_NAME=$DEFAULT_IMAGE_NAME
36
-DOCKER_REGISTRY_IMAGE=${DOCKER_REGISTRY_IMAGE:-registry:latest}
37
-DOCKER_REGISTRY_IMAGE_NAME=registry
38
-DOCKER_REPOSITORY_NAME=${SERVICE_HOST}:${DOCKER_REGISTRY_PORT}/${DOCKER_IMAGE_NAME}
39
-
40
-DOCKER_APT_REPO=${DOCKER_APT_REPO:-https://get.docker.io/ubuntu}
41
-
42
-
43
-# Entry Points
44
-# ------------
45
-
46
-# clean_nova_hypervisor - Clean up an installation
47
-function cleanup_nova_hypervisor {
48
-    stop_service docker
49
-
50
-    # Clean out work area
51
-    sudo rm -rf /var/lib/docker
52
-}
53
-
54
-# configure_nova_hypervisor - Set config files, create data dirs, etc
55
-function configure_nova_hypervisor {
56
-    iniset $NOVA_CONF DEFAULT compute_driver docker.DockerDriver
57
-    iniset $GLANCE_API_CONF DEFAULT container_formats ami,ari,aki,bare,ovf,docker
58
-}
59
-
60
-# is_docker_running - Return 0 (true) if Docker is running, otherwise 1
61
-function is_docker_running {
62
-    local docker_pid
63
-    if [ -f "$DOCKER_PID_FILE" ]; then
64
-        docker_pid=$(cat "$DOCKER_PID_FILE")
65
-    fi
66
-    if [[ -z "$docker_pid" ]] || ! ps -p "$docker_pid" | grep [d]ocker; then
67
-        return 1
68
-    fi
69
-    return 0
70
-}
71
-
72
-# install_nova_hypervisor() - Install external components
73
-function install_nova_hypervisor {
74
-    # So far this is Ubuntu only
75
-    if ! is_ubuntu; then
76
-        die $LINENO "Docker is only supported on Ubuntu at this time"
77
-    fi
78
-
79
-    # Make sure Docker is installed
80
-    if ! is_package_installed lxc-docker; then
81
-        die $LINENO "Docker is not installed.  Please run tools/docker/install_docker.sh"
82
-    fi
83
-
84
-    if ! (is_docker_running); then
85
-        die $LINENO "Docker not running"
86
-    fi
87
-}
88
-
89
-# start_nova_hypervisor - Start any required external services
90
-function start_nova_hypervisor {
91
-    if ! (is_docker_running); then
92
-        die $LINENO "Docker not running"
93
-    fi
94
-
95
-    # Start the Docker registry container
96
-    docker run -d -p ${DOCKER_REGISTRY_PORT}:5000 \
97
-        -e SETTINGS_FLAVOR=openstack -e OS_USERNAME=${OS_USERNAME} \
98
-        -e OS_PASSWORD=${OS_PASSWORD} -e OS_TENANT_NAME=${OS_TENANT_NAME} \
99
-        -e OS_GLANCE_URL="${SERVICE_PROTOCOL}://${GLANCE_HOSTPORT}" \
100
-        -e OS_AUTH_URL=${OS_AUTH_URL} \
101
-        $DOCKER_REGISTRY_IMAGE_NAME ./docker-registry/run.sh
102
-
103
-    echo "Waiting for docker registry to start..."
104
-    DOCKER_REGISTRY=${SERVICE_HOST}:${DOCKER_REGISTRY_PORT}
105
-    if ! timeout $SERVICE_TIMEOUT sh -c "while ! curl -s $DOCKER_REGISTRY; do sleep 1; done"; then
106
-        die $LINENO "docker-registry did not start"
107
-    fi
108
-
109
-    # Tag image if not already tagged
110
-    if ! docker images | grep $DOCKER_REPOSITORY_NAME; then
111
-        docker tag $DOCKER_IMAGE_NAME $DOCKER_REPOSITORY_NAME
112
-    fi
113
-
114
-    # Make sure we copied the image in Glance
115
-    if ! (glance image-show "$DOCKER_IMAGE"); then
116
-        docker push $DOCKER_REPOSITORY_NAME
117
-    fi
118
-}
119
-
120
-# stop_nova_hypervisor - Stop any external services
121
-function stop_nova_hypervisor {
122
-    # Stop the docker registry container
123
-    docker kill $(docker ps | grep docker-registry | cut -d' ' -f1)
124
-}
125
-
126
-
127
-# Restore xtrace
128
-$MY_XTRACE
129
-
130
-# Local variables:
131
-# mode: shell-script
132
-# End:
... ...
@@ -320,9 +320,6 @@ case "$VIRT_DRIVER" in
320 320
     openvz)
321 321
         DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-ubuntu-12.04-x86_64}
322 322
         IMAGE_URLS=${IMAGE_URLS:-"http://download.openvz.org/template/precreated/ubuntu-12.04-x86_64.tar.gz"};;
323
-    docker)
324
-        DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-cirros}
325
-        IMAGE_URLS=${IMAGE_URLS:-};;
326 323
     libvirt)
327 324
         case "$LIBVIRT_TYPE" in
328 325
             lxc) # the cirros root disk in the uec tarball is empty, so it will not work for lxc
329 326
deleted file mode 100644
... ...
@@ -1,13 +0,0 @@
1
-# DevStack on Docker
2
-
3
-Using Docker as Nova's hypervisor requries two steps:
4
-
5
-* Configure DevStack by adding the following to `localrc`::
6
-
7
-    VIRT_DRIVER=docker
8
-
9
-* Download and install the Docker service and images::
10
-
11
-    tools/docker/install_docker.sh
12
-
13
-After this, `stack.sh` should run as normal.
14 1
deleted file mode 100755
... ...
@@ -1,68 +0,0 @@
1
-#!/usr/bin/env bash
2
-
3
-# **install_docker.sh** - Do the initial Docker installation and configuration
4
-
5
-# install_docker.sh
6
-#
7
-# Install docker package and images
8
-# * downloads a base busybox image and a glance registry image if necessary
9
-# * install the images in Docker's image cache
10
-
11
-
12
-# Keep track of the current directory
13
-SCRIPT_DIR=$(cd $(dirname "$0") && pwd)
14
-TOP_DIR=$(cd $SCRIPT_DIR/../..; pwd)
15
-
16
-# Import common functions
17
-source $TOP_DIR/functions
18
-
19
-# Load local configuration
20
-source $TOP_DIR/stackrc
21
-
22
-FILES=$TOP_DIR/files
23
-
24
-# Get our defaults
25
-source $TOP_DIR/lib/nova_plugins/hypervisor-docker
26
-
27
-SERVICE_TIMEOUT=${SERVICE_TIMEOUT:-60}
28
-
29
-
30
-# Install Docker Service
31
-# ======================
32
-
33
-if is_fedora; then
34
-    install_package docker-io socat
35
-else
36
-    # Stop the auto-repo updates and do it when required here
37
-    NO_UPDATE_REPOS=True
38
-
39
-    # Set up home repo
40
-    curl https://get.docker.io/gpg | sudo apt-key add -
41
-    install_package python-software-properties && \
42
-        sudo sh -c "echo deb $DOCKER_APT_REPO docker main > /etc/apt/sources.list.d/docker.list"
43
-    apt_get update
44
-    install_package --force-yes lxc-docker socat
45
-fi
46
-
47
-# Start the daemon - restart just in case the package ever auto-starts...
48
-restart_service docker
49
-
50
-echo "Waiting for docker daemon to start..."
51
-DOCKER_GROUP=$(groups | cut -d' ' -f1)
52
-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
53
-    # Set the right group on docker unix socket before retrying
54
-    sudo chgrp $DOCKER_GROUP $DOCKER_UNIX_SOCKET
55
-    sudo chmod g+rw $DOCKER_UNIX_SOCKET
56
-    sleep 1
57
-done"
58
-if ! timeout $SERVICE_TIMEOUT sh -c "$CONFIGURE_CMD"; then
59
-    die $LINENO "docker did not start"
60
-fi
61
-
62
-# Get guest container image
63
-docker pull $DOCKER_IMAGE
64
-docker tag $DOCKER_IMAGE $DOCKER_IMAGE_NAME
65
-
66
-# Get docker-registry image
67
-docker pull $DOCKER_REGISTRY_IMAGE
68
-docker tag $DOCKER_REGISTRY_IMAGE $DOCKER_REGISTRY_IMAGE_NAME