From b72d57c6c7d8c625a5a5fedb9a2c6cc99f693225 Mon Sep 17 00:00:00 2001 From: Lingxian Kong Date: Tue, 26 Sep 2017 01:00:57 +1300 Subject: [PATCH] Correct devstack config in the doc etcd service must be disabled in devstack environment. Change-Id: I327653fb81e408d33327e56dbbc9770a7593f966 --- .../development-environment-devstack.rst | 58 ++++++++++--------- .../openstack_integration.rst | 2 + doc/source/quick_start.rst | 10 +++- tools/gate/funcs/network.sh | 4 +- 4 files changed, 45 insertions(+), 29 deletions(-) diff --git a/doc/source/contributor/development-environment-devstack.rst b/doc/source/contributor/development-environment-devstack.rst index 07622f13..a47f6e3c 100644 --- a/doc/source/contributor/development-environment-devstack.rst +++ b/doc/source/contributor/development-environment-devstack.rst @@ -26,7 +26,7 @@ Following these instructions will allow you to have a fully functional qinling environment using the devstack project (a shell script to build complete OpenStack development environments) on Ubuntu 16.04. -Configuring devstack with qinling +Configuring devstack with Qinling --------------------------------- Qinling can be enabled in devstack by using the plug-in based interface it @@ -36,7 +36,7 @@ offers. The following steps have been fully verified only on Ubuntu 16.04. -Start by cloning the devstack repository: +Start by cloning the devstack repository using a non-root user: :: @@ -48,30 +48,34 @@ Change to devstack directory: cd devstack/ -Copy the ``local.conf`` sample file to the upper level directory: +Create the ``local.conf`` file with the following minimal devstack +configuration: -:: +.. code-block:: ini - cp samples/local.conf . - -Enable the qinling plugin adding the following lines to the end of the -``local.conf`` file: - -:: - - ENABLED_SERVICES=rabbit,mysql,key,tempest + [[local|localrc]] + RECLONE=True enable_plugin qinling https://github.com/openstack/qinling - LIBS_FROM_GIT="python-qinlingclient" + + LIBS_FROM_GIT=python-qinlingclient + DATABASE_PASSWORD=password + ADMIN_PASSWORD=password + SERVICE_PASSWORD=password + SERVICE_TOKEN=password + RABBIT_PASSWORD=password + LOGFILE=$DEST/logs/stack.sh.log + LOG_COLOR=False + SCREEN_LOGDIR=$DEST/logs + LOGFILE=$DEST/logs/stack.sh.log + LOGDAYS=1 + + ENABLED_SERVICES=rabbit,mysql,key + +.. end Running devstack ---------------- -.. note:: - - Before running devstack, make sure there is a loopback device defined in - ``/etc/hosts`` file, ``127.0.1.1 localhost`` is recommended, any line - including '127.0.0.1' will be deleted automatically during devstack running. - Run the ``stack.sh`` script: :: @@ -84,18 +88,20 @@ After it completes, verify qinling service is installed properly: $ source openrc admin admin $ openstack service list - +----------------------------------+----------+----------+ - | ID | Name | Type | - +----------------------------------+----------+----------+ - | 60145bf464f943aa88613026bd6aa5e3 | qinling | function | - | 750ec7b067b7465bab2389e331f826de | keystone | identity | - +----------------------------------+----------+----------+ + +----------------------------------+----------+-----------------+ + | ID | Name | Type | + +----------------------------------+----------+-----------------+ + | 59be2ecc8b8d4e61af184ea3495bf207 | qinling | function-engine | + | e5891d41a929402384ef00ce7135a16d | keystone | identity | + +----------------------------------+----------+-----------------+ $ openstack runtime list --print-empty +----+------+-------+--------+-------------+------------+------------+------------+ | Id | Name | Image | Status | Description | Project_id | Created_at | Updated_at | +----+------+-------+--------+-------------+------------+------------+------------+ +----+------+-------+--------+-------------+------------+------------+------------+ +.. end + Kubernetes Integration ---------------------- @@ -103,7 +109,7 @@ By default, Qinling uses Kubernetes as its orchestrator backend, so a k8s all-in-one environment (and some other related tools, e.g. kubectl) is also setup during devstack installation. -The idea and most of the scripts are coming from +The idea and most of the scripts come from `OpenStack-Helm `_ project originally, but may be probably changed as the project evolving in future. diff --git a/doc/source/function_developer/openstack_integration.rst b/doc/source/function_developer/openstack_integration.rst index ad8b87f1..92cf7063 100644 --- a/doc/source/function_developer/openstack_integration.rst +++ b/doc/source/function_developer/openstack_integration.rst @@ -37,6 +37,8 @@ Python which will interact with Swift service in OpenStack. obj_info = conn.head_object(container, object) return obj_info +.. end + In the above code, note the following: - Qinling supports most of OpenStack service clients, so you don't need to diff --git a/doc/source/quick_start.rst b/doc/source/quick_start.rst index f0355795..f5718a80 100644 --- a/doc/source/quick_start.rst +++ b/doc/source/quick_start.rst @@ -9,6 +9,12 @@ related components and dependencies of Qinling service. For quick installation, evaluation, and convenience, Qinling team provides a Vagrantfile in ``tools/vagrant`` folder. +.. note:: + + You can also install Qinling service in OpenStack devstack environment, + please refer to + http://qinling.readthedocs.io/en/latest/contributor/development-environment-devstack.html. + Qinling is a FaaS implemented on top of container orchestration system such as Kubernetes, Swarm, etc. Particularly, Kubernetes is a reference backend considering its popularity. So, you need to setup Kubernetes first before @@ -24,8 +30,8 @@ they can communicate with each other without any network configuration. command line tool. Qinling can work with OpenStack Keystone for authentication, or it can work -without authentication at all. By default, authentication is disabled, config -``auth_enable = True`` to enable authentication. +without authentication at all. By default, authentication is enabled, set +``auth_enable = False`` to enable authentication. After Kubernetes installation, perform the following commands on your local host. diff --git a/tools/gate/funcs/network.sh b/tools/gate/funcs/network.sh index b4aa3e3f..2534d277 100755 --- a/tools/gate/funcs/network.sh +++ b/tools/gate/funcs/network.sh @@ -38,7 +38,9 @@ function net_resolv_post_kube { function net_hosts_pre_kube { sudo cp -f /etc/hosts /etc/hosts-pre-kube - # sudo sed -i "/$(hostname)/d" /etc/hosts + sudo sed -i "/$(hostname)/d" /etc/hosts + sudo sed -i "/127.0.0.1/d" /etc/hosts + sudo sed -i "1 i 127.0.0.1 localhost" /etc/hosts # The var will be used in qinling pre_test_hook.sh export DEFAULT_HOST_IP=$(net_default_host_ip)