A service for managing and provisioning Bare Metal servers.
Go to file
Julia Kreger 49e085583d Phase 1 - SQLAlchemy 2.0 Compatability
One of the major changes in SQLAlchemy 2.0 is the removal
of autocommit support. It turns out Ironic was using this quite
aggressively without even really being aware of it.

* Moved the declaritive_base to ORM, as noted in the SQLAlchemy 2.0
  changes[0].

* Console testing caused us to become aware of issues around locking
  where session synchronization, when autocommit was enabled, was
  defaulted to False. The result of this is that you could have two
  sessions have different results, which could results on different
  threads, and where one could still attempt to lock based upon prior
  information. Inherently, while this basically worked, it was
  also sort of broken behavior. This resulted in locking being
  rewritten to use the style mandated in SQLAlchemy 2.0 migration
  documentation. This ultimately is due to locking, which is *heavily*
  relied upon in Ironic, and in unit testing with sqlite, there are
  no transactions, which means we can get some data inconsistency
  in unit testing as well if we're reliant upon the database to
  precisely and exactly return what we committed.[1]

* Begins changing the query.one()/query.all() style to use explicit
  select statements as part of the new style mandated for migration
  to SQLAlchemy 2.0.

* Instead of using field label strings for joined queries, use the
  object format, which makes much more sense now, and is part of
  the items required for eventual migration to 2.0.

* DB queries involving Traits are now loaded using SelectInLoad
  as opposed to Joins. The now deprecated ORM queries were quietly
  and silently de-duplicating rows and providing consistent sets
  from the resulting joined table responses, however putting much
  higher CPU load on the processing of results on the client.
  Prior performance testing has informed us this should be a minimal
  overhead impact, however these queries should no longer be in
  transactions with the Database Servers which should offset the
  shift in load pattern. The reason we cannot continue to deduplicate
  locally in our code is because we carry Dict data sets which cannot
  be hashed for deduplication. Most projects have handled this by
  treating them as Text and then converting, but without a massive
  rewrite, this seems to be the viable middle ground.

* Adds an explict mapping for traits and tags on the Node object
  to point directly to the NodeTrait and NodeTag classes. This
  superceeds the prior usage of a backref to make the association.

* Splits SQLAlchemy class model Node into Node and NodeBase, which
  allows for high performance queries to skip querying for ``tags``
  and ``traits``. Otherwise with the afrormentioned lookups would
  always execute as they are now properties as well on the Node
  class. This more common of a SQLAlchemy model, but Ironic's model
  has been a bit more rigid to date.

* Adds a ``start_consoles`` and ``start_allocations`` option to the
  conductor ``init_host`` method. This allows unit tests to be
  executed and launched with the service context, while *not* also
  creating race conditions which resulted in failed tests.

* The db API ``_paginate_query`` wrapper now contains additional
  logic to handle traditional ORM query responses and the newer style
  of unified query responses. Due to differences in queries and handling,
  which also was part of the driver for the creation of ``NodeBase``,
  as SQLAlchemy will only create an object if a base object is referenced.
  Also, by default, everything returned is a tuple in 1.4 with the
  unified interface.

* Also modified one unit test which counted time.sleep calls, which is
  a known pattern which can create failures which are ultimately noise.

Ultimately, I have labelled the remaining places which SQLAlchemy
warnings are raised at for deprecation/removal of functionality,
which needs to be addressed.

[0] https://docs.sqlalchemy.org/en/14/changelog/migration_20.html
[1] https://docs.sqlalchemy.org/en/14/dialects/sqlite.html#transaction-isolation-level-autocommit

Change-Id: Ie0f4b8a814eaef1e852088d12d33ce1eab408e23
2022-10-13 21:21:40 +00:00
api-ref Allocation candidates prefer matching name 2022-06-16 15:31:10 +12:00
devstack Add upgrade check warning for allocations db 2022-10-13 10:54:55 -07:00
doc Fix allocations default table type 2022-10-13 21:21:24 +00:00
etc Bye-bye iSCSI deploy, you served us well 2021-05-04 14:28:25 +02:00
ironic Phase 1 - SQLAlchemy 2.0 Compatability 2022-10-13 21:21:40 +00:00
playbooks/ci-workarounds CI: Save routing table information for troubleshooting 2022-07-20 11:02:39 -07:00
releasenotes Phase 1 - SQLAlchemy 2.0 Compatability 2022-10-13 21:21:40 +00:00
tools Add audit middleware options to ironic.conf 2022-07-07 15:51:07 +00:00
zuul.d CI: Changes to support Anaconda CI jobs 2022-09-06 07:38:11 -07:00
.gitignore Migrate to stestr as unit tests runner 2017-09-22 08:56:34 +00:00
.gitreview OpenDev Migration Patch 2019-04-19 19:40:53 +00:00
.mailmap Add my new address to .mailmap 2020-04-13 07:29:37 -07:00
.stestr.conf Migrate to stestr as unit tests runner 2017-09-22 08:56:34 +00:00
CONTRIBUTING.rst Project Contributing updates for Goal 2020-02-20 02:01:21 +00:00
LICENSE Added project infrastructure needs. 2013-05-02 14:55:43 -04:00
README.rst Add ironic-specs link to readme.rst 2019-08-30 17:16:09 +08:00
bindep.txt Drop python2 from bindep.txt 2022-06-10 20:42:46 +03:00
driver-requirements.txt Fix idrac-redfish RAID controller mode conversion 2022-09-15 03:36:31 -04:00
reno.yaml tell reno to ignore the kilo branch 2020-02-07 16:42:15 -05:00
requirements.txt Phase 1 - SQLAlchemy 2.0 Compatability 2022-10-13 21:21:40 +00:00
setup.cfg Implement a DHCP driver backed by dnsmasq 2022-09-05 13:57:39 +12:00
setup.py Cleanup Python 2.7 support 2020-04-03 17:49:23 +02:00
test-requirements.txt Update requirements 2021-07-13 14:37:28 +02:00
tox.ini Phase 1 - SQLAlchemy 2.0 Compatability 2022-10-13 21:21:40 +00:00

README.rst

Ironic

Team and repository tags

image

Overview

Ironic consists of an API and plug-ins for managing and provisioning physical machines in a security-aware and fault-tolerant manner. It can be used with nova as a hypervisor driver, or standalone service using bifrost. By default, it will use PXE and IPMI to interact with bare metal machines. Ironic also supports vendor-specific plug-ins which may implement additional functionality.

Ironic is distributed under the terms of the Apache License, Version 2.0. The full terms and conditions of this license are detailed in the LICENSE file.

Project resources

Project status, bugs, and requests for feature enhancements (RFEs) are tracked in StoryBoard: https://storyboard.openstack.org/#!/project/943

For information on how to contribute to ironic, see https://docs.openstack.org/ironic/latest/contributor