From cafbea5e92f34bf8de5b4656add507d8c91aa922 Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Sat, 18 Nov 2017 19:18:41 +0000 Subject: [PATCH] Consolidate devstack config into sample There are sample local.conf in multiple locations. It is better to consolidate them into one location to ensure consistency. Change-Id: I3bfe6a32daeab6ca427173e3e3f96354d622b991 --- devstack/README.rst | 17 -------- devstack/local.conf.sample | 5 +++ devstack/local.conf.subnode.sample | 19 +++++++++ doc/source/contributor/quickstart.rst | 52 ++++++------------------ doc/source/contributor/tempest-tests.rst | 23 ++--------- 5 files changed, 39 insertions(+), 77 deletions(-) create mode 100644 devstack/local.conf.subnode.sample diff --git a/devstack/README.rst b/devstack/README.rst index 42c38c410..1e40702de 100644 --- a/devstack/README.rst +++ b/devstack/README.rst @@ -7,20 +7,3 @@ This directory contains the files necessary to integrate zun with devstack. Refer the quickstart guide at https://docs.openstack.org/zun/latest/contributor/manual-devstack.html for more information on using devstack and zun. - -To install zun into devstack, add the following settings to enable the -zun plugin:: - - cat > /opt/stack/devstack/local.conf << END - [[local|localrc]] - enable_plugin zun https://git.openstack.org/openstack/zun master - END - -If you would like to install python-zunclient from git, add to local.conf:: - - LIBS_FROM_GIT="python-zunclient" - -Then run devstack normally:: - - cd /opt/stack/devstack - ./stack.sh diff --git a/devstack/local.conf.sample b/devstack/local.conf.sample index 51d456694..1f8f4acf1 100644 --- a/devstack/local.conf.sample +++ b/devstack/local.conf.sample @@ -1,10 +1,12 @@ [[local|localrc]] +HOST_IP=10.0.0.11 # change this to your IP address DATABASE_PASSWORD=password RABBIT_PASSWORD=password SERVICE_TOKEN=password SERVICE_PASSWORD=password ADMIN_PASSWORD=password enable_plugin zun https://git.openstack.org/openstack/zun +enable_plugin zun-tempest-plugin https://git.openstack.org/openstack/zun-tempest-plugin #This below plugin enables installation of container engine on Devstack. #The default container engine is Docker @@ -18,3 +20,6 @@ LIBS_FROM_GIT="python-zunclient" # Optional: uncomment to enable the Zun UI plugin in Horizon # enable_plugin zun-ui https://git.openstack.org/openstack/zun-ui + +# Optional: uncomment to enable the Heat plugin for container orchestration +# enable_plugin heat https://git.openstack.org/openstack/heat diff --git a/devstack/local.conf.subnode.sample b/devstack/local.conf.subnode.sample new file mode 100644 index 000000000..1bf72ac03 --- /dev/null +++ b/devstack/local.conf.subnode.sample @@ -0,0 +1,19 @@ +[[local|localrc]] +HOST_IP=10.0.0.31 # change this to your IP address +DATABASE_PASSWORD=password +RABBIT_PASSWORD=password +SERVICE_TOKEN=password +SERVICE_PASSWORD=password +ADMIN_PASSWORD=password +enable_plugin devstack-plugin-container https://git.openstack.org/openstack/devstack-plugin-container +enable_plugin zun https://git.openstack.org/openstack/zun +enable_plugin kuryr-libnetwork https://git.openstack.org/openstack/kuryr-libnetwork + +# Following is for multi host settings +MULTI_HOST=True +SERVICE_HOST=10.0.0.11 # change this to controller's IP address +DATABASE_TYPE=mysql +MYSQL_HOST=$SERVICE_HOST +RABBIT_HOST=$SERVICE_HOST + +ENABLED_SERVICES=zun-compute,kuryr-libnetwork,q-agt diff --git a/doc/source/contributor/quickstart.rst b/doc/source/contributor/quickstart.rst index 2e054ada9..1a7573de7 100644 --- a/doc/source/contributor/quickstart.rst +++ b/doc/source/contributor/quickstart.rst @@ -28,24 +28,11 @@ Clone devstack:: We will run devstack with minimal local.conf settings required to enable required OpenStack services:: - $ cat > /opt/stack/devstack/local.conf << END - [[local|localrc]] - HOST_IP=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/') - DATABASE_PASSWORD=password - RABBIT_PASSWORD=password - SERVICE_TOKEN=password - SERVICE_PASSWORD=password - ADMIN_PASSWORD=password - enable_plugin devstack-plugin-container https://git.openstack.org/openstack/devstack-plugin-container - enable_plugin zun https://git.openstack.org/openstack/zun - enable_plugin kuryr-libnetwork https://git.openstack.org/openstack/kuryr-libnetwork - - # install python-zunclient from git - LIBS_FROM_GIT="python-zunclient" - - # Optional: uncomment to enable the Zun UI plugin in Horizon - # enable_plugin zun-ui https://git.openstack.org/openstack/zun-ui - END + $ HOST_IP= + $ git clone https://git.openstack.org/openstack/zun /opt/stack/zun + $ cat /opt/stack/zun/devstack/local.conf.sample \ + | sed "s/HOST_IP=.*/HOST_IP=$HOST_IP/" \ + > /opt/stack/devstack/local.conf More devstack configuration information can be found at `Devstack Configuration `_ @@ -113,28 +100,13 @@ On the second host, clone devstack:: The second host will only need zun-compute service along with kuryr-libnetwork support. You also need to tell devstack where the SERVICE_HOST is:: - $ export CTRL_IP= - $ cat > /opt/stack/devstack/local.conf << END - [[local|localrc]] - HOST_IP=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/') - DATABASE_PASSWORD=password - RABBIT_PASSWORD=password - SERVICE_TOKEN=password - SERVICE_PASSWORD=password - ADMIN_PASSWORD=password - enable_plugin devstack-plugin-container https://git.openstack.org/openstack/devstack-plugin-container - enable_plugin zun https://git.openstack.org/openstack/zun - enable_plugin kuryr-libnetwork https://git.openstack.org/openstack/kuryr-libnetwork - - # Following is for multi host settings - MULTI_HOST=True - SERVICE_HOST=$CTRL_IP - DATABASE_TYPE=mysql - MYSQL_HOST=$CTRL_IP - RABBIT_HOST=$CTRL_IP - - ENABLED_SERVICES=zun-compute,kuryr-libnetwork,q-agt - END + $ SERVICE_HOST= + $ HOST_IP= + $ git clone https://git.openstack.org/openstack/zun /opt/stack/zun + $ cat /opt/stack/zun/devstack/local.conf.subnode.sample \ + | sed "s/HOST_IP=.*/HOST_IP=$HOST_IP/" \ + | sed "s/SERVICE_HOST=.*/SERVICE_HOST=$SERVICE_HOST/" \ + > /opt/stack/devstack/local.conf .. note:: diff --git a/doc/source/contributor/tempest-tests.rst b/doc/source/contributor/tempest-tests.rst index 130d25363..0f6acf78a 100644 --- a/doc/source/contributor/tempest-tests.rst +++ b/doc/source/contributor/tempest-tests.rst @@ -31,26 +31,9 @@ Prerequisite You need to deploy Zun in a devstack environment. -Clone devstack:: - - # Create a root directory for devstack if needed - sudo mkdir -p /opt/stack - sudo chown $USER /opt/stack - - git clone https://git.openstack.org/openstack-dev/devstack /opt/stack/devstack - -We will run devstack with minimal local.conf settings required. You can use the -sample local.conf as a quick-start:: - - git clone https://git.openstack.org/openstack/zun /opt/stack/zun - cp /opt/stack/zun/devstack/local.conf.sample /opt/stack/devstack/local.conf - -Run devstack:: - - cd /opt/stack/devstack - ./stack.sh - -**NOTE:** This will take a while to setup the dev environment. +Refer the ``Exercising the Services Using Devstack`` session at `Developer +Quick-Start Guide `_ +for details. Run the test ============