Retire repo

This patch completes step 2 of the infra project retirement process
found here:

https://docs.opendev.org/opendev/infra-manual/latest/drivers.html#step-2-remove-project-content

Reference:

http://lists.openstack.org/pipermail/openstack-discuss/2020-June/015600.html

Depend-on: https://review.opendev.org/737566

Change-Id: Id3a5477860323547a4e17155061f597a8c96640b
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
changes/64/737564/2
Sean McGinnis 2 years ago
parent 4dc36ed649
commit 7839f35ca3
No known key found for this signature in database
GPG Key ID: CE7EE4BFAF8D70C8
  1. 7
      .coveragerc
  2. 66
      .gitignore
  3. 3
      .mailmap
  4. 3
      .stestr.conf
  5. 135
      .zuul.yaml
  6. 16
      CONTRIBUTING.rst
  7. 25
      Dockerfile
  8. 21
      Dockerfile.fedora
  9. 4
      HACKING.rst
  10. 176
      LICENSE
  11. 136
      README.rst
  12. 2
      babel.cfg
  13. 171
      devstack/cassandra_driver
  14. 24
      devstack/devstackgaterc-common
  15. 21
      devstack/devstackgaterc-etcd-zmq
  16. 21
      devstack/devstackgaterc-fullstack-common
  17. 23
      devstack/devstackgaterc-fullstack-etcd-zmq
  18. 22
      devstack/devstackgaterc-fullstack-redis
  19. 22
      devstack/devstackgaterc-rally-redis
  20. 21
      devstack/devstackgaterc-redis
  21. 24
      devstack/devstackgaterc-tempest-redis
  22. 22
      devstack/etcd.conf
  23. 15
      devstack/etcd.service
  24. 41
      devstack/etcd.service.conf
  25. 35
      devstack/etcd_driver
  26. 7
      devstack/etcd_pubsub_driver
  27. 49
      devstack/override-defaults
  28. 203
      devstack/ovs_dpdk_setup.sh
  29. 271
      devstack/ovs_setup.sh
  30. 668
      devstack/plugin.sh
  31. 85
      devstack/ramcloud_driver
  32. 174
      devstack/redis_driver
  33. 7
      devstack/redis_pubsub_driver
  34. 88
      devstack/rethinkdb_driver
  35. 66
      devstack/settings
  36. 86
      devstack/tempest-filter
  37. 13
      devstack/zmq_pubsub_driver
  38. 104
      devstack/zookeeper_driver
  39. BIN
      doc/images/db1.jpg
  40. BIN
      doc/images/db2.jpg
  41. BIN
      doc/images/db3.jpg
  42. BIN
      doc/images/df_logo.png
  43. BIN
      doc/images/dhcp1.jpg
  44. BIN
      doc/images/dhcp2.jpg
  45. BIN
      doc/images/dragonflow_distributed_architecture.png
  46. BIN
      doc/images/pipeline1.jpg
  47. BIN
      doc/images/pipeline2.jpg
  48. BIN
      doc/images/pipeline3.jpg
  49. BIN
      doc/images/pipeline4.jpg
  50. BIN
      doc/images/pipeline5.jpg
  51. BIN
      doc/images/pipeline6.jpg
  52. 249
      doc/images/pubsub_neutron_API_server.graphml
  53. BIN
      doc/images/pubsub_neutron_API_server.png
  54. 627
      doc/images/pubsub_topology.graphml
  55. BIN
      doc/images/pubsub_topology.png
  56. 8
      doc/requirements.txt
  57. 78
      doc/source/cli/dragonflow-status.rst
  58. 7
      doc/source/cli/index.rst
  59. 84
      doc/source/conf.py
  60. 12
      doc/source/configuration.rst
  61. 4
      doc/source/containers.rst
  62. 4
      doc/source/contributing.rst
  63. 43
      doc/source/devrefs/index.rst
  64. 248
      doc/source/devrefs/models.rst
  65. 57
      doc/source/distributed_dhcp.rst
  66. 143
      doc/source/distributed_dragonflow.rst
  67. 125
      doc/source/docker_install.rst
  68. 84
      doc/source/features.rst
  69. 87
      doc/source/gmr.rst
  70. 63
      doc/source/index.rst
  71. 94
      doc/source/installation.rst
  72. 259
      doc/source/manual_deployment.rst
  73. 55
      doc/source/multi-node-conf/cassandra_compute_node.conf
  74. 48
      doc/source/multi-node-conf/cassandra_controller_node.conf
  75. 43
      doc/source/multi-node-conf/etcd_compute_node.conf
  76. 32
      doc/source/multi-node-conf/etcd_controller_node.conf
  77. 49
      doc/source/multi-node-conf/ramcloud_compute_node.conf
  78. 34
      doc/source/multi-node-conf/ramcloud_controller_node.conf
  79. 53
      doc/source/multi-node-conf/redis_compute_node_local_controller.conf
  80. 33
      doc/source/multi-node-conf/redis_controller_node_local_controller.conf
  81. 50
      doc/source/multi-node-conf/rethinkDB_compute_node.conf
  82. 33
      doc/source/multi-node-conf/rethinkDB_controller_node.conf
  83. 53
      doc/source/multi-node-conf/zookeeper_compute_node.conf
  84. 48
      doc/source/multi-node-conf/zookeeper_controller_node.conf
  85. 68
      doc/source/osprofiler.rst
  86. 43
      doc/source/pipeline.rst
  87. 142
      doc/source/pluggable_db.rst
  88. 140
      doc/source/pluggable_pubsub.rst
  89. 123
      doc/source/readme.rst
  90. 40
      doc/source/releasenotes_create.rst
  91. 106
      doc/source/reviewers_guide.rst
  92. 327
      doc/source/sfc-example/sfc-example.yaml
  93. 47
      doc/source/single-node-conf/cassandra_local_controller.conf
  94. 29
      doc/source/single-node-conf/etcd_local_controller.conf
  95. 35
      doc/source/single-node-conf/etcd_skydive_local_controller.conf
  96. 31
      doc/source/single-node-conf/ramcloud_local_controller.conf
  97. 30
      doc/source/single-node-conf/redis_local_controller.conf
  98. 30
      doc/source/single-node-conf/rethinkDB_local_controller.conf
  99. 45
      doc/source/single-node-conf/zookeeper_local_controller.conf
  100. 95
      doc/source/specs/allowed_address_pairs.rst
  101. Some files were not shown because too many files have changed in this diff Show More

