[openstack-dev] Alembic or SA Migrate (again)

Roman Podoliaka rpodolyaka at mirantis.com
Wed Nov 13 10:31:17 UTC 2013


I don't quite know the current state of affairs in Ceilometer, but we
had a design session at the summit at which we discussed how we were
going to proceed with Alembic not supporting migrations on SQLite.
Basically, we don't care about supporting of SQLite for production,
but we still need to run tests though.

So there are two ways:
1) continue to use SQLite for running tests, use models definitions to
generate the initial DB schema. This depends on [1] to be finished
2) run tests on MySQL/PostgreSQL instead (we have a proof-of-concept
implementation here [2])

The latter approach has a few problems though:
1) even if tests are run in parallel and each test case is run within
a single transaction with ROLLBACK in the end (read "fast cleanups"),
running of the whole test suite on MySQL will take much longer (for
PostgreSQL we can use fsync = off to speed up things a lot, though)
2) this would require developers to have MySQL/PostgreSQL installed on
their workstation (or we could skip the DB tests when a
MySQL/PostgreSQL server is not available?)

That's why I would rather we started with the first approach and then
moved to the second one when we are ready.


[1] https://blueprints.launchpad.net/ceilometer/+spec/ceilometer-db-sync-models-with-migrations
[2] https://review.openstack.org/#/c/33236/

On Wed, Nov 13, 2013 at 12:58 AM, Herndon, John Luke
<john.herndon at hp.com> wrote:
> Hi Folks!
> Sorry to dig up a really old topic, but I¹d like to know the status of
> ceilometer db migrations.
> I¹d like to submit two branches to modify the Event and Trait tables. If I
> were to do that now, I would need to write SQLAlchemy scripts to do the
> database migration - (background:
> https://bitbucket.org/zzzeek/alembic/issue/21/column-renames-not-supported-
> on-sqlite). Since the unit tests use db migrations to build up the db
> schema, there¹s currently no way to get the unit tests to run if your new
> code uses an alembic migration and needs to alter columnsŠ which mine does
> :(
> A couple of questions:
> 1) What is the progress of creating the schema from the models for unit
> tests?
> 2) What is the time frame for requiring alembic migrations?
> 3) Should I push these branches up now, or wait and use an alembic
> migration?
> 4) Is there anything I can do to help with 1 or 2?
> Thanks!
> -john
> Related threads:
> http://lists.openstack.org/pipermail/openstack-dev/2013-August/014214.html
> http://lists.openstack.org/pipermail/openstack-dev/2013-September/014593.ht
> ml
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

More information about the OpenStack-dev mailing list