Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions .zuul.d/magnum-cluster-api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
- job:
name: magnum-cluster-api
parent: devstack
abstract: true
timeout: 7200
override-checkout: master
required-projects:
- name: github.com/vexxhost/magnum-cluster-api
override-checkout: main
- opendev.org/openstack/barbican
- opendev.org/openstack/magnum
- opendev.org/openstack/manila
- opendev.org/openstack/octavia
- opendev.org/openstack/ovn-octavia-provider
- opendev.org/openstack/python-magnumclient
vars:
devstack_plugins:
barbican: https://github.com/openstack/barbican
magnum: https://review.opendev.org/openstack/magnum
manila: https://github.com/openstack/manila
octavia: https://github.com/openstack/octavia
ovn-octavia-provider: https://github.com/openstack/ovn-octavia-provider
magnum-cluster-api: https://github.com/vexxhost/magnum-cluster-api
devstack_localrc:
DISABLE_AMP_IMAGE_BUILD: true
FIXED_RANGE: 10.1.0.0/20
GIT_BASE: https://github.com
MAGNUM_GUEST_IMAGE_URL: "{{ image_url }}"
MANILA_DEFAULT_SHARE_TYPE_EXTRA_SPECS: snapshot_support=True create_share_from_snapshot_support=True
MANILA_ENABLED_BACKENDS: generic
MANILA_USE_SERVICE_INSTANCE_PASSWORD: true
OCTAVIA_NODE: api
devstack_local_conf:
post-config:
/etc/manila/manila.conf:
generic:
driver_handles_share_servers: true
connect_share_server_to_tenant_network: true
/etc/magnum/magnum.conf:
cluster_template:
kubernetes_allowed_network_drivers: calico,cilium
kubernetes_default_network_driver: calico
nova_client:
api_version: 2.15
devstack_services:
s-account: false
s-container: false
s-object: false
s-proxy: false
octavia: true
o-api: true
o-hk: true
o-da: true
image_url: "https://github.com/vexxhost/capo-image-elements/releases/latest/download/ubuntu-22.04-{{ kube_tag }}.qcow2"
nodeset:
nodes:
- name: controller
label: ubuntu-noble-16GB
groups:
- name: tempest
nodes:
- controller

- job:
name: magnum-cluster-api-v1.35.4
parent: magnum-cluster-api
vars:
kube_tag: v1.35.4

- job:
name: magnum-cluster-api-v1.35.4-calico
parent: magnum-cluster-api-v1.35.4
vars:
network_driver: calico

- job:
name: magnum-cluster-api-v1.35.4-cilium
parent: magnum-cluster-api-v1.35.4
vars:
network_driver: cilium

- project-template:
name: magnum-cluster-api
description: |
magnum-cluster-api jobs
check:
jobs:
- magnum-cluster-api-v1.35.4-calico
- magnum-cluster-api-v1.35.4-cilium
gate:
jobs:
- magnum-cluster-api-v1.35.4-calico
- magnum-cluster-api-v1.35.4-cilium
15 changes: 15 additions & 0 deletions .zuul.d/project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- project:
queue: magnum
templates:
- check-requirements
- magnum-cluster-api
- openstack-cover-jobs
- openstack-python3-jobs
- publish-openstack-docs-pti
- release-notes-jobs-python3
check:
jobs:
- magnum-tempest-plugin-tests-api
gate:
jobs:
- magnum-tempest-plugin-tests-api
40 changes: 0 additions & 40 deletions .zuul.yaml

This file was deleted.

43 changes: 19 additions & 24 deletions magnum/db/sqlalchemy/migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,19 @@

import os

from oslo_db.sqlalchemy.migration_cli import manager
from alembic import command as alembic_command
from alembic import config as alembic_config
from alembic import migration as alembic_migration
from oslo_db.sqlalchemy import enginefacade

import magnum.conf

CONF = magnum.conf.CONF
_MANAGER = None


def get_manager():
global _MANAGER
if not _MANAGER:
alembic_path = os.path.abspath(
os.path.join(os.path.dirname(__file__), 'alembic.ini'))
migrate_path = os.path.abspath(
os.path.join(os.path.dirname(__file__), 'alembic'))
migration_config = {'alembic_ini_path': alembic_path,
'alembic_repo_path': migrate_path,
'db_url': CONF.database.connection}
_MANAGER = manager.MigrationManager(migration_config)

return _MANAGER
def _get_alembic_config():
ini_path = os.path.join(os.path.dirname(__file__), 'alembic.ini')
cfg = alembic_config.Config(ini_path)
cfg.set_main_option(
'script_location',
os.path.join(os.path.dirname(__file__), 'alembic'))
return cfg


def version():
Expand All @@ -45,7 +37,10 @@ def version():
:returns: Database version
:rtype: string
"""
return get_manager().version()
engine = enginefacade.writer.get_engine()
with engine.connect() as conn:
ctx = alembic_migration.MigrationContext.configure(conn)
return ctx.get_current_revision()


def upgrade(version):
Expand All @@ -55,8 +50,7 @@ def upgrade(version):
:type version: string
"""
version = version or 'head'

get_manager().upgrade(version)
alembic_command.upgrade(_get_alembic_config(), version)


def stamp(revision):
Expand All @@ -68,7 +62,7 @@ def stamp(revision):
database with most recent revision
:type revision: string
"""
get_manager().stamp(revision)
alembic_command.stamp(_get_alembic_config(), revision)


def revision(message=None, autogenerate=False):
Expand All @@ -80,4 +74,5 @@ def revision(message=None, autogenerate=False):
state
:type autogenerate: bool
"""
return get_manager().revision(message=message, autogenerate=autogenerate)
return alembic_command.revision(
_get_alembic_config(), message=message, autogenerate=autogenerate)
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description_file =
author = OpenStack
author_email = openstack-dev@lists.openstack.org
home_page = http://docs.openstack.org/magnum/latest/
python_requires = >=3.10
python_requires = >=3.11
classifier =
Environment :: OpenStack
Intended Audience :: Information Technology
Expand All @@ -17,7 +17,6 @@ classifier =
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Expand Down