qinling/qinling/db/sqlalchemy/migration/alembic_migrations
Lingxian Kong e924577d64 Support to specify workload type for runtime
Support to specify ``trusted`` for runtime creation. In Kubernetes
orchestrator implementation, it's using
``io.kubernetes.cri-o.TrustedSandbox`` annotation in the pod specification
to choose the underlying container runtime. This feature is useful to
leverage the security container technology such as Kata containers or
gVisor. It also gets rid of the security concerns for running image type
function.

Story: 2003088
Task: 23172
Change-Id: Ic4fa3e97dcc239c7177448e3cef5d0f02340d302
2018-07-26 15:20:34 +12:00
..
versions Support to specify workload type for runtime 2018-07-26 15:20:34 +12:00
README.md Add runtimes rest api 2017-05-05 15:57:52 +12:00
__init__.py Add runtimes rest api 2017-05-05 15:57:52 +12:00
env.py Add runtimes rest api 2017-05-05 15:57:52 +12:00
script.py.mako Add runtimes rest api 2017-05-05 15:57:52 +12:00

README.md

The migrations in alembic_migrations/versions contain the changes needed to migrate between Qinling database revisions. A migration occurs by executing a script that details the changes needed to upgrade the database. The migration scripts are ordered so that multiple scripts can run sequentially. The scripts are executed by Qinling's migration wrapper which uses the Alembic library to manage the migration. Qinling supports migration from Pike or later.

You can upgrade to the latest database version via:

qinling-db-manage --config-file /path/to/qinling.conf upgrade head

To check the current database version:

qinling-db-manage --config-file /path/to/qinling.conf current

To create a script to run the migration offline:

qinling-db-manage --config-file /path/to/qinling.conf upgrade head --sql

To run the offline migration between specific migration versions:

qinling-db-manage --config-file /path/to/qinling.conf upgrade <start version>:<end version> --sql

Upgrade the database incrementally:

qinling-db-manage --config-file /path/to/qinling.conf upgrade --delta <# of revs>

Or, upgrade the database to one newer revision:

qinling-db-manage --config-file /path/to/qinling.conf upgrade +1

Create new revision:

qinling-db-manage --config-file /path/to/qinling.conf revision -m "description of revision" --autogenerate

Create a blank file:

qinling-db-manage --config-file /path/to/qinling.conf revision -m "description of revision"

This command does not perform any migrations, it only sets the revision. Revision may be any existing revision. Use this command carefully.

qinling-db-manage --config-file /path/to/qinling.conf stamp <revision>

To verify that the timeline does branch, you can run this command:

qinling-db-manage --config-file /path/to/qinling.conf check_migration

If the migration path has branch, you can find the branch point via:

qinling-db-manage --config-file /path/to/qinling.conf history