[all] Supporting SQLAlchemy 2.0 in OpenStack

Sean Mooney smooney at redhat.com
Wed Feb 1 16:50:11 UTC 2023


On Wed, 2023-02-01 at 08:58 -0500, Mike Bayer wrote:
> We started talking about SQLAlchemy 2.0 in Openstack most officially in August 2021:
> 
> https://lists.openstack.org/pipermail/openstack-discuss/2021-August/024122.html
> 
> Since then, lots of work has been done for SQLAlchemy 2.0 compatibility.  oslo.db master IIUC should be fully free of 2.0 deprecation warnings, this is the topic for that: https://review.opendev.org/q/topic:sqlalchemy-20+repo:openstack/oslo.db  however, sqlalchemy-migrate would need to be fully retired from it which hasn't happened yet.
stephen who is alredy on cc has been driving most of the work to remvoign sqlalchmey-migrate
nova and several other project move to alembic thanks to there work in  zed.

i would think moving nova and placment at least to SQLAlchemy 2.0 in bobcat would not be contoverital given the work that stephen and other have
already been doing.

this would be good perhasp as a comunity goal

> 
> For downstream projects, the vast majority of SQLAlchemy-related code, which is lots of session.query() calls, should not have to change except to the degree that string-based notation for object attributes is removed in favor of actual attributes, e.g. joinedload("networks") becomes joinedload(Machine.networks).
> 
> The SQLAlchemy 2.0 migration process is designed to be gradual and starts with building a 2.0 forwards-compliant application that runs under SQLAlchemy 1.4.  This process is documented at https://docs.sqlalchemy.org/en/20/changelog/migration_20.html#the-1-4-2-0-migration-path .   I think a lot of projects are already through this process and are now trying to run directly on the 2.0 release.
> 
ya if we have nto got there with nova/placment yet i think it something we can push for in the next release
we do have the deprecation warnign mostly turn on and we try to fix them when they happen so its proably time to actully complete the move.
>    
> 
> 
> On Wed, Feb 1, 2023, at 8:02 AM, Thomas Goirand wrote:
> > Hi,
> > 
> > SQLAlchemy 2.0 was released 5 days ago. IMO, we should start drawing a 
> > plan to support it for Bobcat, and possibly backport patches for 
> > Antelope. Note that I have no clue what his implies. Maybe Mike, you 
> > could write about it? Has a lot of things changed?
> > 
> > Cheers,
> > 
> > Thomas Goirand (zigo)
> > 
> > 




More information about the openstack-discuss mailing list