Handwritten Text Recognition for manuscripts and early printed texts
Neutrondev ppt
1. Neutron Dev
(In a Nutshell)
Reference: https://wiki.openstack.org/wiki/NeutronDevelopment
2. • Neutron Service
• Exposes REST interface to manage network resources
• Requires a plugin to implement a specific network management strategy
• Agents (OVS and LB plugins)
• Manage state on the compute and gateway nodes
• External service (plugin-specific)
• Agent-based (manage configuration on compute/gateway nodes)
• Manage hardware or other resources
3. • Provides framework for plugins
• API (neutron.{api,extensions}) - standard interface to clients
• DB (neutron.db) - helpers to make plugin implementation easier
• Typical request lifecycle
• Accept client request
• Update local system state (in mysql)
• Async dispatch of state change to agent (rpc) or external service (http)
• Return status to client
• A request returning 200 is no guarantee of success!
5. There Be Dictionaries
• Neutron uses dictionaries instead of objects
• Legacy - intended to allow non-db plugins
• But all plugins need to store local state
• So...lots of manual introspection to determine ‘model’ state
• Like lisp, but with square brackets
• pf_ref['packet_filter']['status']
6. OVS Plugin
• L2 Agent
• Ensures tenant isolation on a compute node with local vlans
• Configures communication across compute nodes (via vlan, gre, etc)
• Integrates support for security groups (which apply at the port level)
• Linux bridge between ovs and vif supports iptables
• Other agents are required but not OVS-specific
• L3 + Metadata
• DHCP
7. • Routes traffic between networks, internal and external
• Manages metadata agents (one per subnet) to proxy traffic to nova’s
metadata service
• Supports SNAT (outbound) and DNAT (floating ips)
• Implemented via iptables rules
• Usually deployed on a gateway node alongside the L2 agent (required to
ensure connectivity a given subnet)
8. • Manages dnsmasq instances to implement IPAM
• A dnsmasq instance per subnet
• Relies on the L2 agent to ensure connectivity with a given subnet
9. • Required to support overlapping ips
• RHEL support is limited to creating virtual interfaces in a namespace
• Fedora/Ubuntu et all support moving virtual interfaces between
namespaces
• ovs_use_veth ensures that RHEL-compatible port handling is used
10. Development Speed
• The faster we can iterate, the more we get done
• Configure and install
• Virtualization
• Virt orchestration
• Dependency Caching
• Validate
• Debug failures with pdb
• Neutron smoke test in tempest
11. Virtualization
• Neutron usage is destructive - need to reset to clean state often
• Virtualization allows easy snapshot and restore - use!
• Nested virt (and ssd’s) largely obviate the virt speed penalty
• https://github.com/kashyapc/nvmx-haswell/blob/master/SETUP-nVMX.rst
• Automate image creation
• veewee - https://github.com/jedi4ever/veewee
• Orchestrate virtualization
• vagrant - https://github.com/adrahon/vagrant-kvm
12. Dependency Caching
• Speed up devstack/packstack runs by caching
• Fedora/RHEL
• reposync/createrepo (full repo, can be huge)
• intelligentmirror (incremental, can be a pain to configure)
• Ubuntu: apt-cacher-ng (incremental, works for rpms too)
• python: wheel (https://wheel.readthedocs.org) - binary packages
• ~/.pip/pip.conf can configure wheel usage globally
• python: pypi mirror
• Either full mirror or a forthcoming upstream script that mirrors only
openstack dependencies
13. Unit Testing
• Tox - http://tox.readthedocs.org/en/latest/
• Install with pip
• Deploys package to an isolated virtualenv and runs tests
• tox [-e py26,pep8] [neutron.tests.unit.test_module]
• see tox.ini for names of supported envs
• Debugging
• Reuse the tox-created venv: source .tox/py27/bin/activate
• Or install fresh: pip install --editable
• Tox doesn’t support pdb (uses subunit.run internally)
• python -m testtools.run neutron.tests.unit.test_module
• Integration
• Configure tempest with devstack
• API_RATE_LIMIT=False
• ENABLED_SERVICES+=,tempest
14. Mocking
• Mox - https://code.google.com/p/pymox/
• Uses a record/replay model
• Heavyweight
• Avoid if possible!
• Mock - http://www.voidspace.org.uk/python/mock/
• Uses an evaluate/assert model
• Lightweight
• Prefer!
15. Integration Testing
• enable_service tempest
• Packstack (/var/lib/tempest)
• Provision for demo usage, configure tempest and external ovs bridge
• Need to install - pip install --editable /var/lib/tempest
• Neutron smoke - nosetests tempest/scenario/test_network_basic_ops.py
• Sanity check that the service and agents are working
• Deploys package to an isolated virtualenv and runs tests
• tox [-e py26,pep8] [neutron.tests.unit.test_module]
• see tox.ini for names of supported envs
• Debugging
• Reuse the tox-created venv: source .tox/py27/bin/activate
• Or install fresh: pip install --editable
• Tox doesn’t support pdb (uses subunit.run internally)
• python -m testtools.run neutron.tests.unit.test_module