@ -1,7 +0,0 @@
[run]
branch = True
source = dragonflow
omit = dragonflow/tests/*
[report]
ignore_errors = True

66
.gitignore vendored

@ -1,66 +0,0 @@
*.py[cod]
# C extensions
*.so
# Packages
*.egg
*.eggs
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64
# Installer logs
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
.stestr
.venv
# Translations
*.mo
# Mr Developer
.mr.developer.cfg
.project
.pydevproject
# Complexity
output/*.html
output/*/index.html
# Sphinx
doc/build
# pbr generates these
AUTHORS
ChangeLog
# Editors
*~
.*.swp
.*sw?
.idea
# Vagrant
.vagrant
# etcd Configuration
/devstack/etcd.override
# Configurations
etc/*.sample
# Releasenotes
releasenotes/build

@ -1,3 +0,0 @@
# Format is:
# <preferred e-mail> <other e-mail 1>
# <preferred e-mail> <other e-mail 2>

@ -1,3 +0,0 @@
[DEFAULT]
test_path=${OS_TEST_PATH:-./dragonflow/tests/unit}
top_dir=./

@ -1,135 +0,0 @@
- project:
templates:
- check-requirements
- openstack-python-jobs-neutron
- openstack-python35-jobs-neutron
- openstack-python36-jobs-neutron
- build-openstack-docs-pti
check:
jobs:
- dragonflow-tox-lower-constraints
- dragonflow-dsvm-fullstack-redis
- dragonflow-dsvm-fullstack-etcd-zmq
- openstack-tox-pep8:
required-projects:
- openstack/networking-sfc
- openstack/neutron-dynamic-routing
- openstack-tox-py27:
required-projects:
- openstack/networking-sfc
- openstack/neutron-dynamic-routing
- openstack-tox-py35:
required-projects:
- openstack/networking-sfc
- openstack/neutron-dynamic-routing
- openstack-tox-py36:
required-projects:
- openstack/networking-sfc
- openstack/neutron-dynamic-routing
gate:
jobs:
- dragonflow-tox-lower-constraints
- dragonflow-dsvm-fullstack-redis
- openstack-tox-pep8:
required-projects:
- openstack/networking-sfc
- openstack/neutron-dynamic-routing
- openstack-tox-py27:
required-projects:
- openstack/networking-sfc
- openstack/neutron-dynamic-routing
- openstack-tox-py35:
required-projects:
- openstack/networking-sfc
- openstack/neutron-dynamic-routing
- openstack-tox-py36:
required-projects:
- openstack/networking-sfc
- openstack/neutron-dynamic-routing
experimental:
jobs:
- dragonflow-tempest:
voting: false
irrelevant-files:
- ^(test-|)requirements.txt$
- ^setup.cfg$
- dragonflow-dsvm-rally:
voting: false
- dragonflow-openstack-ansible-cross-repo:
voting: false
- kuryr-kubernetes-tempest-dragonflow:
voting: false
- job:
name: dragonflow-dsvm-fullstack-redis
parent: legacy-dsvm-base
run: zuul/dragonflow-dsvm-fullstack-redis/run.yaml
post-run: zuul/dragonflow-dsvm-fullstack-redis/post.yaml
timeout: 10800
required-projects:
- openstack/devstack-gate
- openstack/dragonflow
- openstack/neutron
- openstack/networking-sfc
- openstack/neutron-dynamic-routing
- job:
name: dragonflow-dsvm-fullstack-etcd-zmq
parent: legacy-dsvm-base
run: zuul/dragonflow-dsvm-fullstack-etcd-zmq/run.yaml
post-run: zuul/dragonflow-dsvm-fullstack-etcd-zmq/post.yaml
timeout: 10800
required-projects:
- openstack/devstack-gate
- openstack/dragonflow
- openstack/neutron
- openstack/networking-sfc
- openstack/neutron-dynamic-routing
- job:
name: dragonflow-dsvm-rally
parent: legacy-dsvm-base
run: zuul/dragonflow-dsvm-rally/run.yaml
post-run: zuul/dragonflow-dsvm-rally/post.yaml
timeout: 10800
required-projects:
- openstack/devstack-gate
- openstack/dragonflow
- openstack/neutron
- openstack/networking-sfc
- openstack/neutron-dynamic-routing
- openstack/rally
- job:
name: dragonflow-tempest
parent: legacy-dsvm-base
run: zuul/tempest-dsvm-dragonflow/run.yaml
post-run: zuul/tempest-dsvm-dragonflow/post.yaml
timeout: 10800
required-projects:
- openstack/devstack-gate
- openstack/dragonflow
- openstack/neutron
- openstack/networking-sfc
- openstack/neutron-dynamic-routing
- openstack/tempest
- openstack/neutron-tempest-plugin
- job:
name: dragonflow-openstack-ansible-cross-repo
parent: openstack-ansible-cross-repo-functional
required-projects:
- openstack/requirements
- openstack/openstack-ansible-os_neutron
vars:
tox_env: dragonflow
osa_test_repo: openstack/openstack-ansible-os_neutron
- job:
name: dragonflow-tox-lower-constraints
parent: openstack-tox-lower-constraints
required-projects:
- openstack/networking-sfc
- openstack/neutron-dynamic-routing
- openstack/neutron

@ -1,16 +0,0 @@
If you would like to contribute to the development of OpenStack,
you must follow the steps in this page:
https://docs.openstack.org/infra/manual/developers.html
Once those steps have been completed, changes to OpenStack
should be submitted for review via the Gerrit tool, following
the workflow documented at:
https://docs.openstack.org/infra/manual/developers.html#development-workflow
Pull requests submitted through GitHub will be ignored.
Bugs should be filed on Launchpad, not GitHub:
https://bugs.launchpad.net/dragonflow

@ -1,25 +0,0 @@
FROM ubuntu:16.04
# Install dependencies and some useful tools.
ENV DRAGONFLOW_PACKAGES git \
python-pip python-psutil python-subprocess32 \
python-dev libpython-dev
# Ignore questions when installing with apt-get:
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y $DRAGONFLOW_PACKAGES
# Create config folder
ENV DRAGONFLOW_ETCDIR /etc/dragonflow
RUN mkdir -p $DRAGONFLOW_ETCDIR /opt/dragonflow /var/run/dragonflow
# Copy Dragonflow sources to the container
COPY . /opt/dragonflow/
# Install Dragonflow on the container
WORKDIR /opt/dragonflow
RUN pip install -e .
ENTRYPOINT ["/opt/dragonflow/tools/run_dragonflow.sh"]

@ -1,21 +0,0 @@
FROM fedora:latest
RUN dnf install -y git python3-pip python3-psutil python3-devel \
"@C Development Tools and Libraries"
RUN alternatives --install /usr/bin/python python /usr/bin/python3 1
RUN alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
# Create config folder
ENV DRAGONFLOW_ETCDIR /etc/dragonflow
RUN mkdir -p $DRAGONFLOW_ETCDIR /opt/dragonflow /var/run/dragonflow
# Copy Dragonflow sources to the container
COPY . /opt/dragonflow/
# Install Dragonflow on the container
WORKDIR /opt/dragonflow
RUN pip install -e .
ENTRYPOINT ["/opt/dragonflow/tools/run_dragonflow.sh"]

@ -1,4 +0,0 @@
dragonflow Style Commandments
=============================
Read the OpenStack Style Commandments https://docs.openstack.org/hacking/latest/

@ -1,176 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

@ -1,130 +1,10 @@
========================
Team and repository tags
========================
This project is no longer maintained.
.. image:: https://governance.openstack.org/tc/badges/dragonflow.svg
:target: https://governance.openstack.org/tc/reference/tags/index.html
The contents of this repository are still available in the Git
source code management system. To see the contents of this
repository before it reached its end of life, please check out the
previous commit with "git checkout HEAD^1".
.. Change things from this point on
Distributed SDN-based Neutron Implementation
* Free software: Apache license
* Homepage: http://www.dragonflow.net/
* Source: https://opendev.org/openstack/dragonflow
* Bugs: https://bugs.launchpad.net/dragonflow
* Documentation: https://docs.openstack.org/dragonflow/latest/
* Release notes: https://docs.openstack.org/developer/dragonflow/releasenotes.html
.. image:: https://raw.githubusercontent.com/openstack/dragonflow/master/doc/images/df_logo.png
:alt: Solution Overview
:width: 500
:height: 350
:align: center
Overview
--------
Dragonflow implements Neutron using a lightweight embedded SDN Controller.
Our project mission is *to Implement advanced networking services in a manner
that is efficient, elegant and resource-nimble*
Distributed Dragonflow
======================
Comprehensive agentless implementation of the Neutron APIs and advanced
network services, such as fully distributed Switching, Routing, DHCP
and more.
This configuration is the current focus of Dragonflow.
Overview and details are available in the `Distributed Dragonflow Section`_
.. _Distributed Dragonflow Section: https://docs.openstack.org/dragonflow/latest/distributed_dragonflow.html
.. image:: https://raw.githubusercontent.com/openstack/dragonflow/master/doc/images/dragonflow_distributed_architecture.png
:alt: Solution Overview
:width: 600
:height: 525
:align: center
Mitaka Version Features
=======================
* L2 core API
IPv4, IPv6
GRE/VxLAN/STT/Geneve tunneling protocols
L2 Population
* Distributed L3 Virtual Router
* Distributed DHCP
* Distributed DNAT
* Security Groups Using OVS and Connection tracking
* Pluggable Distributed Database
Supported databases:
Stable:
ETCD, RAMCloud, Redis, Zookeeper
In progress:
RethinkDB
* Pluggable Publish-Subscribe
ZeroMQ, Redis
* Selective DB Distribution
Tenant Based Selective data distribution to the compute nodes
Experimental Mitaka Features
============================
* Local Controller Reliability
In progress
===========
* IGMP Distributed application
* Allowed Address Pairs
* Port Security
* DHCP DOS protection
* Distributed Meta Data Service
* Kuryr integration
* Local Controller HA
* ML2 Driver, hierarchical Port Binding
* VLAN L2 Networking support
* Smart broadcast/multicast
In planning
===========
* Distributed Load Balancing (East/West)
* DNS service
* Port Fault detection
* Dynamic service chaining (service Injection)
* SFC support
* Distributed FWaaS
* Distributed SNAT
* VPNaaS
Configurations
==============
To generate the sample dragonflow configuration files, run the following
command from the top level of the dragonflow directory:
tox -e genconfig
If a 'tox' environment is unavailable, then you can run the following script
instead to generate the configuration files:
./tools/generate_config_file_samples.sh
For any further questions, please email
openstack-discuss@lists.openstack.org or join #openstack-dev on
Freenode.

@ -1,2 +0,0 @@
[python: **.py]

@ -1,171 +0,0 @@
#!/bin/bash
#
#
# ``plugin.sh`` calls the following methods in the sourced driver:
#
# - nb_db_driver_install_server
# - nb_db_driver_install_client
# - nb_db_driver_start_server
# - nb_db_driver_stop_server
# - nb_db_driver_clean
# - nb_db_driver_configure
HOSTNAME=`hostname -f`
if is_ubuntu ; then
UBUNTU_RELEASE_BASE_NUM=`lsb_release -r | awk '{print $2}' | cut -d '.' -f 1`
fi
CASSANDRA_HOME="/etc/cassandra"
CASSANDRA_DATA_HOME="/var/lib/cassandra"
CASSANDRA_DEB_SOURCE_FILE="/etc/apt/sources.list.d/cassandra.list"
CASSANDRA_RPM_SOURCE_FILE="/etc/yum.repos.d/cassandra.repo"
CASSANDRA_DEFAULT_KEYSPACE="openstack"
# By default, the cassandra uses one replication for the all-in-one deployment
CASSANDRA_DEFAULT_REPLICATION=1
CASSANDRA_DEFAULT_CONSISTENCY_LEVEL="one"
# Cassandra service startup/cleanup duration
CASSANDRA_SERVICE_CHECK_REPLAY=5
# The seeds of cassandra (the cassandra hosts to form a cluster) should
# be specified in the configuration file. In order to generate the ip list
# of the cluster, string manipulation is needed here to get the right
# format of the seeds.
CASSANDRA_CLUSTER=$REMOTE_DB_HOSTS
CASSANDRA_NUM_OF_HOSTS_IN_CLUSTER=${CASSANDRA_NUM_OF_HOSTS:-1}
CASSANDRA_TEMP_FILE="/tmp/cassandra_hosts"
echo $CASSANDRA_CLUSTER > $CASSANDRA_TEMP_FILE
IPS=''
for ((i=1;i<=$CASSANDRA_NUM_OF_HOSTS_IN_CLUSTER;i++))
do
ip=`cut -d ',' -f $i < $CASSANDRA_TEMP_FILE | cut -d ':' -f 1`
IPS=$IPS','$ip
done
CASSANDRA_CLUSTER_IPS=${IPS#*","}
rm $CASSANDRA_TEMP_FILE
# End
if is_ubuntu; then
CASSANDRA_CONF_DIR="$CASSANDRA_HOME"
elif is_fedora; then
CASSANDRA_CONF_DIR="$CASSANDRA_HOME/conf"
else
die $LINENO "Other distributions are not supported"
fi
CASSANDRA_CONF_FILE="$CASSANDRA_CONF_DIR/cassandra.yaml"
function _cassandra_create_keyspace {
keyspace="CREATE KEYSPACE IF NOT EXISTS $CASSANDRA_DEFAULT_KEYSPACE "
replica="WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : $CASSANDRA_DEFAULT_REPLICATION } "
durable="AND DURABLE_WRITES = true;"
cqlsh $HOST_IP -e "$keyspace$replica$durable"
}
function _cassandra_drop_keyspace {
cqlsh $HOST_IP -e "DROP KEYSPACE IF EXISTS $CASSANDRA_DEFAULT_KEYSPACE;"
}
function nb_db_driver_install_server {
if is_service_enabled df-cassandra-server ; then
echo "Installing Cassandra server"
if is_ubuntu; then
sudo tee -a $CASSANDRA_DEB_SOURCE_FILE >/dev/null <<'EOF'
deb http://debian.datastax.com/datastax-ddc 3.9 main
EOF
curl -L https://debian.datastax.com/debian/repo_key | sudo apt-key add -
sudo apt-get update -y
install_package openjdk-8-jre-headless
elif is_fedora; then
sudo tee -a $CASSANDRA_RPM_SOURCE_FILE >/dev/null <<'EOF'
[datastax-ddc]
name = DataStax Repo for Apache Cassandra
baseurl = http://rpm.datastax.com/datastax-ddc/3.9
enabled = 1
gpgcheck = 0
EOF
sudo yum update -y
install_package java-1.8.0-openjdk-headless
fi
install_package datastax-ddc
echo "Configuring Cassandra"
sudo sed -i "s/127.0.0.1/${CASSANDRA_CLUSTER_IPS}/g" $CASSANDRA_CONF_FILE
sudo sed -i "/^listen_address:/c listen_address: ${HOST_IP}" $CASSANDRA_CONF_FILE
sudo sed -i "/^rpc_address:/c rpc_address:" $CASSANDRA_CONF_FILE
sudo sed -i "/^broadcast_address:/c broadcast_address:" $CASSANDRA_CONF_FILE
# change ownership for data directory
sudo chown -R cassandra:cassandra $CASSANDRA_DATA_HOME
# start cassandra service
nb_db_driver_start_server
# initialize keyspace
_cassandra_create_keyspace
fi
}
function nb_db_driver_install_client {
echo 'Cassandra client sdk is in the requirements file.'
}
function nb_db_driver_status_server
{
if is_service_enabled df-cassandra-server ; then
TEMP_PIDS=`pgrep -f "cassandra"`
if [ -z "$TEMP_PIDS" ]; then
return 1
fi
fi
return 0
}
function _check_cassandra_status {
times=0
# Initially Cassandra needs long duration to startup/cleanup
sleep 20
# Check the Cassandra cluster UP and Normal
result=$(nodetool -h $HOST_IP status | grep $HOST_IP | grep 'UN' | wc -l)
while [[ $result -lt 1 ]]
do
sleep 10
result=$(nodetool -h $HOST_IP status | grep $HOST_IP | grep 'UN' | wc -l)
times=`expr $times + 1`
if [[ $times > $CASSANDRA_SERVICE_CHECK_REPLAY ]];
then
echo "Cassandra Restart Error!"
return 1
fi
done
return 0
}
function nb_db_driver_start_server {
if is_service_enabled df-cassandra-server ; then
sudo /etc/init.d/cassandra restart
_check_cassandra_status
fi
}
function nb_db_driver_stop_server {
if is_service_enabled df-cassandra-server ; then
sudo /etc/init.d/cassandra stop
fi
}
function nb_db_driver_clean {
nb_db_driver_start_server
_cassandra_drop_keyspace
nb_db_driver_stop_server
if is_ubuntu || is_fedora; then
uninstall_package -y datastax-ddc
fi
sudo rm -rf ${CASSANDRA_HOME}
sudo rm -rf ${CASSANDRA_DATA_HOME}
}
function nb_db_driver_configure {
# set consistency level
iniset $DRAGONFLOW_CONF df-cassandra consistency_level "$CASSANDRA_DEFAULT_CONSISTENCY_LEVEL"
}

@ -1,24 +0,0 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# This script is executed in the OpenStack CI job that runs DevStack + tempest.
# It is also used by the rally job. You can find the CI job configuration here:
#
# https://opendev.org/openstack/dragonflow/src/branch/master/.zuul.yaml
#
export OVERRIDE_ENABLED_SERVICES=key,n-api,n-api-meta,n-cpu,n-cond,n-sch,n-crt,n-cauth,n-obj,g-api,g-reg,rabbit,mysql,dstat,df-controller,q-svc,df-metadata,q-qos,placement-api,q-trunk
export DEVSTACK_LOCAL_CONFIG+=$'\n'"DF_RUNNING_IN_GATE=True"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"EXTERNAL_HOST_IP=172.24.4.100"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"OVS_INSTALL_FROM_GIT=False"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"OVS_BRANCH=v2.9.1"

@ -1,21 +0,0 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# This script is executed in the OpenStack CI job that runs DevStack + tempest.
# It is also used by the rally job. You can find the CI job configuration here:
#
# https://opendev.org/openstack/dragonflow/src/branch/master/.zuul.yaml
#
export OVERRIDE_ENABLED_SERVICES+=,df-etcd,etcd3,df-zmq-publisher-service
export DEVSTACK_LOCAL_CONFIG+=$'\n'"ENABLE_ACTIVE_DETECTION=False"

@ -1,21 +0,0 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# This script is executed in the OpenStack CI job that runs DevStack + tempest.
# It is also used by the rally job. You can find the CI job configuration here:
#
# https://opendev.org/openstack/dragonflow/src/branch/master/.zuul.yaml
#
export DEVSTACK_LOCAL_CONFIG+=$'\n'"ENABLE_DF_SFC=True"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"NEUTRON_CREATE_INITIAL_NETWORKS=False"

@ -1,23 +0,0 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# This script is executed in the OpenStack CI job that runs DevStack + tempest.
# It is also used by the rally job. You can find the CI job configuration here:
#
# https://opendev.org/openstack/dragonflow/src/branch/master/.zuul.yaml
#
source /opt/stack/new/dragonflow/devstack/devstackgaterc-common
source /opt/stack/new/dragonflow/devstack/devstackgaterc-fullstack-common
source /opt/stack/new/dragonflow/devstack/devstackgaterc-etcd-zmq
export DEVSTACK_LOCAL_CONFIG+=$'\n'"DF_PUB_SUB=True"

@ -1,22 +0,0 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# This script is executed in the OpenStack CI job that runs DevStack + tempest.
# It is also used by the rally job. You can find the CI job configuration here:
#
# https://opendev.org/openstack/dragonflow/src/branch/master/.zuul.yaml
#
source /opt/stack/new/dragonflow/devstack/devstackgaterc-common
source /opt/stack/new/dragonflow/devstack/devstackgaterc-fullstack-common
source /opt/stack/new/dragonflow/devstack/devstackgaterc-redis

@ -1,22 +0,0 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# This script is executed in the OpenStack CI job that runs DevStack + tempest.
# It is also used by the rally job. You can find the CI job configuration here:
#
# https://opendev.org/openstack/dragonflow/src/branch/master/.zuul.yaml
#
source /opt/stack/new/dragonflow/devstack/devstackgaterc-common
source /opt/stack/new/dragonflow/devstack/devstackgaterc-redis
export DEVSTACK_LOCAL_CONFIG+=$'\n'"NEUTRON_CREATE_INITIAL_NETWORKS=False"

@ -1,21 +0,0 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# This script is executed in the OpenStack CI job that runs DevStack + tempest.
# It is also used by the rally job. You can find the CI job configuration here:
#
# https://opendev.org/openstack/dragonflow/src/branch/master/.zuul.yaml
#
export OVERRIDE_ENABLED_SERVICES+=,df-redis,df-redis-server
export DEVSTACK_LOCAL_CONFIG+=$'\n'"DF_REDIS_PUBSUB=True"

@ -1,24 +0,0 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# This script is executed in the OpenStack CI job that runs DevStack + tempest.
# It is also used by the rally job. You can find the CI job configuration here:
#
# https://opendev.org/openstack/dragonflow/src/branch/master/.zuul.yaml
#
source /opt/stack/new/dragonflow/devstack/devstackgaterc-common
source /opt/stack/new/dragonflow/devstack/devstackgaterc-redis
source /opt/stack/new/dragonflow/devstack/tempest-filter
export OVERRIDE_ENABLED_SERVICES+=,tempest,df-bgp
export DEVSTACK_LOCAL_CONFIG+=$'\n'"NEUTRON_CREATE_INITIAL_NETWORKS=True"

@ -1,22 +0,0 @@
description "etcd 2.0 distributed key-value store"
author "Scott Lowe <scott.lowe@scottlowe.org>"
start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [016]
respawn
respawn limit 10 5
script
if [ -f "/etc/default/etcd" ]; then
. /etc/default/etcd
fi
if [ ! -d "/var/etcd" ]; then
mkdir /var/etcd
fi
cd /var/etcd
exec /usr/local/bin/etcd >>/var/log/etcd.log 2>&1
end script

@ -1,15 +0,0 @@
[Unit]
Description=Etcd Server
After=network.target
[Service]
Type=notify
WorkingDirectory=/var/lib/etcd/
EnvironmentFile=-/etc/etcd/etcd.conf
#User=etcd
ExecStart=/usr/local/bin/etcd
Restart=on-failure
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target

@ -1,41 +0,0 @@
# [member]
#ETCD_NAME=default
#ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
#ETCD_SNAPSHOT_COUNTER="10000"
#ETCD_HEARTBEAT_INTERVAL="100"
#ETCD_ELECTION_TIMEOUT="1000"
#ETCD_LISTEN_PEER_URLS="http://localhost:2380"
#ETCD_LISTEN_CLIENT_URLS="http://localhost:2379"
#ETCD_MAX_SNAPSHOTS="5"
#ETCD_MAX_WALS="5"
#ETCD_CORS=""
#
#[cluster]
#ETCD_INITIAL_ADVERTISE_PEER_URLS="http://localhost:2380"
# if you use different ETCD_NAME (e.g. test), set ETCD_INITIAL_CLUSTER value for this name, i.e. "test=http://..."
#ETCD_INITIAL_CLUSTER="default=http://localhost:2380"
#ETCD_INITIAL_CLUSTER_STATE="new"
#ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster"
#ETCD_ADVERTISE_CLIENT_URLS="http://localhost:2379"
#ETCD_DISCOVERY=""
#ETCD_DISCOVERY_SRV=""
#ETCD_DISCOVERY_FALLBACK="proxy"
#ETCD_DISCOVERY_PROXY=""
#
#[proxy]
#ETCD_PROXY="off"
#
#[security]
#ETCD_CERT_FILE=""
#ETCD_KEY_FILE=""
#ETCD_CLIENT_CERT_AUTH="false"
#ETCD_TRUSTED_CA_FILE=""
#ETCD_PEER_CERT_FILE=""
#ETCD_PEER_KEY_FILE=""
#ETCD_PEER_CLIENT_CERT_AUTH="false"
#ETCD_PEER_TRUSTED_CA_FILE=""
#
#[logging]
#ETCD_DEBUG="false"
# examples for -log-package-levels etcdserver=WARNING,security=DEBUG
#ETCD_LOG_PACKAGE_LEVELS=""

@ -1,35 +0,0 @@
#!/bin/bash
#
#
# ``plugin.sh`` calls the following methods in the sourced driver:
#
# - nb_db_driver_install_server
# - nb_db_driver_install_client
# - nb_db_driver_start_server
# - nb_db_driver_stop_server
# - nb_db_driver_clean
# - nb_db_driver_configure
function nb_db_driver_install_server {
:
}
function nb_db_driver_install_client {
:
}
function nb_db_driver_start_server {
:
}
function nb_db_driver_stop_server {
:
}
function nb_db_driver_clean {
:
}
function nb_db_driver_configure {
:
}

@ -1,7 +0,0 @@
#!/bin/bash
function configure_pubsub_service_plugin {
NEUTRON_CONF=${NEUTRON_CONF:-"/etc/neutron/neutron.conf"}
PUB_SUB_DRIVER=${PUB_SUB_DRIVER:-"etcd_pubsub_driver"}
iniset $DRAGONFLOW_CONF df pub_sub_driver $PUB_SUB_DRIVER
}

@ -1,49 +0,0 @@
# NOTE(xiaohhui): By default, devstack will set Q_AGENT as openvswitch.
# Here we deny that, because there is no agent in DF. But most of
# functions in lib/neutron_plugins/openvswitch_agent are needed. So,
# lib/neutron_plugins/openvswitch_agent is still used here. And override
# functions can be added in this file.
Q_AGENT=${Q_AGENT:-" "}
source $TOP_DIR/lib/neutron_plugins/openvswitch_agent
# This function is invoked by DevStack's Neutron plugin setup
# code and is being overridden here since the DF devstack
# plugin will handle the install.
function neutron_plugin_install_agent_packages {
:
}
# Workaround for devstack/systemd, which will try to define q-agt even though
# it's disabled.
AGENT_BINARY=$(which true)
if is_service_enabled df-l3-agent ; then
AGENT_L3_BINARY=${AGENT_L3_BINARY:-"$(get_python_exec_prefix)/df-l3-agent"}
enable_service q-l3
fi
if is_service_enabled df-metadata ; then
disable_service q-meta
fi
DRAGONFLOW_CONF=/etc/neutron/dragonflow.ini
DRAGONFLOW_PUBLISHER_CONF=/etc/neutron/dragonflow_publisher.ini
DRAGONFLOW_DATAPATH=/etc/neutron/dragonflow_datapath_layout.yaml
Q_PLUGIN_EXTRA_CONF_PATH=/etc/neutron
Q_PLUGIN_EXTRA_CONF_FILES=(dragonflow.ini)
Q_ML2_PLUGIN_MECHANISM_DRIVERS=${Q_ML2_PLUGIN_MECHANISM_DRIVERS:-"df"}
if [[ -z ${ML2_L3_PLUGIN} ]]; then
if is_service_enabled q-l3 ; then
ML2_L3_PLUGIN="df-l3"
else
ML2_L3_PLUGIN="df-l3-agentless"
fi
fi
if [[ "$ENABLE_DPDK" == "True" ]]; then
# By default, dragonflow uses OVS kernel datapath. If you want to use
# user space datapath powered by DPDK, please use 'netdev'.
OVS_DATAPATH_TYPE=netdev
fi

@ -1,203 +0,0 @@
#!/bin/bash
DPDK_VERSION=16.07.2
DPDK_DIR=$DEST/dpdk/dpdk-stable-${DPDK_VERSION}
DPDK_TARGET=x86_64-native-linuxapp-gcc
DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
PCI_BUS_INFO=`sudo ethtool -i ${DPDK_NIC_NAME} | grep bus-info`
DPDK_PCI_TARGET=${PCI_BUS_INFO#*:}
OVS_DIR=/usr/local/var/run/openvswitch
OVSDB_SOCK=/usr/local/var/run/openvswitch/db.sock
# includes ovs_setup.sh
source $DEST/dragonflow/devstack/ovs_setup.sh
function _neutron_ovs_configure_dependencies {
# Configure TUN
if [ ! -e /sys/class/misc/tun]; then
sudo modprobe tun
fi
if [ ! -e /dev/net/tun]; then
sudo mkdir -p /dev/net
sudo mknod /dev/net/tun c 10 200
fi
# Configure huge-pages
sudo sysctl -w vm.nr_hugepages=${DPDK_NUM_OF_HUGEPAGES}
sudo mkdir -p /dev/hugepages
sudo mount -t hugetlbfs none /dev/hugepages
# Configure UIO
sudo modprobe uio || true
sudo insmod $DPDK_BUILD/kmod/${DPDK_BIND_DRIVER}.ko || true
}
function _configure_ovs_dpdk {
# Configure user space datapath
iniset $DRAGONFLOW_CONF df vif_type vhostuser
iniset $DRAGONFLOW_CONF df vhost_sock_dir ${OVS_DIR}
# Disable kernel TCP/IP stack
sudo iptables -A INPUT -i ${DPDK_NIC_NAME} -j DROP
sudo iptables -A FORWARD -i ${DPDK_NIC_NAME} -j DROP
# Set up DPDK NIC
sudo ip link set ${DPDK_NIC_NAME} down
sudo $DPDK_DIR/tools/dpdk-devbind.py --bind=${DPDK_BIND_DRIVER} ${DPDK_PCI_TARGET}
}
function _install_dpdk {
if is_fedora; then
install_package kernel-devel
elif is_ubuntu; then
install_package build-essential
fi
if [ ! -d $DEST/dpdk ]; then
mkdir -p $DEST/dpdk
pushd $DEST/dpdk
if [ ! -e $DEST/dpdk/dpdk-${DPDK_VERSION}.tar.xz ]
then
wget http://fast.dpdk.org/rel/dpdk-${DPDK_VERSION}.tar.xz
fi
tar xvJf dpdk-${DPDK_VERSION}.tar.xz
cd $DPDK_DIR
sudo make install T=$DPDK_TARGET DESTDIR=install
popd
fi
}
function _uninstall_dpdk {
sudo $DPDK_DIR/tools/dpdk-devbind.py -u ${DPDK_PCI_TARGET}
sudo rmmod $DPDK_BUILD/kmod/${DPDK_BIND_DRIVER}.ko
sudo modprobe -r uio
sudo ip link set ${DPDK_NIC_NAME} up
# Enable kernel TCP/IP stack
sudo iptables -D INPUT -i ${DPDK_NIC_NAME} -j DROP
sudo iptables -D FORWARD -i ${DPDK_NIC_NAME} -j DROP
pushd $DPDK_DIR
sudo make uninstall
popd
sudo rm -rf $DPDK_DIR
}
function install_ovs {
_install_dpdk
_neutron_ovs_configure_dependencies
_neutron_ovs_clone_ovs
# If OVS is already installed, remove it, because we're about to re-install
# it from source.
for package in openvswitch openvswitch-switch openvswitch-common; do
if is_package_installed $package ; then
uninstall_package $package
fi
done
install_package autoconf automake libtool gcc patch make
pushd $DEST/ovs
./boot.sh
./configure --with-dpdk=$DPDK_BUILD
make
sudo make install
sudo pip install ./python
popd
}
function uninstall_ovs {
sudo pip uninstall -y ovs
pushd $DEST/ovs
sudo make uninstall
popd
_uninstall_dpdk
}
function start_ovs {
# First time, only DB creation/clearing
sudo mkdir -p /var/run/openvswitch
# Start OVSDB
sudo ovsdb-server --remote=punix:$OVSDB_SOCK \
--remote=db:Open_vSwitch,Open_vSwitch,manager_options \
--pidfile --detach
# Start vswitchd
sudo ovs-vsctl --db=unix:$OVSDB_SOCK --no-wait init
sudo ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true
sudo ovs-vswitchd unix:$OVSDB_SOCK --pidfile --detach
}
function configure_ovs {
_configure_ovs_dpdk
if is_service_enabled df-controller ; then
# setup external bridge if necessary
check_dnat=$(echo $DF_APPS_LIST | grep "dnat")
if [[ "$check_dnat" != "" ]]; then
echo "Setup external bridge for DNAT"
sudo ovs-vsctl add-br $PUBLIC_BRIDGE || true
sudo ip link set dev $PUBLIC_BRIDGE up || true
sudo ip addr add $PUBLIC_NETWORK_GATEWAY/$PUBLIC_NETWORK_PREFIXLEN dev $PUBLIC_BRIDGE || true
fi
_neutron_ovs_base_setup_bridge $INTEGRATION_BRIDGE
sudo ovs-vsctl --no-wait set bridge $INTEGRATION_BRIDGE fail-mode=secure other-config:disable-in-band=true
# Configure Open vSwitch to connect dpdk-enabled physical NIC
# to the OVS bridge. For example:
sudo ovs-vsctl add-port ${INTEGRATION_BRIDGE} dpdk0 -- set interface \
dpdk0 type=dpdk ofport_request=1
fi
}
function cleanup_ovs {
# Remove the patch ports
for port in $(sudo ovs-vsctl show | grep Port | awk '{print $2}' | cut -d '"' -f 2 | grep patch); do
sudo ovs-vsctl del-port ${port}
done
# remove all OVS ports that look like Neutron created ports
for port in $(sudo ovs-vsctl list port | grep -o -e tap[0-9a-f\-]* -e q[rg]-[0-9a-f\-]*); do
sudo ovs-vsctl del-port ${port}
done
# Remove all the vxlan ports
for port in $(sudo ovs-vsctl list port | grep name | grep vxlan | awk '{print $3}' | cut -d '"' -f 2); do
sudo ovs-vsctl del-port ${port}
done
}
function stop_ovs {
sudo ovs-dpctl dump-dps | sudo xargs -n1 ovs-dpctl del-dp
sudo killall ovsdb-server
sudo killall ovs-vswitchd
}
function init_ovs {
# clean up from previous (possibly aborted) runs
# create required data files
# Assumption: this is a dedicated test system and there is nothing important
# ovs databases. We're going to trash them and
# create new ones on each devstack run.
base_dir=/usr/local/etc/openvswitch
sudo mkdir -p $base_dir
for db in conf.db ; do
if [ -f $base_dir/$db ] ; then
sudo rm -f $base_dir/$db
fi
done
sudo rm -f $base_dir/.*.db.~lock~
echo "Creating OVS Database"
sudo ovsdb-tool create $base_dir/conf.db \
/usr/local/share/openvswitch/vswitch.ovsschema
}

@ -1,271 +0,0 @@
#!/bin/bash
function _neutron_ovs_install_ovs_deps_fedora {
install_package -y rpm-build rpmrebuild
# So apparently we need to compile to learn the requirements...
set `rpmspec -q --buildrequires rhel/openvswitch-fedora.spec`
set "$@" `rpmspec -q --buildrequires rhel/openvswitch-kmod-fedora.spec`
if [ $# > 0 ]; then
install_package -y $@
fi
}
function _neutron_ovs_get_rpm_basename {
PACKAGE=$1
SPEC=${2:-rhel/openvswitch-fedora.spec}
BASENAME=`rpmspec -q $SPEC --provides | awk "/^$PACKAGE\s*=/ {print \\\$1\"-\"\\\$3}" | head -1`
echo `rpmspec -q $SPEC | grep "^$BASENAME"`
}
function _neutron_ovs_get_rpm_file {
BASENAME=`_neutron_ovs_get_rpm_basename "$@"`
find $HOME/rpmbuild/RPMS/ -name "$BASENAME.rpm" | head -1
}
function _neutron_ovs_clone_ovs {
if [ -d $DEST/ovs ]; then
pushd $DEST/ovs
git checkout $OVS_BRANCH
git pull || true
popd
else
pushd $DEST
git clone $OVS_REPO -b $OVS_BRANCH
popd
fi
}
function _neutron_ovs_install_ovs_fedora {
_neutron_ovs_clone_ovs
mkdir -p $DEST/ovs/build-dragonflow
pushd $DEST/ovs/build-dragonflow
pushd ..
./boot.sh
popd
../configure
make dist
VERSION=`awk '/^Version:/ { print $2 }' ../rhel/openvswitch-fedora.spec | head -1`
mkdir -p $HOME/rpmbuild/SOURCES
cp openvswitch-${VERSION}.tar.gz $HOME/rpmbuild/SOURCES/
tar -xzf openvswitch-${VERSION}.tar.gz -C $HOME/rpmbuild/SOURCES
pushd $HOME/rpmbuild/SOURCES/openvswitch-${VERSION}
_neutron_ovs_install_ovs_deps_fedora
rpmbuild -bb --without check rhel/openvswitch-fedora.spec
rpmbuild -bb -D "kversion `uname -r`" rhel/openvswitch-kmod-fedora.spec
OVS_RPM_BASENAME=$(_neutron_ovs_get_rpm_file openvswitch)
rpmrebuild --change-spec-requires="awk '\$1 == \"Requires:\" && \$2 == \"/bin/python\" {\$2 = \"/usr/bin/python\"} {print \$0}'" -p $OVS_RPM_BASENAME
OVS_PY_RPM_BASENAME=""
OVS_KMOD_RPM_BASENAME=$(_neutron_ovs_get_rpm_file openvswitch-kmod rhel/openvswitch-kmod-fedora.spec)
install_package -y $OVS_RPM_BASENAME $OVS_PY_RPM_BASENAME $OVS_KMOD_RPM_BASENAME
sudo pip install ./python
popd
popd
}
function _neutron_ovs_install_ovs_deps_ubuntu {
install_package -y build-essential fakeroot devscripts equivs dkms linux-libc-dev linux-headers-$(uname -r)
sudo mk-build-deps -i -t "/usr/bin/apt-get --no-install-recommends -y"
}
function _neutron_ovs_install_ovs_ubuntu {
_neutron_ovs_clone_ovs
pushd $DEST/ovs
_neutron_ovs_install_ovs_deps_ubuntu
DEB_BUILD_OPTIONS='nocheck' fakeroot debian/rules binary
sudo dpkg -i ../openvswitch-datapath-dkms*.deb
sudo dpkg -i ../libopenvswitch*.deb ../openvswitch-common*.deb ../openvswitch-switch*.deb
sudo pip install ./python
popd
}
function _neutron_ovs_install_ovs {
local _is_ovs_installed=false
if [ "$OVS_INSTALL_FROM_GIT" == "True" ]; then
echo "Installing OVS and dependent packages from git"
# If OVS is already installed, remove it, because we're about to re-install
# it from source.
for package in openvswitch openvswitch-switch openvswitch-common; do
if is_package_installed $package ; then
_is_ovs_installed=true
break
fi
done
if [ "$_is_ovs_installed" = true ]; then
cleanup_ovs
stop_ovs
uninstall_ovs
fi
install_package -y autoconf automake libtool gcc patch make
if is_ubuntu; then
_neutron_ovs_install_ovs_ubuntu
elif is_fedora; then
_neutron_ovs_install_ovs_fedora
else
echo "Unsupported system. Trying to install via package manager"
install_package $(get_packages "openvswitch")
fi
else
echo "Installing OVS and dependent packages via package manager"
install_package $(get_packages "openvswitch")
fi
}
function install_ovs {
unload_module_if_loaded openvswitch
_neutron_ovs_install_ovs
# reload module
load_module_if_not_loaded openvswitch
}
function start_ovs {
echo "Starting OVS"
SERVICE_NAME=openvswitch # Default value
if is_fedora; then
SERVICE_NAME=openvswitch
elif is_ubuntu; then
SERVICE_NAME=openvswitch-switch
fi
restart_service $SERVICE_NAME
sleep 5
local _pwd=$(pwd)
cd $DATA_DIR/ovs
if ! ovs_service_status $OVS_DB_SERVICE; then
die "$OVS_DB_SERVICE is not running"
fi
if is_service_enabled df-controller ; then
if ! ovs_service_status $OVS_VSWITCHD_SERVICE; then
die "$OVS_VSWITCHD_SERVICE is not running"
fi
fi