Commit Graph

44 Commits

Author SHA1 Message Date
Dr. Jens Harbott 31884f77d5 Fix issues with newer flake8
The updated flake8 seems to have fixed a check for .format() issues that
discovered a bug in one of our tests, which is fixed here.

Also get rid of using "l" as a variable name and tag the imports that
need to stay in order after setting an environment variable.

Change-Id: I28de0ffa68f9bff4685d81fe7b5a5d8909e2313c
2020-05-12 14:39:03 +00:00
Erik Olof Gunnar Andersson a09064a5d1 Refactored service layer
Service layer has been simplified by removing abstraction
and making the implementation more in line with other
OpenStack projects.

Moved Heartbeat code out of Service class and
into the console scripts. We only need one instance
of the Heartbeat Emitter.

Cleaned up the WSGI code by making use of the
reusable oslo_service.wsgi code.

* Added Heartbeat to designate-sink.
* Cleaned up and refactored Service layers.
* Fixed various bugs e.g. errors on shutdown.
* Removed deprecated options host, port etc.
* Simplified Heartbeat implementation.

Closes-Bug: #1442141
Change-Id: I536b92407bf6ca5bddf4c048909cd13d4e094d26
2019-09-20 15:10:46 -07:00
Erik Olof Gunnar Andersson 2c9e9f5f41 Bump to hacking 1.1.0
* Minor changes to fix some new checks.
* Use pycodestyle directly instead of pep8.

Change-Id: I5fbe877f8d05c1b25bf760e52ea8abdfd0a2d8d9
2019-07-04 00:33:00 -07:00
Erik Olof Gunnar Andersson a53c3daf16 Moved most configuration into designate.conf
Based upon the established conf paradigm used in Nova,
this patch moves most of the configuration to a
central location. Making config a lot easier to
manage, as well a lot easier to locate.

There is still some configuration listed in classes,
that I would like to eventually move to
designate.conf as well, but to lower complexity not
all config was moved.

General changes
* Centrelized most configuration under designate.conf.
* Cleaned up configuration.
* Simplified config generation.
* Renamed generated config to designate.conf.sample.

Previously broken
* xfr_timeout now in the appropriate section.
* memcached_servers now in the appropriate section.

Previously missing from sample config
* allowed_remote_exmods listed in sample config.
* backend:akamai section listed in sample config.
* backend:dynect section listed in sample config.
* backend:infoblox section listed in sample config.

blueprint centralize-config-designate

