Build separately for each supported series and use binary builds

Charms for OpenStack Yoga supports both Ubuntu Focal and Jammy
which means Python 3.8 and Python 3.10.  Managing dependencies
across those two versions is non-trivial and we need to build
the charm on the series the charm is supposed to support.

Switch to using a binary build which allows pip's dependency
resolution to work.

This patch also drops the impish bundle.

Change-Id: I0b50d48bd356a99bcb41ab26c08458b40873b85d
This commit is contained in:
Corey Bryant 2022-09-21 13:20:11 +00:00
parent 94711143fd
commit 57a1e3e079
8 changed files with 39 additions and 368 deletions

View File

@ -10,24 +10,40 @@ parts:
apt-get install ca-certificates -y
tox -e build-reactive
override-stage: |
echo "Copying charm to staging area: $CHARMCRAFT_STAGE"
NAME=$(ls $CHARMCRAFT_PART_BUILD/build/builds)
cp -r $CHARMCRAFT_PART_BUILD/build/builds/$NAME/* $CHARMCRAFT_STAGE/
echo "Copying charm to staging area: $CRAFT_STAGE"
NAME=$(ls $CRAFT_PART_BUILD/build/builds)
cp -r $CRAFT_PART_BUILD/build/builds/$NAME/* $CRAFT_STAGE/
override-prime: |
# For some reason, the normal priming chokes on the fact that there's a
# hooks directory.
cp -r $CHARMCRAFT_STAGE/* .
cp -r $CRAFT_STAGE/* .
# Charmcraft looks for this specific entry point.
mkdir -p src
touch src/charm.py
chmod +x src/charm.py
bases:
- build-on:
- name: ubuntu
channel: "20.04"
architectures:
- amd64
run-on:
- name: ubuntu
channel: "20.04"
architectures: [amd64, s390x, ppc64el, arm64]
- name: ubuntu
channel: "22.04"
architectures: [amd64, s390x, ppc64el, arm64]
- name: ubuntu
channel: "20.04"
architectures: [amd64]
- name: ubuntu
channel: "20.04"
architectures: [arm64]
- name: ubuntu
channel: "20.04"
architectures: [ppc64el]
- name: ubuntu
channel: "20.04"
architectures: [s390x]
- name: ubuntu
channel: "22.04"
architectures: [amd64]
- name: ubuntu
channel: "22.04"
architectures: [arm64]
- name: ubuntu
channel: "22.04"
architectures: [ppc64el]
- name: ubuntu
channel: "22.04"
architectures: [s390x]

View File

@ -8,3 +8,4 @@
needs_charm_build: true
charm_build_name: cinder-backup-swift-proxy
build_type: charmcraft
charmcraft_channel: 2.0/stable

View File

@ -109,7 +109,7 @@ applications:
channel: latest/edge
cinder-backup-swift-proxy:
charm: ../../../cinder-backup-swift-proxy.charm
charm: ../../../cinder-backup-swift-proxy_ubuntu-20.04-amd64.charm
num_units: 0
options:
auth-version: 3

View File

@ -109,7 +109,7 @@ applications:
channel: latest/edge
cinder-backup-swift-proxy:
charm: ../../../cinder-backup-swift-proxy.charm
charm: ../../../cinder-backup-swift-proxy_ubuntu-20.04-amd64.charm
num_units: 0
options:
auth-version: 3

View File

@ -1,330 +0,0 @@
variables:
openstack-origin: &openstack-origin distro
local_overlay_enabled: False
series: impish
comment:
- 'machines section to decide order of deployment. database sooner = faster'
machines:
'0':
constraints: mem=3072M
'1':
constraints: mem=3072M
'2':
constraints: mem=3072M
'3':
constraints: mem=3072M
'4':
constraints: mem=3072M
'5':
constraints: mem=3072M
'6':
'7':
'8':
'9':
'10':
'11':
'12':
'13':
'14':
'15':
'16':
'17':
'18':
'19':
'20':
'21':
applications:
keystone-mysql-router:
charm: ch:mysql-router
channel: latest/edge
glance-mysql-router:
charm: ch:mysql-router
channel: latest/edge
nova-cloud-controller-mysql-router:
charm: ch:mysql-router
channel: latest/edge
cinder-mysql-router:
charm: ch:mysql-router
channel: latest/edge
placement-mysql-router:
charm: ch:mysql-router
channel: latest/edge
mysql-innodb-cluster:
charm: ch:mysql-innodb-cluster
num_units: 3
options:
source: *openstack-origin
to:
- '0'
- '1'
- '2'
channel: latest/edge
ceph-mon:
charm: ch:ceph-mon
num_units: 3
options:
source: *openstack-origin
monitor-count: '3'
to:
- '6'
- '7'
- '8'
channel: latest/edge
ceph-osd:
charm: ch:ceph-osd
num_units: 3
storage:
osd-devices: 'cinder,10G'
options:
source: *openstack-origin
osd-devices: '/dev/test-non-existent'
to:
- '9'
- '10'
- '11'
channel: latest/edge
cinder:
charm: ch:cinder
num_units: 1
options:
block-device: None
openstack-origin: *openstack-origin
glance-api-version: 2
to:
- '12'
channel: latest/edge
cinder-ceph:
charm: ch:cinder-ceph
num_units: 0
channel: latest/edge
cinder-backup-swift-proxy:
charm: ../../../cinder-backup-swift-proxy.charm
num_units: 0
options:
auth-version: 3
swift-user: admin
swift-key: openstack
user-domain: admin_domain
project-domain: admin_domain
project-name: admin
glance:
charm: ch:glance
num_units: 1
options:
openstack-origin: *openstack-origin
to:
- '13'
channel: latest/edge
keystone:
charm: ch:keystone
num_units: 1
options:
openstack-origin: *openstack-origin
to:
- '14'
channel: latest/edge
nova-cloud-controller:
charm: ch:nova-cloud-controller
num_units: 1
options:
openstack-origin: *openstack-origin
to:
- '15'
channel: latest/edge
rabbitmq-server:
charm: ch:rabbitmq-server
num_units: 1
options:
source: *openstack-origin
to:
- '16'
channel: latest/edge
nova-compute:
charm: ch:nova-compute
num_units: 1
options:
openstack-origin: *openstack-origin
to:
- '17'
channel: latest/edge
placement:
charm: ch:placement
num_units: 1
constraints: mem=1G
options:
openstack-origin: *openstack-origin
to:
- '18'
channel: latest/edge
# external swift
swift-keystone-mysql-router:
charm: ch:mysql-router
channel: latest/edge
swift-mysql-innodb-cluster:
charm: ch:mysql-innodb-cluster
num_units: 3
options:
source: *openstack-origin
to:
- '3'
- '4'
- '5'
channel: latest/edge
swift-keystone:
charm: ch:keystone
num_units: 1
options:
openstack-origin: *openstack-origin
admin-password: openstack
preferred-api-version: 3
to:
- '19'
channel: latest/edge
swift-proxy:
charm: ch:swift-proxy
num_units: 1
options:
openstack-origin: *openstack-origin
zone-assignment: manual
replicas: 1
to:
- '20'
channel: latest/edge
swift-storage:
charm: ch:swift-storage
num_units: 1
options:
openstack-origin: *openstack-origin
zone: 1
storage:
block-devices: 'cinder,10G'
to:
- '21'
channel: latest/edge
relations:
- - 'nova-compute:amqp'
- 'rabbitmq-server:amqp'
- - 'keystone:shared-db'
- 'keystone-mysql-router:shared-db'
- - 'keystone-mysql-router:db-router'
- 'mysql-innodb-cluster:db-router'
- - 'nova-cloud-controller:identity-service'
- 'keystone:identity-service'
- - 'glance:identity-service'
- 'keystone:identity-service'
- - 'glance:shared-db'
- 'glance-mysql-router:shared-db'
- - 'glance-mysql-router:db-router'
- 'mysql-innodb-cluster:db-router'
- - 'glance:amqp'
- 'rabbitmq-server:amqp'
- - 'nova-cloud-controller:image-service'
- 'glance:image-service'
- - 'nova-compute:image-service'
- 'glance:image-service'
- - 'nova-cloud-controller:cloud-compute'
- 'nova-compute:cloud-compute'
- - 'nova-cloud-controller:amqp'
- 'rabbitmq-server:amqp'
- - 'nova-cloud-controller:shared-db'
- 'nova-cloud-controller-mysql-router:shared-db'
- - 'nova-cloud-controller-mysql-router:db-router'
- 'mysql-innodb-cluster:db-router'
- - 'placement:shared-db'
- 'placement-mysql-router:shared-db'
- - 'placement-mysql-router:db-router'
- 'mysql-innodb-cluster:db-router'
- - 'placement:identity-service'
- 'keystone:identity-service'
- - 'placement:placement'
- 'nova-cloud-controller:placement'
- - 'cinder:image-service'
- 'glance:image-service'
- - 'cinder:amqp'
- 'rabbitmq-server:amqp'
- - 'cinder:identity-service'
- 'keystone:identity-service'
- - 'cinder:cinder-volume-service'
- 'nova-cloud-controller:cinder-volume-service'
- - 'cinder-ceph:storage-backend'
- 'cinder:storage-backend'
- - 'cinder'
- 'cinder-backup-swift-proxy'
- - 'ceph-mon:client'
- 'nova-compute:ceph'
- - 'nova-compute:ceph-access'
- 'cinder-ceph:ceph-access'
- - 'cinder:shared-db'
- 'cinder-mysql-router:shared-db'
- - 'cinder-mysql-router:db-router'
- 'mysql-innodb-cluster:db-router'
- - 'ceph-mon:client'
- 'cinder-ceph:ceph'
- - 'ceph-mon:client'
- 'glance:ceph'
- - 'ceph-osd:mon'
- 'ceph-mon:osd'
# external swift service
- - 'swift-keystone:shared-db'
- 'swift-keystone-mysql-router:shared-db'
- - 'swift-keystone-mysql-router:db-router'
- 'swift-mysql-innodb-cluster:db-router'
- - 'swift-proxy:identity-service'
- 'swift-keystone:identity-service'
- - 'swift-proxy:swift-storage'
- 'swift-storage:swift-storage'

View File

@ -109,7 +109,7 @@ applications:
channel: latest/edge
cinder-backup-swift-proxy:
charm: ../../../cinder-backup-swift-proxy.charm
charm: ../../../cinder-backup-swift-proxy_ubuntu-22.04-amd64.charm
num_units: 0
options:
auth-version: 3

View File

@ -1,7 +1,6 @@
charm_name: cinder-backup-swift-proxy
gate_bundles:
- focal-xena
- impish-xena
dev_bundles:
- focal-yoga
- jammy-yoga
@ -13,5 +12,4 @@ tests:
- zaza.openstack.charm_tests.cinder_backup_swift_proxy.tests.CinderBackupSwiftTest
tests_options:
force_deploy:
- impish-xena
- jammy-yoga

20
tox.ini
View File

@ -11,18 +11,6 @@ envlist = pep8,py3
sitepackages = False
# NOTE: Avoid false positives by not skipping missing interpreters.
skip_missing_interpreters = False
# NOTES:
# * We avoid the new dependency resolver by pinning pip < 20.3, see
# https://github.com/pypa/pip/issues/9187
# * Pinning dependencies requires tox >= 3.2.0, see
# https://tox.readthedocs.io/en/latest/config.html#conf-requires
# * It is also necessary to pin virtualenv as a newer virtualenv would still
# lead to fetching the latest pip in the func* tox targets, see
# https://stackoverflow.com/a/38133283
requires =
pip < 20.3
virtualenv < 20.0
setuptools<50.0.0
# NOTE: https://wiki.canonical.com/engineering/OpenStack/InstallLatestToxOnOsci
minversion = 3.18.0
@ -41,7 +29,6 @@ allowlist_externals =
charmcraft
bash
tox
rename.sh
deps =
-r{toxinidir}/requirements.txt
@ -50,13 +37,12 @@ basepython = python3
deps = -r{toxinidir}/build-requirements.txt
commands =
charmcraft clean
charmcraft -v build
{toxinidir}/rename.sh
charmcraft -v pack
[testenv:build-reactive]
basepython = python3
commands =
charm-build --log-level DEBUG --use-lock-file-branches -o {toxinidir}/build/builds src {posargs}
charm-build --log-level DEBUG --use-lock-file-branches --binary-wheels-from-source -o {toxinidir}/build/builds src {posargs}
[testenv:add-build-lock-file]
basepython = python3
@ -91,7 +77,7 @@ commands = stestr run --slowest {posargs}
[testenv:pep8]
basepython = python3
deps = flake8==3.9.2
charm-tools==2.8.3
git+https://github.com/juju/charm-tools.git
commands = flake8 {posargs} src unit_tests
[testenv:func-target]