diff --git a/devstack/local.conf.sample b/devstack/local.conf.sample index 64afff05..940d1a44 100644 --- a/devstack/local.conf.sample +++ b/devstack/local.conf.sample @@ -16,6 +16,7 @@ ENABLE_PLUGINV2=False # If you want to use stable kuryr lib, please comment out this line. LIBS_FROM_GIT=kuryr +enable_plugin devstack-plugin-container https://github.com/openstack/devstack-plugin-container enable_plugin kuryr-libnetwork https://git.openstack.org/openstack/kuryr-libnetwork enable_plugin neutron https://git.openstack.org/openstack/neutron diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 249ea447..2d5bf9dc 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -129,53 +129,13 @@ if is_service_enabled kuryr-libnetwork; then # Run etcd first pgrep -x "etcd" >/dev/null || run_process etcd-server "$DEST/etcd/etcd-$ETCD_VERSION-linux-amd64/etcd --data-dir $DEST/etcd/db.etcd --advertise-client-urls http://0.0.0.0:$KURYR_ETCD_PORT --listen-client-urls http://0.0.0.0:$KURYR_ETCD_PORT" - - # FIXME(mestery): By default, Ubuntu ships with /bin/sh pointing to - # the dash shell. - # .. - # .. - # The dots above represent a pause as you pick yourself up off the - # floor. This means the latest version of "install_docker.sh" to load - # docker fails because dash can't interpret some of it's bash-specific - # things. It's a bug in install_docker.sh that it relies on those and - # uses a shebang of /bin/sh, but that doesn't help us if we want to run - # docker and specifically Kuryr. So, this works around that. - sudo update-alternatives --install /bin/sh sh /bin/bash 100 - - # Install docker only if it's not already installed. The following checks - # whether the docker-engine package is already installed, as this is the - # most common way for installing docker from binaries. In case it's been - # manually installed, the install_docker.sh script will prompt a warning - # if another docker executable is found - check_docker || { - wget http://get.docker.com -O install_docker.sh - sudo chmod 777 install_docker.sh - sudo sh install_docker.sh - sudo rm install_docker.sh - } - - # After an ./unstack it will be stopped. So it is ok if it returns exit-code == 1 - sudo service docker stop || true - - run_process docker-engine "/usr/bin/docker daemon -H unix://$KURYR_DOCKER_ENGINE_SOCKET_FILE -H tcp://0.0.0.0:$KURYR_DOCKER_ENGINE_PORT --cluster-store etcd://localhost:$KURYR_ETCD_PORT" "" "root" - - # 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" - - echo "Build busybox docker image for fullstack and rally test" - cd $DEST/kuryr-libnetwork/contrib/busybox - sudo usermod -aG docker $STACK_USER - sh build_image.sh fi if [[ "$1" == "stack" && "$2" == "extra" ]]; then + echo "Build busybox docker image for fullstack and rally test" + cd $DEST/kuryr-libnetwork/contrib/busybox + sh build_image.sh + # FIXME(limao): When Kuryr start up, it need to detect if neutron support tag plugin. # Kuryr will call neutron extension api to verify if neutron support tag. # So Kuryr need to start after neutron-server finish load tag plugin. @@ -216,10 +176,6 @@ if is_service_enabled kuryr-libnetwork; then fi stop_process etcd-server rm -rf $DEST/etcd/ - stop_process docker-engine - # 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 - sudo kill -s SIGTERM "$(cat /var/run/docker.pid)" fi fi diff --git a/devstack/settings b/devstack/settings index e47a9e8c..f778d326 100644 --- a/devstack/settings +++ b/devstack/settings @@ -19,8 +19,8 @@ KURYR_POOL_PREFIX=${KURYR_POOL_PREFIX:-10.10.0.0/16} KURYR_POOL_PREFIX_LEN=${KURYR_POOL_PREFIX_LEN:-24} KURYR_DOCKER_ENGINE_PORT=${KURYR_DOCKER_ENGINE_PORT:-2375} -KURYR_DOCKER_ENGINE_SOCKET_FILE=${KURYR_DOCKER_ENGINE_SOCKET_FILE:-/var/run/docker.sock} KURYR_ETCD_PORT=${KURYR_ETCD_PORT:-4001} +DOCKER_CLUSTER_STORE=${DOCKER_CLUSTER_STORE:-etcd://localhost:$KURYR_ETCD_PORT} GITREPO["kuryr"]=${KURYR_REPO:-${GIT_BASE}/openstack/kuryr.git} GITBRANCH["kuryr"]=${KURYR_BRANCH:-master} diff --git a/kuryr_libnetwork/tests/contrib/gate_hook.sh b/kuryr_libnetwork/tests/contrib/gate_hook.sh index 5f37f831..00e05533 100644 --- a/kuryr_libnetwork/tests/contrib/gate_hook.sh +++ b/kuryr_libnetwork/tests/contrib/gate_hook.sh @@ -7,4 +7,6 @@ VENV=${1:-"fullstack"} GATE_DEST=$BASE/new DEVSTACK_PATH=$GATE_DEST/devstack -$BASE/new/devstack-gate/devstack-vm-gate.sh \ No newline at end of file +export DEVSTACK_LOCAL_CONFIG+=$'\n'"enable_plugin devstack-plugin-container https://github.com/openstack/devstack-plugin-container" + +$BASE/new/devstack-gate/devstack-vm-gate.sh