Change-Id: I3be68bf294157631a9bac128df0841220020de96
2019-05-28 23:54:00 +00:00
Tytus Kurek c0b54602a4
CAA DNS records
This patchset adds support for DNS CAA (Certification Authority
Authorization) Resource Record which is described in RFC 6844
(https://tools.ietf.org/html/rfc6844)

Change-Id: If9619096f1706d1123895b63b9129b9ffd4fb320
Closes-Bug: 1787552
2018-11-07 16:08:01 +00:00
Tytus Kurek 44d9c02c7c
NAPTR DNS records
This patchset adds support for DNS NAPTR (Naming Authority
Pointer) Resource Record which is described in RFC 2915
(https://tools.ietf.org/html/rfc2915)

Change-Id: Ic7d26a6c653ce46e67438e983476782edd6ec890
Closes-Bug: 1779850
2018-11-06 15:59:04 +00:00
Erik Olof Gunnar Andersson 268bab6413 Simplify olso.log setup
Switching to log.get_default_log_levels, and implement
_EXTRA_DEFAULT_LOG_LEVELS on top for anything designate specific.

Change-Id: I20c89e0ddfde39c1a43c2e32a5dad67d180e38c3
2018-08-05 21:17:53 -07:00
melissaml b16971d68c fix a typo in code
Remove the duplicated 'for'.

Change-Id: I83a1a1f085b5d8272f920db7df2b40ed23802915
2018-06-05 17:39:22 +08:00
David Rabel fdd8ffd448 Add sample_default for pybasedir in __init__.py
Adding that parameter helps to make Debian package
builds reproducible.

Change-Id: I676f0bbcba4c6ddd2b1694c116169ac9a174698d
2018-02-09 15:28:08 +01:00
Thomas Goirand 2fff7cda03
Make designate.conf reproducible
The hostname of the build machine leaks in the designate.conf.
Therefore, this patch sets sample_default='<Hostname>' to make
the build reproducible.

If you don't know about reproducible build, please read here:
https://wiki.debian.org/ReproducibleBuilds/About

Change-Id: I972aed4cf47510eb669d1db61c8f569136f861b6
Closes-Bug: #1736801
2017-12-07 16:29:09 +00:00
Jenkins 9d688e2836 Merge "Auto-generate designate.conf.sample via genconfig testenv" 2017-07-12 20:12:39 +00:00
Nguyen Van Trung 416ae6cd08 Auto-generate designate.conf.sample via genconfig testenv
- Keep currently config in the Designate
- Fix some warning about missing help string
- Auto-generate sample config via genconfig testenv.
- Add an instruction in README about genconfig
- Create config sample along with whole service, backend
- Create opts.py to focus list_opts.

Change-Id: Iead7772cd13316c9f4adafe1b1e70d36bbc6a11a
2017-07-01 21:32:16 +07:00
Hieu LE 59711d5db8 Eliminate annoying oslo.messaging timed out message
Oslo.messaging >=5.18.0 polling spam logs for timed out message.
Setting oslo.messaging log level to INFO for eliminating annoying
timed out messages.

This commit also adopt get_rpc_transport and
get_notification_transport from oslo.messaging.

Change-Id: I2de252a59073af0db2d570f78208ee0402a2826e
Depends-On: I0ee741d8deda358e7cfb29407865ac6780ac64b9
Closes-Bug: #1691618
Related-Bug: #1671781
2017-06-28 17:45:10 +00:00
Graham Hayes b56a7b14f3 Bump hacking to new required version
Change-Id: Ice127b5e673cee3159b780e3da06cec496c845e3
2017-03-07 21:56:28 +00:00
Tim Simmons 81ce132e90 Worker Model
- More information about the actual worker code can be found
  in `designate/worker/README.md` and in the inline docstrings

- Stand up a `designate-worker` process with an rpcapi, all
  the usual jazz

- Implement a base `Task` class that defines the behavior of
  a task and exposes resources to the task.

- Implement CUD Zone tasks, which includes Tasks that poll for zones,
  send Notifies, and update status. These are all done in parallel
  with threads using a shared threadpool, rather than iteratively.

- Implement a `recover_shard` task that serves the function
  of a periodic recovery, but only for a shard. Call that
  task with various shards from the zone manager.

- Put some shims in central and mdns so that the worker can
  be switched on/off with a few config values.

- Changes Zone Manager -> Producer
    - Removes zm rpcapi
    - Adds startable designate-producer service
    - Makes zone-manager an alias for producer service with a warning log
    - Lots of renaming

- Moves zone export to worker
    - API now uses central_api.export_zone to get zonefiles
    - Central uses worker_api.start_zone_export to init exports
    - Now including unit tests
    - Temporary workarounds for upgrade/migration move the logic
      into central if worker isn't available.

- Deprecates Pool manager polling options and adds warning msg on
  starting designate-pool-manager

- Get some devstack going

- Changes powerdns backend to get new sqlalchemy sessions for each
  action

- Sets the default number of threads in a worker process to 200,
  this is pretty much a shot in the dark, but 1000 seemed like
  too many, and 20 wasn't enough.

- Grenade upgrade testing

- Deprecation warnings for zone/pool mgr

The way to run this is simple, just stop `designate-pool-manager`
and `designate-zone-manager`, toggle the config settings in the
`service:worker` section: enabled = true, notify = true
and start `designate-worker` and `designate-producer` and you
should be good to go.

Change-Id: I259e9825d3a4eea58e082303ba3bdbdb7bf8c363
2016-08-24 14:54:31 +00:00
Federico Ceratto aa140ff92f Randomize SOA refresh interval
Change-Id: I4271d428fbb0d81faaa9c06c41d00d9584e0cd90
2016-02-22 14:54:43 +00:00
James Li 79a4af0455 Make supported record type configurable
Also made the distinction between 'valid' and 'supported' record
types. For example an error of "'foo' is not a valid record type"
will return when user tries to create a record type of 'foo'.
User will get "'SPF' is not a supported record type" if operator
chooses not to expose SPF.

Implements blueprint configurable-record-type
Change-Id: I22410a760a5ec78270162496ee03f2b2b8ba7d25
2016-02-03 20:32:17 +00:00
TimSimmons 50d1b1553e Asynchronous Zone Export
Do the needful to move Zone Exports to an asynchronous resource in the
v2 API, as discussed at the Austin 2015 summe mid-cycle

* Make designate-zone-manager an RPC service, with a read-only connection
  to the database
* Add a 'location' column to the zone_tasks table that stores a location
  (swift, URI) that is used to determine where the export will be made
  available to the user
* Add all the infrastucture to make zone export resources live (objects,
  central, storage methods)
* Add a quota on the size of allowed synchronous exports
* Tests, docs

THIS DOES NOT IMPLEMENT
* Zone exports to Swift
* Debateable: See the note in zone_manager/service.py about how the configuration
  and determination of future swift exports will work.

ApiImpact
Blueprint: async-export
Change-Id: I1c168b10358164c3ca5be986b4d615df71062851
2015-08-28 16:45:10 -05:00
Kiall Mac Innes ef34b3a313 Silence some DEBUG logs
Change-Id: I32ba3b0141adb999e9ffdc961afc84238c90416e
2015-06-30 14:23:44 +01:00
Jenkins 556f3826be Merge "Re-arrange default log levels and add iso8601" 2015-06-25 18:41:18 +00:00
Endre Karlson 0dfe70675d Re-arrange default log levels and add iso8601
Change-Id: Ic8ecbcc3624cdbe77eb8cd7aa25e673ec2a98e0d
2015-06-25 13:37:21 +02:00
Kiall Mac Innes 7861480134 Eventlet+DNSPython breaks /etc/hosts resolution
Eventlet's GreenDNS Patching will prevent the resolution of names in
the /etc/hosts file, causing problems for for installs. By forcing
the EVENTLET_NO_GREENDNS=yes environment variable, we tell eventlet
not to patch the stdlib's DNS functions with dnspython.

Change-Id: I08b91c598f2904fe8d82827a35b187ae8a4d5d0d
2015-06-13 10:49:36 +01:00
Doug Hellmann f9c55abbff Drop use of 'oslo' namespace package
The Oslo libraries have moved all of their code out of the 'oslo'
namespace package into per-library packages. The namespace package was
retained during kilo for backwards compatibility, but will be removed by
the liberty-2 milestone. This change removes the use of the namespace
package, replacing it with the new package names.

The patches in the libraries will be put on hold until application
patches have landed, or L2, whichever comes first. At that point, new
versions of the libraries without namespace packages will be released as
a major version update.

Please merge this patch, or an equivalent, before L2 to avoid problems
with those library releases.

Blueprint: remove-namespace-packages
https://blueprints.launchpad.net/oslo-incubator/+spec/remove-namespace-packages

Change-Id: Ia21c15e8eca6bf456f7cfe13f815f5ce068601e7
2015-05-06 20:36:49 +00:00
Doug Hellmann 1ff8469ef7 Drop use of 'oslo' namespace package
The Oslo libraries have moved all of their code out of the 'oslo'
namespace package into per-library packages. The namespace package was
retained during kilo for backwards compatibility, but will be removed by
the liberty-2 milestone. This change removes the use of the namespace
package, replacing it with the new package names.

The patches in the libraries will be put on hold until application
patches have landed, or L2, whichever comes first. At that point, new
versions of the libraries without namespace packages will be released as
a major version update.

Please merge this patch, or an equivalent, before L2 to avoid problems
with those library releases.

Blueprint: remove-namespace-packages
https://blueprints.launchpad.net/oslo-incubator/+spec/remove-namespace-packages

Change-Id: Iae62b48993eef3b31420f8cc245a55f5e303c4fc
2015-04-28 18:32:15 +00:00
Jenkins 6da216778c Merge "PM: Ensure only one periodic task runs per host" 2015-04-22 14:36:35 +00:00
Kiall Mac Innes f3dd7a8f42 PM: Ensure only one periodic task runs per host
Ensure multiple periodic sync/recovery tasks do not run concurrently on
a single host by using an inter process lock inside the periodic task.

This has the effect of serializing the tasks, rather than the more correct
deduplication of tasks. Bug 1445127 tracks the longer term fix.

Change-Id: Ib0041f127aacfd0f49ca84deecc2a6950594dd58
Closes-Bug: 1445125
2015-04-21 17:15:18 +01:00
Kiall Mac Innes d479133ddb Correct mDNS TCP/UDP socket flags
* Explicitly mark TCP and UDP as blocking sockets
* Added socket.SO_REUSEADDR to UDP socket
* Added socket.SO_REUSEPORT to TCP+UDP sockets
* Moved socket creation to inside the worker thread's
  start() method.
* Added a socket.close() to the stop() method.
* Enable eventlet patching of the "os" module, required
  to avoid symptoms which look near identical to [1].

[1]: https://github.com/eventlet/eventlet/issues/210

Closes-Bug: 1444384
Change-Id: Iff642673a33d7b8d2e2c1af833f944330001c33b
2015-04-15 17:22:15 +01:00
Eric Larson f0de963625 Replace nova with designate in pybasedir help
I also had to reformat the code slightly for pep8.

Change-Id: I63d643c6da3a450d8d2248f9392744c8a50172c7
2015-02-20 09:00:55 -06:00
Endre Karlson 7eefb71b8b Switch to oslo.log
Change-Id: I08386ed2c8a2d9e16c57776413a612b8bf8323f7
2015-01-21 21:39:16 +01:00
Jenkins 7b310d459f Merge "Remove the agent service and old-style backend tests" 2014-12-16 00:20:48 +00:00
Graham Hayes 1f046a2513 Changed oslo.messaging's default log level
Moved the default log level for oslo.messaging to WARN,
reducing the amount of cluter in the logs

Change-Id: Icde2f6f52d6b72162805424434ebbd458c0af10b
2014-12-15 19:57:38 +00:00
Kiall Mac Innes 6285bdaf6d Remove the agent service and old-style backend tests
The agent service has been replaced by Pools, we should remove it
now that pools has fully merged.

Additionaly, the Backend tests rely on the Agent code, and no tests
exist for Pools based backends. This will be fixed as a priority in
Kilo 2.

Change-Id: I9cf96dbe8c079792bd55a9eab7a12efb7a983552
2014-12-15 16:09:26 +00:00
rjrjr bc17db433c Pool Manager Service Changes
- Added the Pool Manager cache (including test cases)
- Added the pool_manager_status table (including test cases)
- Added the PoolManagerStatus object
- Added the PoolServer object
- Added the BackendOption object
- Added support for global and server specific backend configurations
- Added a backend driver for pool manager (BIND9)
- Stubbed out the pool manager service (including periodic_sync)

Change-Id: I3d94e5df663d2938b0e6017fe43c28c71f7a29a0
Partially-implements: blueprint server-pools-service
2014-10-24 15:12:35 -07:00
chioleong 3ea34d29ad Use auth_token from keystonemiddleware
auth_token middleware in python-keystoneclient is deprecated and has
been moved to the keystonemiddleware repo.

Change-Id: Id5056c834fb99f93c507a867ff6d8c085d7394f9
Closes-Bug: #1342274
2014-07-24 11:48:32 -07:00
Kiall Mac Innes 0c22ba0799 Ensure eventlet monkey patching happens as early as possible
Change-Id: I37822944087385f582181cac3d908287c728d88d
Closes-Bug: 1343526
2014-07-17 20:20:28 +01:00
Jordan Cazamias 50295fb39e Fix style errors H305 and H307
H305: Imports not grouped correctly
H307: Like imports should be grouped together

Change-Id: Ic63d253e015298c7b952121a4b3634d2b1bdaf92
Implements: blueprint new-hacking-style-rules
2014-06-18 17:35:43 -05:00
Kiall Mac Innes 36e501c6f7 Implement mDNS Service
This service listens on a TCP/UDP port, and dispatches requests to a
single method for parsing and handling.

Each incoming request is handled in a greenthread spawned specifically
for that request, allow for >1 concurrent requests.

Additionally, the "workers" config option allows for multiple distict
processes to be spawned for the service, all sharing the same socket,
to allow for >1 CPU core usage.

Change-Id: I173f4640a50b56f52c0371bae47b84ce44301263
2014-06-04 23:45:27 +01:00
Endre Karlson 0d3a4427d9 Switch to oslo.messaging
Change-Id: Ie223ca4c6384902ec006380c68911f57d0ed501e
2014-04-10 13:16:26 +02:00
Artom Lifshitz 49562df128 Default state-path to /var/lib/designate
In a production system, the previous state-path would default to
something like /usr/lib/python2.6/site-packages. Not only is this a
bizarre place to keep Designate's state, it also breaks the bind9
backend, which attemps to create and write to
/usr/lib/python2.6/site-packages/bind9.

Since /var/lib is defined in the Filesystem Hierarchy Standard as the
place to store persistent state information, it's better to explicitly
use it as the default state-path.

Change-Id: I91922799ba1dcae1ad33f1abbec79b1eb907307f
Closes-bug: 1279989
2014-02-17 15:21:18 -05:00
Kiall Mac Innes 1f8a9b3a68 Allow default SOA values to be configured
We now allow the default SOA values to be specified in the
configuration file.

Change-Id: Ie24a9c3c70114a38e6f8979ad3113bf1c1b3b945
2013-09-13 11:13:13 +01:00
Kiall Mac Innes 8b63ef08c0 Reduce logspam from amqp
Change-Id: I9323e46397c41cb2e0a1e117ce3e668731a50a2a
2013-07-31 10:29:17 +00:00
Kiall Mac Innes d0ec349ec7 Override default config values correctly
Change-Id: If00c23892611ad3db7782315993e392a8f015da0
2013-07-12 13:28:10 +01:00
Kiall Mac Innes f3ce2698dc Sync with oslo stable/grizzly c7862b5239822d701b7fb155faa4607eff602627
Change-Id: Ib7f5dd1404bdac1969e947cc310573052760f3f4
2013-07-03 14:47:22 +01:00
Kiall Mac Innes 193085cf56 Rename Moniker -> Designate
Change-Id: I4b9c7b277a524058408d5c551bb51531e9a3949c
2013-06-09 21:15:03 +01:00